arc_dx
Version:
A platform for building DAOs
1,120 lines (1,119 loc) • 126 kB
JSON
{
"contractName": "GlobalConstraintMock",
"abi": [
{
"constant": true,
"inputs": [],
"name": "currentCallPhase",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "bytes32"
}
],
"name": "testParams",
"outputs": [
{
"name": "pre",
"type": "bool"
},
{
"name": "post",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "method",
"type": "bytes32"
},
{
"name": "pre",
"type": "bool"
},
{
"name": "post",
"type": "bool"
}
],
"name": "setConstraint",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "bytes32"
},
{
"name": "method",
"type": "bytes32"
}
],
"name": "pre",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "bytes32"
},
{
"name": "method",
"type": "bytes32"
}
],
"name": "post",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "when",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b506102b5806100206000396000f3006080604052600436106100775763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632414112b811461007c578063696a7253146100b557806373d2ea39146100eb5780638043154d1461011e578063c1786ab214610152578063e2b0caef14610186575b600080fd5b34801561008857600080fd5b5061009161019b565b604051808260028111156100a157fe5b60ff16815260200191505060405180910390f35b3480156100c157600080fd5b506100d7600435602435151560443515156101a4565b604080519115158252519081900360200190f35b3480156100f757600080fd5b5061010360043561022d565b60408051921515835290151560208301528051918290030190f35b34801561012a57600080fd5b506100d773ffffffffffffffffffffffffffffffffffffffff6004351660243560443561024b565b34801561015e57600080fd5b506100d773ffffffffffffffffffffffffffffffffffffffff60043516602435604435610268565b34801561019257600080fd5b50610091610280565b60015460ff1681565b6000838152602081905260408120805460ff19168415801591821761ff00191661010086151502179092556101d7575081155b156101f557600180546002919060ff191681835b0217905550610223565b82151561020f57600180546000919060ff191681836101eb565b811515610223576001805460ff1916811790555b5060019392505050565b60006020819052908152604090205460ff8082169161010090041682565b600090815260208190526040902054610100900460ff1692915050565b60009081526020819052604090205460ff1692915050565b60015460ff16905600a165627a7a72305820353323dfd7a6975bba170bbee4d2709efd50275f51a3c24043fae11495e57ba40029",
"deployedBytecode": "0x6080604052600436106100775763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632414112b811461007c578063696a7253146100b557806373d2ea39146100eb5780638043154d1461011e578063c1786ab214610152578063e2b0caef14610186575b600080fd5b34801561008857600080fd5b5061009161019b565b604051808260028111156100a157fe5b60ff16815260200191505060405180910390f35b3480156100c157600080fd5b506100d7600435602435151560443515156101a4565b604080519115158252519081900360200190f35b3480156100f757600080fd5b5061010360043561022d565b60408051921515835290151560208301528051918290030190f35b34801561012a57600080fd5b506100d773ffffffffffffffffffffffffffffffffffffffff6004351660243560443561024b565b34801561015e57600080fd5b506100d773ffffffffffffffffffffffffffffffffffffffff60043516602435604435610268565b34801561019257600080fd5b50610091610280565b60015460ff1681565b6000838152602081905260408120805460ff19168415801591821761ff00191661010086151502179092556101d7575081155b156101f557600180546002919060ff191681835b0217905550610223565b82151561020f57600180546000919060ff191681836101eb565b811515610223576001805460ff1916811790555b5060019392505050565b60006020819052908152604090205460ff8082169161010090041682565b600090815260208190526040902054610100900460ff1692915050565b60009081526020819052604090205460ff1692915050565b60015460ff16905600a165627a7a72305820353323dfd7a6975bba170bbee4d2709efd50275f51a3c24043fae11495e57ba40029",
"sourceMap": "89:1142:21:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;89:1142:21;;;;;;;",
"deployedSourceMap": "89:1142:21:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;245:59;;8:9:-1;5:2;;;30:1;27;20:12;5:2;245:59:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;312:545;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;312:545:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;192:46;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;192:46:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;988:122;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;988:122:21;;;;;;;;;;;863:119;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;863:119:21;;;;;;;;;;;1116:113;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1116:113:21;;;;245:59;;;;;;:::o;312:545::-;385:4;401:18;;;;;;;;;;:28;;-1:-1:-1;;401:28:21;;;;;;;;-1:-1:-1;;439:30:21;401:28;439:30;;;;;;;;484:13;;;493:4;492:5;484:13;480:350;;;513:16;:65;;532:46;;513:16;-1:-1:-1;;513:65:21;:16;532:46;513:65;;;;;;480:350;;;614:3;613:4;609:211;;;637:16;:58;;656:39;;637:16;-1:-1:-1;;637:58:21;:16;656:39;637:58;;609:211;719:4;718:5;714:106;;;767:40;748:59;;-1:-1:-1;;748:59:21;;;;;714:106;-1:-1:-1;846:4:21;312:545;;;;;:::o;192:46::-;;;;;;;;;;;;;;;;;;;;;;;:::o;988:122::-;1057:4;1080:18;;;;;;;;;;:23;;;;;;;988:122;-1:-1:-1;;988:122:21:o;863:119::-;930:4;953:18;;;;;;;;;;:22;;;;863:119;-1:-1:-1;;863:119:21:o;1116:113::-;1206:16;;;;1116:113;:::o",
"source": "pragma solidity ^0.4.25;\n\nimport \"../globalConstraints/GlobalConstraintInterface.sol\";\n\n\ncontract GlobalConstraintMock {\n\n struct TestParam {\n bool pre;\n bool post;\n }\n mapping (bytes32=>TestParam) public testParams;\n\n GlobalConstraintInterface.CallPhase public currentCallPhase ;\n\n function setConstraint(bytes32 method,bool pre,bool post) public returns(bool) {\n testParams[method].pre = pre;\n testParams[method].post = post;\n\n if (!pre && !post) {\n currentCallPhase = GlobalConstraintInterface.CallPhase.PreAndPost;\n } else {\n if (!pre) {\n currentCallPhase = GlobalConstraintInterface.CallPhase.Pre;\n } else if (!post) {\n currentCallPhase = GlobalConstraintInterface.CallPhase.Post;\n }\n }\n return true;\n }\n\n function pre(address, bytes32, bytes32 method) public view returns(bool) {\n return testParams[method].pre;\n }\n\n function post(address, bytes32 , bytes32 method) public view returns(bool) {\n return testParams[method].post;\n }\n\n function when() public view returns(GlobalConstraintInterface.CallPhase) {\n return currentCallPhase;\n }\n}\n",
"sourcePath": "/Users/oren/daostack/daostack2/daostack/contracts/test/GlobalConstraintMock.sol",
"ast": {
"absolutePath": "/Users/oren/daostack/daostack2/daostack/contracts/test/GlobalConstraintMock.sol",
"exportedSymbols": {
"GlobalConstraintMock": [
6716
]
},
"id": 6717,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6599,
"literals": [
"solidity",
"^",
"0.4",
".25"
],
"nodeType": "PragmaDirective",
"src": "0:24:21"
},
{
"absolutePath": "/Users/oren/daostack/daostack2/daostack/contracts/globalConstraints/GlobalConstraintInterface.sol",
"file": "../globalConstraints/GlobalConstraintInterface.sol",
"id": 6600,
"nodeType": "ImportDirective",
"scope": 6717,
"sourceUnit": 3843,
"src": "26:60:21",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 6716,
"linearizedBaseContracts": [
6716
],
"name": "GlobalConstraintMock",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "GlobalConstraintMock.TestParam",
"id": 6605,
"members": [
{
"constant": false,
"id": 6602,
"name": "pre",
"nodeType": "VariableDeclaration",
"scope": 6605,
"src": "153:8:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6601,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "153:4:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6604,
"name": "post",
"nodeType": "VariableDeclaration",
"scope": 6605,
"src": "171:9:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6603,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "171:4:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "TestParam",
"nodeType": "StructDefinition",
"scope": 6716,
"src": "126:61:21",
"visibility": "public"
},
{
"constant": false,
"id": 6609,
"name": "testParams",
"nodeType": "VariableDeclaration",
"scope": 6716,
"src": "192:46:21",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_TestParam_$6605_storage_$",
"typeString": "mapping(bytes32 => struct GlobalConstraintMock.TestParam)"
},
"typeName": {
"id": 6608,
"keyType": {
"id": 6606,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "201:7:21",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Mapping",
"src": "192:28:21",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_TestParam_$6605_storage_$",
"typeString": "mapping(bytes32 => struct GlobalConstraintMock.TestParam)"
},
"valueType": {
"contractScope": null,
"id": 6607,
"name": "TestParam",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6605,
"src": "210:9:21",
"typeDescriptions": {
"typeIdentifier": "t_struct$_TestParam_$6605_storage_ptr",
"typeString": "struct GlobalConstraintMock.TestParam"
}
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 6611,
"name": "currentCallPhase",
"nodeType": "VariableDeclaration",
"scope": 6716,
"src": "245:59:21",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
},
"typeName": {
"contractScope": null,
"id": 6610,
"name": "GlobalConstraintInterface.CallPhase",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3814,
"src": "245:35:21",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 6672,
"nodeType": "Block",
"src": "391:466:21",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 6627,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 6622,
"name": "testParams",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6609,
"src": "401:10:21",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_TestParam_$6605_storage_$",
"typeString": "mapping(bytes32 => struct GlobalConstraintMock.TestParam storage ref)"
}
},
"id": 6624,
"indexExpression": {
"argumentTypes": null,
"id": 6623,
"name": "method",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6613,
"src": "412:6:21",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "401:18:21",
"typeDescriptions": {
"typeIdentifier": "t_struct$_TestParam_$6605_storage",
"typeString": "struct GlobalConstraintMock.TestParam storage ref"
}
},
"id": 6625,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "pre",
"nodeType": "MemberAccess",
"referencedDeclaration": 6602,
"src": "401:22:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 6626,
"name": "pre",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6615,
"src": "426:3:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "401:28:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 6628,
"nodeType": "ExpressionStatement",
"src": "401:28:21"
},
{
"expression": {
"argumentTypes": null,
"id": 6634,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 6629,
"name": "testParams",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6609,
"src": "439:10:21",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_TestParam_$6605_storage_$",
"typeString": "mapping(bytes32 => struct GlobalConstraintMock.TestParam storage ref)"
}
},
"id": 6631,
"indexExpression": {
"argumentTypes": null,
"id": 6630,
"name": "method",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6613,
"src": "450:6:21",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "439:18:21",
"typeDescriptions": {
"typeIdentifier": "t_struct$_TestParam_$6605_storage",
"typeString": "struct GlobalConstraintMock.TestParam storage ref"
}
},
"id": 6632,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "post",
"nodeType": "MemberAccess",
"referencedDeclaration": 6604,
"src": "439:23:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 6633,
"name": "post",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6617,
"src": "465:4:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "439:30:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 6635,
"nodeType": "ExpressionStatement",
"src": "439:30:21"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 6640,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 6637,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "484:4:21",
"subExpression": {
"argumentTypes": null,
"id": 6636,
"name": "pre",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6615,
"src": "485:3:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"id": 6639,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "492:5:21",
"subExpression": {
"argumentTypes": null,
"id": 6638,
"name": "post",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6617,
"src": "493:4:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "484:13:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 6668,
"nodeType": "Block",
"src": "595:235:21",
"statements": [
{
"condition": {
"argumentTypes": null,
"id": 6649,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "613:4:21",
"subExpression": {
"argumentTypes": null,
"id": 6648,
"name": "pre",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6615,
"src": "614:3:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"id": 6658,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "718:5:21",
"subExpression": {
"argumentTypes": null,
"id": 6657,
"name": "post",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6617,
"src": "719:4:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 6666,
"nodeType": "IfStatement",
"src": "714:106:21",
"trueBody": {
"id": 6665,
"nodeType": "Block",
"src": "725:95:21",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 6663,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 6659,
"name": "currentCallPhase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6611,
"src": "748:16:21",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 6660,
"name": "GlobalConstraintInterface",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3842,
"src": "767:25:21",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_GlobalConstraintInterface_$3842_$",
"typeString": "type(contract GlobalConstraintInterface)"
}
},
"id": 6661,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "CallPhase",
"nodeType": "MemberAccess",
"referencedDeclaration": 3814,
"src": "767:35:21",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_CallPhase_$3814_$",
"typeString": "type(enum GlobalConstraintInterface.CallPhase)"
}
},
"id": 6662,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "Post",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "767:40:21",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
}
},
"src": "748:59:21",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
}
},
"id": 6664,
"nodeType": "ExpressionStatement",
"src": "748:59:21"
}
]
}
},
"id": 6667,
"nodeType": "IfStatement",
"src": "609:211:21",
"trueBody": {
"id": 6656,
"nodeType": "Block",
"src": "619:89:21",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 6654,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 6650,
"name": "currentCallPhase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6611,
"src": "637:16:21",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 6651,
"name": "GlobalConstraintInterface",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3842,
"src": "656:25:21",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_GlobalConstraintInterface_$3842_$",
"typeString": "type(contract GlobalConstraintInterface)"
}
},
"id": 6652,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "CallPhase",
"nodeType": "MemberAccess",
"referencedDeclaration": 3814,
"src": "656:35:21",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_CallPhase_$3814_$",
"typeString": "type(enum GlobalConstraintInterface.CallPhase)"
}
},
"id": 6653,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "Pre",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "656:39:21",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
}
},
"src": "637:58:21",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
}
},
"id": 6655,
"nodeType": "ExpressionStatement",
"src": "637:58:21"
}
]
}
}
]
},
"id": 6669,
"nodeType": "IfStatement",
"src": "480:350:21",
"trueBody": {
"id": 6647,
"nodeType": "Block",
"src": "499:90:21",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 6645,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 6641,
"name": "currentCallPhase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6611,
"src": "513:16:21",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 6642,
"name": "GlobalConstraintInterface",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3842,
"src": "532:25:21",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_GlobalConstraintInterface_$3842_$",
"typeString": "type(contract GlobalConstraintInterface)"
}
},
"id": 6643,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "CallPhase",
"nodeType": "MemberAccess",
"referencedDeclaration": 3814,
"src": "532:35:21",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_CallPhase_$3814_$",
"typeString": "type(enum GlobalConstraintInterface.CallPhase)"
}
},
"id": 6644,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "PreAndPost",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "532:46:21",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
}
},
"src": "513:65:21",
"typeDescriptions": {
"typeIdentifier": "t_enum$_CallPhase_$3814",
"typeString": "enum GlobalConstraintInterface.CallPhase"
}
},
"id": 6646,
"nodeType": "ExpressionStatement",
"src": "513:65:21"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 6670,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "846:4:21",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"functionReturnParameters": 6621,
"id": 6671,
"nodeType": "Return",
"src": "839:11:21"
}
]
},
"documentation": null,
"id": 6673,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setConstraint",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6618,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6613,
"name": "method",
"nodeType": "VariableDeclaration",
"scope": 6673,
"src": "335:14:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6612,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "335:7:21",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6615,
"name": "pre",
"nodeType": "VariableDeclaration",
"scope": 6673,
"src": "350:8:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6614,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "350:4:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6617,
"name": "post",
"nodeType": "VariableDeclaration",
"scope": 6673,
"src": "359:9:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6616,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "359:4:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "334:35:21"
},
"payable": false,
"returnParameters": {
"id": 6621,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6620,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 6673,
"src": "385:4:21",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6619,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "385:4:21",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "384:6:21"
},
"scope": 6716,
"src": "312:545:21",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 6689,
"nodeType": "Block",
"src": "936:46:21",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 6684,
"name": "testParams",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6609,
"src": "953:10:21",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_TestParam_$6605_storage_$",
"typeString": "mapping(bytes32 => struct GlobalConstraintMock.TestParam storage ref)"
}
},
"id": 6686,
"indexExpression": {
"argumentTypes": null,
"id": 6685,
"name": "method",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6679,
"src": "964:6:21",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},