@gnosis.pm/pm-contracts
Version:
Collection of smart contracts for the Gnosis prediction market platform
1,243 lines (1,242 loc) • 56.5 kB
JSON
{
"contractName": "Migrations",
"abi": [
{
"constant": true,
"inputs": [],
"name": "last_completed_migration",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"name": "completed",
"type": "uint256"
}
],
"name": "setCompleted",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "new_address",
"type": "address"
}
],
"name": "upgrade",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.6+commit.b259423e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"new_address\",\"type\":\"address\"}],\"name\":\"upgrade\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"last_completed_migration\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"completed\",\"type\":\"uint256\"}],\"name\":\"setCompleted\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/alan/src/github.com/gnosis/pm-contracts/contracts/Migrations.sol\":{\"keccak256\":\"0x55635705cf391c2e1dd09788587de36081748e6b3d0588f01a5afdd6f46f8e66\",\"urls\":[\"bzzr://8fad81178485bdbff869f72ea32b9e6bcc7fba8f6744c9fa5e1b074c4c5a550a\"]},\"canonical-weth/contracts/WETH9.sol\":{\"keccak256\":\"0x8f392bda1fce5c7106f32ffc911571669f8751d84dfad2f79b34256851e1a62f\",\"urls\":[\"bzzr://d160cc09f86f5a0f9a58a93dc322fb8adb6a055e27635e8b2dc8bb34c9ae25f4\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol\":{\"keccak256\":\"0xc61b3603089b09a730d8ca72e9133a496cc4405da40e9b87c12f073245d774bf\",\"urls\":[\"bzzr://f280f38d5ab6e1b89fd898ccd3901054a56572c141d91d30302e2db1db4cc6ff\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzzr://aa8b45b57edafc3d67bc5d916327ea16807fae33f753ca163ae0c4061b789766\"]}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102ae806100606000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100955780638da5cb5b146100b3578063fdacd576146100fd575b600080fd5b6100936004803603602081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061012b565b005b61009d6101f7565b6040518082815260200191505060405180910390f35b6100bb6101fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101296004803603602081101561011357600080fd5b8101908080359060200190929190505050610222565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101f45760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156101da57600080fd5b505af11580156101ee573d6000803e3d6000fd5b50505050505b50565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561027f57806001819055505b5056fea165627a7a723058207bd71a03c5c5f95f52f72f290ac585644c95c376da9b1c8be3ddd1640e3d464a0029",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100955780638da5cb5b146100b3578063fdacd576146100fd575b600080fd5b6100936004803603602081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061012b565b005b61009d6101f7565b6040518082815260200191505060405180910390f35b6100bb6101fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101296004803603602081101561011357600080fd5b8101908080359060200190929190505050610222565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101f45760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156101da57600080fd5b505af11580156101ee573d6000803e3d6000fd5b50505050505b50565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561027f57806001819055505b5056fea165627a7a723058207bd71a03c5c5f95f52f72f290ac585644c95c376da9b1c8be3ddd1640e3d464a0029",
"sourceMap": "142:520:13:-;;;308:56;8:9:-1;5:2;;;30:1;27;20:12;5:2;308:56:13;347:10;339:5;;:18;;;;;;;;;;;;;;;;;;142:520;;;;;;",
"deployedSourceMap": "142:520:13:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;142:520:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;485:175;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;485:175:13;;;;;;;;;;;;;;;;;;;:::i;:::-;;194:36;;;:::i;:::-;;;;;;;;;;;;;;;;;;;168:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;370:109;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;370:109:13;;;;;;;;;;;;;;;;;:::i;:::-;;485:175;287:5;;;;;;;;;;;273:19;;:10;:19;;;269:26;;;551:19;584:11;551:45;;606:8;:21;;;628:24;;606:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;606:47:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;606:47:13;;;;294:1;269:26;485:175;:::o;194:36::-;;;;:::o;168:20::-;;;;;;;;;;;;;:::o;370:109::-;287:5;;;;;;;;;;;273:19;;:10;:19;;;269:26;;;463:9;436:24;:36;;;;269:26;370:109;:::o",
"source": "pragma solidity ^0.5.0;\nimport \"canonical-weth/contracts/WETH9.sol\";\nimport \"openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol\";\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() public {\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": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Migrations.sol",
"ast": {
"absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Migrations.sol",
"exportedSymbols": {
"Migrations": [
3681
]
},
"id": 3682,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 3624,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:13"
},
{
"absolutePath": "canonical-weth/contracts/WETH9.sol",
"file": "canonical-weth/contracts/WETH9.sol",
"id": 3625,
"nodeType": "ImportDirective",
"scope": 3682,
"sourceUnit": 7075,
"src": "24:44:13",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol",
"file": "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol",
"id": 3626,
"nodeType": "ImportDirective",
"scope": 3682,
"sourceUnit": 7837,
"src": "69:71:13",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 3681,
"linearizedBaseContracts": [
3681
],
"name": "Migrations",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 3628,
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 3681,
"src": "168:20:13",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 3627,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "168:7:13",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 3630,
"name": "last_completed_migration",
"nodeType": "VariableDeclaration",
"scope": 3681,
"src": "194:36:13",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 3629,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "194:4:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 3638,
"nodeType": "Block",
"src": "259:43:13",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 3635,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 3632,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7920,
"src": "273:3:13",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 3633,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "273:10:13",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 3634,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3628,
"src": "287:5:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "273:19:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 3637,
"nodeType": "IfStatement",
"src": "269:26:13",
"trueBody": {
"id": 3636,
"nodeType": "PlaceholderStatement",
"src": "294:1:13"
}
}
]
},
"documentation": null,
"id": 3639,
"name": "restricted",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 3631,
"nodeType": "ParameterList",
"parameters": [],
"src": "256:2:13"
},
"src": "237:65:13",
"visibility": "internal"
},
{
"body": {
"id": 3647,
"nodeType": "Block",
"src": "329:35:13",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 3645,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 3642,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3628,
"src": "339:5:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 3643,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7920,
"src": "347:3:13",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 3644,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "347:10:13",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "339:18:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 3646,
"nodeType": "ExpressionStatement",
"src": "339:18:13"
}
]
},
"documentation": null,
"id": 3648,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3640,
"nodeType": "ParameterList",
"parameters": [],
"src": "319:2:13"
},
"returnParameters": {
"id": 3641,
"nodeType": "ParameterList",
"parameters": [],
"src": "329:0:13"
},
"scope": 3681,
"src": "308:56:13",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 3659,
"nodeType": "Block",
"src": "426:53:13",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 3657,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 3655,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3630,
"src": "436:24:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 3656,
"name": "completed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3650,
"src": "463:9:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "436:36:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 3658,
"nodeType": "ExpressionStatement",
"src": "436:36:13"
}
]
},
"documentation": null,
"id": 3660,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 3653,
"modifierName": {
"argumentTypes": null,
"id": 3652,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3639,
"src": "415:10:13",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "415:10:13"
}
],
"name": "setCompleted",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3651,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3650,
"name": "completed",
"nodeType": "VariableDeclaration",
"scope": 3660,
"src": "392:14:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 3649,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "392:4:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "391:16:13"
},
"returnParameters": {
"id": 3654,
"nodeType": "ParameterList",
"parameters": [],
"src": "426:0:13"
},
"scope": 3681,
"src": "370:109:13",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 3679,
"nodeType": "Block",
"src": "541:119:13",
"statements": [
{
"assignments": [
3668
],
"declarations": [
{
"constant": false,
"id": 3668,
"name": "upgraded",
"nodeType": "VariableDeclaration",
"scope": 3679,
"src": "551:19:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$3681",
"typeString": "contract Migrations"
},
"typeName": {
"contractScope": null,
"id": 3667,
"name": "Migrations",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3681,
"src": "551:10:13",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$3681",
"typeString": "contract Migrations"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 3672,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 3670,
"name": "new_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3662,
"src": "584:11:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 3669,
"name": "Migrations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3681,
"src": "573:10:13",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Migrations_$3681_$",
"typeString": "type(contract Migrations)"
}
},
"id": 3671,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "573:23:13",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$3681",
"typeString": "contract Migrations"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "551:45:13"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 3676,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3630,
"src": "628:24:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 3673,
"name": "upgraded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3668,
"src": "606:8:13",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$3681",
"typeString": "contract Migrations"
}
},
"id": 3675,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "setCompleted",
"nodeType": "MemberAccess",
"referencedDeclaration": 3660,
"src": "606:21:13",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256) external"
}
},
"id": 3677,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "606:47:13",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 3678,
"nodeType": "ExpressionStatement",
"src": "606:47:13"
}
]
},
"documentation": null,
"id": 3680,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 3665,
"modifierName": {
"argumentTypes": null,
"id": 3664,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3639,
"src": "530:10:13",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "530:10:13"
}
],
"name": "upgrade",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3663,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3662,
"name": "new_address",
"nodeType": "VariableDeclaration",
"scope": 3680,
"src": "502:19:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 3661,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "502:7:13",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "501:21:13"
},
"returnParameters": {
"id": 3666,
"nodeType": "ParameterList",
"parameters": [],
"src": "541:0:13"
},
"scope": 3681,
"src": "485:175:13",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 3682,
"src": "142:520:13"
}
],
"src": "0:663:13"
},
"legacyAST": {
"absolutePath": "/home/alan/src/github.com/gnosis/pm-contracts/contracts/Migrations.sol",
"exportedSymbols": {
"Migrations": [
3681
]
},
"id": 3682,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 3624,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:13"
},
{
"absolutePath": "canonical-weth/contracts/WETH9.sol",
"file": "canonical-weth/contracts/WETH9.sol",
"id": 3625,
"nodeType": "ImportDirective",
"scope": 3682,
"sourceUnit": 7075,
"src": "24:44:13",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol",
"file": "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol",
"id": 3626,
"nodeType": "ImportDirective",
"scope": 3682,
"sourceUnit": 7837,
"src": "69:71:13",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 3681,
"linearizedBaseContracts": [
3681
],
"name": "Migrations",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 3628,
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 3681,
"src": "168:20:13",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 3627,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "168:7:13",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 3630,
"name": "last_completed_migration",
"nodeType": "VariableDeclaration",
"scope": 3681,
"src": "194:36:13",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 3629,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "194:4:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 3638,
"nodeType": "Block",
"src": "259:43:13",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 3635,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 3632,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7920,
"src": "273:3:13",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 3633,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "273:10:13",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 3634,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3628,
"src": "287:5:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "273:19:13",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 3637,
"nodeType": "IfStatement",
"src": "269:26:13",
"trueBody": {
"id": 3636,
"nodeType": "PlaceholderStatement",
"src": "294:1:13"
}
}
]
},
"documentation": null,
"id": 3639,
"name": "restricted",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 3631,
"nodeType": "ParameterList",
"parameters": [],
"src": "256:2:13"
},
"src": "237:65:13",
"visibility": "internal"
},
{
"body": {
"id": 3647,
"nodeType": "Block",
"src": "329:35:13",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 3645,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 3642,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3628,
"src": "339:5:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 3643,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7920,
"src": "347:3:13",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 3644,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "347:10:13",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "339:18:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 3646,
"nodeType": "ExpressionStatement",
"src": "339:18:13"
}
]
},
"documentation": null,
"id": 3648,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3640,
"nodeType": "ParameterList",
"parameters": [],
"src": "319:2:13"
},
"returnParameters": {
"id": 3641,
"nodeType": "ParameterList",
"parameters": [],
"src": "329:0:13"
},
"scope": 3681,
"src": "308:56:13",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 3659,
"nodeType": "Block",
"src": "426:53:13",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 3657,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 3655,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3630,
"src": "436:24:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 3656,
"name": "completed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3650,
"src": "463:9:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "436:36:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 3658,
"nodeType": "ExpressionStatement",
"src": "436:36:13"
}
]
},
"documentation": null,
"id": 3660,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 3653,
"modifierName": {
"argumentTypes": null,
"id": 3652,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3639,
"src": "415:10:13",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "415:10:13"
}
],
"name": "setCompleted",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3651,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3650,
"name": "completed",
"nodeType": "VariableDeclaration",
"scope": 3660,
"src": "392:14:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 3649,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "392:4:13",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "391:16:13"
},
"returnParameters": {
"id": 3654,
"nodeType": "ParameterList",
"parameters": [],
"src": "426:0:13"
},
"scope": 3681,
"src": "370:109:13",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 3679,
"nodeType": "Block",
"src": "541:119:13",
"statements": [
{
"assignments": [
3668
],
"declarations": [
{
"constant": false,
"id": 3668,
"name": "upgraded",
"nodeType": "VariableDeclaration",
"scope": 3679,
"src": "551:19:13",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$3681",
"typeString": "contract Migrations"
},
"typeName": {
"contractScope": null,
"id": 3667,
"name": "Migrations",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3681,
"src": "551:10:13",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$3681",
"typeString": "contract Migrations"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 3672,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 3670,
"name": "new_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3662,
"src": "584:11:13",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 3669,
"name": "Migrations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3681,
"src": "573:10:13",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Migrations_$3681_$",
"typeString": "type(contract Migrations)"
}
},
"id": 3671,
"isConstant": false,