smt-rollup
Version:
Sparse Merkle Tree roll up
1,270 lines (1,269 loc) • 57 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.6.0+commit.26b70077\"},\"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\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/Migrations.sol\":{\"keccak256\":\"0x6412522af1202bcec83318f20f253412c7ccd58fd657054b860ec98ba6819b80\",\"urls\":[\"bzz-raw://6fc3eac6a6e0b78532828f0f915cf036dff0c188dded085a56064863375db945\",\"dweb:/ipfs/QmXk8XdCEXiqbkV9sUbkMeEF9aVshtepS6zX3ddDdt3enu\"]},\"/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/SMT.sol\":{\"keccak256\":\"0x6da0de244d820286121a3dc7149968c8c6e449ac529e28c2c720247b5e4635c5\",\"urls\":[\"bzz-raw://4e3adc3a46b1974a95a58dc7a7b7ef09eb33a4b07e23091c73dd98fef92b8e63\",\"dweb:/ipfs/QmZ21CJPA6utrtUMoL4esHmFa2hAEQFE5eFjqjN4e9ikBh\"]}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102b8806100606000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100955780638da5cb5b146100b3578063fdacd576146100fd575b600080fd5b6100936004803603602081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061012b565b005b61009d6101f7565b6040518082815260200191505060405180910390f35b6100bb6101fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101296004803603602081101561011357600080fd5b8101908080359060200190929190505050610222565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101f45760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156101da57600080fd5b505af11580156101ee573d6000803e3d6000fd5b50505050505b50565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561027f57806001819055505b5056fea264697066735822122088b8c4492aa148993885fbbda24ae39fc28db67056517305f52111b5daa0cdf064736f6c63430006000033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100955780638da5cb5b146100b3578063fdacd576146100fd575b600080fd5b6100936004803603602081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061012b565b005b61009d6101f7565b6040518082815260200191505060405180910390f35b6100bb6101fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101296004803603602081101561011357600080fd5b8101908080359060200190929190505050610222565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101f45760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156101da57600080fd5b505af11580156101ee573d6000803e3d6000fd5b50505050505b50565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561027f57806001819055505b5056fea264697066735822122088b8c4492aa148993885fbbda24ae39fc28db67056517305f52111b5daa0cdf064736f6c63430006000033",
"sourceMap": "76:520:0:-:0;;;171:56;8:9:-1;5:2;;;30:1;27;20:12;5:2;171:56:0;210:10;202:5;;:18;;;;;;;;;;;;;;;;;;76:520;;;;;;",
"deployedSourceMap": "76:520:0:-:0;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;76:520:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;419:175;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;419:175:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;128:36;;;:::i;:::-;;;;;;;;;;;;;;;;;;;102:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;304:109;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;304:109:0;;;;;;;;;;;;;;;;;:::i;:::-;;419:175;283:5;;;;;;;;;;;269:19;;:10;:19;;;265:26;;;485:19:::1;518:11;485:45;;540:8;:21;;;562:24;;540:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27::::0;20:12:::1;5:2;540:47:0;;;;8:9:-1;5:2;;;45:16;42:1;39::::0;24:38:::1;77:16;74:1;67:27;5:2;540:47:0;;;;290:1;265:26:::0;419:175;:::o;128:36::-;;;;:::o;102:20::-;;;;;;;;;;;;;:::o;304:109::-;283:5;;;;;;;;;;;269:19;;:10;:19;;;265:26;;;397:9:::1;370:24;:36;;;;265:26:::0;304:109;:::o",
"source": "pragma solidity >= 0.6.0;\n\nimport { SMT256 } from \"../contracts/SMT.sol\";\n\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n constructor() public {\n owner = msg.sender;\n }\n\n modifier restricted() {\n if (msg.sender == owner) _;\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/wanseob/Projects/wilsonbeam/smt-rollup/contracts/Migrations.sol",
"ast": {
"absolutePath": "/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/Migrations.sol",
"exportedSymbols": {
"Migrations": [
58
]
},
"id": 59,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
">=",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:25:0"
},
{
"absolutePath": "/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/SMT.sol",
"file": "../contracts/SMT.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 59,
"sourceUnit": 523,
"src": "27:46:0",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 2,
"name": "SMT256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "36:6:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 58,
"linearizedBaseContracts": [
58
],
"name": "Migrations",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"functionSelector": "8da5cb5b",
"id": 5,
"name": "owner",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 58,
"src": "102:20:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "102:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "445df0ac",
"id": 7,
"name": "last_completed_migration",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 58,
"src": "128:36:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "128:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 15,
"nodeType": "Block",
"src": "192:35:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 13,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 10,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "202:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 11,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 747,
"src": "210:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 12,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "210:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "202:18:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 14,
"nodeType": "ExpressionStatement",
"src": "202:18:0"
}
]
},
"documentation": null,
"id": 16,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8,
"nodeType": "ParameterList",
"parameters": [],
"src": "182:2:0"
},
"returnParameters": {
"id": 9,
"nodeType": "ParameterList",
"parameters": [],
"src": "192:0:0"
},
"scope": 58,
"src": "171:56:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 24,
"nodeType": "Block",
"src": "255:43:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 21,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 18,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 747,
"src": "269:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 19,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "269:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 20,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "283:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "269:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 23,
"nodeType": "IfStatement",
"src": "265:26:0",
"trueBody": {
"id": 22,
"nodeType": "PlaceholderStatement",
"src": "290:1:0"
}
}
]
},
"documentation": null,
"id": 25,
"name": "restricted",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 17,
"nodeType": "ParameterList",
"parameters": [],
"src": "252:2:0"
},
"src": "233:65:0",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 36,
"nodeType": "Block",
"src": "360: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": 7,
"src": "370:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 33,
"name": "completed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27,
"src": "397:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "370:36:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 35,
"nodeType": "ExpressionStatement",
"src": "370:36:0"
}
]
},
"documentation": null,
"functionSelector": "fdacd576",
"id": 37,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 30,
"modifierName": {
"argumentTypes": null,
"id": 29,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 25,
"src": "349:10:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "349:10:0"
}
],
"name": "setCompleted",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 28,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 27,
"name": "completed",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 37,
"src": "326:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 26,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "326:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "325:16:0"
},
"returnParameters": {
"id": 31,
"nodeType": "ParameterList",
"parameters": [],
"src": "360:0:0"
},
"scope": 58,
"src": "304:109:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 56,
"nodeType": "Block",
"src": "475:119:0",
"statements": [
{
"assignments": [
45
],
"declarations": [
{
"constant": false,
"id": 45,
"name": "upgraded",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 56,
"src": "485: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": "485: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": "new_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "518:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 46,
"name": "Migrations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 58,
"src": "507: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": "507:23:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_Migrations_$58",
"typeString": "contract Migrations"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "485:45:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 53,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "562: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": "540: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": "540: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": "540:47:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 55,
"nodeType": "ExpressionStatement",
"src": "540:47:0"
}
]
},
"documentation": null,
"functionSelector": "0900f010",
"id": 57,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 42,
"modifierName": {
"argumentTypes": null,
"id": 41,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 25,
"src": "464:10:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "464:10:0"
}
],
"name": "upgrade",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 40,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 39,
"name": "new_address",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 57,
"src": "436:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 38,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "436:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "435:21:0"
},
"returnParameters": {
"id": 43,
"nodeType": "ParameterList",
"parameters": [],
"src": "475:0:0"
},
"scope": 58,
"src": "419:175:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
}
],
"scope": 59,
"src": "76:520:0"
}
],
"src": "0:597:0"
},
"legacyAST": {
"absolutePath": "/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/Migrations.sol",
"exportedSymbols": {
"Migrations": [
58
]
},
"id": 59,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
">=",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:25:0"
},
{
"absolutePath": "/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/SMT.sol",
"file": "../contracts/SMT.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 59,
"sourceUnit": 523,
"src": "27:46:0",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 2,
"name": "SMT256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "36:6:0",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 58,
"linearizedBaseContracts": [
58
],
"name": "Migrations",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"functionSelector": "8da5cb5b",
"id": 5,
"name": "owner",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 58,
"src": "102:20:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "102:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"functionSelector": "445df0ac",
"id": 7,
"name": "last_completed_migration",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 58,
"src": "128:36:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "128:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 15,
"nodeType": "Block",
"src": "192:35:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 13,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 10,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "202:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 11,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 747,
"src": "210:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 12,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "210:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "202:18:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 14,
"nodeType": "ExpressionStatement",
"src": "202:18:0"
}
]
},
"documentation": null,
"id": 16,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8,
"nodeType": "ParameterList",
"parameters": [],
"src": "182:2:0"
},
"returnParameters": {
"id": 9,
"nodeType": "ParameterList",
"parameters": [],
"src": "192:0:0"
},
"scope": 58,
"src": "171:56:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 24,
"nodeType": "Block",
"src": "255:43:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 21,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 18,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 747,
"src": "269:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 19,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "269:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 20,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "283:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "269:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 23,
"nodeType": "IfStatement",
"src": "265:26:0",
"trueBody": {
"id": 22,
"nodeType": "PlaceholderStatement",
"src": "290:1:0"
}
}
]
},
"documentation": null,
"id": 25,
"name": "restricted",
"nodeType": "ModifierDefinition",
"overrides": null,
"parameters": {
"id": 17,
"nodeType": "ParameterList",
"parameters": [],
"src": "252:2:0"
},
"src": "233:65:0",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 36,
"nodeType": "Block",
"src": "360: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": 7,
"src": "370:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 33,
"name": "completed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27,
"src": "397:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "370:36:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 35,
"nodeType": "ExpressionStatement",
"src": "370:36:0"
}
]
},
"documentation": null,
"functionSelector": "fdacd576",
"id": 37,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 30,
"modifierName": {
"argumentTypes": null,
"id": 29,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 25,
"src": "349:10:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "349:10:0"
}
],
"name": "setCompleted",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 28,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 27,
"name": "completed",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 37,
"src": "326:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 26,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "326:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "325:16:0"
},
"returnParameters": {
"id": 31,
"nodeType": "ParameterList",
"parameters": [],
"src": "360:0:0"
},
"scope": 58,
"src": "304:109:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 56,
"nodeType": "Block",
"src": "475:119:0",
"statements": [
{
"assignments": [
45
],
"declarations": [
{
"constant": false,
"id": 45,
"name": "upgraded",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 56,
"src": "485: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": "485: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": "new_address",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 39,
"src": "518:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 46,
"name": "Migrations",
"nodeType": "Identifier",
"overloadedDeclarations": [],