@gnosis.pm/util-contracts
Version:
Utility contracts for Gnosis
1,285 lines (1,284 loc) • 51.5 kB
JSON
{
"contractName": "Migrations",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "last_completed_migration",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "completed",
"type": "uint256"
}
],
"name": "setCompleted",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "new_address",
"type": "address"
}
],
"name": "upgrade",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.7.5+commit.eb77ed08\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"last_completed_migration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"completed\",\"type\":\"uint256\"}],\"name\":\"setCompleted\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"new_address\",\"type\":\"address\"}],\"name\":\"upgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/bensniff/Projects/gnosis/util-contracts/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/bensniff/Projects/gnosis/util-contracts/contracts/Migrations.sol\":{\"keccak256\":\"0x2f4e7d0532cdd2816da036a13eb48ee3c17785260cebb0ab8310308e49d29b32\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://aa7ec4fb46ceb3e6c0ca3253aca57ad6c6793350c93b66ac6841acce45309a01\",\"dweb:/ipfs/QmQ9MeALKvzfT41QozGPXJEqsLe8S8oh9FxFgfUAeHMhTe\"]}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916331790556101b4806100326000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100795780638da5cb5b14610093578063fdacd576146100b7575b600080fd5b6100776004803603602081101561006757600080fd5b50356001600160a01b03166100d4565b005b610081610151565b60408051918252519081900360200190f35b61009b610157565b604080516001600160a01b039092168252519081900360200190f35b610077600480360360208110156100cd57600080fd5b5035610166565b6000546001600160a01b031633141561014e576000819050806001600160a01b031663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561013457600080fd5b505af1158015610148573d6000803e3d6000fd5b50505050505b50565b60015481565b6000546001600160a01b031681565b6000546001600160a01b031633141561014e5760015556fea26469706673582212204b32bfb0cbac139fd26d3e836a9100fe8fe102ffeb6b6d6825bf7c63256d493464736f6c63430007050033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100795780638da5cb5b14610093578063fdacd576146100b7575b600080fd5b6100776004803603602081101561006757600080fd5b50356001600160a01b03166100d4565b005b610081610151565b60408051918252519081900360200190f35b61009b610157565b604080516001600160a01b039092168252519081900360200190f35b610077600480360360208110156100cd57600080fd5b5035610166565b6000546001600160a01b031633141561014e576000819050806001600160a01b031663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561013457600080fd5b505af1158015610148573d6000803e3d6000fd5b50505050505b50565b60015481565b6000546001600160a01b031681565b6000546001600160a01b031633141561014e5760015556fea26469706673582212204b32bfb0cbac139fd26d3e836a9100fe8fe102ffeb6b6d6825bf7c63256d493464736f6c63430007050033",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "67:513:4:-:0;;;233:49;;;;;;;;;-1:-1:-1;257:5:4;:18;;-1:-1:-1;;;;;;257:18:4;265:10;257:18;;;67:513;;;;;;",
"deployedSourceMap": "67:513:4:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;403:175;;;;;;;;;;;;;;;;-1:-1:-1;403:175:4;-1:-1:-1;;;;;403:175:4;;:::i;:::-;;119:36;;;:::i;:::-;;;;;;;;;;;;;;;;93:20;;;:::i;:::-;;;;-1:-1:-1;;;;;93:20:4;;;;;;;;;;;;;;288:109;;;;;;;;;;;;;;;;-1:-1:-1;288:109:4;;:::i;403:175::-;212:5;;-1:-1:-1;;;;;212:5:4;198:10;:19;194:26;;;469:19:::1;502:11;469:45;;524:8;-1:-1:-1::0;;;;;524:21:4::1;;546:24;;524:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;219:1;194:26:::0;403:175;:::o;119:36::-;;;;:::o;93:20::-;;;-1:-1:-1;;;;;93:20:4;;:::o;288:109::-;212:5;;-1:-1:-1;;;;;212:5:4;198:10;:19;194:26;;;354:24:::1;:36:::0;288:109::o",
"source": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.7.0;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n modifier restricted() {\n if (msg.sender == owner) _;\n }\n\n constructor() {\n owner = msg.sender;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n\n function upgrade(address new_address) public restricted {\n Migrations upgraded = Migrations(new_address);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n",
"sourcePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/Migrations.sol",
"ast": {
"absolutePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/Migrations.sol",
"exportedSymbols": {
"Migrations": [
1610
]
},
"id": 1611,
"license": "LGPL-3.0-only",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1555,
"literals": [
"solidity",
"^",
"0.7",
".0"
],
"nodeType": "PragmaDirective",
"src": "42:23:4"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
"id": 1610,
"linearizedBaseContracts": [
1610
],
"name": "Migrations",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"functionSelector": "8da5cb5b",
"id": 1557,
"mutability": "mutable",
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 1610,
"src": "93:20:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1556,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "93:7:4",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "445df0ac",
"id": 1559,
"mutability": "mutable",
"name": "last_completed_migration",
"nodeType": "VariableDeclaration",
"scope": 1610,
"src": "119:36:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1558,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "119:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "public"
},
{
"body": {
"id": 1567,
"nodeType": "Block",
"src": "184:43:4",
"statements": [
{
"condition": {
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1564,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 1561,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "198:3:4",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1562,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"src": "198:10:4",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 1563,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1557,
"src": "212:5:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "198:19:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1566,
"nodeType": "IfStatement",
"src": "194:26:4",
"trueBody": {
"id": 1565,
"nodeType": "PlaceholderStatement",
"src": "219:1:4"
}
}
]
},
"id": 1568,
"name": "restricted",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 1560,
"nodeType": "ParameterList",
"parameters": [],
"src": "181:2:4"
},
"src": "162:65:4",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 1576,
"nodeType": "Block",
"src": "247:35:4",
"statements": [
{
"expression": {
"id": 1574,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 1571,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1557,
"src": "257:5:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"expression": {
"id": 1572,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "265:3:4",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1573,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"src": "265:10:4",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "257:18:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1575,
"nodeType": "ExpressionStatement",
"src": "257:18:4"
}
]
},
"id": 1577,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1569,
"nodeType": "ParameterList",
"parameters": [],
"src": "244:2:4"
},
"returnParameters": {
"id": 1570,
"nodeType": "ParameterList",
"parameters": [],
"src": "247:0:4"
},
"scope": 1610,
"src": "233:49:4",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1588,
"nodeType": "Block",
"src": "344:53:4",
"statements": [
{
"expression": {
"id": 1586,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 1584,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1559,
"src": "354:24:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 1585,
"name": "completed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1579,
"src": "381:9:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "354:36:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1587,
"nodeType": "ExpressionStatement",
"src": "354:36:4"
}
]
},
"functionSelector": "fdacd576",
"id": 1589,
"implemented": true,
"kind": "function",
"modifiers": [
{
"id": 1582,
"modifierName": {
"id": 1581,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1568,
"src": "333:10:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "333:10:4"
}
],
"name": "setCompleted",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1580,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1579,
"mutability": "mutable",
"name": "completed",
"nodeType": "VariableDeclaration",
"scope": 1589,
"src": "310:14:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1578,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "310:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "309:16:4"
},
"returnParameters": {
"id": 1583,
"nodeType": "ParameterList",
"parameters": [],
"src": "344:0:4"
},
"scope": 1610,
"src": "288:109:4",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1608,
"nodeType": "Block",
"src": "459:119:4",
"statements": [
{
"assignments": [
1597
],
"declarations": [
{
"constant": false,
"id": 1597,
"mutability": "mutable",
"name": "upgraded",
"nodeType": "VariableDeclaration",
"scope": 1608,
"src": "469:19:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1610",
"typeString": "contract Migrations"
},
"typeName": {
"id": 1596,
"name": "Migrations",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1610,
"src": "469:10:4",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1610",
"typeString": "contract Migrations"
}
},
"visibility": "internal"
}
],
"id": 1601,
"initialValue": {
"arguments": [
{
"id": 1599,
"name": "new_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1591,
"src": "502:11:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1598,
"name": "Migrations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1610,
"src": "491:10:4",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Migrations_$1610_$",
"typeString": "type(contract Migrations)"
}
},
"id": 1600,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "491:23:4",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1610",
"typeString": "contract Migrations"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "469:45:4"
},
{
"expression": {
"arguments": [
{
"id": 1605,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1559,
"src": "546:24:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"id": 1602,
"name": "upgraded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1597,
"src": "524:8:4",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1610",
"typeString": "contract Migrations"
}
},
"id": 1604,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "setCompleted",
"nodeType": "MemberAccess",
"referencedDeclaration": 1589,
"src": "524:21:4",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256) external"
}
},
"id": 1606,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "524:47:4",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1607,
"nodeType": "ExpressionStatement",
"src": "524:47:4"
}
]
},
"functionSelector": "0900f010",
"id": 1609,
"implemented": true,
"kind": "function",
"modifiers": [
{
"id": 1594,
"modifierName": {
"id": 1593,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1568,
"src": "448:10:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "448:10:4"
}
],
"name": "upgrade",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1592,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1591,
"mutability": "mutable",
"name": "new_address",
"nodeType": "VariableDeclaration",
"scope": 1609,
"src": "420:19:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1590,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "420:7:4",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "419:21:4"
},
"returnParameters": {
"id": 1595,
"nodeType": "ParameterList",
"parameters": [],
"src": "459:0:4"
},
"scope": 1610,
"src": "403:175:4",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"scope": 1611,
"src": "67:513:4"
}
],
"src": "42:539:4"
},
"legacyAST": {
"absolutePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/Migrations.sol",
"exportedSymbols": {
"Migrations": [
1610
]
},
"id": 1611,
"license": "LGPL-3.0-only",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1555,
"literals": [
"solidity",
"^",
"0.7",
".0"
],
"nodeType": "PragmaDirective",
"src": "42:23:4"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"fullyImplemented": true,
"id": 1610,
"linearizedBaseContracts": [
1610
],
"name": "Migrations",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"functionSelector": "8da5cb5b",
"id": 1557,
"mutability": "mutable",
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 1610,
"src": "93:20:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1556,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "93:7:4",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "445df0ac",
"id": 1559,
"mutability": "mutable",
"name": "last_completed_migration",
"nodeType": "VariableDeclaration",
"scope": 1610,
"src": "119:36:4",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1558,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "119:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "public"
},
{
"body": {
"id": 1567,
"nodeType": "Block",
"src": "184:43:4",
"statements": [
{
"condition": {
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1564,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 1561,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "198:3:4",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1562,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"src": "198:10:4",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 1563,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1557,
"src": "212:5:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "198:19:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1566,
"nodeType": "IfStatement",
"src": "194:26:4",
"trueBody": {
"id": 1565,
"nodeType": "PlaceholderStatement",
"src": "219:1:4"
}
}
]
},
"id": 1568,
"name": "restricted",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 1560,
"nodeType": "ParameterList",
"parameters": [],
"src": "181:2:4"
},
"src": "162:65:4",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 1576,
"nodeType": "Block",
"src": "247:35:4",
"statements": [
{
"expression": {
"id": 1574,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 1571,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1557,
"src": "257:5:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"expression": {
"id": 1572,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "265:3:4",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1573,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"src": "265:10:4",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "257:18:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1575,
"nodeType": "ExpressionStatement",
"src": "257:18:4"
}
]
},
"id": 1577,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1569,
"nodeType": "ParameterList",
"parameters": [],
"src": "244:2:4"
},
"returnParameters": {
"id": 1570,
"nodeType": "ParameterList",
"parameters": [],
"src": "247:0:4"
},
"scope": 1610,
"src": "233:49:4",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1588,
"nodeType": "Block",
"src": "344:53:4",
"statements": [
{
"expression": {
"id": 1586,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 1584,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1559,
"src": "354:24:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 1585,
"name": "completed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1579,
"src": "381:9:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "354:36:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1587,
"nodeType": "ExpressionStatement",
"src": "354:36:4"
}
]
},
"functionSelector": "fdacd576",
"id": 1589,
"implemented": true,
"kind": "function",
"modifiers": [
{
"id": 1582,
"modifierName": {
"id": 1581,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1568,
"src": "333:10:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "333:10:4"
}
],
"name": "setCompleted",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1580,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1579,
"mutability": "mutable",
"name": "completed",
"nodeType": "VariableDeclaration",
"scope": 1589,
"src": "310:14:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1578,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "310:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "309:16:4"
},
"returnParameters": {
"id": 1583,
"nodeType": "ParameterList",
"parameters": [],
"src": "344:0:4"
},
"scope": 1610,
"src": "288:109:4",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 1608,
"nodeType": "Block",
"src": "459:119:4",
"statements": [
{
"assignments": [
1597
],
"declarations": [
{
"constant": false,
"id": 1597,
"mutability": "mutable",
"name": "upgraded",
"nodeType": "VariableDeclaration",
"scope": 1608,
"src": "469:19:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1610",
"typeString": "contract Migrations"
},
"typeName": {
"id": 1596,
"name": "Migrations",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1610,
"src": "469:10:4",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1610",
"typeString": "contract Migrations"
}
},
"visibility": "internal"
}
],
"id": 1601,
"initialValue": {
"arguments": [
{
"id": 1599,
"name": "new_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1591,
"src": "502:11:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1598,
"name": "Migrations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1610,
"src": "491:10:4",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Migrations_$1610_$",
"typeString": "type(contract Migrations)"
}
},
"id": 1600,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "491:23:4",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1610",
"typeString": "contract Migrations"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "469:45:4"
},
{
"expression": {
"arguments": [
{
"id": 1605,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1559,
"src": "546:24:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"id": 1602,
"name": "upgraded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1597,
"src": "524:8:4",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$1610",
"typeString": "contract Migrations"
}
},
"id": 1604,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "setCompleted",
"nodeType": "MemberAccess",
"referencedDeclaration": 1589,
"src": "524:21:4",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256) external"
}
},
"id": 1606,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "524:47:4",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1607,
"nodeType": "ExpressionStatement",
"src": "524:47:4"
}
]
},
"functionSelector": "0900f010",
"id": 1609,
"implemented": true,
"kind": "function",
"modifiers": [
{
"id": 1594,
"modifierName": {
"id": 1593,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1568,
"src": "448:10:4",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "448:10:4"
}
],
"name": "upgrade",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1592,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1591,
"mutability": "mutable",
"name": "new_address",
"nodeType": "VariableDeclaration",
"scope": 1609,
"src": "420:19:4",
"stateVariable": false,
"storageLocation": "default",