UNPKG

@dolomite-exchange/dolomite-margin

Version:

Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol

1,242 lines (1,241 loc) 56.1 kB
{ "contractName": "Migrations", "abi": [ { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "constant": true, "inputs": [], "name": "last_completed_migration", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "uint256", "name": "completed", "type": "uint256" } ], "name": "setCompleted", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "newAddress", "type": "address" } ], "name": "upgrade", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"constant\":true,\"inputs\":[],\"name\":\"last_completed_migration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"completed\",\"type\":\"uint256\"}],\"name\":\"setCompleted\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"upgrade\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/Migrations.sol\":{\"keccak256\":\"0xc1201bbe9e255aa4b53db78217373d146219a9427be45b374e91c3052f29ac3a\",\"urls\":[\"bzz-raw://7f27fdabed1013f495bd07382c4fa286dd4cb068551ece2becd82e93271406de\",\"dweb:/ipfs/QmQH9qUD5LnA8LdxBMBcsEe5jbtjvPDbmfC1NZDMKc6Z7k\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916331790556102b4806100326000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100665780638da5cb5b14610084578063fdacd57614610099575b600080fd5b61006461005f3660046101bb565b6100ac565b005b61006e610158565b60405161007b9190610225565b60405180910390f35b61008c61015e565b60405161007b9190610217565b6100646100a73660046101e1565b61017a565b60005473ffffffffffffffffffffffffffffffffffffffff16331415610155576001546040517ffdacd576000000000000000000000000000000000000000000000000000000008152829173ffffffffffffffffffffffffffffffffffffffff83169163fdacd5769161012191600401610225565b600060405180830381600087803b15801561013b57600080fd5b505af115801561014f573d6000803e3d6000fd5b50505050505b50565b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633141561015557600155565b80356101aa81610254565b92915050565b80356101aa81610268565b6000602082840312156101cd57600080fd5b60006101d9848461019f565b949350505050565b6000602082840312156101f357600080fd5b60006101d984846101b0565b61020881610233565b82525050565b61020881610251565b602081016101aa82846101ff565b602081016101aa828461020e565b600073ffffffffffffffffffffffffffffffffffffffff82166101aa565b90565b61025d81610233565b811461015557600080fd5b61025d8161025156fea365627a7a72315820f81d8344e8c927d050ebcac25da05fbc3095ab15d9de3b1440da6ebf3c3f42bd6c6578706572696d656e74616cf564736f6c63430005100040", "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100665780638da5cb5b14610084578063fdacd57614610099575b600080fd5b61006461005f3660046101bb565b6100ac565b005b61006e610158565b60405161007b9190610225565b60405180910390f35b61008c61015e565b60405161007b9190610217565b6100646100a73660046101e1565b61017a565b60005473ffffffffffffffffffffffffffffffffffffffff16331415610155576001546040517ffdacd576000000000000000000000000000000000000000000000000000000008152829173ffffffffffffffffffffffffffffffffffffffff83169163fdacd5769161012191600401610225565b600060405180830381600087803b15801561013b57600080fd5b505af115801561014f573d6000803e3d6000fd5b50505050505b50565b60015481565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633141561015557600155565b80356101aa81610254565b92915050565b80356101aa81610268565b6000602082840312156101cd57600080fd5b60006101d9848461019f565b949350505050565b6000602082840312156101f357600080fd5b60006101d984846101b0565b61020881610233565b82525050565b61020881610251565b602081016101aa82846101ff565b602081016101aa828461020e565b600073ffffffffffffffffffffffffffffffffffffffff82166101aa565b90565b61025d81610233565b811461015557600080fd5b61025d8161025156fea365627a7a72315820f81d8344e8c927d050ebcac25da05fbc3095ab15d9de3b1440da6ebf3c3f42bd6c6578706572696d656e74616cf564736f6c63430005100040", "sourceMap": "663:548:0:-;;;856:56;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;887:5:0;:18;;-1:-1:-1;;;;;;887:18:0;895:10;887:18;;;663:548;;;;;;", "deployedSourceMap": "663:548:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;663:548:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1036:173;;;;;;;;;:::i;:::-;;715:39;;;:::i;:::-;;;;;;;;;;;;;;;;689:20;;;:::i;:::-;;;;;;;;918:112;;;;;;;;;:::i;1036:173::-;811:5;;;;797:10;:19;793:51;;;1177:24;;1155:47;;;;;1134:10;;1155:21;;;;;;:47;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1155:47:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1155:47:0;;;;832:1;793:51;1036:173;:::o;715:39::-;;;;:::o;689:20::-;;;;;;:::o;918:112::-;811:5;;;;797:10;:19;793:51;;;987:24;:36;918:112::o;5:130:-1:-;72:20;;97:33;72:20;97:33;;;57:78;;;;;142:130;209:20;;234:33;209:20;234:33;;279:241;;383:2;371:9;362:7;358:23;354:32;351:2;;;399:1;396;389:12;351:2;434:1;451:53;496:7;476:9;451:53;;;441:63;345:175;-1:-1;;;;345:175;527:241;;631:2;619:9;610:7;606:23;602:32;599:2;;;647:1;644;637:12;599:2;682:1;699:53;744:7;724:9;699:53;;775:113;858:24;876:5;858:24;;;853:3;846:37;840:48;;;895:113;978:24;996:5;978:24;;1015:213;1133:2;1118:18;;1147:71;1122:9;1191:6;1147:71;;1235:213;1353:2;1338:18;;1367:71;1342:9;1411:6;1367:71;;1455:91;;1626:42;1615:54;;1517:24;1598:76;1681:72;1743:5;1726:27;1760:117;1829:24;1847:5;1829:24;;;1822:5;1819:35;1809:2;;1868:1;1865;1858:12;1884:117;1953:24;1971:5;1953:24;", "source": "/*\n\n Copyright 2019 dYdX Trading Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.7;\npragma experimental ABIEncoderV2;\n\n\ncontract Migrations {\n address public owner;\n uint256 public last_completed_migration;\n\n modifier restricted() {\n if (msg.sender == owner) {\n _;\n }\n }\n\n constructor() public {\n owner = msg.sender;\n }\n\n function setCompleted(uint256 completed) public restricted {\n last_completed_migration = completed;\n }\n\n function upgrade(address newAddress) public restricted {\n Migrations upgraded = Migrations(newAddress);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n", "sourcePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/Migrations.sol", "ast": { "absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/Migrations.sol", "exportedSymbols": { "Migrations": [ 58 ] }, "id": 59, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "603:23:0" }, { "id": 2, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "627:33:0" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 58, "linearizedBaseContracts": [ 58 ], "name": "Migrations", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 4, "name": "owner", "nodeType": "VariableDeclaration", "scope": 58, "src": "689:20:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3, "name": "address", "nodeType": "ElementaryTypeName", "src": "689:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 6, "name": "last_completed_migration", "nodeType": "VariableDeclaration", "scope": 58, "src": "715:39:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "715:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "body": { "id": 15, "nodeType": "Block", "src": "783:67:0", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 11, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 8, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38107, "src": "797:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 9, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "797:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 10, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4, "src": "811:5:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "797:19:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 14, "nodeType": "IfStatement", "src": "793:51:0", "trueBody": { "id": 13, "nodeType": "Block", "src": "818:26:0", "statements": [ { "id": 12, "nodeType": "PlaceholderStatement", "src": "832:1:0" } ] } } ] }, "documentation": null, "id": 16, "name": "restricted", "nodeType": "ModifierDefinition", "parameters": { "id": 7, "nodeType": "ParameterList", "parameters": [], "src": "780:2:0" }, "src": "761:89:0", "visibility": "internal" }, { "body": { "id": 24, "nodeType": "Block", "src": "877:35:0", "statements": [ { "expression": { "argumentTypes": null, "id": 22, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4, "src": "887:5:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 20, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38107, "src": "895:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 21, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "895:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "src": "887:18:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 23, "nodeType": "ExpressionStatement", "src": "887:18:0" } ] }, "documentation": null, "id": 25, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 17, "nodeType": "ParameterList", "parameters": [], "src": "867:2:0" }, "returnParameters": { "id": 18, "nodeType": "ParameterList", "parameters": [], "src": "877:0:0" }, "scope": 58, "src": "856:56:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 36, "nodeType": "Block", "src": "977:53:0", "statements": [ { "expression": { "argumentTypes": null, "id": 34, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 32, "name": "last_completed_migration", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "987:24:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 33, "name": "completed", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 27, "src": "1014:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "987:36:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 35, "nodeType": "ExpressionStatement", "src": "987:36:0" } ] }, "documentation": null, "id": 37, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 30, "modifierName": { "argumentTypes": null, "id": 29, "name": "restricted", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16, "src": "966:10:0", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "966:10:0" } ], "name": "setCompleted", "nodeType": "FunctionDefinition", "parameters": { "id": 28, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 27, "name": "completed", "nodeType": "VariableDeclaration", "scope": 37, "src": "940:17:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 26, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "940:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "939:19:0" }, "returnParameters": { "id": 31, "nodeType": "ParameterList", "parameters": [], "src": "977:0:0" }, "scope": 58, "src": "918:112:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 56, "nodeType": "Block", "src": "1091:118:0", "statements": [ { "assignments": [ 45 ], "declarations": [ { "constant": false, "id": 45, "name": "upgraded", "nodeType": "VariableDeclaration", "scope": 56, "src": "1101:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Migrations_$58", "typeString": "contract Migrations" }, "typeName": { "contractScope": null, "id": 44, "name": "Migrations", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 58, "src": "1101:10:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Migrations_$58", "typeString": "contract Migrations" } }, "value": null, "visibility": "internal" } ], "id": 49, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 47, "name": "newAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 39, "src": "1134:10:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 46, "name": "Migrations", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 58, "src": "1123:10:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Migrations_$58_$", "typeString": "type(contract Migrations)" } }, "id": 48, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1123:22:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Migrations_$58", "typeString": "contract Migrations" } }, "nodeType": "VariableDeclarationStatement", "src": "1101:44:0" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 53, "name": "last_completed_migration", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "1177:24:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 50, "name": "upgraded", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45, "src": "1155:8:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Migrations_$58", "typeString": "contract Migrations" } }, "id": 52, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setCompleted", "nodeType": "MemberAccess", "referencedDeclaration": 37, "src": "1155:21:0", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external" } }, "id": 54, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1155:47:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 55, "nodeType": "ExpressionStatement", "src": "1155:47:0" } ] }, "documentation": null, "id": 57, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 42, "modifierName": { "argumentTypes": null, "id": 41, "name": "restricted", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16, "src": "1080:10:0", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "1080:10:0" } ], "name": "upgrade", "nodeType": "FunctionDefinition", "parameters": { "id": 40, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 39, "name": "newAddress", "nodeType": "VariableDeclaration", "scope": 57, "src": "1053:18:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 38, "name": "address", "nodeType": "ElementaryTypeName", "src": "1053:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1052:20:0" }, "returnParameters": { "id": 43, "nodeType": "ParameterList", "parameters": [], "src": "1091:0:0" }, "scope": 58, "src": "1036:173:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 59, "src": "663:548:0" } ], "src": "603:609:0" }, "legacyAST": { "absolutePath": "/home/cdc218/projects/dolomite/dolomite-protocol-v2/contracts/Migrations.sol", "exportedSymbols": { "Migrations": [ 58 ] }, "id": 59, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "603:23:0" }, { "id": 2, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "627:33:0" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 58, "linearizedBaseContracts": [ 58 ], "name": "Migrations", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 4, "name": "owner", "nodeType": "VariableDeclaration", "scope": 58, "src": "689:20:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3, "name": "address", "nodeType": "ElementaryTypeName", "src": "689:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 6, "name": "last_completed_migration", "nodeType": "VariableDeclaration", "scope": 58, "src": "715:39:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 5, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "715:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "body": { "id": 15, "nodeType": "Block", "src": "783:67:0", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 11, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 8, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38107, "src": "797:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 9, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "797:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 10, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4, "src": "811:5:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "797:19:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 14, "nodeType": "IfStatement", "src": "793:51:0", "trueBody": { "id": 13, "nodeType": "Block", "src": "818:26:0", "statements": [ { "id": 12, "nodeType": "PlaceholderStatement", "src": "832:1:0" } ] } } ] }, "documentation": null, "id": 16, "name": "restricted", "nodeType": "ModifierDefinition", "parameters": { "id": 7, "nodeType": "ParameterList", "parameters": [], "src": "780:2:0" }, "src": "761:89:0", "visibility": "internal" }, { "body": { "id": 24, "nodeType": "Block", "src": "877:35:0", "statements": [ { "expression": { "argumentTypes": null, "id": 22, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4, "src": "887:5:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 20, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38107, "src": "895:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 21, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "895:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "src": "887:18:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 23, "nodeType": "ExpressionStatement", "src": "887:18:0" } ] }, "documentation": null, "id": 25, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 17, "nodeType": "ParameterList", "parameters": [], "src": "867:2:0" }, "returnParameters": { "id": 18, "nodeType": "ParameterList", "parameters": [], "src": "877:0:0" }, "scope": 58, "src": "856:56:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 36, "nodeType": "Block", "src": "977:53:0", "statements": [ { "expression": { "argumentTypes": null, "id": 34, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 32, "name": "last_completed_migration", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "987:24:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 33, "name": "completed", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 27, "src": "1014:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "987:36:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 35, "nodeType": "ExpressionStatement", "src": "987:36:0" } ] }, "documentation": null, "id": 37, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 30, "modifierName": { "argumentTypes": null, "id": 29, "name": "restricted", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16, "src": "966:10:0", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "966:10:0" } ], "name": "setCompleted", "nodeType": "FunctionDefinition", "parameters": { "id": 28, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 27, "name": "completed", "nodeType": "VariableDeclaration", "scope": 37, "src": "940:17:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 26, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "940:7:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "939:19:0" }, "returnParameters": { "id": 31, "nodeType": "ParameterList", "parameters": [], "src": "977:0:0" }, "scope": 58, "src": "918:112:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 56, "nodeType": "Block", "src": "1091:118:0", "statements": [ { "assignments": [ 45 ], "declarations": [ { "constant": false, "id": 45, "name": "upgraded", "nodeType": "VariableDeclaration", "scope": 56, "src": "1101:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Migrations_$58", "typeString": "contract Migrations" }, "typeName": { "contractScope": null, "id": 44, "name": "Migrations", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 58, "src": "1101:10:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Migrations_$58", "typeString": "contract Migrations" } }, "value": null, "visibility": "internal" } ], "id": 49, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 47, "name": "newAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 39, "src": "1134:10:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 46, "name": "Migrations", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 58, "src": "1123:10:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Migrations_$58_$", "typeString": "type(contract Migrations)" } }, "id": 48, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1123:22:0",