UNPKG

@gnosis.pm/util-contracts

Version:
1,138 lines (1,137 loc) 221 kB
{ "contractName": "StandardTokenData", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.7.5+commit.eb77ed08\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Deprecated: Use Open Zeppeling one instead\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/bensniff/Projects/gnosis/util-contracts/contracts/GnosisStandardToken.sol\":\"StandardTokenData\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/bensniff/Projects/gnosis/util-contracts/contracts/GnosisStandardToken.sol\":{\"keccak256\":\"0x2c8298a3f7792fca8989ac46cc0247e578871535cd3f0e06998808075ddd7987\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://f27e71ff51c670526a30585c5408821fc274dee9bd1cdd1f314b75dda7961236\",\"dweb:/ipfs/QmPhn8HqMRJQ86xFXHPnLrtpDMffkhYcqDWYoMsw1qsiM1\"]},\"/Users/bensniff/Projects/gnosis/util-contracts/contracts/Math.sol\":{\"keccak256\":\"0xd6411e92ade55d077dc3cab8a7ef2a2a16c87e7f00b709de3d16e206b3a26828\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://5fe697b4c22396abf00835cfd358216370c3cda4f2fbf4ff0f76f87aab0b7460\",\"dweb:/ipfs/Qmb9DWeY4HpCXwLiFTx5qEDnh4cK6Lct6X7mcnY6sTzGm9\"]},\"/Users/bensniff/Projects/gnosis/util-contracts/contracts/Proxy.sol\":{\"keccak256\":\"0x6ff1c0fdd8b1160fcbcef19b406896dee8479f2227413bdc17489a8f4b2bf894\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://0ddd4792b88aa34a1eebdb9eb8474660ac8d9718a247601962e91f9a297e8a24\",\"dweb:/ipfs/QmZxSNpNZmfYEWbTu3mqmxQobGXsWqTunM3j73MquYC77c\"]},\"/Users/bensniff/Projects/gnosis/util-contracts/contracts/Token.sol\":{\"keccak256\":\"0x5328b269119ce2771bc332924519228fdef2d8a5237ffcbc5ce4b9c4680a9b79\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://5a40fd561e73ac545ebb64d358f69d5dfb78bede41159f1500a08202cf2e53a6\",\"dweb:/ipfs/QmVFni1zySZek7uTpqaig48H23dMuhaKULQvcD8HYvDnXX\"]}},\"version\":1}", "bytecode": "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220a23a9b95c2ea3a6497125d858594a4df66e53ca6f8e751b8149677874a7b53df64736f6c63430007050033", "deployedBytecode": "0x6080604052600080fdfea2646970667358221220a23a9b95c2ea3a6497125d858594a4df66e53ca6f8e751b8149677874a7b53df64736f6c63430007050033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "186:183:1:-:0;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "186:183:1:-:0;;;;;", "source": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.7.0;\nimport \"./Token.sol\";\nimport \"./Math.sol\";\nimport \"./Proxy.sol\";\n\n/**\n * Deprecated: Use Open Zeppeling one instead\n */\ncontract StandardTokenData {\n /*\n * Storage\n */\n mapping(address => uint) balances;\n mapping(address => mapping(address => uint)) allowances;\n uint totalTokens;\n}\n\n/**\n * Deprecated: Use Open Zeppeling one instead\n */\n/// @title Standard token contract with overflow protection\ncontract GnosisStandardToken is Token, StandardTokenData {\n using GnosisMath for *;\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) public override returns (bool) {\n if (!balances[msg.sender].safeToSub(value) || !balances[to].safeToAdd(value)) {\n return false;\n }\n\n balances[msg.sender] -= value;\n balances[to] += value;\n emit 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) public override returns (bool) {\n if (!balances[from].safeToSub(value) || !allowances[from][msg.sender].safeToSub(\n value\n ) || !balances[to].safeToAdd(value)) {\n return false;\n }\n balances[from] -= value;\n allowances[from][msg.sender] -= value;\n balances[to] += value;\n emit 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) public override returns (bool) {\n allowances[msg.sender][spender] = value;\n emit 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) public override view returns (uint) {\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) public override view returns (uint) {\n return balances[owner];\n }\n\n /// @dev Returns total supply of tokens\n /// @return Total supply\n function totalSupply() public override view returns (uint) {\n return totalTokens;\n }\n}\n", "sourcePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/GnosisStandardToken.sol", "ast": { "absolutePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/GnosisStandardToken.sol", "exportedSymbols": { "GnosisMath": [ 1553 ], "GnosisStandardToken": [ 330 ], "Proxied": [ 1616 ], "Proxy": [ 1667 ], "StandardTokenData": [ 123 ], "Token": [ 1903 ] }, "id": 331, "license": "LGPL-3.0-only", "nodeType": "SourceUnit", "nodes": [ { "id": 106, "literals": [ "solidity", "^", "0.7", ".0" ], "nodeType": "PragmaDirective", "src": "42:23:1" }, { "absolutePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/Token.sol", "file": "./Token.sol", "id": 107, "nodeType": "ImportDirective", "scope": 331, "sourceUnit": 1904, "src": "66:21:1", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/Math.sol", "file": "./Math.sol", "id": 108, "nodeType": "ImportDirective", "scope": 331, "sourceUnit": 1554, "src": "88:20:1", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/Proxy.sol", "file": "./Proxy.sol", "id": 109, "nodeType": "ImportDirective", "scope": 331, "sourceUnit": 1668, "src": "109:21:1", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": { "id": 110, "nodeType": "StructuredDocumentation", "src": "132:53:1", "text": " Deprecated: Use Open Zeppeling one instead" }, "fullyImplemented": true, "id": 123, "linearizedBaseContracts": [ 123 ], "name": "StandardTokenData", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 114, "mutability": "mutable", "name": "balances", "nodeType": "VariableDeclaration", "scope": 123, "src": "250:33:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 113, "keyType": { "id": 111, "name": "address", "nodeType": "ElementaryTypeName", "src": "258:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "250:24:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 112, "name": "uint", "nodeType": "ElementaryTypeName", "src": "269:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "visibility": "internal" }, { "constant": false, "id": 120, "mutability": "mutable", "name": "allowances", "nodeType": "VariableDeclaration", "scope": 123, "src": "289:55:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", "typeString": "mapping(address => mapping(address => uint256))" }, "typeName": { "id": 119, "keyType": { "id": 115, "name": "address", "nodeType": "ElementaryTypeName", "src": "297:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "289:44:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", "typeString": "mapping(address => mapping(address => uint256))" }, "valueType": { "id": 118, "keyType": { "id": 116, "name": "address", "nodeType": "ElementaryTypeName", "src": "316:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "308:24:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 117, "name": "uint", "nodeType": "ElementaryTypeName", "src": "327:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } } }, "visibility": "internal" }, { "constant": false, "id": 122, "mutability": "mutable", "name": "totalTokens", "nodeType": "VariableDeclaration", "scope": 123, "src": "350:16:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 121, "name": "uint", "nodeType": "ElementaryTypeName", "src": "350:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "scope": 331, "src": "186:183:1" }, { "abstract": false, "baseContracts": [ { "baseName": { "id": 125, "name": "Token", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1903, "src": "517:5:1", "typeDescriptions": { "typeIdentifier": "t_contract$_Token_$1903", "typeString": "contract Token" } }, "id": 126, "nodeType": "InheritanceSpecifier", "src": "517:5:1" }, { "baseName": { "id": 127, "name": "StandardTokenData", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 123, "src": "524:17:1", "typeDescriptions": { "typeIdentifier": "t_contract$_StandardTokenData_$123", "typeString": "contract StandardTokenData" } }, "id": 128, "nodeType": "InheritanceSpecifier", "src": "524:17:1" } ], "contractDependencies": [ 123, 1903 ], "contractKind": "contract", "documentation": { "id": 124, "nodeType": "StructuredDocumentation", "src": "425:60:1", "text": "@title Standard token contract with overflow protection" }, "fullyImplemented": true, "id": 330, "linearizedBaseContracts": [ 330, 123, 1903 ], "name": "GnosisStandardToken", "nodeType": "ContractDefinition", "nodes": [ { "id": 130, "libraryName": { "id": 129, "name": "GnosisMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1553, "src": "554:10:1", "typeDescriptions": { "typeIdentifier": "t_contract$_GnosisMath_$1553", "typeString": "library GnosisMath" } }, "nodeType": "UsingForDirective", "src": "548:23:1" }, { "baseFunctions": [ 1861 ], "body": { "id": 183, "nodeType": "Block", "src": "900:269:1", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 156, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 148, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "914:38:1", "subExpression": { "arguments": [ { "id": 146, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 135, "src": "946:5:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "baseExpression": { "id": 141, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 114, "src": "915:8:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 144, "indexExpression": { "expression": { "id": 142, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "924:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 143, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "src": "924:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "915:20:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 145, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "safeToSub", "nodeType": "MemberAccess", "referencedDeclaration": 1306, "src": "915:30:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_bool_$bound_to$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (bool)" } }, "id": 147, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "915:37:1", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "||", "rightExpression": { "id": 155, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "956:30:1", "subExpression": { "arguments": [ { "id": 153, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 135, "src": "980:5:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "baseExpression": { "id": 149, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 114, "src": "957:8:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 151, "indexExpression": { "id": 150, "name": "to", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 133, "src": "966:2:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "957:12:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 152, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "safeToAdd", "nodeType": "MemberAccess", "referencedDeclaration": 1291, "src": "957:22:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_bool_$bound_to$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (bool)" } }, "id": 154, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "957:29:1", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "914:72:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 160, "nodeType": "IfStatement", "src": "910:115:1", "trueBody": { "id": 159, "nodeType": "Block", "src": "988:37:1", "statements": [ { "expression": { "hexValue": "66616c7365", "id": 157, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1009:5:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 140, "id": 158, "nodeType": "Return", "src": "1002:12:1" } ] } }, { "expression": { "id": 166, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 161, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 114, "src": "1035:8:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 164, "indexExpression": { "expression": { "id": 162, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "1044:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 163, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "src": "1044:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1035:20:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "-=", "rightHandSide": { "id": 165, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 135, "src": "1059:5:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1035:29:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 167, "nodeType": "ExpressionStatement", "src": "1035:29:1" }, { "expression": { "id": 172, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 168, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 114, "src": "1074:8:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 170, "indexExpression": { "id": 169, "name": "to", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 133, "src": "1083:2:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "1074:12:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "id": 171, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 135, "src": "1090:5:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "1074:21:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 173, "nodeType": "ExpressionStatement", "src": "1074:21:1" }, { "eventCall": { "arguments": [ { "expression": { "id": 175, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "1119:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 176, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "src": "1119:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, { "id": 177, "name": "to", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 133, "src": "1131:2:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "id": 178, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 135, "src": "1135:5:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" }, { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 174, "name": "Transfer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1844, "src": "1110:8:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", "typeString": "function (address,address,uint256)" } }, "id": 179, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1110:31:1", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 180, "nodeType": "EmitStatement", "src": "1105:36:1" }, { "expression": { "hexValue": "74727565", "id": 181, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1158:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "functionReturnParameters": 140, "id": 182, "nodeType": "Return", "src": "1151:11:1" } ] }, "documentation": { "id": 131, "nodeType": "StructuredDocumentation", "src": "617:205:1", "text": "@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?" }, "functionSelector": "a9059cbb", "id": 184, "implemented": true, "kind": "function", "modifiers": [], "name": "transfer", "nodeType": "FunctionDefinition", "overrides": { "id": 137, "nodeType": "OverrideSpecifier", "overrides": [], "src": "876:8:1" }, "parameters": { "id": 136, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 133, "mutability": "mutable", "name": "to", "nodeType": "VariableDeclaration", "scope": 184, "src": "845:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 132, "name": "address", "nodeType": "ElementaryTypeName", "src": "845:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 135, "mutability": "mutable", "name": "value", "nodeType": "VariableDeclaration", "scope": 184, "src": "857:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 134, "name": "uint", "nodeType": "ElementaryTypeName", "src": "857:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "844:24:1" }, "returnParameters": { "id": 140, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 139, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 184, "src": "894:4:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 138, "name": "bool", "nodeType": "ElementaryTypeName", "src": "894:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "893:6:1" }, "scope": 330, "src": "827:342:1", "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { "baseFunctions": [ 1872 ], "body": { "id": 256, "nodeType": "Block", "src": "1572:369:1", "statements": [ { "condition": { "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 222, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 214, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 203, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "1586:32:1", "subExpression": { "arguments": [ { "id": 201, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 191, "src": "1612:5:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "baseExpression": { "id": 197, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 114, "src": "1587:8:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 199, "indexExpression": { "id": 198, "name": "from", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 187, "src": "1596:4:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "1587:14:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 200, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "safeToSub", "nodeType": "MemberAccess", "referencedDeclaration": 1306, "src": "1587:24:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_bool_$bound_to$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (bool)" } }, "id": 202, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1587:31:1", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "||", "rightExpression": { "id": 213, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "1622:68:1", "subExpression": { "arguments": [ { "id": 211, "name": "value", "nodeType": "Identifier",