arc_dx
Version:
A platform for building DAOs
1,120 lines (1,119 loc) • 150 kB
JSON
{
"contractName": "TokenCapGC",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "",
"type": "bytes32"
}
],
"name": "parameters",
"outputs": [
{
"name": "token",
"type": "address"
},
{
"name": "cap",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_token",
"type": "address"
},
{
"name": "_cap",
"type": "uint256"
}
],
"name": "setParameters",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_token",
"type": "address"
},
{
"name": "_cap",
"type": "uint256"
}
],
"name": "getParametersHash",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "bytes32"
},
{
"name": "",
"type": "bytes32"
}
],
"name": "pre",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "_paramsHash",
"type": "bytes32"
},
{
"name": "",
"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": "pure",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b506103e4806100206000396000f3006080604052600436106100775763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302506804811461007c57806378fc063c146100b75780638043154d146100ed578063c1786ab214610128578063c41981611461014f578063e2b0caef14610173575b600080fd5b34801561008857600080fd5b506100946004356101ac565b60408051600160a060020a03909316835260208301919091528051918290030190f35b3480156100c357600080fd5b506100db600160a060020a03600435166024356101d1565b60408051918252519081900360200190f35b3480156100f957600080fd5b50610114600160a060020a036004351660243560443561027e565b604080519115158252519081900360200190f35b34801561013457600080fd5b50610114600160a060020a0360043516602435604435610355565b34801561015b57600080fd5b506100db600160a060020a036004351660243561035e565b34801561017f57600080fd5b506101886103b3565b6040518082600281111561019857fe5b60ff16815260200191505060405180910390f35b60006020819052908152604090208054600190910154600160a060020a039091169082565b600082826040516020018083600160a060020a0316600160a060020a03166c01000000000000000000000000028152601401828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061024b5780518252601f19909201916020918201910161022c565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b600082815260208190526040812054600160a060020a03161580159061033d57506000838152602081815260408083206001810154905482517f18160ddd00000000000000000000000000000000000000000000000000000000815292519194600160a060020a03909116936318160ddd936004808201949293918390030190829087803b15801561030f57600080fd5b505af1158015610323573d6000803e3d6000fd5b505050506040513d602081101561033957600080fd5b5051115b1561034a5750600061034e565b5060015b9392505050565b60019392505050565b60008061036b84846101d1565b60008181526020819052604090208054600160a060020a03871673ffffffffffffffffffffffffffffffffffffffff1990911617815560010184905591508190505092915050565b6001905600a165627a7a723058209b1ae597119da4ad8cf4af4eef2c0932998c00e8dedef7f044b3f65bf2f032ae0029",
"deployedBytecode": "0x6080604052600436106100775763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302506804811461007c57806378fc063c146100b75780638043154d146100ed578063c1786ab214610128578063c41981611461014f578063e2b0caef14610173575b600080fd5b34801561008857600080fd5b506100946004356101ac565b60408051600160a060020a03909316835260208301919091528051918290030190f35b3480156100c357600080fd5b506100db600160a060020a03600435166024356101d1565b60408051918252519081900360200190f35b3480156100f957600080fd5b50610114600160a060020a036004351660243560443561027e565b604080519115158252519081900360200190f35b34801561013457600080fd5b50610114600160a060020a0360043516602435604435610355565b34801561015b57600080fd5b506100db600160a060020a036004351660243561035e565b34801561017f57600080fd5b506101886103b3565b6040518082600281111561019857fe5b60ff16815260200191505060405180910390f35b60006020819052908152604090208054600190910154600160a060020a039091169082565b600082826040516020018083600160a060020a0316600160a060020a03166c01000000000000000000000000028152601401828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061024b5780518252601f19909201916020918201910161022c565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b600082815260208190526040812054600160a060020a03161580159061033d57506000838152602081815260408083206001810154905482517f18160ddd00000000000000000000000000000000000000000000000000000000815292519194600160a060020a03909116936318160ddd936004808201949293918390030190829087803b15801561030f57600080fd5b505af1158015610323573d6000803e3d6000fd5b505050506040513d602081101561033957600080fd5b5051115b1561034a5750600061034e565b5060015b9392505050565b60019392505050565b60008061036b84846101d1565b60008181526020819052604090208054600160a060020a03871673ffffffffffffffffffffffffffffffffffffffff1990911617815560010184905591508190505092915050565b6001905600a165627a7a723058209b1ae597119da4ad8cf4af4eef2c0932998c00e8dedef7f044b3f65bf2f032ae0029",
"sourceMap": "253:2277:7:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;253:2277:7;;;;;;;",
"deployedSourceMap": "253:2277:7:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;496:47;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;496:47:7;;;;;;;;;-1:-1:-1;;;;;496:47:7;;;;;;;;;;;;;;;;;;;;;1289:156;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1289:156:7;-1:-1:-1;;;;;1289:156:7;;;;;;;;;;;;;;;;;;;;;;;1926:304;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1926:304:7;-1:-1:-1;;;;;1926:304:7;;;;;;;;;;;;;;;;;;;;;;;;;;;1637:94;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1637:94:7;-1:-1:-1;;;;;1637:94:7;;;;;;;;;772:266;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;772:266:7;-1:-1:-1;;;;;772:266:7;;;;;;;2391:137;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2391:137:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;496:47;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;496:47:7;;;;;:::o;1289:156::-;1369:7;1423:6;1431:4;1406:30;;;;;;-1:-1:-1;;;;;1406:30:7;-1:-1:-1;;;;;1406:30:7;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1406:30:7;;;1396:41;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;;;;365:33;;1396:41:7;;;;;;;;;;;;-1:-1:-1;;;;;;1289:156:7:o;1926:304::-;1999:4;2020:23;;;;;;;;;;:29;-1:-1:-1;;;;;2020:29:7;:49;;;;2019:143;;-1:-1:-1;2134:10:7;:23;;;;;;;;;;;:27;;;;2088:29;;:43;;;;;;;2134:27;;-1:-1:-1;;;;;2088:29:7;;;;:41;;:43;;;;;2134:23;;2088:43;;;;;;;;:29;:43;;;5:2:-1;;;;30:1;27;20:12;5:2;2088:43:7;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2088:43:7;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2088:43:7;:73;2019:143;2015:188;;;-1:-1:-1;2185:5:7;2178:12;;2015:188;-1:-1:-1;2219:4:7;1926:304;;;;;;:::o;1637:94::-;1720:4;1637:94;;;;;:::o;772:266::-;843:7;862:18;883:31;901:6;909:4;883:17;:31::i;:::-;924:10;:22;;;;;;;;;;:37;;-1:-1:-1;;;;;924:37:7;;-1:-1:-1;;924:37:7;;;;;;;971:26;:33;;;862:52;-1:-1:-1;862:52:7;;-1:-1:-1;772:266:7;;;;;:::o;2391:137::-;2481:40;2391:137;:::o",
"source": "pragma solidity ^0.4.25;\n\nimport \"openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol\";\nimport \"./GlobalConstraintInterface.sol\";\n\n\n/**\n * @title Token Cap Global Constraint\n * @dev A simple global constraint to cap the number of tokens.\n */\n\ncontract TokenCapGC {\n // A set of parameters, on which the cap will be checked:\n struct Parameters {\n StandardToken token;\n uint cap;\n }\n\n // Mapping from the hash of the parameters to the parameters themselves:\n mapping (bytes32=>Parameters) public parameters;\n\n\n /**\n * @dev adding a new set of parameters\n * @param _token the token to add to the params.\n * @param _cap the cap to check the total supply against.\n * @return the calculated parameters hash\n */\n function setParameters(StandardToken _token, uint _cap) public returns(bytes32) {\n bytes32 paramsHash = getParametersHash(_token, _cap);\n parameters[paramsHash].token = _token;\n parameters[paramsHash].cap = _cap;\n return paramsHash;\n }\n\n /**\n * @dev calculate and returns the hash of the given parameters\n * @param _token the token to add to the params.\n * @param _cap the cap to check the total supply against.\n * @return the calculated parameters hash\n */\n function getParametersHash(StandardToken _token, uint _cap) public pure returns(bytes32) {\n return (keccak256(abi.encodePacked(_token, _cap)));\n }\n\n /**\n * @dev check the constraint after the action.\n * This global constraint only checks the state after the action, so here we just return true:\n * @return true\n */\n function pre(address, bytes32, bytes32) public pure returns(bool) {\n return true;\n }\n\n /**\n * @dev check the total supply cap.\n * @param _paramsHash the parameters hash to check the total supply cap against.\n * @return bool which represents a success\n */\n function post(address, bytes32 _paramsHash, bytes32) public view returns(bool) {\n if ((parameters[_paramsHash].token != StandardToken(0)) &&\n ( parameters[_paramsHash].token.totalSupply() > parameters[_paramsHash].cap)) {\n return false;\n }\n return true;\n }\n\n /**\n * @dev when return if this globalConstraints is pre, post or both.\n * @return CallPhase enum indication Pre, Post or PreAndPost.\n */\n function when() public pure returns(GlobalConstraintInterface.CallPhase) {\n return GlobalConstraintInterface.CallPhase.Post;\n }\n}\n",
"sourcePath": "/Users/oren/daostack/daostack2/daostack/contracts/globalConstraints/TokenCapGC.sol",
"ast": {
"absolutePath": "/Users/oren/daostack/daostack2/daostack/contracts/globalConstraints/TokenCapGC.sol",
"exportedSymbols": {
"TokenCapGC": [
3972
]
},
"id": 3973,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 3844,
"literals": [
"solidity",
"^",
"0.4",
".25"
],
"nodeType": "PragmaDirective",
"src": "0:24:7"
},
{
"absolutePath": "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol",
"file": "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol",
"id": 3845,
"nodeType": "ImportDirective",
"scope": 3973,
"sourceUnit": 21535,
"src": "26:71:7",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/oren/daostack/daostack2/daostack/contracts/globalConstraints/GlobalConstraintInterface.sol",
"file": "./GlobalConstraintInterface.sol",
"id": 3846,
"nodeType": "ImportDirective",
"scope": 3973,
"sourceUnit": 3843,
"src": "98:41:7",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": "@title Token Cap Global Constraint\n@dev A simple global constraint to cap the number of tokens.",
"fullyImplemented": true,
"id": 3972,
"linearizedBaseContracts": [
3972
],
"name": "TokenCapGC",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "TokenCapGC.Parameters",
"id": 3851,
"members": [
{
"constant": false,
"id": 3848,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 3851,
"src": "369:19:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
},
"typeName": {
"contractScope": null,
"id": 3847,
"name": "StandardToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21534,
"src": "369:13:7",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 3850,
"name": "cap",
"nodeType": "VariableDeclaration",
"scope": 3851,
"src": "398:8:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 3849,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "398:4:7",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Parameters",
"nodeType": "StructDefinition",
"scope": 3972,
"src": "341:72:7",
"visibility": "public"
},
{
"constant": false,
"id": 3855,
"name": "parameters",
"nodeType": "VariableDeclaration",
"scope": 3972,
"src": "496:47:7",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Parameters_$3851_storage_$",
"typeString": "mapping(bytes32 => struct TokenCapGC.Parameters)"
},
"typeName": {
"id": 3854,
"keyType": {
"id": 3852,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "505:7:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Mapping",
"src": "496:29:7",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Parameters_$3851_storage_$",
"typeString": "mapping(bytes32 => struct TokenCapGC.Parameters)"
},
"valueType": {
"contractScope": null,
"id": 3853,
"name": "Parameters",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3851,
"src": "514:10:7",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Parameters_$3851_storage_ptr",
"typeString": "struct TokenCapGC.Parameters"
}
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 3887,
"nodeType": "Block",
"src": "852:186:7",
"statements": [
{
"assignments": [
3865
],
"declarations": [
{
"constant": false,
"id": 3865,
"name": "paramsHash",
"nodeType": "VariableDeclaration",
"scope": 3888,
"src": "862:18:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 3864,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "862:7:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 3870,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 3867,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3857,
"src": "901:6:7",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
}
},
{
"argumentTypes": null,
"id": 3868,
"name": "_cap",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3859,
"src": "909:4:7",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 3866,
"name": "getParametersHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3907,
"src": "883:17:7",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_contract$_StandardToken_$21534_$_t_uint256_$returns$_t_bytes32_$",
"typeString": "function (contract StandardToken,uint256) pure returns (bytes32)"
}
},
"id": 3869,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "883:31:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "862:52:7"
},
{
"expression": {
"argumentTypes": null,
"id": 3876,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 3871,
"name": "parameters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3855,
"src": "924:10:7",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Parameters_$3851_storage_$",
"typeString": "mapping(bytes32 => struct TokenCapGC.Parameters storage ref)"
}
},
"id": 3873,
"indexExpression": {
"argumentTypes": null,
"id": 3872,
"name": "paramsHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3865,
"src": "935:10:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "924:22:7",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Parameters_$3851_storage",
"typeString": "struct TokenCapGC.Parameters storage ref"
}
},
"id": 3874,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "token",
"nodeType": "MemberAccess",
"referencedDeclaration": 3848,
"src": "924:28:7",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 3875,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3857,
"src": "955:6:7",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
}
},
"src": "924:37:7",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
}
},
"id": 3877,
"nodeType": "ExpressionStatement",
"src": "924:37:7"
},
{
"expression": {
"argumentTypes": null,
"id": 3883,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 3878,
"name": "parameters",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3855,
"src": "971:10:7",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Parameters_$3851_storage_$",
"typeString": "mapping(bytes32 => struct TokenCapGC.Parameters storage ref)"
}
},
"id": 3880,
"indexExpression": {
"argumentTypes": null,
"id": 3879,
"name": "paramsHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3865,
"src": "982:10:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "971:22:7",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Parameters_$3851_storage",
"typeString": "struct TokenCapGC.Parameters storage ref"
}
},
"id": 3881,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"memberName": "cap",
"nodeType": "MemberAccess",
"referencedDeclaration": 3850,
"src": "971:26:7",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 3882,
"name": "_cap",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3859,
"src": "1000:4:7",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "971:33:7",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 3884,
"nodeType": "ExpressionStatement",
"src": "971:33:7"
},
{
"expression": {
"argumentTypes": null,
"id": 3885,
"name": "paramsHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3865,
"src": "1021:10:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"functionReturnParameters": 3863,
"id": 3886,
"nodeType": "Return",
"src": "1014:17:7"
}
]
},
"documentation": "@dev adding a new set of parameters\n@param _token the token to add to the params.\n@param _cap the cap to check the total supply against.\n@return the calculated parameters hash",
"id": 3888,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "setParameters",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3860,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3857,
"name": "_token",
"nodeType": "VariableDeclaration",
"scope": 3888,
"src": "795:20:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
},
"typeName": {
"contractScope": null,
"id": 3856,
"name": "StandardToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21534,
"src": "795:13:7",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 3859,
"name": "_cap",
"nodeType": "VariableDeclaration",
"scope": 3888,
"src": "817:9:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 3858,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "817:4:7",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "794:33:7"
},
"payable": false,
"returnParameters": {
"id": 3863,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3862,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 3888,
"src": "843:7:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 3861,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "843:7:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "842:9:7"
},
"scope": 3972,
"src": "772:266:7",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 3906,
"nodeType": "Block",
"src": "1378:67:7",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 3900,
"name": "_token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3890,
"src": "1423:6:7",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
}
},
{
"argumentTypes": null,
"id": 3901,
"name": "_cap",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3892,
"src": "1431:4:7",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 3898,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21536,
"src": "1406:3:7",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 3899,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodePacked",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1406:16:7",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$",
"typeString": "function () pure returns (bytes memory)"
}
},
"id": 3902,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1406:30:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 3897,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21543,
"src": "1396:9:7",
"typeDescriptions": {
"typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$",
"typeString": "function () pure returns (bytes32)"
}
},
"id": 3903,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1396:41:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"id": 3904,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1395:43:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"functionReturnParameters": 3896,
"id": 3905,
"nodeType": "Return",
"src": "1388:50:7"
}
]
},
"documentation": "@dev calculate and returns the hash of the given parameters\n@param _token the token to add to the params.\n@param _cap the cap to check the total supply against.\n@return the calculated parameters hash",
"id": 3907,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getParametersHash",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3893,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3890,
"name": "_token",
"nodeType": "VariableDeclaration",
"scope": 3907,
"src": "1316:20:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
},
"typeName": {
"contractScope": null,
"id": 3889,
"name": "StandardToken",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 21534,
"src": "1316:13:7",
"typeDescriptions": {
"typeIdentifier": "t_contract$_StandardToken_$21534",
"typeString": "contract StandardToken"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 3892,
"name": "_cap",
"nodeType": "VariableDeclaration",
"scope": 3907,
"src": "1338:9:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 3891,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1338:4:7",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1315:33:7"
},
"payable": false,
"returnParameters": {
"id": 3896,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3895,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 3907,
"src": "1369:7:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 3894,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1369:7:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1368:9:7"
},
"scope": 3972,
"src": "1289:156:7",
"stateMutability": "pure",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 3920,
"nodeType": "Block",
"src": "1703:28:7",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 3918,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1720:4:7",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"functionReturnParameters": 3917,
"id": 3919,
"nodeType": "Return",
"src": "1713:11:7"
}
]
},
"documentation": "@dev check the constraint after the action.\nThis global constraint only checks the state after the action, so here we just return true:\n@return true",
"id": 3921,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "pre",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3914,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 3909,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 3921,
"src": "1650:7:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 3908,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1650:7:7",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 3911,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 3921,
"src": "1659:7:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 3910,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1659:7:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 3913,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 3921,
"src": "1668:7:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 3912,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1668:7:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1649:27:7"
},
"payable": false,
"returnParameters": {
"id": 3917,
"nodeType": "ParameterList",
"parameters": [