UNPKG

@josojo/realitytoken-contracts

Version:
1,010 lines 232 kB
{ "contractName": "StandardToken", "abi": [ { "anonymous": false, "inputs": [ { "indexed": true, "name": "from", "type": "address" }, { "indexed": true, "name": "to", "type": "address" }, { "indexed": false, "name": "value", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "owner", "type": "address" }, { "indexed": true, "name": "spender", "type": "address" }, { "indexed": false, "name": "value", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "constant": false, "inputs": [ { "name": "to", "type": "address" }, { "name": "value", "type": "uint256" } ], "name": "transfer", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "from", "type": "address" }, { "name": "to", "type": "address" }, { "name": "value", "type": "uint256" } ], "name": "transferFrom", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "spender", "type": "address" }, { "name": "value", "type": "uint256" } ], "name": "approve", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "owner", "type": "address" }, { "name": "spender", "type": "address" } ], "name": "allowance", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b506106ff806100206000396000f3006080604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007c57806318160ddd146100b457806323b872dd146100db57806370a0823114610105578063a9059cbb14610126578063dd62ed3e1461014a575b600080fd5b34801561008857600080fd5b506100a0600160a060020a0360043516602435610171565b604080519115158252519081900360200190f35b3480156100c057600080fd5b506100c96101d8565b60408051918252519081900360200190f35b3480156100e757600080fd5b506100a0600160a060020a03600435811690602435166044356101de565b34801561011157600080fd5b506100c9600160a060020a03600435166104ac565b34801561013257600080fd5b506100a0600160a060020a03600435166024356104c7565b34801561015657600080fd5b506100c9600160a060020a03600435811690602435166106a8565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025490565b600160a060020a0383166000908152602081815260408083205481517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052905173__Math__________________________________9263e31c71c49260448082019391829003018186803b15801561026557600080fd5b505af4158015610279573d6000803e3d6000fd5b505050506040513d602081101561028f57600080fd5b505115806103595750600160a060020a03841660009081526001602090815260408083203384528252918290205482517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________9263e31c71c4926044808301939192829003018186803b15801561032b57600080fd5b505af415801561033f573d6000803e3d6000fd5b505050506040513d602081101561035557600080fd5b5051155b806104165750600160a060020a038316600090815260208181526040918290205482517f4e30a66c000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________92634e30a66c926044808301939192829003018186803b1580156103e857600080fd5b505af41580156103fc573d6000803e3d6000fd5b505050506040513d602081101561041257600080fd5b5051155b15610423575060006104a5565b600160a060020a038085166000818152602081815260408083208054889003905560018252808320338452825280832080548890039055938716808352828252918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a031660009081526020819052604090205490565b336000908152602081815260408083205481517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052905173__Math__________________________________9263e31c71c49260448082019391829003018186803b15801561054557600080fd5b505af4158015610559573d6000803e3d6000fd5b505050506040513d602081101561056f57600080fd5b5051158061062f5750600160a060020a038316600090815260208181526040918290205482517f4e30a66c000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________92634e30a66c926044808301939192829003018186803b15801561060157600080fd5b505af4158015610615573d6000803e3d6000fd5b505050506040513d602081101561062b57600080fd5b5051155b1561063c575060006101d2565b3360008181526020818152604080832080548790039055600160a060020a03871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b600160a060020a039182166000908152600160209081526040808320939094168252919091522054905600a165627a7a72305820b967c3382153289e67ba3d8b8c3881ffd6f0a7c640e17bbabd1e8cab294ca9b40029", "deployedBytecode": "0x6080604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007c57806318160ddd146100b457806323b872dd146100db57806370a0823114610105578063a9059cbb14610126578063dd62ed3e1461014a575b600080fd5b34801561008857600080fd5b506100a0600160a060020a0360043516602435610171565b604080519115158252519081900360200190f35b3480156100c057600080fd5b506100c96101d8565b60408051918252519081900360200190f35b3480156100e757600080fd5b506100a0600160a060020a03600435811690602435166044356101de565b34801561011157600080fd5b506100c9600160a060020a03600435166104ac565b34801561013257600080fd5b506100a0600160a060020a03600435166024356104c7565b34801561015657600080fd5b506100c9600160a060020a03600435811690602435166106a8565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025490565b600160a060020a0383166000908152602081815260408083205481517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052905173__Math__________________________________9263e31c71c49260448082019391829003018186803b15801561026557600080fd5b505af4158015610279573d6000803e3d6000fd5b505050506040513d602081101561028f57600080fd5b505115806103595750600160a060020a03841660009081526001602090815260408083203384528252918290205482517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________9263e31c71c4926044808301939192829003018186803b15801561032b57600080fd5b505af415801561033f573d6000803e3d6000fd5b505050506040513d602081101561035557600080fd5b5051155b806104165750600160a060020a038316600090815260208181526040918290205482517f4e30a66c000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________92634e30a66c926044808301939192829003018186803b1580156103e857600080fd5b505af41580156103fc573d6000803e3d6000fd5b505050506040513d602081101561041257600080fd5b5051155b15610423575060006104a5565b600160a060020a038085166000818152602081815260408083208054889003905560018252808320338452825280832080548890039055938716808352828252918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b600160a060020a031660009081526020819052604090205490565b336000908152602081815260408083205481517fe31c71c4000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052905173__Math__________________________________9263e31c71c49260448082019391829003018186803b15801561054557600080fd5b505af4158015610559573d6000803e3d6000fd5b505050506040513d602081101561056f57600080fd5b5051158061062f5750600160a060020a038316600090815260208181526040918290205482517f4e30a66c000000000000000000000000000000000000000000000000000000008152600481019190915260248101859052915173__Math__________________________________92634e30a66c926044808301939192829003018186803b15801561060157600080fd5b505af4158015610615573d6000803e3d6000fd5b505050506040513d602081101561062b57600080fd5b5051155b1561063c575060006101d2565b3360008181526020818152604080832080548790039055600160a060020a03871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b600160a060020a039182166000908152600160209081526040808320939094168252919091522054905600a165627a7a72305820b967c3382153289e67ba3d8b8c3881ffd6f0a7c640e17bbabd1e8cab294ca9b40029", "sourceMap": "145:2861:13:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;145:2861:13;;;;;;;", "deployedSourceMap": "145:2861:13:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1951:211;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1951:211:13;-1:-1:-1;;;;;1951:211:13;;;;;;;;;;;;;;;;;;;;;;;;;2887:117;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2887:117:13;;;;;;;;;;;;;;;;;;;;1275:459;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1275:459:13;-1:-1:-1;;;;;1275:459:13;;;;;;;;;;;;2676:132;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2676:132:13;-1:-1:-1;;;;;2676:132:13;;;;;613:350;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;613:350:13;-1:-1:-1;;;;;613:350:13;;;;;;;2372:160;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2372:160:13;-1:-1:-1;;;;;2372:160:13;;;;;;;;;;1951:211;2060:10;2029:4;2049:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;2049:31:13;;;;;;;;;;;:39;;;2098:36;;;;;;;2029:4;;2049:31;;2060:10;;2098:36;;;;;;;;-1:-1:-1;2151:4:13;1951:211;;;;;:::o;2887:117::-;2986:11;;2887:117;:::o;1275:459::-;-1:-1:-1;;;;;1395:14:13;;1367:4;1395:14;;;;;;;;;;;;:31;;;;;;;;;;;;;;;;;;;;:24;;;;:31;;;;;;;;;;;:24;:31;;;5:2:-1;;;;30:1;27;20:12;5:2;1395:31:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1395:31:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1395:31:13;1394:32;;:94;;-1:-1:-1;;;;;;1443:16:13;;;;;;:10;:16;;;;;;;;1460:10;1443:28;;;;;;;;;:45;;;;;;;;;;;;;;;;;;;;:38;;;;:45;;;;;:16;;:45;;;;;:38;:45;;;5:2:-1;;;;30:1;27;20:12;5:2;1443:45:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1443:45:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1443:45:13;1442:46;1394:94;:140;;;-1:-1:-1;;;;;;1505:12:13;;:8;:12;;;;;;;;;;;;;:29;;;;;;;;;;;;;;;;;;;;:22;;;;:29;;;;;:12;;:29;;;;;:22;:29;;;5:2:-1;;;;30:1;27;20:12;5:2;1505:29:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1505:29:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1505:29:13;1504:30;1394:140;1387:173;;;-1:-1:-1;1555:5:13;1548:12;;1387:173;-1:-1:-1;;;;;1570:14:13;;;:8;:14;;;;;;;;;;;:23;;;;;;;-1:-1:-1;1603:16:13;;;;;1620:10;1603:28;;;;;;;:37;;;;;;;1650:12;;;;;;;;;;;;;:21;;;;;;1681:25;;;;;;;1650:12;;1681:25;;;;;;;;;;;-1:-1:-1;1723:4:13;1275:459;;;;;;:::o;2676:132::-;-1:-1:-1;;;;;2786:15:13;2759:4;2786:15;;;;;;;;;;;;2676:132::o;613:350::-;724:10;687:4;715:20;;;;;;;;;;;;:37;;;;;;;;;;;;;;;;;;;;:30;;;;:37;;;;;;;;;;;:30;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;715:37:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;715:37:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;715:37:13;714:38;;:84;;-1:-1:-1;;;;;;769:12:13;;:8;:12;;;;;;;;;;;;;:29;;;;;;;;;;;;;;;;;;;;:22;;;;:29;;;;;:12;;:29;;;;;:22;:29;;;5:2:-1;;;;30:1;27;20:12;5:2;769:29:13;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;769:29:13;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;769:29:13;768:30;714:84;707:117;;;-1:-1:-1;819:5:13;812:12;;707:117;843:10;834:8;:20;;;;;;;;;;;:29;;;;;;;-1:-1:-1;;;;;873:12:13;;;;;;;;;:21;;;;;;904:31;;;;;;;873:12;;843:10;904:31;;;;;;;;;;;-1:-1:-1;952:4:13;613:350;;;;:::o;2372:160::-;-1:-1:-1;;;;;2499:17:13;;;2472:4;2499:17;;;:10;:17;;;;;;;;:26;;;;;;;;;;;;;2372:160::o", "source": "pragma solidity ^0.4.15;\nimport \"../Tokens/Token.sol\";\nimport \"../Utils/Math.sol\";\n\n\n/// @title Standard token contract with overflow protection\ncontract StandardToken is Token {\n using Math for *;\n\n /*\n * Storage\n */\n mapping (address => uint) balances;\n mapping (address => mapping (address => uint)) allowances;\n uint totalTokens;\n\n /*\n * Public functions\n */\n /// @dev Transfers sender's tokens to a given address. Returns success\n /// @param to Address of token receiver\n /// @param value Number of tokens to transfer\n /// @return Was transfer successful?\n function transfer(address to, uint value)\n public\n returns (bool)\n {\n if ( !balances[msg.sender].safeToSub(value)\n || !balances[to].safeToAdd(value))\n return false;\n balances[msg.sender] -= value;\n balances[to] += value;\n Transfer(msg.sender, to, value);\n return true;\n }\n\n /// @dev Allows allowed third party to transfer tokens from one address to another. Returns success\n /// @param from Address from where tokens are withdrawn\n /// @param to Address to where tokens are sent\n /// @param value Number of tokens to transfer\n /// @return Was transfer successful?\n function transferFrom(address from, address to, uint value)\n public\n returns (bool)\n {\n if ( !balances[from].safeToSub(value)\n || !allowances[from][msg.sender].safeToSub(value)\n || !balances[to].safeToAdd(value))\n return false;\n balances[from] -= value;\n allowances[from][msg.sender] -= value;\n balances[to] += value;\n Transfer(from, to, value);\n return true;\n }\n\n /// @dev Sets approved amount of tokens for spender. Returns success\n /// @param spender Address of allowed account\n /// @param value Number of approved tokens\n /// @return Was approval successful?\n function approve(address spender, uint value)\n public\n returns (bool)\n {\n allowances[msg.sender][spender] = value;\n Approval(msg.sender, spender, value);\n return true;\n }\n\n /// @dev Returns number of allowed tokens for given address\n /// @param owner Address of token owner\n /// @param spender Address of token spender\n /// @return Remaining allowance for spender\n function allowance(address owner, address spender)\n public\n constant\n returns (uint)\n {\n return allowances[owner][spender];\n }\n\n /// @dev Returns number of tokens owned by given address\n /// @param owner Address of token owner\n /// @return Balance of owner\n function balanceOf(address owner)\n public\n constant\n returns (uint)\n {\n return balances[owner];\n }\n\n /// @dev Returns total supply of tokens\n /// @return Total supply\n function totalSupply()\n public\n constant\n returns (uint)\n {\n return totalTokens;\n }\n}\n", "sourcePath": "@gnosis.pm/pm-contracts/contracts/Tokens/StandardToken.sol", "ast": { "absolutePath": "@gnosis.pm/pm-contracts/contracts/Tokens/StandardToken.sol", "exportedSymbols": { "StandardToken": [ 3291 ] }, "id": 3292, "nodeType": "SourceUnit", "nodes": [ { "id": 3087, "literals": [ "solidity", "^", "0.4", ".15" ], "nodeType": "PragmaDirective", "src": "0:24:13" }, { "absolutePath": "@gnosis.pm/pm-contracts/contracts/Tokens/Token.sol", "file": "../Tokens/Token.sol", "id": 3088, "nodeType": "ImportDirective", "scope": 3292, "sourceUnit": 3361, "src": "25:29:13", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@gnosis.pm/pm-contracts/contracts/Utils/Math.sol", "file": "../Utils/Math.sol", "id": 3089, "nodeType": "ImportDirective", "scope": 3292, "sourceUnit": 4612, "src": "55:27:13", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 3090, "name": "Token", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 3360, "src": "171:5:13", "typeDescriptions": { "typeIdentifier": "t_contract$_Token_$3360", "typeString": "contract Token" } }, "id": 3091, "nodeType": "InheritanceSpecifier", "src": "171:5:13" } ], "contractDependencies": [ 3360 ], "contractKind": "contract", "documentation": "@title Standard token contract with overflow protection", "fullyImplemented": true, "id": 3291, "linearizedBaseContracts": [ 3291, 3360 ], "name": "StandardToken", "nodeType": "ContractDefinition", "nodes": [ { "id": 3093, "libraryName": { "contractScope": null, "id": 3092, "name": "Math", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4611, "src": "189:4:13", "typeDescriptions": { "typeIdentifier": "t_contract$_Math_$4611", "typeString": "library Math" } }, "nodeType": "UsingForDirective", "src": "183:17:13", "typeName": null }, { "constant": false, "id": 3097, "name": "balances", "nodeType": "VariableDeclaration", "scope": 3291, "src": "237:34:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 3096, "keyType": { "id": 3094, "name": "address", "nodeType": "ElementaryTypeName", "src": "246:7:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "237:25:13", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 3095, "name": "uint", "nodeType": "ElementaryTypeName", "src": "257:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 3103, "name": "allowances", "nodeType": "VariableDeclaration", "scope": 3291, "src": "277:57:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", "typeString": "mapping(address => mapping(address => uint256))" }, "typeName": { "id": 3102, "keyType": { "id": 3098, "name": "address", "nodeType": "ElementaryTypeName", "src": "286:7:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "277:46:13", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", "typeString": "mapping(address => mapping(address => uint256))" }, "valueType": { "id": 3101, "keyType": { "id": 3099, "name": "address", "nodeType": "ElementaryTypeName", "src": "306:7:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "297:25:13", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 3100, "name": "uint", "nodeType": "ElementaryTypeName", "src": "317:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 3105, "name": "totalTokens", "nodeType": "VariableDeclaration", "scope": 3291, "src": "340:16:13", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3104, "name": "uint", "nodeType": "ElementaryTypeName", "src": "340:4:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "body": { "id": 3155, "nodeType": "Block", "src": "697:266:13", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 3129, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 3121, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "714:38:13", "subExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 3119, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3109, "src": "746:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 3114, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3097, "src": "715:8:13", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 3117, "indexExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 3115, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9180, "src": "724:3:13", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 3116, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "724:10:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "715:20:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 3118, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "safeToSub", "nodeType": "MemberAccess", "referencedDeclaration": 4374, "src": "715:30:13", "typeDescriptions": { "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_uint256_$returns$_t_bool_$bound_to$_t_uint256_$", "typeString": "function (uint256,uint256) view returns (bool)" } }, "id": 3120, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "715:37:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "||", "rightExpression": { "argumentTypes": null, "id": 3128, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "768:30:13", "subExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 3126, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3109, "src": "792:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 3122, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3097, "src": "769:8:13", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 3124, "indexExpression": { "argumentTypes": null, "id": 3123, "name": "to", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3107, "src": "778:2:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "769:12:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 3125, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "safeToAdd", "nodeType": "MemberAccess", "referencedDeclaration": 4360, "src": "769:22:13", "typeDescriptions": { "typeIdentifier": "t_function_delegatecall_view$_t_uint256_$_t_uint256_$returns$_t_bool_$bound_to$_t_uint256_$", "typeString": "function (uint256,uint256) view returns (bool)" } }, "id": 3127, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "769:29:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "714:84:13", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 3132, "nodeType": "IfStatement", "src": "707:117:13", "trueBody": { "expression": { "argumentTypes": null, "hexValue": "66616c7365", "id": 3130, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "819:5:13", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 3113, "id": 3131, "nodeType": "Return", "src": "812:12:13" } }, { "expression": { "argumentTypes": null, "id": 3138, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 3133, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3097, "src": "834:8:13", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 3136, "indexExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 3134, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9180, "src": "843:3:13", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 3135, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "843:10:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "834:20:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "-=", "rightHandSide": { "argumentTypes": null, "id": 3137, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3109, "src": "858:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "834:29:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 3139, "nodeType": "ExpressionStatement", "src": "834:29:13" }, { "expression": { "argumentTypes": null, "id": 3144, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 3140, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3097, "src": "873:8:13", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 3142, "indexExpression": { "argumentTypes": null, "id": 3141, "name": "to", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3107, "src": "882:2:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "873:12:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "argumentTypes": null, "id": 3143, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3109, "src": "889:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "873:21:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 3145, "nodeType": "ExpressionStatement", "src": "873:21:13" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 3147, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9180, "src": "913:3:13", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 3148, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "913:10:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 3149, "name": "to", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3107, "src": "925:2:13", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 3150, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3109, "src": "929:5:13", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 3146, "name": "Transfer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3301, "src": "904:8:13", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", "typeString": "function (address,address,uint256)" } }, "id": 3151, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "904:31:13", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 3152, "nodeType": "ExpressionStatement", "src": "904:31:13" }, { "expression": { "argumentTypes": null, "hexValue": "74727565", "id": 3153, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "952:4:13", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "functionReturnParameters": 3113, "id": 3154, "nodeType": "Return", "src": "945:11:13" } ] }, "documentation": "@dev Transfers sender's tokens to a given address. Returns success\n @param to Address of token receiver\n @param value Number of tokens to transfer\n @return Was transfer successful?", "id": 3156, "implemented": true, "isConstructor": false, "isDeclaredConst": false, "modifiers": [], "name": "transfer", "nodeType": "FunctionDefinition", "parameters": { "id": 3110, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3107, "name": "to", "nodeTy