web3 7.0.0b1__py3-none-any.whl → 7.0.0b3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. ens/async_ens.py +6 -8
  2. ens/ens.py +6 -6
  3. ens/utils.py +18 -16
  4. web3/_utils/abi.py +9 -15
  5. web3/_utils/events.py +15 -6
  6. web3/_utils/math.py +12 -14
  7. web3/_utils/method_formatters.py +7 -0
  8. web3/_utils/module_testing/eth_module.py +67 -6
  9. web3/_utils/module_testing/module_testing_utils.py +2 -2
  10. web3/_utils/request.py +1 -1
  11. web3/_utils/rpc_abi.py +1 -0
  12. web3/_utils/transactions.py +4 -0
  13. web3/contract/base_contract.py +1 -1
  14. web3/datastructures.py +7 -7
  15. web3/eth/async_eth.py +20 -2
  16. web3/eth/eth.py +13 -1
  17. web3/exceptions.py +11 -0
  18. web3/main.py +4 -30
  19. web3/manager.py +12 -13
  20. web3/middleware/__init__.py +9 -8
  21. web3/module.py +1 -1
  22. web3/providers/async_base.py +6 -6
  23. web3/providers/base.py +8 -8
  24. web3/providers/eth_tester/main.py +16 -20
  25. web3/providers/ipc.py +1 -1
  26. web3/providers/legacy_websocket.py +1 -1
  27. web3/providers/persistent/persistent.py +2 -2
  28. web3/providers/persistent/request_processor.py +3 -5
  29. web3/tools/benchmark/main.py +2 -2
  30. web3/types.py +4 -0
  31. web3/utils/caching.py +2 -4
  32. {web3-7.0.0b1.dist-info → web3-7.0.0b3.dist-info}/METADATA +3 -9
  33. web3-7.0.0b3.dist-info/RECORD +168 -0
  34. {web3-7.0.0b1.dist-info → web3-7.0.0b3.dist-info}/WHEEL +1 -1
  35. {web3-7.0.0b1.dist-info → web3-7.0.0b3.dist-info}/top_level.txt +0 -1
  36. ethpm/__init__.py +0 -20
  37. ethpm/_utils/__init__.py +0 -0
  38. ethpm/_utils/backend.py +0 -93
  39. ethpm/_utils/cache.py +0 -44
  40. ethpm/_utils/chains.py +0 -119
  41. ethpm/_utils/contract.py +0 -35
  42. ethpm/_utils/deployments.py +0 -145
  43. ethpm/_utils/ipfs.py +0 -116
  44. ethpm/_utils/protobuf/__init__.py +0 -0
  45. ethpm/_utils/protobuf/ipfs_file_pb2.py +0 -33
  46. ethpm/_utils/registry.py +0 -29
  47. ethpm/assets/__init__.py +0 -0
  48. ethpm/assets/ens/v3.json +0 -1
  49. ethpm/assets/escrow/with_bytecode_v3.json +0 -1
  50. ethpm/assets/ipfs_file.proto +0 -32
  51. ethpm/assets/owned/output_v3.json +0 -1
  52. ethpm/assets/owned/with_contract_type_v3.json +0 -1
  53. ethpm/assets/registry/contracts/Authority.sol +0 -156
  54. ethpm/assets/registry/contracts/IndexedOrderedSetLib.sol +0 -106
  55. ethpm/assets/registry/contracts/PackageDB.sol +0 -225
  56. ethpm/assets/registry/contracts/PackageRegistry.sol +0 -361
  57. ethpm/assets/registry/contracts/PackageRegistryInterface.sol +0 -97
  58. ethpm/assets/registry/contracts/ReleaseDB.sol +0 -309
  59. ethpm/assets/registry/contracts/ReleaseValidator.sol +0 -152
  60. ethpm/assets/registry/solc_input.json +0 -1
  61. ethpm/assets/registry/solc_output.json +0 -1
  62. ethpm/assets/registry/v3.json +0 -1
  63. ethpm/assets/safe-math-lib/v3-strict-no-deployments.json +0 -1
  64. ethpm/assets/simple-registry/contracts/Ownable.sol +0 -63
  65. ethpm/assets/simple-registry/contracts/PackageRegistry.sol +0 -373
  66. ethpm/assets/simple-registry/contracts/PackageRegistryInterface.sol +0 -96
  67. ethpm/assets/simple-registry/solc_input.json +0 -33
  68. ethpm/assets/simple-registry/solc_output.json +0 -1
  69. ethpm/assets/simple-registry/v3.json +0 -1
  70. ethpm/assets/standard-token/output_v3.json +0 -1
  71. ethpm/assets/standard-token/with_bytecode_v3.json +0 -1
  72. ethpm/assets/vyper_registry/0.1.0.json +0 -1
  73. ethpm/assets/vyper_registry/registry.vy +0 -216
  74. ethpm/assets/vyper_registry/registry_with_delete.vy +0 -244
  75. ethpm/backends/__init__.py +0 -0
  76. ethpm/backends/base.py +0 -43
  77. ethpm/backends/http.py +0 -108
  78. ethpm/backends/ipfs.py +0 -219
  79. ethpm/backends/registry.py +0 -154
  80. ethpm/constants.py +0 -17
  81. ethpm/contract.py +0 -187
  82. ethpm/dependencies.py +0 -58
  83. ethpm/deployments.py +0 -80
  84. ethpm/ethpm-spec/examples/escrow/1.0.0-pretty.json +0 -146
  85. ethpm/ethpm-spec/examples/escrow/1.0.0.json +0 -1
  86. ethpm/ethpm-spec/examples/escrow/contracts/Escrow.sol +0 -32
  87. ethpm/ethpm-spec/examples/escrow/contracts/SafeSendLib.sol +0 -20
  88. ethpm/ethpm-spec/examples/escrow/v3-pretty.json +0 -171
  89. ethpm/ethpm-spec/examples/escrow/v3.json +0 -1
  90. ethpm/ethpm-spec/examples/owned/1.0.0-pretty.json +0 -21
  91. ethpm/ethpm-spec/examples/owned/1.0.0.json +0 -1
  92. ethpm/ethpm-spec/examples/owned/contracts/Owned.sol +0 -12
  93. ethpm/ethpm-spec/examples/owned/v3-pretty.json +0 -27
  94. ethpm/ethpm-spec/examples/owned/v3.json +0 -1
  95. ethpm/ethpm-spec/examples/piper-coin/1.0.0-pretty.json +0 -31
  96. ethpm/ethpm-spec/examples/piper-coin/1.0.0.json +0 -1
  97. ethpm/ethpm-spec/examples/piper-coin/v3-pretty.json +0 -21
  98. ethpm/ethpm-spec/examples/piper-coin/v3.json +0 -1
  99. ethpm/ethpm-spec/examples/safe-math-lib/1.0.0-pretty.json +0 -85
  100. ethpm/ethpm-spec/examples/safe-math-lib/1.0.0.json +0 -1
  101. ethpm/ethpm-spec/examples/safe-math-lib/contracts/SafeMathLib.sol +0 -24
  102. ethpm/ethpm-spec/examples/safe-math-lib/v3-pretty.json +0 -117
  103. ethpm/ethpm-spec/examples/safe-math-lib/v3.json +0 -1
  104. ethpm/ethpm-spec/examples/standard-token/1.0.0-pretty.json +0 -55
  105. ethpm/ethpm-spec/examples/standard-token/1.0.0.json +0 -1
  106. ethpm/ethpm-spec/examples/standard-token/contracts/AbstractToken.sol +0 -20
  107. ethpm/ethpm-spec/examples/standard-token/contracts/StandardToken.sol +0 -84
  108. ethpm/ethpm-spec/examples/standard-token/v3-pretty.json +0 -460
  109. ethpm/ethpm-spec/examples/standard-token/v3.json +0 -1
  110. ethpm/ethpm-spec/examples/transferable/1.0.0-pretty.json +0 -21
  111. ethpm/ethpm-spec/examples/transferable/1.0.0.json +0 -1
  112. ethpm/ethpm-spec/examples/transferable/contracts/Transferable.sol +0 -14
  113. ethpm/ethpm-spec/examples/transferable/v3-pretty.json +0 -27
  114. ethpm/ethpm-spec/examples/transferable/v3.json +0 -1
  115. ethpm/ethpm-spec/examples/wallet/1.0.0-pretty.json +0 -120
  116. ethpm/ethpm-spec/examples/wallet/1.0.0.json +0 -1
  117. ethpm/ethpm-spec/examples/wallet/contracts/Wallet.sol +0 -41
  118. ethpm/ethpm-spec/examples/wallet/v3-pretty.json +0 -181
  119. ethpm/ethpm-spec/examples/wallet/v3.json +0 -1
  120. ethpm/ethpm-spec/examples/wallet-with-send/1.0.0-pretty.json +0 -135
  121. ethpm/ethpm-spec/examples/wallet-with-send/1.0.0.json +0 -1
  122. ethpm/ethpm-spec/examples/wallet-with-send/contracts/WalletWithSend.sol +0 -18
  123. ethpm/ethpm-spec/examples/wallet-with-send/v3-pretty.json +0 -207
  124. ethpm/ethpm-spec/examples/wallet-with-send/v3.json +0 -1
  125. ethpm/ethpm-spec/spec/package.spec.json +0 -379
  126. ethpm/ethpm-spec/spec/v3.spec.json +0 -483
  127. ethpm/exceptions.py +0 -68
  128. ethpm/package.py +0 -438
  129. ethpm/tools/__init__.py +0 -4
  130. ethpm/tools/builder.py +0 -930
  131. ethpm/tools/checker.py +0 -312
  132. ethpm/tools/get_manifest.py +0 -19
  133. ethpm/uri.py +0 -141
  134. ethpm/validation/__init__.py +0 -0
  135. ethpm/validation/manifest.py +0 -146
  136. ethpm/validation/misc.py +0 -39
  137. ethpm/validation/package.py +0 -80
  138. ethpm/validation/uri.py +0 -163
  139. web3/pm.py +0 -602
  140. web3/tools/__init__.py +0 -4
  141. web3/tools/pytest_ethereum/__init__.py +0 -0
  142. web3/tools/pytest_ethereum/_utils.py +0 -145
  143. web3/tools/pytest_ethereum/deployer.py +0 -48
  144. web3/tools/pytest_ethereum/exceptions.py +0 -22
  145. web3/tools/pytest_ethereum/linker.py +0 -128
  146. web3/tools/pytest_ethereum/plugins.py +0 -33
  147. web3-7.0.0b1.dist-info/RECORD +0 -280
  148. web3-7.0.0b1.dist-info/entry_points.txt +0 -2
  149. {web3-7.0.0b1.dist-info → web3-7.0.0b3.dist-info}/LICENSE +0 -0
