@daostack/upgrades
Version:
Proxy upgadable contracts based on openzeppelin-sdk
440 lines (439 loc) • 18.8 kB
JSON
{
"fileName": "WithConstructorImplementation.sol",
"contractName": "WithConstructorImplementation",
"source": "pragma solidity ^0.6.0;\n// SPDX-License-Identifier: MIT\n\ncontract WithConstructorImplementation {\n uint256 public value;\n string public text;\n\n constructor(uint256 _value, string memory _text) public {\n require(_value > 0);\n value = _value;\n text = _text;\n }\n}",
"sourcePath": "contracts/mocks/WithConstructorImplementation.sol",
"sourceMap": "57:216:22:-:0;;;147:124;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;226:1;217:6;:10;209:19;;;;;;;;242:6;234:5;;:14;;;;;;;261:5;254:4;;:12;;;;;;;;;;;;;:::i;:::-;;147:124;;;57:216;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;",
"deployedSourceMap": "57:216:22:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;124:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;100:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;124:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;100:20::-;;;;;;:::o",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "_value",
"type": "uint256"
},
{
"internalType": "string",
"name": "_text",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "text",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "value",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"ast": {
"absolutePath": "contracts/mocks/WithConstructorImplementation.sol",
"exportedSymbols": {
"WithConstructorImplementation": [
4973
]
},
"id": 4974,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 4946,
"literals": [
"solidity",
"^",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:22"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 4973,
"linearizedBaseContracts": [
4973
],
"name": "WithConstructorImplementation",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"functionSelector": "3fa4f245",
"id": 4948,
"mutability": "mutable",
"name": "value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 4973,
"src": "100:20:22",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4947,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "100:7:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "1f1bd692",
"id": 4950,
"mutability": "mutable",
"name": "text",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 4973,
"src": "124:18:22",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 4949,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "124:6:22",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 4971,
"nodeType": "Block",
"src": "203:68:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 4960,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 4958,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4952,
"src": "217:6:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 4959,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "226:1:22",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "217:10:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 4957,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "209:7:22",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 4961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "209:19:22",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 4962,
"nodeType": "ExpressionStatement",
"src": "209:19:22"
},
{
"expression": {
"argumentTypes": null,
"id": 4965,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 4963,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4948,
"src": "234:5:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 4964,
"name": "_value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4952,
"src": "242:6:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "234:14:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 4966,
"nodeType": "ExpressionStatement",
"src": "234:14:22"
},
{
"expression": {
"argumentTypes": null,
"id": 4969,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 4967,
"name": "text",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4950,
"src": "254:4:22",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 4968,
"name": "_text",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4954,
"src": "261:5:22",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "254:12:22",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 4970,
"nodeType": "ExpressionStatement",
"src": "254:12:22"
}
]
},
"documentation": null,
"id": 4972,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 4955,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 4952,
"mutability": "mutable",
"name": "_value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 4972,
"src": "159:14:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4951,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "159:7:22",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4954,
"mutability": "mutable",
"name": "_text",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 4972,
"src": "175:19:22",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 4953,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "175:6:22",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "158:37:22"
},
"returnParameters": {
"id": 4956,
"nodeType": "ParameterList",
"parameters": [],
"src": "203:0:22"
},
"scope": 4973,
"src": "147:124:22",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"scope": 4974,
"src": "57:216:22"
}
],
"src": "0:273:22"
},
"bytecode": "0x60806040523480156100115760006000fd5b506040516103c23803806103c2833981810160405260408110156100355760006000fd5b8101908080519060200190929190805160405193929190846401000000008211156100605760006000fd5b838201915060208201858111156100775760006000fd5b82518660018202830111640100000000821117156100955760006000fd5b8083526020830192505050908051906020019080838360005b838110156100ca5780820151818401525b6020810190506100ae565b50505050905090810190601f1680156100f75780820380516001836020036101000a031916815260200191505b506040526020015050505b6000821115156101125760006000fd5b8160006000508190909055508060016000509080519060200190610137929190610140565b505b50506101f0565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061018157805160ff19168380011785556101b4565b828001600101855582156101b4579182015b828111156101b35782518260005090905591602001919060010190610193565b5b5090506101c191906101c5565b5090565b6101ed91906101cf565b808211156101e957600081815060009055506001016101cf565b5090565b90565b6101c3806101ff6000396000f3fe60806040523480156100115760006000fd5b506004361061003b5760003560e01c80631f1bd692146100415780633fa4f245146100c55761003b565b60006000fd5b6100496100e3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561008a5780820151818401525b60208101905061006e565b50505050905090810190601f1680156100b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100cd610184565b6040518082815260200191505060405180910390f35b60016000508054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561017c5780601f106101515761010080835404028352916020019161017c565b820191906000526020600020905b81548152906001019060200180831161015f57829003601f168201915b505050505081565b6000600050548156fea2646970667358221220e53e893a9069facc8bae67ccfaeb28619577b0496f2625f18bd93b94f5eb705364736f6c634300060a0033",
"deployedBytecode": "0x60806040523480156100115760006000fd5b506004361061003b5760003560e01c80631f1bd692146100415780633fa4f245146100c55761003b565b60006000fd5b6100496100e3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561008a5780820151818401525b60208101905061006e565b50505050905090810190601f1680156100b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100cd610184565b6040518082815260200191505060405180910390f35b60016000508054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561017c5780601f106101515761010080835404028352916020019161017c565b820191906000526020600020905b81548152906001019060200180831161015f57829003601f168201915b505050505081565b6000600050548156fea2646970667358221220e53e893a9069facc8bae67ccfaeb28619577b0496f2625f18bd93b94f5eb705364736f6c634300060a0033",
"compiler": {
"name": "solc",
"version": "0.6.10+commit.00c0fcaf.Emscripten.clang",
"optimizer": {},
"evmVersion": "constantinople"
}
}