UNPKG

@gnosis.pm/util-contracts

Version:
948 lines (947 loc) 130 kB
{ "contractName": "EtherToken", "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": "sender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Deposit", "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" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Withdrawal", "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": "decimals", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "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" }, { "inputs": [], "name": "deposit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "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\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"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\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Stefan George - <stefan@gnosis.pm>\",\"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\"}},\"deposit()\":{\"details\":\"Buys tokens with Ether, exchanging them 1:1\"},\"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?\"}},\"withdraw(uint256)\":{\"details\":\"Sells tokens in exchange for Ether, exchanging them 1:1\",\"params\":{\"value\":\"Number of tokens to sell\"}}},\"title\":\"Token contract - Token exchanging Ether 1:1\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/bensniff/Projects/gnosis/util-contracts/contracts/EtherToken.sol\":\"EtherToken\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/bensniff/Projects/gnosis/util-contracts/contracts/EtherToken.sol\":{\"keccak256\":\"0x7063f34c1d71d7d1fbec46999eccd00fe3c825177e4cd15acead052bff94de53\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://edd2db2c31e7fb4a5f1602df430f0b682dd89dcdcccd2bec2858336e4010eac7\",\"dweb:/ipfs/QmZha6FS1VXXPJni5GW3TBNZiN1DH2C43tqQQbDfAPX5zw\"]},\"/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": "0x608060405234801561001057600080fd5b5061075f806100206000396000f3fe60806040526004361061009c5760003560e01c8063313ce56711610064578063313ce5671461020e57806370a082311461023957806395d89b411461026c578063a9059cbb14610281578063d0e30db0146102ba578063dd62ed3e146102c25761009c565b806306fdde03146100a1578063095ea7b31461012b57806318160ddd1461017857806323b872dd1461019f5780632e1a7d4d146101e2575b600080fd5b3480156100ad57600080fd5b506100b66102fd565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013757600080fd5b506101646004803603604081101561014e57600080fd5b506001600160a01b038135169060200135610324565b604080519115158252519081900360200190f35b34801561018457600080fd5b5061018d61038b565b60408051918252519081900360200190f35b3480156101ab57600080fd5b50610164600480360360608110156101c257600080fd5b506001600160a01b03813581169160208101359091169060400135610391565b3480156101ee57600080fd5b5061020c6004803603602081101561020557600080fd5b50356104ac565b005b34801561021a57600080fd5b5061022361054d565b6040805160ff9092168252519081900360200190f35b34801561024557600080fd5b5061018d6004803603602081101561025c57600080fd5b50356001600160a01b0316610552565b34801561027857600080fd5b506100b661056d565b34801561028d57600080fd5b50610164600480360360408110156102a457600080fd5b506001600160a01b03813516906020013561058c565b61020c61064b565b3480156102ce57600080fd5b5061018d600480360360408110156102e557600080fd5b506001600160a01b03813581169160200135166106bd565b6040518060400160405280600b81526020016a22ba3432b9102a37b5b2b760a91b81525081565b3360008181526001602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025490565b6001600160a01b0383166000908152602081905260408120546103b490836106e8565b15806103eb57506001600160a01b03841660009081526001602090815260408083203384529091529020546103e990836106e8565b155b8061041657506001600160a01b03831660009081526020819052604090205461041490836106ed565b155b15610423575060006104a5565b6001600160a01b038085166000818152602081815260408083208054889003905560018252808320338452825280832080548890039055938716808352828252918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b336000908152602081905260409020546104c690826106f4565b336000908152602081905260409020556002546104e390826106f4565b600255604051339082156108fc029083906000818181858888f19350505050158015610513573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b601281565b6001600160a01b031660009081526020819052604090205490565b6040518060400160405280600381526020016208aa8960eb1b81525081565b336000908152602081905260408120546105a690836106e8565b15806105d257506001600160a01b0383166000908152602081905260409020546105d090836106ed565b155b156105df57506000610385565b33600081815260208181526040808320805487900390556001600160a01b03871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b33600090815260208190526040902054610665903461070f565b33600090815260208190526040902055600254610682903461070f565b60025560408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a2565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b111590565b8101101590565b600061070083836106e8565b61070957600080fd5b50900390565b600061071b83836106ed565b61072457600080fd5b50019056fea2646970667358221220f1cf345249e2d55a6e120411c7985b8aace8e72510e5cb7f758284e90f9516e064736f6c63430007050033", "deployedBytecode": "0x60806040526004361061009c5760003560e01c8063313ce56711610064578063313ce5671461020e57806370a082311461023957806395d89b411461026c578063a9059cbb14610281578063d0e30db0146102ba578063dd62ed3e146102c25761009c565b806306fdde03146100a1578063095ea7b31461012b57806318160ddd1461017857806323b872dd1461019f5780632e1a7d4d146101e2575b600080fd5b3480156100ad57600080fd5b506100b66102fd565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013757600080fd5b506101646004803603604081101561014e57600080fd5b506001600160a01b038135169060200135610324565b604080519115158252519081900360200190f35b34801561018457600080fd5b5061018d61038b565b60408051918252519081900360200190f35b3480156101ab57600080fd5b50610164600480360360608110156101c257600080fd5b506001600160a01b03813581169160208101359091169060400135610391565b3480156101ee57600080fd5b5061020c6004803603602081101561020557600080fd5b50356104ac565b005b34801561021a57600080fd5b5061022361054d565b6040805160ff9092168252519081900360200190f35b34801561024557600080fd5b5061018d6004803603602081101561025c57600080fd5b50356001600160a01b0316610552565b34801561027857600080fd5b506100b661056d565b34801561028d57600080fd5b50610164600480360360408110156102a457600080fd5b506001600160a01b03813516906020013561058c565b61020c61064b565b3480156102ce57600080fd5b5061018d600480360360408110156102e557600080fd5b506001600160a01b03813581169160200135166106bd565b6040518060400160405280600b81526020016a22ba3432b9102a37b5b2b760a91b81525081565b3360008181526001602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60025490565b6001600160a01b0383166000908152602081905260408120546103b490836106e8565b15806103eb57506001600160a01b03841660009081526001602090815260408083203384529091529020546103e990836106e8565b155b8061041657506001600160a01b03831660009081526020819052604090205461041490836106ed565b155b15610423575060006104a5565b6001600160a01b038085166000818152602081815260408083208054889003905560018252808320338452825280832080548890039055938716808352828252918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b9392505050565b336000908152602081905260409020546104c690826106f4565b336000908152602081905260409020556002546104e390826106f4565b600255604051339082156108fc029083906000818181858888f19350505050158015610513573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b601281565b6001600160a01b031660009081526020819052604090205490565b6040518060400160405280600381526020016208aa8960eb1b81525081565b336000908152602081905260408120546105a690836106e8565b15806105d257506001600160a01b0383166000908152602081905260409020546105d090836106ed565b155b156105df57506000610385565b33600081815260208181526040808320805487900390556001600160a01b03871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b33600090815260208190526040902054610665903461070f565b33600090815260208190526040902055600254610682903461070f565b60025560408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a2565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b111590565b8101101590565b600061070083836106e8565b61070957600080fd5b50900390565b600061071b83836106ed565b61072457600080fd5b50019056fea2646970667358221220f1cf345249e2d55a6e120411c7985b8aace8e72510e5cb7f758284e90f9516e064736f6c63430007050033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "205:1081:0:-:0;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "205:1081:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;462:43;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2158:205:1;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2158:205:1;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;3042:94;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;1481:460;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;1481:460:1;;;;;;;;;;;;;;;;;:::i;1018:266:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1018:266:0;;:::i;:::-;;554:35;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2854:109:1;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2854:109:1;-1:-1:-1;;;;;2854:109:1;;:::i;511:37:0:-;;;;;;;;;;;;;:::i;827:342:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;827:342:1;;;;;;;;:::i;693:204:0:-;;;:::i;2573:137:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2573:137:1;;;;;;;;;;:::i;462:43:0:-;;;;;;;;;;;;;;-1:-1:-1;;;462:43:0;;;;:::o;2158:205:1:-;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;1018:266:0:-;1129:10;1120:8;:20;;;;;;;;;;;:31;;1145:5;1120:24;:31::i;:::-;1106:10;1097:8;:20;;;;;;;;;;:54;1175:11;;:22;;1191:5;1175:15;:22::i;:::-;1161:11;:36;1207:26;;:10;;:26;;;;;1227:5;;1207:26;;;;1227:5;1207:10;:26;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1248:29:0;;;;;;;;1259:10;;1248:29;;;;;;;;;;1018:266;:::o;554:35::-;587:2;554:35;:::o;2854:109:1:-;-1:-1:-1;;;;;2941:15:1;2918:4;2941:15;;;;;;;;;;;;2854:109::o;511:37:0:-;;;;;;;;;;;;;;-1:-1:-1;;;511:37:0;;;;:::o;827:342:1:-;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;693:204:0:-;769:10;760:8;:20;;;;;;;;;;;:35;;785:9;760:24;:35::i;:::-;746:10;737:8;:20;;;;;;;;;;:58;819:11;;:26;;835:9;819:15;:26::i;:::-;805:11;:40;860:30;;;880:9;860:30;;;;868:10;;860:30;;;;;;;;;;693:204::o;2573:137:1:-;-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;7438:121::-;7490:4;7514:15;7524:1;7527;7514:9;:15::i;:::-;7506:24;;;;;;-1:-1:-1;7547:5:3;;;7438:121::o;7175:::-;7227:4;7251:15;7261:1;7264;7251:9;:15::i;:::-;7243:24;;;;;;-1:-1:-1;7284:5:3;;7175:121::o", "source": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.7.0;\nimport \"./GnosisStandardToken.sol\";\n\n/// @title Token contract - Token exchanging Ether 1:1\n/// @author Stefan George - <stefan@gnosis.pm>\ncontract EtherToken is GnosisStandardToken {\n using GnosisMath for *;\n\n /*\n * Events\n */\n event Deposit(address indexed sender, uint value);\n event Withdrawal(address indexed receiver, uint value);\n\n /*\n * Constants\n */\n string public constant name = \"Ether Token\";\n string public constant symbol = \"ETH\";\n uint8 public constant decimals = 18;\n\n /*\n * Public functions\n */\n /// @dev Buys tokens with Ether, exchanging them 1:1\n function deposit() public payable {\n balances[msg.sender] = balances[msg.sender].add(msg.value);\n totalTokens = totalTokens.add(msg.value);\n emit Deposit(msg.sender, msg.value);\n }\n\n /// @dev Sells tokens in exchange for Ether, exchanging them 1:1\n /// @param value Number of tokens to sell\n function withdraw(uint value) public {\n // Balance covers value\n balances[msg.sender] = balances[msg.sender].sub(value);\n totalTokens = totalTokens.sub(value);\n msg.sender.transfer(value);\n emit Withdrawal(msg.sender, value);\n }\n}\n", "sourcePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/EtherToken.sol", "ast": { "absolutePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/EtherToken.sol", "exportedSymbols": { "EtherToken": [ 104 ], "GnosisMath": [ 1553 ], "GnosisStandardToken": [ 330 ], "Proxied": [ 1616 ], "Proxy": [ 1667 ], "StandardTokenData": [ 123 ], "Token": [ 1903 ] }, "id": 105, "license": "LGPL-3.0-only", "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", "^", "0.7", ".0" ], "nodeType": "PragmaDirective", "src": "42:23:0" }, { "absolutePath": "/Users/bensniff/Projects/gnosis/util-contracts/contracts/GnosisStandardToken.sol", "file": "./GnosisStandardToken.sol", "id": 2, "nodeType": "ImportDirective", "scope": 105, "sourceUnit": 331, "src": "66:35:0", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [ { "baseName": { "id": 4, "name": "GnosisStandardToken", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 330, "src": "228:19:0", "typeDescriptions": { "typeIdentifier": "t_contract$_GnosisStandardToken_$330", "typeString": "contract GnosisStandardToken" } }, "id": 5, "nodeType": "InheritanceSpecifier", "src": "228:19:0" } ], "contractDependencies": [ 123, 330, 1903 ], "contractKind": "contract", "documentation": { "id": 3, "nodeType": "StructuredDocumentation", "src": "103:102:0", "text": "@title Token contract - Token exchanging Ether 1:1\n @author Stefan George - <stefan@gnosis.pm>" }, "fullyImplemented": true, "id": 104, "linearizedBaseContracts": [ 104, 330, 123, 1903 ], "name": "EtherToken", "nodeType": "ContractDefinition", "nodes": [ { "id": 7, "libraryName": { "id": 6, "name": "GnosisMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1553, "src": "260:10:0", "typeDescriptions": { "typeIdentifier": "t_contract$_GnosisMath_$1553", "typeString": "library GnosisMath" } }, "nodeType": "UsingForDirective", "src": "254:23:0" }, { "anonymous": false, "id": 13, "name": "Deposit", "nodeType": "EventDefinition", "parameters": { "id": 12, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 9, "indexed": true, "mutability": "mutable", "name": "sender", "nodeType": "VariableDeclaration", "scope": 13, "src": "327:22:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 8, "name": "address", "nodeType": "ElementaryTypeName", "src": "327:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 11, "indexed": false, "mutability": "mutable", "name": "value", "nodeType": "VariableDeclaration", "scope": 13, "src": "351:10:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 10, "name": "uint", "nodeType": "ElementaryTypeName", "src": "351:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "326:36:0" }, "src": "313:50:0" }, { "anonymous": false, "id": 19, "name": "Withdrawal", "nodeType": "EventDefinition", "parameters": { "id": 18, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 15, "indexed": true, "mutability": "mutable", "name": "receiver", "nodeType": "VariableDeclaration", "scope": 19, "src": "385:24:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 14, "name": "address", "nodeType": "ElementaryTypeName", "src": "385:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 17, "indexed": false, "mutability": "mutable", "name": "value", "nodeType": "VariableDeclaration", "scope": 19, "src": "411:10:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 16, "name": "uint", "nodeType": "ElementaryTypeName", "src": "411:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "384:38:0" }, "src": "368:55:0" }, { "constant": true, "functionSelector": "06fdde03", "id": 22, "mutability": "constant", "name": "name", "nodeType": "VariableDeclaration", "scope": 104, "src": "462:43:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 20, "name": "string", "nodeType": "ElementaryTypeName", "src": "462:6:0", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": { "hexValue": "457468657220546f6b656e", "id": 21, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "492:13:0", "typeDescriptions": { "typeIdentifier": "t_stringliteral_5183d46069fc1711f0a0e1193b8720aa63106225f6d8c86be32c7b593cbf1795", "typeString": "literal_string \"Ether Token\"" }, "value": "Ether Token" }, "visibility": "public" }, { "constant": true, "functionSelector": "95d89b41", "id": 25, "mutability": "constant", "name": "symbol", "nodeType": "VariableDeclaration", "scope": 104, "src": "511:37:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 23, "name": "string", "nodeType": "ElementaryTypeName", "src": "511:6:0", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": { "hexValue": "455448", "id": 24, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "543:5:0", "typeDescriptions": { "typeIdentifier": "t_stringliteral_aaaebeba3810b1e6b70781f14b2d72c1cb89c0b2b320c43bb67ff79f562f5ff4", "typeString": "literal_string \"ETH\"" }, "value": "ETH" }, "visibility": "public" }, { "constant": true, "functionSelector": "313ce567", "id": 28, "mutability": "constant", "name": "decimals", "nodeType": "VariableDeclaration", "scope": 104, "src": "554:35:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 26, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "554:5:0", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": { "hexValue": "3138", "id": 27, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "587:2:0", "typeDescriptions": { "typeIdentifier": "t_rational_18_by_1", "typeString": "int_const 18" }, "value": "18" }, "visibility": "public" }, { "body": { "id": 61, "nodeType": "Block", "src": "727:170:0", "statements": [ { "expression": { "id": 44, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { "id": 32, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 114, "src": "737:8:0", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 35, "indexExpression": { "expression": { "id": 33, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "746:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 34, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "src": "746:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "737:20:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "arguments": [ { "expression": { "id": 41, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "785:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 42, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "value", "nodeType": "MemberAccess", "src": "785:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "baseExpression": { "id": 36, "name": "balances", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 114, "src": "760:8:0", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 39, "indexExpression": { "expression": { "id": 37, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "769:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 38, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "src": "769:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "760:20:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 40, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "add", "nodeType": "MemberAccess", "referencedDeclaration": 1351, "src": "760:24:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 43, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "760:35:0", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "737:58:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 45, "nodeType": "ExpressionStatement", "src": "737:58:0" }, { "expression": { "id": 52, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 46, "name": "totalTokens", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 122, "src": "805:11:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "arguments": [ { "expression": { "id": 49, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "835:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 50, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "value", "nodeType": "MemberAccess", "src": "835:9:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "id": 47, "name": "totalTokens", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 122, "src": "819:11:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 48, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "add", "nodeType": "MemberAccess", "referencedDeclaration": 1351, "src": "819:15:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", "typeString": "function (uint256,uint256) pure returns (uint256)" } }, "id": 51,