@@ -1,21 +0,0 @@
1
- {
2
- "manifest": "ethpm/3",
3
- "version": "1.0.0",
4
- "name": "piper-coin",
5
- "deployments": {
6
- "blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/8edfc8c04a400d0269bb4f89b6620c28321bf3ef205452cc0a3dd9a3d4d90640": {
7
- "PiperCoin": {
8
- "contractType": "standard-token:StandardToken",
9
- "address": "0x77C7C1e9F6cC426179F9bb95f3f9F6d8D37315a5",
10
- "transaction": "0x76221eca6879628d1d4549f44b6fc0aa923743ce4f0ddcc7721dbf9151e554d7",
11
- "block": "0x8a78fa5f540ad205c2259dbf134c09a18e83fb50721b1c6a74be6421663c239e",
12
- "runtimeBytecode": {
13
- "bytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063095ea7b31461006757806318160ddd146100cd57806323b872dd146100eb57806370a0823114610171578063a9059cbb146101c9578063dd62ed3e1461022f575b600080fd5b6100b36004803603604081101561007d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506102a7565b604051808215151515815260200191505060405180910390f35b6100d5610399565b6040518082815260200191505060405180910390f35b6101576004803603606081101561010157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061039f565b604051808215151515815260200191505060405180910390f35b6101b36004803603602081101561018757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610618565b6040518082815260200191505060405180910390f35b610215600480360360408110156101df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610660565b604051808215151515815260200191505060405180910390f35b6102916004803603604081101561024557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107c6565b6040518082815260200191505060405180910390f35b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b6000816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015801561046b575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156104775750600082115b1561060c57816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610611565b600090505b9392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156106b05750600082115b156107bb57816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506107c0565b600090505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509291505056fea26469706673582212205b1030a46711be4af481d287498c2f627fc76b95f9dac96fd56a41db27633a3d64736f6c634300060a0033"
14
- }
15
- }
16
- }
17
- },
18
- "buildDependencies": {
19
- "standard-token": "ipfs://QmQNffBrmbB3TuBCtYfYsJWJVLssatWXa3H6CkGeyNUySA"
20
- }
21
- }
@@ -1 +0,0 @@
1
- {"buildDependencies":{"standard-token":"ipfs://QmQNffBrmbB3TuBCtYfYsJWJVLssatWXa3H6CkGeyNUySA"},"deployments":{"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/8edfc8c04a400d0269bb4f89b6620c28321bf3ef205452cc0a3dd9a3d4d90640":{"PiperCoin":{"address":"0x77C7C1e9F6cC426179F9bb95f3f9F6d8D37315a5","block":"0x8a78fa5f540ad205c2259dbf134c09a18e83fb50721b1c6a74be6421663c239e","contractType":"standard-token:StandardToken","runtimeBytecode":{"bytecode":"0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063095ea7b31461006757806318160ddd146100cd57806323b872dd146100eb57806370a0823114610171578063a9059cbb146101c9578063dd62ed3e1461022f575b600080fd5b6100b36004803603604081101561007d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506102a7565b604051808215151515815260200191505060405180910390f35b6100d5610399565b6040518082815260200191505060405180910390f35b6101576004803603606081101561010157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061039f565b604051808215151515815260200191505060405180910390f35b6101b36004803603602081101561018757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610618565b6040518082815260200191505060405180910390f35b610215600480360360408110156101df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610660565b604051808215151515815260200191505060405180910390f35b6102916004803603604081101561024557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107c6565b6040518082815260200191505060405180910390f35b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b6000816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015801561046b575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156104775750600082115b1561060c57816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610611565b600090505b9392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156106b05750600082115b156107bb57816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506107c0565b600090505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509291505056fea26469706673582212205b1030a46711be4af481d287498c2f627fc76b95f9dac96fd56a41db27633a3d64736f6c634300060a0033"},"transaction":"0x76221eca6879628d1d4549f44b6fc0aa923743ce4f0ddcc7721dbf9151e554d7"}}},"manifest":"ethpm/3","name":"piper-coin","version":"1.0.0"}
@@ -1,85 +0,0 @@
1
- {
2
- "manifest_version": "2",
3
- "version": "1.0.0",
4
- "package_name": "safe-math-lib",
5
- "sources": {
6
- "./contracts/SafeMathLib.sol": "ipfs://QmNQeuwMDGJ7UiLaRjwzAoekcaKLp9TjiqeFdovj3syN1n"
7
- },
8
- "contract_types": {
9
- "SafeMathLib": {
10
- "deployment_bytecode": {
11
- "bytecode": "0x610145610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f3007300000000000000000000000000000000000000003014608060405260043610610063576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a293d1e814610068578063e6cb9013146100a6575b600080fd5b61009060048036038101908080359060200190929190803590602001909291905050506100e4565b6040518082815260200191505060405180910390f35b6100ce60048036038101908080359060200190929190803590602001909291905050506100fd565b6040518082815260200191505060405180910390f35b60008282111515156100f257fe5b818303905092915050565b6000818301905082811015151561011057fe5b809050929150505600a165627a7a72305820ac19b530c9fab4716b26d7706467f9a30d5542de1ac898dc56c67ff65ebe9bd50029"
12
- },
13
- "runtime_bytecode": {
14
- "bytecode": "0x73a66a05d6ab5c1c955f4d2c3fcc166ae6300b452b3014608060405260043610610063576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a293d1e814610068578063e6cb9013146100a6575b600080fd5b61009060048036038101908080359060200190929190803590602001909291905050506100e4565b6040518082815260200191505060405180910390f35b6100ce60048036038101908080359060200190929190803590602001909291905050506100fd565b6040518082815260200191505060405180910390f35b60008282111515156100f257fe5b818303905092915050565b6000818301905082811015151561011057fe5b809050929150505600a165627a7a72305820ac19b530c9fab4716b26d7706467f9a30d5542de1ac898dc56c67ff65ebe9bd50029"
15
- },
16
- "abi": [
17
- {
18
- "constant": true,
19
- "inputs": [
20
- {"name": "a","type": "uint256"},
21
- {"name": "b","type": "uint256"}
22
- ],
23
- "name": "safeSub",
24
- "outputs": [
25
- {"name": "","type": "uint256"}
26
- ],
27
- "payable": false,
28
- "stateMutability": "pure",
29
- "type": "function"
30
- },
31
- {
32
- "constant": true,
33
- "inputs": [
34
- {"name": "a","type": "uint256"},
35
- {"name": "b","type": "uint256"}
36
- ],
37
- "name": "safeAdd",
38
- "outputs": [
39
- {"name": "c","type": "uint256"}
40
- ],
41
- "payable": false,
42
- "stateMutability": "pure",
43
- "type": "function"
44
- }
45
- ],
46
- "compiler": {
47
- "name": "solc",
48
- "version": "0.4.24+commit.e67f0147.Emscripten.clang",
49
- "settings": {
50
- "optimize": false
51
- }
52
- },
53
- "natspec": {
54
- "author": "Piper Merriam <pipermerriam@gmail.com>",
55
- "methods": {
56
- "safeAdd(uint256,uint256)": {
57
- "details": "Adds a and b, throwing an error if the operation would cause an overflow.",
58
- "params": {
59
- "a": "The first number to add",
60
- "b": "The second number to add"
61
- }
62
- },
63
- "safeSub(uint256,uint256)": {
64
- "details": "Subtracts b from a, throwing an error if the operation would cause an underflow.",
65
- "params": {
66
- "a": "The number to be subtracted from",
67
- "b": "The amount that should be subtracted"
68
- }
69
- }
70
- },
71
- "title": "Safe Math Library"
72
- }
73
- }
74
- },
75
- "deployments": {
76
- "blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/cf1fe2fc56f116e30ee6f6de77c1bfe9304231414fa8c7e0c98075e93f618368": {
77
- "SafeMathLib": {
78
- "contract_type": "SafeMathLib",
79
- "address": "0xa66A05D6AB5c1c955F4D2c3FCC166AE6300b452B",
80
- "transaction": "0x7ee011d3e2e5aef3be0ab5853666aa8e0427bcb19b3da6411c90768090bc5517",
81
- "block": "0xe11241bf8d2862026db775ee3e9c85cc2ae99ea8938b795d77d9f2f277271b2a"
82
- }
83
- }
84
- }
85
- }
@@ -1 +0,0 @@
1
- {"contract_types":{"SafeMathLib":{"abi":[{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"safeSub","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"}],"name":"safeAdd","outputs":[{"name":"c","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"}],"compiler":{"name":"solc","settings":{"optimize":false},"version":"0.4.24+commit.e67f0147.Emscripten.clang"},"deployment_bytecode":{"bytecode":"0x610145610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f3007300000000000000000000000000000000000000003014608060405260043610610063576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a293d1e814610068578063e6cb9013146100a6575b600080fd5b61009060048036038101908080359060200190929190803590602001909291905050506100e4565b6040518082815260200191505060405180910390f35b6100ce60048036038101908080359060200190929190803590602001909291905050506100fd565b6040518082815260200191505060405180910390f35b60008282111515156100f257fe5b818303905092915050565b6000818301905082811015151561011057fe5b809050929150505600a165627a7a72305820ac19b530c9fab4716b26d7706467f9a30d5542de1ac898dc56c67ff65ebe9bd50029"},"natspec":{"author":"Piper Merriam <pipermerriam@gmail.com>","methods":{"safeAdd(uint256,uint256)":{"details":"Adds a and b, throwing an error if the operation would cause an overflow.","params":{"a":"The first number to add","b":"The second number to add"}},"safeSub(uint256,uint256)":{"details":"Subtracts b from a, throwing an error if the operation would cause an underflow.","params":{"a":"The number to be subtracted from","b":"The amount that should be subtracted"}}},"title":"Safe Math Library"},"runtime_bytecode":{"bytecode":"0x73a66a05d6ab5c1c955f4d2c3fcc166ae6300b452b3014608060405260043610610063576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a293d1e814610068578063e6cb9013146100a6575b600080fd5b61009060048036038101908080359060200190929190803590602001909291905050506100e4565b6040518082815260200191505060405180910390f35b6100ce60048036038101908080359060200190929190803590602001909291905050506100fd565b6040518082815260200191505060405180910390f35b60008282111515156100f257fe5b818303905092915050565b6000818301905082811015151561011057fe5b809050929150505600a165627a7a72305820ac19b530c9fab4716b26d7706467f9a30d5542de1ac898dc56c67ff65ebe9bd50029"}}},"deployments":{"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/cf1fe2fc56f116e30ee6f6de77c1bfe9304231414fa8c7e0c98075e93f618368":{"SafeMathLib":{"address":"0xa66A05D6AB5c1c955F4D2c3FCC166AE6300b452B","block":"0xe11241bf8d2862026db775ee3e9c85cc2ae99ea8938b795d77d9f2f277271b2a","contract_type":"SafeMathLib","transaction":"0x7ee011d3e2e5aef3be0ab5853666aa8e0427bcb19b3da6411c90768090bc5517"}}},"manifest_version":"2","package_name":"safe-math-lib","sources":{"./contracts/SafeMathLib.sol":"ipfs://QmNQeuwMDGJ7UiLaRjwzAoekcaKLp9TjiqeFdovj3syN1n"},"version":"1.0.0"}
@@ -1,24 +0,0 @@
1
- // SPDX-License-Identifier: MIT
2
- pragma solidity ^0.6.8;
3
-
4
-
5
- /// @title Safe Math Library
6
- /// @author Piper Merriam <pipermerriam@gmail.com>
7
- library SafeMathLib {
8
- /// @dev Adds a and b, throwing an error if the operation would cause an overflow.
9
- /// @param a The first number to add
10
- /// @param b The second number to add
11
- function safeAdd(uint256 a, uint256 b) public pure returns (uint256 c) {
12
- c = a + b;
13
- assert(c >= a);
14
- return c;
15
- }
16
-
17
- /// @dev Subtracts b from a, throwing an error if the operation would cause an underflow.
18
- /// @param a The number to be subtracted from
19
- /// @param b The amount that should be subtracted
20
- function safeSub(uint256 a, uint256 b) public pure returns (uint256) {
21
- assert(b <= a);
22
- return a - b;
23
- }
24
- }
@@ -1,117 +0,0 @@
1
- {
2
- "compilers": [
3
- {
4
- "contractTypes": [
5
- "SafeMathLib"
6
- ],
7
- "name": "solc",
8
- "settings": {
9
- "optimize": false
10
- },
11
- "version": "0.6.8+commit.0bbfe453"
12
- }
13
- ],
14
- "contractTypes": {
15
- "SafeMathLib": {
16
- "abi": [
17
- {
18
- "inputs": [
19
- {
20
- "internalType": "uint256",
21
- "name": "a",
22
- "type": "uint256"
23
- },
24
- {
25
- "internalType": "uint256",
26
- "name": "b",
27
- "type": "uint256"
28
- }
29
- ],
30
- "name": "safeAdd",
31
- "outputs": [
32
- {
33
- "internalType": "uint256",
34
- "name": "c",
35
- "type": "uint256"
36
- }
37
- ],
38
- "stateMutability": "pure",
39
- "type": "function"
40
- },
41
- {
42
- "inputs": [
43
- {
44
- "internalType": "uint256",
45
- "name": "a",
46
- "type": "uint256"
47
- },
48
- {
49
- "internalType": "uint256",
50
- "name": "b",
51
- "type": "uint256"
52
- }
53
- ],
54
- "name": "safeSub",
55
- "outputs": [
56
- {
57
- "internalType": "uint256",
58
- "name": "",
59
- "type": "uint256"
60
- }
61
- ],
62
- "stateMutability": "pure",
63
- "type": "function"
64
- }
65
- ],
66
- "deploymentBytecode": {
67
- "bytecode": "0x610144610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c8063a293d1e814610045578063e6cb901314610091575b600080fd5b61007b6004803603604081101561005b57600080fd5b8101908080359060200190929190803590602001909291905050506100dd565b6040518082815260200191505060405180910390f35b6100c7600480360360408110156100a757600080fd5b8101908080359060200190929190803590602001909291905050506100f4565b6040518082815260200191505060405180910390f35b6000828211156100e957fe5b818303905092915050565b600081830190508281101561010557fe5b8090509291505056fea26469706673582212201732500f2fac649ab2ce116d2145af69b3e8c6ef2d172ec377db7ed0b7a4801964736f6c63430006080033"
68
- },
69
- "devdoc": {
70
- "author": "Piper Merriam <pipermerriam@gmail.com>",
71
- "methods": {
72
- "safeAdd(uint256,uint256)": {
73
- "details": "Adds a and b, throwing an error if the operation would cause an overflow.",
74
- "params": {
75
- "a": "The first number to add",
76
- "b": "The second number to add"
77
- }
78
- },
79
- "safeSub(uint256,uint256)": {
80
- "details": "Subtracts b from a, throwing an error if the operation would cause an underflow.",
81
- "params": {
82
- "a": "The number to be subtracted from",
83
- "b": "The amount that should be subtracted"
84
- }
85
- }
86
- },
87
- "title": "Safe Math Library"
88
- },
89
- "runtimeBytecode": {
90
- "bytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c8063a293d1e814610045578063e6cb901314610091575b600080fd5b61007b6004803603604081101561005b57600080fd5b8101908080359060200190929190803590602001909291905050506100dd565b6040518082815260200191505060405180910390f35b6100c7600480360360408110156100a757600080fd5b8101908080359060200190929190803590602001909291905050506100f4565b6040518082815260200191505060405180910390f35b6000828211156100e957fe5b818303905092915050565b600081830190508281101561010557fe5b8090509291505056fea26469706673582212201732500f2fac649ab2ce116d2145af69b3e8c6ef2d172ec377db7ed0b7a4801964736f6c63430006080033"
91
- },
92
- "sourceId": "SafeMathLib.sol"
93
- }
94
- },
95
- "deployments": {
96
- "blockchain://d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3/block/c4b7297b918ce3a93186eccff5195e77ef0c47b4e8cb8b66439aa25271f5170c": {
97
- "SafeMathLib": {
98
- "address": "0x6B2534269C5Ee98C37729d07Dc92C4b97EBB6235",
99
- "block": "0x64fa9306a5c7aa3b8a71c29cd09fb897c3fb7325a3dbc75c4627dd8f08b759a6",
100
- "contractType": "SafeMathLib",
101
- "transaction": "0xb0ac2dbb86a29d70c8f3996834672e3af8cae7fc37718e49ac3adfd99eb23d31"
102
- }
103
- }
104
- },
105
- "manifest": "ethpm/3",
106
- "name": "safe-math-lib",
107
- "sources": {
108
- "./SafeMathLib.sol": {
109
- "installPath": "./SafeMathLib.sol",
110
- "type": "solidity",
111
- "urls": [
112
- "ipfs://QmeyYahfHxPSoytQ2rPH2JUURin24sPvaMo6o6tKghwkAg"
113
- ]
114
- }
115
- },
116
- "version": "1.0.0"
117
- }
@@ -1 +0,0 @@
1
- {"compilers":[{"contractTypes":["SafeMathLib"],"name":"solc","settings":{"optimize":false},"version":"0.6.8+commit.0bbfe453"}],"contractTypes":{"SafeMathLib":{"abi":[{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"safeAdd","outputs":[{"internalType":"uint256","name":"c","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"name":"safeSub","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"}],"deploymentBytecode":{"bytecode":"0x610144610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c8063a293d1e814610045578063e6cb901314610091575b600080fd5b61007b6004803603604081101561005b57600080fd5b8101908080359060200190929190803590602001909291905050506100dd565b6040518082815260200191505060405180910390f35b6100c7600480360360408110156100a757600080fd5b8101908080359060200190929190803590602001909291905050506100f4565b6040518082815260200191505060405180910390f35b6000828211156100e957fe5b818303905092915050565b600081830190508281101561010557fe5b8090509291505056fea26469706673582212201732500f2fac649ab2ce116d2145af69b3e8c6ef2d172ec377db7ed0b7a4801964736f6c63430006080033"},"devdoc":{"author":"Piper Merriam <pipermerriam@gmail.com>","methods":{"safeAdd(uint256,uint256)":{"details":"Adds a and b, throwing an error if the operation would cause an overflow.","params":{"a":"The first number to add","b":"The second number to add"}},"safeSub(uint256,uint256)":{"details":"Subtracts b from a, throwing an error if the operation would cause an underflow.","params":{"a":"The number to be subtracted from","b":"The amount that should be subtracted"}}},"title":"Safe Math Library"},"runtimeBytecode":{"bytecode":"0x73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c8063a293d1e814610045578063e6cb901314610091575b600080fd5b61007b6004803603604081101561005b57600080fd5b8101908080359060200190929190803590602001909291905050506100dd565b6040518082815260200191505060405180910390f35b6100c7600480360360408110156100a757600080fd5b8101908080359060200190929190803590602001909291905050506100f4565b6040518082815260200191505060405180910390f35b6000828211156100e957fe5b818303905092915050565b600081830190508281101561010557fe5b8090509291505056fea26469706673582212201732500f2fac649ab2ce116d2145af69b3e8c6ef2d172ec377db7ed0b7a4801964736f6c63430006080033"},"sourceId":"SafeMathLib.sol"}},"deployments":{"blockchain://d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3/block/c4b7297b918ce3a93186eccff5195e77ef0c47b4e8cb8b66439aa25271f5170c":{"SafeMathLib":{"address":"0x6B2534269C5Ee98C37729d07Dc92C4b97EBB6235","block":"0x64fa9306a5c7aa3b8a71c29cd09fb897c3fb7325a3dbc75c4627dd8f08b759a6","contractType":"SafeMathLib","transaction":"0xb0ac2dbb86a29d70c8f3996834672e3af8cae7fc37718e49ac3adfd99eb23d31"}}},"manifest":"ethpm/3","name":"safe-math-lib","sources":{"./SafeMathLib.sol":{"installPath":"./SafeMathLib.sol","type":"solidity","urls":["ipfs://QmeyYahfHxPSoytQ2rPH2JUURin24sPvaMo6o6tKghwkAg"]}},"version":"1.0.0"}
@@ -1,55 +0,0 @@
1
- {
2
- "manifest_version":"2",
3
- "version":"1.0.0",
4
- "package_name":"standard-token",
5
- "sources":{
6
- "./contracts/AbstractToken.sol":"ipfs://Qma8tiYLSYGSjbLVn4RbTHBt2LBUXe2ADb37NVsG5UgXea",
7
- "./contracts/StandardToken.sol":"ipfs://QmRJHLmPVct2rbBpdGjP3xkXbF7romQigtmcs8TRfV1yC7"
8
- },
9
- "contract_types":{
10
- "StandardToken":{
11
- "abi": [{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_totalSupply","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}],
12
- "natspec":{
13
- "author":"Stefan George - <stefan.george@consensys.net>",
14
- "methods":{
15
- "allowance(address,address)":{
16
- "details":"Returns number of allowed tokens for given address.",
17
- "params":{
18
- "_owner":"Address of token owner.",
19
- "_spender":"Address of token spender."
20
- }
21
- },
22
- "approve(address,uint256)":{
23
- "details":"Sets approved amount of tokens for spender. Returns success.",
24
- "params":{
25
- "_spender":"Address of allowed account.",
26
- "_value":"Number of approved tokens."
27
- }
28
- },
29
- "balanceOf(address)":{
30
- "details":"Returns number of tokens owned by given address.",
31
- "params":{
32
- "_owner":"Address of token owner."
33
- }
34
- },
35
- "transfer(address,uint256)":{
36
- "details":"Transfers sender's tokens to a given address. Returns success.",
37
- "params":{
38
- "_to":"Address of token receiver.",
39
- "_value":"Number of tokens to transfer."
40
- }
41
- },
42
- "transferFrom(address,address,uint256)":{
43
- "details":"Allows allowed third party to transfer tokens from one address to another. Returns success.",
44
- "params":{
45
- "_from":"Address from where tokens are withdrawn.",
46
- "_to":"Address to where tokens are sent.",
47
- "_value":"Number of tokens to transfer."
48
- }
49
- }
50
- },
51
- "title":"Standard token contract"
52
- }
53
- }
54
- }
55
- }
@@ -1 +0,0 @@
1
- {"contract_types":{"StandardToken":{"abi":[{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_totalSupply","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}],"natspec":{"author":"Stefan George - <stefan.george@consensys.net>","methods":{"allowance(address,address)":{"details":"Returns number of allowed tokens for given address.","params":{"_owner":"Address of token owner.","_spender":"Address of token 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."}},"balanceOf(address)":{"details":"Returns number of tokens owned by given address.","params":{"_owner":"Address of token owner."}},"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."}},"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."}}},"title":"Standard token contract"}}},"manifest_version":"2","package_name":"standard-token","sources":{"./contracts/AbstractToken.sol":"ipfs://Qma8tiYLSYGSjbLVn4RbTHBt2LBUXe2ADb37NVsG5UgXea","./contracts/StandardToken.sol":"ipfs://QmRJHLmPVct2rbBpdGjP3xkXbF7romQigtmcs8TRfV1yC7"},"version":"1.0.0"}
@@ -1,20 +0,0 @@
1
- // SPDX-License-Identifier: MIT
2
- pragma solidity ^0.6.8;
3
-
4
-
5
- /// Implements ERC 20 Token standard: https://github.com/ethereum/EIPs/issues/20
6
-
7
- /// @title Abstract token contract - Functions to be implemented by token contracts.
8
- /// @author Stefan George - <stefan.george@consensys.net>
9
- abstract contract Token {
10
- // This is not an abstract function, because solc won't recognize generated getter functions for public variables as functions
11
- function totalSupply() external view virtual returns (uint256 supply) {}
12
- function balanceOf(address owner) public view virtual returns (uint256 balance);
13
- function transfer(address to, uint256 value) public virtual returns (bool success);
14
- function transferFrom(address from, address to, uint256 value) public virtual returns (bool success);
15
- function approve(address spender, uint256 value) public virtual returns (bool success);
16
- function allowance(address owner, address spender) public view virtual returns (uint256 remaining);
17
-
18
- event Transfer(address indexed from, address indexed to, uint256 value);
19
- event Approval(address indexed owner, address indexed spender, uint256 value);
20
- }
@@ -1,84 +0,0 @@
1
- // SPDX-License-Identifier: MIT
2
- pragma solidity ^0.6.8;
3
-
4
-
5
- import "./AbstractToken.sol";
6
-
7
-
8
- /// @title Standard token contract
9
- /// @author Stefan George - <stefan.george@consensys.net>
10
- contract StandardToken is Token {
11
- /*
12
- * Data structures
13
- */
14
- mapping (address => uint256) balances;
15
- mapping (address => mapping (address => uint256)) allowed;
16
- uint256 override public totalSupply;
17
-
18
- constructor (uint _totalSupply) public {
19
- totalSupply = _totalSupply;
20
- balances[msg.sender] = _totalSupply;
21
- emit Transfer(address(0), msg.sender, _totalSupply);
22
- }
23
-
24
- /*
25
- * Read and write storage functions
26
- */
27
- /// @dev Transfers sender's tokens to a given address. Returns success.
28
- /// @param _to Address of token receiver.
29
- /// @param _value Number of tokens to transfer.
30
- function transfer(address _to, uint256 _value) public override returns (bool success) {
31
- if (balances[msg.sender] >= _value && _value > 0) {
32
- balances[msg.sender] -= _value;
33
- balances[_to] += _value;
34
- emit Transfer(msg.sender, _to, _value);
35
- return true;
36
- }
37
- else {
38
- return false;
39
- }
40
- }
41
-
42
- /// @dev Allows allowed third party to transfer tokens from one address to another. Returns success.
43
- /// @param _from Address from where tokens are withdrawn.
44
- /// @param _to Address to where tokens are sent.
45
- /// @param _value Number of tokens to transfer.
46
- function transferFrom(address _from, address _to, uint256 _value) public override returns (bool success) {
47
- if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
48
- balances[_to] += _value;
49
- balances[_from] -= _value;
50
- allowed[_from][msg.sender] -= _value;
51
- emit Transfer(_from, _to, _value);
52
- return true;
53
- }
54
- else {
55
- return false;
56
- }
57
- }
58
-
59
- /// @dev Returns number of tokens owned by given address.
60
- /// @param _owner Address of token owner.
61
- function balanceOf(address _owner) public override view returns (uint256 balance) {
62
- return balances[_owner];
63
- }
64
-
65
- /// @dev Sets approved amount of tokens for spender. Returns success.
66
- /// @param _spender Address of allowed account.
67
- /// @param _value Number of approved tokens.
68
- function approve(address _spender, uint256 _value) public override returns (bool success) {
69
- allowed[msg.sender][_spender] = _value;
70
- emit Approval(msg.sender, _spender, _value);
71
- return true;
72
- }
73
-
74
- /*
75
- * Read storage functions
76
- */
77
- /// @dev Returns number of allowed tokens for given address.
78
- /// @param _owner Address of token owner.
79
- /// @param _spender Address of token spender.
80
- function allowance(address _owner, address _spender) public override view returns (uint256 remaining) {
81
- return allowed[_owner][_spender];
82
- }
83
-
84
- }