@gnosis.pm/util-contracts
Version:
Utility contracts for Gnosis
989 lines • 236 kB
JSON
{
"contractName": "GnosisStandardToken",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.7.5+commit.eb77ed08\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns number of allowed tokens for given address\",\"params\":{\"owner\":\"Address of token owner\",\"spender\":\"Address of token spender\"},\"returns\":{\"_0\":\"Remaining allowance for spender\"}},\"approve(address,uint256)\":{\"details\":\"Sets approved amount of tokens for spender. Returns success\",\"params\":{\"spender\":\"Address of allowed account\",\"value\":\"Number of approved tokens\"},\"returns\":{\"_0\":\"Was approval successful?\"}},\"balanceOf(address)\":{\"details\":\"Returns number of tokens owned by given address\",\"params\":{\"owner\":\"Address of token owner\"},\"returns\":{\"_0\":\"Balance of owner\"}},\"totalSupply()\":{\"details\":\"Returns total supply of tokens\",\"returns\":{\"_0\":\"Total supply\"}},\"transfer(address,uint256)\":{\"details\":\"Transfers sender's tokens to a given address. Returns success\",\"params\":{\"to\":\"Address of token receiver\",\"value\":\"Number of tokens to transfer\"},\"returns\":{\"_0\":\"Was transfer successful?\"}},\"transferFrom(address,address,uint256)\":{\"details\":\"Allows allowed third party to transfer tokens from one address to another. Returns success\",\"params\":{\"from\":\"Address from where tokens are withdrawn\",\"to\":\"Address to where tokens are sent\",\"value\":\"Number of tokens to transfer\"},\"returns\":{\"_0\":\"Was transfer successful?\"}}},\"title\":\"Standard token contract with overflow protection\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/bensniff/Projects/gnosis/util-contracts/contracts/GnosisStandardToken.sol\":\"GnosisStandardToken\"},\"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": "0x608060405234801561001057600080fd5b50610446806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063095ea7b31461006757806318160ddd146100a757806323b872dd146100c157806370a08231146100f7578063a9059cbb1461011d578063dd62ed3e14610149575b600080fd5b6100936004803603604081101561007d57600080fd5b506001600160a01b038135169060200135610177565b604080519115158252519081900360200190f35b6100af6101de565b60408051918252519081900360200190f35b610093600480360360608110156100d757600080fd5b506001600160a01b038135811691602081013590911690604001356101e4565b6100af6004803603602081101561010d57600080fd5b50356001600160a01b03166102ff565b6100936004803603604081101561013357600080fd5b506001600160a01b03813516906020013561031a565b6100af6004803603604081101561015f57600080fd5b506001600160a01b03813581169160200135166103d9565b3360008181526001602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025490565b6001600160a01b0383166000908152602081905260408120546102079083610404565b158061023e57506001600160a01b038416600090815260016020908152604080832033845290915290205461023c9083610404565b155b8061026957506001600160a01b0383166000908152602081905260409020546102679083610409565b155b15610276575060006102f8565b6001600160a01b038085166000818152602081815260408083208054889003905560018252808320338452825280832080548890039055938716808352828252918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b6001600160a01b031660009081526020819052604090205490565b336000908152602081905260408120546103349083610404565b158061036057506001600160a01b03831660009081526020819052604090205461035e9083610409565b155b1561036d575060006101d8565b33600081815260208181526040808320805487900390556001600160a01b03871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b111590565b810110159056fea2646970667358221220fe82ccd7bb9383e96ad7b2a79a50b58e9151d026bf7d5e65b76df14a251d4c3d64736f6c63430007050033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063095ea7b31461006757806318160ddd146100a757806323b872dd146100c157806370a08231146100f7578063a9059cbb1461011d578063dd62ed3e14610149575b600080fd5b6100936004803603604081101561007d57600080fd5b506001600160a01b038135169060200135610177565b604080519115158252519081900360200190f35b6100af6101de565b60408051918252519081900360200190f35b610093600480360360608110156100d757600080fd5b506001600160a01b038135811691602081013590911690604001356101e4565b6100af6004803603602081101561010d57600080fd5b50356001600160a01b03166102ff565b6100936004803603604081101561013357600080fd5b506001600160a01b03813516906020013561031a565b6100af6004803603604081101561015f57600080fd5b506001600160a01b03813581169160200135166103d9565b3360008181526001602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025490565b6001600160a01b0383166000908152602081905260408120546102079083610404565b158061023e57506001600160a01b038416600090815260016020908152604080832033845290915290205461023c9083610404565b155b8061026957506001600160a01b0383166000908152602081905260409020546102679083610409565b155b15610276575060006102f8565b6001600160a01b038085166000818152602081815260408083208054889003905560018252808320338452825280832080548890039055938716808352828252918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b6001600160a01b031660009081526020819052604090205490565b336000908152602081905260408120546103349083610404565b158061036057506001600160a01b03831660009081526020819052604090205461035e9083610409565b155b1561036d575060006101d8565b33600081815260208181526040808320805487900390556001600160a01b03871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b111590565b810110159056fea2646970667358221220fe82ccd7bb9383e96ad7b2a79a50b58e9151d026bf7d5e65b76df14a251d4c3d64736f6c63430007050033",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "485:2653:1:-:0;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "485:2653:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2158:205;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2158:205:1;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;3042:94;;;:::i;:::-;;;;;;;;;;;;;;;;1481:460;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;1481:460:1;;;;;;;;;;;;;;;;;:::i;2854:109::-;;;;;;;;;;;;;;;;-1:-1:-1;2854:109:1;-1:-1:-1;;;;;2854:109:1;;:::i;827:342::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;827:342:1;;;;;;;;:::i;2573:137::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2573:137:1;;;;;;;;;;:::i;2158:205::-;2256:10;2229:4;2245:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;2245:31:1;;;;;;;;;;;:39;;;2299:36;;;;;;;2229:4;;2245:31;;2256:10;;2299:36;;;;;;;;-1:-1:-1;2352:4:1;2158:205;;;;;:::o;3042:94::-;3118:11;;3042:94;:::o;1481:460::-;-1:-1:-1;;;;;1587:14:1;;1566:4;1587:14;;;;;;;;;;;:31;;1612:5;1587:24;:31::i;:::-;1586:32;:104;;;-1:-1:-1;;;;;;1623:16:1;;;;;;:10;:16;;;;;;;;1640:10;1623:28;;;;;;;;:67;;1675:5;1623:38;:67::i;:::-;1622:68;1586:104;:138;;;-1:-1:-1;;;;;;1695:12:1;;:8;:12;;;;;;;;;;;:29;;1718:5;1695:22;:29::i;:::-;1694:30;1586:138;1582:181;;;-1:-1:-1;1747:5:1;1740:12;;1582:181;-1:-1:-1;;;;;1772:14:1;;;:8;:14;;;;;;;;;;;:23;;;;;;;-1:-1:-1;1805:16:1;;;;;1822:10;1805:28;;;;;;;:37;;;;;;;1852:12;;;;;;;;;;;;;:21;;;;;;1888:25;;;;;;;1852:12;;1888:25;;;;;;;;;;;-1:-1:-1;1930:4:1;1481:460;;;;;;:::o;2854:109::-;-1:-1:-1;;;;;2941:15:1;2918:4;2941:15;;;;;;;;;;;;2854:109::o;827:342::-;924:10;894:4;915:20;;;;;;;;;;;:37;;946:5;915:30;:37::i;:::-;914:38;:72;;;-1:-1:-1;;;;;;957:12:1;;:8;:12;;;;;;;;;;;:29;;980:5;957:22;:29::i;:::-;956:30;914:72;910:115;;;-1:-1:-1;1009:5:1;1002:12;;910:115;1044:10;1035:8;:20;;;;;;;;;;;:29;;;;;;;-1:-1:-1;;;;;1074:12:1;;;;;;;;;:21;;;;;;1110:31;;;;;;;1074:12;;1044:10;1110:31;;;;;;;;;;;-1:-1:-1;1158:4:1;827:342;;;;:::o;2573:137::-;-1:-1:-1;;;;;2677:17:1;;;2654:4;2677:17;;;:10;:17;;;;;;;;:26;;;;;;;;;;;;;2573:137::o;6658:94:3:-;-1:-1:-1;6739:6:3;;6658:94::o;6388:98::-;6469:5;;-1:-1:-1;6469:10:3;;6388:98::o",
"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"
}