UNPKG

@realitio/realitio-contracts

Version:

Collection of smart contracts for the Realitio fact verification platform

1,209 lines (1,208 loc) 55.9 kB
{ "contractName": "BalanceHolder", "abi": [ { "constant": true, "inputs": [ { "name": "", "type": "address" } ], "name": "balanceOf", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "token", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "user", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" } ], "name": "LogWithdraw", "type": "event" }, { "constant": false, "inputs": [], "name": "withdraw", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b5061036e806100206000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633ccfd60b1461005c57806370a0823114610073578063fc0c546a146100ca575b600080fd5b34801561006857600080fd5b50610071610121565b005b34801561007f57600080fd5b506100b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610305565b6040518082815260200191505060405180910390f35b3480156100d657600080fd5b506100df61031d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561026e57600080fd5b505af1158015610282573d6000803e3d6000fd5b505050506040513d602081101561029857600080fd5b810190808051906020019092919050505015156102b457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167f4ce7033d118120e254016dccf195288400b28fc8936425acd5f17ce2df3ab708826040518082815260200191505060405180910390a250565b60016020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a7230582073cb30830afaae963ec3e87a2c9d35f2dd627a1265651712ba0d105dec4d3ca30029", "deployedBytecode": "0x608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633ccfd60b1461005c57806370a0823114610073578063fc0c546a146100ca575b600080fd5b34801561006857600080fd5b50610071610121565b005b34801561007f57600080fd5b506100b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610305565b6040518082815260200191505060405180910390f35b3480156100d657600080fd5b506100df61031d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561026e57600080fd5b505af1158015610282573d6000803e3d6000fd5b505050506040513d602081101561029857600080fd5b810190808051906020019092919050505015156102b457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167f4ce7033d118120e254016dccf195288400b28fc8936425acd5f17ce2df3ab708826040518082815260200191505060405180910390a250565b60016020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a7230582073cb30830afaae963ec3e87a2c9d35f2dd627a1265651712ba0d105dec4d3ca30029", "sourceMap": "50:406:2:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;50:406:2;;;;;;;", "deployedSourceMap": "50:406:2:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;241:212;;8:9:-1;5:2;;;30:1;27;20:12;5:2;241:212:2;;;;;;106:44;;8:9:-1;5:2;;;30:1;27;20:12;5:2;106:44:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;80:19;;8:9:-1;5:2;;;30:1;27;20:12;5:2;80:19:2;;;;;;;;;;;;;;;;;;;;;;;;;;;241:212;283:11;297:9;:21;307:10;297:21;;;;;;;;;;;;;;;;283:35;;352:1;328:9;:21;338:10;328:21;;;;;;;;;;;;;;;:25;;;;371:5;;;;;;;;;;;:14;;;386:10;398:3;371:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;371:31:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;371:31:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;371:31:2;;;;;;;;;;;;;;;;363:40;;;;;;;;430:10;418:28;;;442:3;418:28;;;;;;;;;;;;;;;;;;241:212;:::o;106:44::-;;;;;;;;;;;;;;;;;:::o;80:19::-;;;;;;;;;;;;;:::o", "source": "pragma solidity ^0.4.25;\n\nimport './IERC20.sol';\n\ncontract BalanceHolder {\n\n IERC20 public token;\n\n mapping(address => uint256) public balanceOf;\n\n event LogWithdraw(\n address indexed user,\n uint256 amount\n );\n\n function withdraw() \n public {\n uint256 bal = balanceOf[msg.sender];\n balanceOf[msg.sender] = 0;\n require(token.transfer(msg.sender, bal));\n emit LogWithdraw(msg.sender, bal);\n }\n\n}\n", "sourcePath": "/home/ed/working/realitio-contracts/truffle/contracts/BalanceHolderERC20.sol", "ast": { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/BalanceHolderERC20.sol", "exportedSymbols": { "BalanceHolder": [ 484 ] }, "id": 485, "nodeType": "SourceUnit", "nodes": [ { "id": 437, "literals": [ "solidity", "^", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:24:2" }, { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/IERC20.sol", "file": "./IERC20.sol", "id": 438, "nodeType": "ImportDirective", "scope": 485, "sourceUnit": 1353, "src": "26:22:2", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 484, "linearizedBaseContracts": [ 484 ], "name": "BalanceHolder", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 440, "name": "token", "nodeType": "VariableDeclaration", "scope": 484, "src": "80:19:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$1352", "typeString": "contract IERC20" }, "typeName": { "contractScope": null, "id": 439, "name": "IERC20", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1352, "src": "80:6:2", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$1352", "typeString": "contract IERC20" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 444, "name": "balanceOf", "nodeType": "VariableDeclaration", "scope": 484, "src": "106:44:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 443, "keyType": { "id": 441, "name": "address", "nodeType": "ElementaryTypeName", "src": "114:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "106:27:2", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 442, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "125:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "public" }, { "anonymous": false, "documentation": null, "id": 450, "name": "LogWithdraw", "nodeType": "EventDefinition", "parameters": { "id": 449, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 446, "indexed": true, "name": "user", "nodeType": "VariableDeclaration", "scope": 450, "src": "184:20:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 445, "name": "address", "nodeType": "ElementaryTypeName", "src": "184:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 448, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", "scope": 450, "src": "214:14:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 447, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "214:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "174:60:2" }, "src": "157:78:2" }, { "body": { "id": 482, "nodeType": "Block", "src": "273:180:2", "statements": [ { "assignments": [ 454 ], "declarations": [ { "constant": false, "id": 454, "name": "bal", "nodeType": "VariableDeclaration", "scope": 483, "src": "283:11:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 453, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "283:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 459, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 455, "name": "balanceOf", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 444, "src": "297:9:2", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 458, "indexExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 456, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "307:3:2", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 457, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "307:10:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "297:21:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "283:35:2" }, { "expression": { "argumentTypes": null, "id": 465, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 460, "name": "balanceOf", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 444, "src": "328:9:2", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 463, "indexExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 461, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "338:3:2", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 462, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "338:10:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "328:21:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "30", "id": 464, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "352:1:2", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "328:25:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 466, "nodeType": "ExpressionStatement", "src": "328:25:2" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 470, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "386:3:2", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 471, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "386:10:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 472, "name": "bal", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 454, "src": "398:3:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 468, "name": "token", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 440, "src": "371:5:2", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$1352", "typeString": "contract IERC20" } }, "id": 469, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "transfer", "nodeType": "MemberAccess", "referencedDeclaration": 1315, "src": "371:14:2", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", "typeString": "function (address,uint256) external returns (bool)" } }, "id": 473, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "371:31:2", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 467, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 9706, 9707 ], "referencedDeclaration": 9706, "src": "363:7:2", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 474, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "363:40:2", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 475, "nodeType": "ExpressionStatement", "src": "363:40:2" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 477, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "430:3:2", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 478, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "430:10:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 479, "name": "bal", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 454, "src": "442:3:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 476, "name": "LogWithdraw", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 450, "src": "418:11:2", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", "typeString": "function (address,uint256)" } }, "id": 480, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "418:28:2", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 481, "nodeType": "EmitStatement", "src": "413:33:2" } ] }, "documentation": null, "id": 483, "implemented": true, "isConstructor": false, "isDeclaredConst": false, "modifiers": [], "name": "withdraw", "nodeType": "FunctionDefinition", "parameters": { "id": 451, "nodeType": "ParameterList", "parameters": [], "src": "258:2:2" }, "payable": false, "returnParameters": { "id": 452, "nodeType": "ParameterList", "parameters": [], "src": "273:0:2" }, "scope": 484, "src": "241:212:2", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], "scope": 485, "src": "50:406:2" } ], "src": "0:457:2" }, "legacyAST": { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/BalanceHolderERC20.sol", "exportedSymbols": { "BalanceHolder": [ 484 ] }, "id": 485, "nodeType": "SourceUnit", "nodes": [ { "id": 437, "literals": [ "solidity", "^", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:24:2" }, { "absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/IERC20.sol", "file": "./IERC20.sol", "id": 438, "nodeType": "ImportDirective", "scope": 485, "sourceUnit": 1353, "src": "26:22:2", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 484, "linearizedBaseContracts": [ 484 ], "name": "BalanceHolder", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 440, "name": "token", "nodeType": "VariableDeclaration", "scope": 484, "src": "80:19:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$1352", "typeString": "contract IERC20" }, "typeName": { "contractScope": null, "id": 439, "name": "IERC20", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1352, "src": "80:6:2", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$1352", "typeString": "contract IERC20" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 444, "name": "balanceOf", "nodeType": "VariableDeclaration", "scope": 484, "src": "106:44:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 443, "keyType": { "id": 441, "name": "address", "nodeType": "ElementaryTypeName", "src": "114:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "106:27:2", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 442, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "125:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "public" }, { "anonymous": false, "documentation": null, "id": 450, "name": "LogWithdraw", "nodeType": "EventDefinition", "parameters": { "id": 449, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 446, "indexed": true, "name": "user", "nodeType": "VariableDeclaration", "scope": 450, "src": "184:20:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 445, "name": "address", "nodeType": "ElementaryTypeName", "src": "184:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 448, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", "scope": 450, "src": "214:14:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 447, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "214:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "174:60:2" }, "src": "157:78:2" }, { "body": { "id": 482, "nodeType": "Block", "src": "273:180:2", "statements": [ { "assignments": [ 454 ], "declarations": [ { "constant": false, "id": 454, "name": "bal", "nodeType": "VariableDeclaration", "scope": 483, "src": "283:11:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 453, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "283:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 459, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 455, "name": "balanceOf", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 444, "src": "297:9:2", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 458, "indexExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 456, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "307:3:2", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 457, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "307:10:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "297:21:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "283:35:2" }, { "expression": { "argumentTypes": null, "id": 465, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 460, "name": "balanceOf", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 444, "src": "328:9:2", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 463, "indexExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 461, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "338:3:2", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 462, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "338:10:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "328:21:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "30", "id": 464, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "352:1:2", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "328:25:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 466, "nodeType": "ExpressionStatement", "src": "328:25:2" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 470, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9703, "src": "386:3:2", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 471, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "386:10:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 472, "name": "bal", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 454, "src": "398:3:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 468, "name": "token", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 440, "src": "371:5:2", "typeDescriptions": { "typeIdentifier": "t_contract$_IERC20_$1352", "typeString": "contract IERC20" } }, "id": 469, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "transfer", "nodeType": "MemberAccess", "referencedDeclaration": 1315, "src": "371:14:2", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", "typeString": "function (address,uint256) external returns (bool)" } }, "id": 473, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "371:31:2", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 467, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 9706, 9707