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,120 +0,0 @@
1
- {
2
- "manifest_version": "2",
3
- "version": "1.0.0",
4
- "package_name": "wallet",
5
- "sources": {
6
- "./contracts/Wallet.sol": "ipfs://QmdvZEW3AaUntDfFkcbdnYzeLAAeD4YFeixQsdmHF88T6Q"
7
- },
8
- "contract_types": {
9
- "Wallet": {
10
- "deployment_bytecode": {
11
- "bytecode": "0x608060405260008054600160a060020a031916331790556102bf806100256000396000f3006080604052600436106100565763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100655780632e1a7d4d146100aa578063d0679d34146100c2575b34801561006257600080fd5b50005b34801561007157600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff600435166024356100f3565b604080519115158252519081900360200190f35b3480156100b657600080fd5b5061009660043561014a565b3480156100ce57600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff60043516602435610236565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461011857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8216600090815260016020819052604090912082905592915050565b3360009081526001602090815260408083205481517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905290517300000000000000000000000000000000000000009263a293d1e89260448082019391829003018186803b1580156101ca57600080fd5b505af41580156101de573d6000803e3d6000fd5b505050506040513d60208110156101f457600080fd5b505133600081815260016020526040808220939093559151909184156108fc02918591818181858888f19350505050151561022e57600080fd5b506001919050565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461025b57600080fd5b60405173ffffffffffffffffffffffffffffffffffffffff84169083156108fc029084906000818181858888f19796505050505050505600a165627a7a723058207816bfaab53d55eff94c08cb3e5655a597fb47b8b10256bc7b52b12105f3095e0029",
12
- "link_references": [{
13
- "offsets": [442],
14
- "length": 20,
15
- "name": "SafeMathLib"
16
- }]
17
- },
18
- "runtime_bytecode": {
19
- "bytecode": "0x6080604052600436106100565763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100655780632e1a7d4d146100aa578063d0679d34146100c2575b34801561006257600080fd5b50005b34801561007157600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff600435166024356100f3565b604080519115158252519081900360200190f35b3480156100b657600080fd5b5061009660043561014a565b3480156100ce57600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff60043516602435610236565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461011857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8216600090815260016020819052604090912082905592915050565b3360009081526001602090815260408083205481517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905290517300000000000000000000000000000000000000009263a293d1e89260448082019391829003018186803b1580156101ca57600080fd5b505af41580156101de573d6000803e3d6000fd5b505050506040513d60208110156101f457600080fd5b505133600081815260016020526040808220939093559151909184156108fc02918591818181858888f19350505050151561022e57600080fd5b506001919050565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461025b57600080fd5b60405173ffffffffffffffffffffffffffffffffffffffff84169083156108fc029084906000818181858888f19796505050505050505600a165627a7a723058207816bfaab53d55eff94c08cb3e5655a597fb47b8b10256bc7b52b12105f3095e0029",
20
- "link_references": [{
21
- "offsets": [405],
22
- "length": 20,
23
- "name": "SafeMathLib"
24
- }]
25
- },
26
- "abi": [
27
- {
28
- "constant": false,
29
- "inputs": [
30
- {"name": "recipient", "type": "address"},
31
- {"name": "value", "type": "uint256"}
32
- ],
33
- "name": "approve",
34
- "outputs": [
35
- {"name": "", "type": "bool"}
36
- ],
37
- "payable": false,
38
- "stateMutability": "nonpayable",
39
- "type": "function"
40
- },
41
- {
42
- "constant": false,
43
- "inputs": [
44
- {"name": "value", "type": "uint256"}
45
- ],
46
- "name": "withdraw",
47
- "outputs": [
48
- {"name": "", "type": "bool"}
49
- ],
50
- "payable": false,
51
- "stateMutability": "nonpayable",
52
- "type": "function"
53
- },
54
- {
55
- "constant": false,
56
- "inputs": [
57
- {"name": "recipient", "type": "address"},
58
- {"name": "value", "type": "uint256"}
59
- ],
60
- "name": "send",
61
- "outputs": [
62
- {"name": "", "type": "bool"}
63
- ],
64
- "payable": false,
65
- "stateMutability": "nonpayable",
66
- "type": "function"
67
- },
68
- {
69
- "payable": false,
70
- "stateMutability": "nonpayable",
71
- "type": "fallback"
72
- }
73
- ],
74
- "natspec": {
75
- "compiler": {
76
- "name": "solc",
77
- "version": "0.4.24+commit.e67f0147.Emscripten.clang",
78
- "settings": {
79
- "optimize": true
80
- }
81
- },
82
- "author": "Piper Merriam <pipermerriam@gmail.com>",
83
- "methods": {
84
- "approve(address,uint256)": {
85
- "details": "Sets recipient to be approved to withdraw the specified amount",
86
- "notice": "This will set the recipient to be approved to withdraw the specified amount."
87
- },
88
- "send(address,uint256)": {
89
- "details": "Sends the recipient the specified amount",
90
- "notice": "This will send the reciepient the specified amount."
91
- },
92
- "withdraw(uint256)": {
93
- "details": "Lets caller withdraw up to their approved amount",
94
- "notice": "This will withdraw provided value, deducting it from your total allowance."
95
- }
96
- },
97
- "title": "Contract for holding funds in escrow between two semi trusted parties."
98
- }
99
- }
100
- },
101
- "deployments": {
102
- "blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/0d2426efb30377a18129af05d887f9ba76bff85482000bd19e3630eb09a8bf39": {
103
- "Wallet": {
104
- "contract_type": "Wallet",
105
- "address": "0x79eb62e7a360952670C03676F47a9087c15065B3",
106
- "transaction": "0xaf122c215282dd340d686a662d60239f43700e15127b44e68dd6a00c48b9c88a",
107
- "block": "0x0a2d01614f4dadd0b7eeeb945d5bab534825911a7769a6d2da8adb72e91b2531",
108
- "runtime_bytecode": {
109
- "link_dependencies": [
110
- {"offsets": [405], "type": "reference", "value": "safe-math-lib:SafeMathLib"}
111
- ]
112
- }
113
- }
114
- }
115
- },
116
- "build_dependencies": {
117
- "owned": "ipfs://QmbeVyFLSuEUxiXKwSsEjef6icpdTdA4kGG9BcrJXKNKUW",
118
- "safe-math-lib": "ipfs://QmWgvM8yXGyHoGWqLFXvareJsoCZVsdrpKNCLMun3RaSJm"
119
- }
120
- }
@@ -1 +0,0 @@
1
- {"build_dependencies":{"owned":"ipfs://QmbeVyFLSuEUxiXKwSsEjef6icpdTdA4kGG9BcrJXKNKUW","safe-math-lib":"ipfs://QmWgvM8yXGyHoGWqLFXvareJsoCZVsdrpKNCLMun3RaSJm"},"contract_types":{"Wallet":{"abi":[{"constant":false,"inputs":[{"name":"recipient","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"withdraw","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"recipient","type":"address"},{"name":"value","type":"uint256"}],"name":"send","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"}],"deployment_bytecode":{"bytecode":"0x608060405260008054600160a060020a031916331790556102bf806100256000396000f3006080604052600436106100565763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100655780632e1a7d4d146100aa578063d0679d34146100c2575b34801561006257600080fd5b50005b34801561007157600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff600435166024356100f3565b604080519115158252519081900360200190f35b3480156100b657600080fd5b5061009660043561014a565b3480156100ce57600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff60043516602435610236565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461011857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8216600090815260016020819052604090912082905592915050565b3360009081526001602090815260408083205481517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905290517300000000000000000000000000000000000000009263a293d1e89260448082019391829003018186803b1580156101ca57600080fd5b505af41580156101de573d6000803e3d6000fd5b505050506040513d60208110156101f457600080fd5b505133600081815260016020526040808220939093559151909184156108fc02918591818181858888f19350505050151561022e57600080fd5b506001919050565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461025b57600080fd5b60405173ffffffffffffffffffffffffffffffffffffffff84169083156108fc029084906000818181858888f19796505050505050505600a165627a7a723058207816bfaab53d55eff94c08cb3e5655a597fb47b8b10256bc7b52b12105f3095e0029","link_references":[{"length":20,"name":"SafeMathLib","offsets":[442]}]},"natspec":{"author":"Piper Merriam <pipermerriam@gmail.com>","compiler":{"name":"solc","settings":{"optimize":true},"version":"0.4.24+commit.e67f0147.Emscripten.clang"},"methods":{"approve(address,uint256)":{"details":"Sets recipient to be approved to withdraw the specified amount","notice":"This will set the recipient to be approved to withdraw the specified amount."},"send(address,uint256)":{"details":"Sends the recipient the specified amount","notice":"This will send the reciepient the specified amount."},"withdraw(uint256)":{"details":"Lets caller withdraw up to their approved amount","notice":"This will withdraw provided value, deducting it from your total allowance."}},"title":"Contract for holding funds in escrow between two semi trusted parties."},"runtime_bytecode":{"bytecode":"0x6080604052600436106100565763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100655780632e1a7d4d146100aa578063d0679d34146100c2575b34801561006257600080fd5b50005b34801561007157600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff600435166024356100f3565b604080519115158252519081900360200190f35b3480156100b657600080fd5b5061009660043561014a565b3480156100ce57600080fd5b5061009673ffffffffffffffffffffffffffffffffffffffff60043516602435610236565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461011857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8216600090815260016020819052604090912082905592915050565b3360009081526001602090815260408083205481517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905290517300000000000000000000000000000000000000009263a293d1e89260448082019391829003018186803b1580156101ca57600080fd5b505af41580156101de573d6000803e3d6000fd5b505050506040513d60208110156101f457600080fd5b505133600081815260016020526040808220939093559151909184156108fc02918591818181858888f19350505050151561022e57600080fd5b506001919050565b6000805473ffffffffffffffffffffffffffffffffffffffff16331461025b57600080fd5b60405173ffffffffffffffffffffffffffffffffffffffff84169083156108fc029084906000818181858888f19796505050505050505600a165627a7a723058207816bfaab53d55eff94c08cb3e5655a597fb47b8b10256bc7b52b12105f3095e0029","link_references":[{"length":20,"name":"SafeMathLib","offsets":[405]}]}}},"deployments":{"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/0d2426efb30377a18129af05d887f9ba76bff85482000bd19e3630eb09a8bf39":{"Wallet":{"address":"0x79eb62e7a360952670C03676F47a9087c15065B3","block":"0x0a2d01614f4dadd0b7eeeb945d5bab534825911a7769a6d2da8adb72e91b2531","contract_type":"Wallet","runtime_bytecode":{"link_dependencies":[{"offsets":[405],"type":"reference","value":"safe-math-lib:SafeMathLib"}]},"transaction":"0xaf122c215282dd340d686a662d60239f43700e15127b44e68dd6a00c48b9c88a"}}},"manifest_version":"2","package_name":"wallet","sources":{"./contracts/Wallet.sol":"ipfs://QmdvZEW3AaUntDfFkcbdnYzeLAAeD4YFeixQsdmHF88T6Q"},"version":"1.0.0"}
@@ -1,41 +0,0 @@
1
- // SPDX-License-Identifier: MIT
2
- pragma solidity ^0.6.8;
3
-
4
-
5
- import {SafeMathLib} from "./safe-math-lib/contracts/SafeMathLib.sol";
6
- import {Owned} from "./owned/contracts/Owned.sol";
7
-
8
-
9
- /// @title Contract for holding funds in escrow between two semi trusted parties.
10
- /// @author Piper Merriam <pipermerriam@gmail.com>
11
- contract Wallet is Owned {
12
- using SafeMathLib for uint;
13
-
14
- mapping (address => uint) allowances;
15
-
16
- /// @dev Fallback function for depositing funds
17
- fallback() external {
18
- }
19
-
20
- /// @dev Sends the recipient the specified amount
21
- /// @notice This will send the reciepient the specified amount.
22
- function send(address payable recipient, uint value) public onlyOwner returns (bool) {
23
- return recipient.send(value);
24
- }
25
-
26
- /// @dev Sets recipient to be approved to withdraw the specified amount
27
- /// @notice This will set the recipient to be approved to withdraw the specified amount.
28
- function approve(address recipient, uint value) public onlyOwner returns (bool) {
29
- allowances[recipient] = value;
30
- return true;
31
- }
32
-
33
- /// @dev Lets caller withdraw up to their approved amount
34
- /// @notice This will withdraw provided value, deducting it from your total allowance.
35
- function withdraw(uint value) public returns (bool) {
36
- allowances[msg.sender] = allowances[msg.sender].safeSub(value);
37
- if (!msg.sender.send(value))
38
- revert();
39
- return true;
40
- }
41
- }
@@ -1,181 +0,0 @@
1
- {
2
- "manifest": "ethpm/3",
3
- "version": "1.0.0",
4
- "name": "wallet",
5
- "sources": {
6
- "Wallet.sol": {
7
- "type": "solidity",
8
- "installPath": "./Wallet.sol",
9
- "urls": [
10
- "ipfs://QmfTZzHLSShTS1woD7JNszAyhjtS7ErFDT4QmtwEQQ1qpa"
11
- ]
12
- }
13
- },
14
- "compilers": [
15
- {
16
- "contractTypes": [
17
- "Wallet"
18
- ],
19
- "name": "solc",
20
- "version": "0.6.8+commit.0bbfe453",
21
- "settings": {
22
- "optimize": false
23
- }
24
- }
25
- ],
26
- "contractTypes": {
27
- "Wallet": {
28
- "sourceId": "Wallet.sol",
29
- "deploymentBytecode": {
30
- "bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610430806100606000396000f3fe608060405234801561001057600080fd5b50600436106100455760003560e01c8063095ea7b3146100485780632e1a7d4d146100ae578063d0679d34146100f457610046565b5b005b6100946004803603604081101561005e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061015a565b604051808215151515815260200191505060405180910390f35b6100da600480360360208110156100c457600080fd5b8101908080359060200190929190505050610203565b604051808215151515815260200191505060405180910390f35b6101406004803603604081101561010a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610362565b604051808215151515815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101b557600080fd5b81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473000000000000000000000000000000000000000063a293d1e89091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561029d57600080fd5b505af41580156102b1573d6000803e3d6000fd5b505050506040513d60208110156102c757600080fd5b8101908080519060200190929190505050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505061035957600080fd5b60019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103bd57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505090509291505056fea2646970667358221220fa09119fa13c8df37a523851a236b913e5d00bf3274d5619daad516f510c8a9264736f6c63430006080033",
31
- "linkReferences": [
32
- {
33
- "offsets": [
34
- 679
35
- ],
36
- "length": 20,
37
- "name": "safe-math-lib:SafeMathLib"
38
- }
39
- ]
40
- },
41
- "runtimeBytecode": {
42
- "bytecode": "0x608060405234801561001057600080fd5b50600436106100455760003560e01c8063095ea7b3146100485780632e1a7d4d146100ae578063d0679d34146100f457610046565b5b005b6100946004803603604081101561005e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061015a565b604051808215151515815260200191505060405180910390f35b6100da600480360360208110156100c457600080fd5b8101908080359060200190929190505050610203565b604051808215151515815260200191505060405180910390f35b6101406004803603604081101561010a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610362565b604051808215151515815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101b557600080fd5b81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473000000000000000000000000000000000000000063a293d1e89091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561029d57600080fd5b505af41580156102b1573d6000803e3d6000fd5b505050506040513d60208110156102c757600080fd5b8101908080519060200190929190505050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505061035957600080fd5b60019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103bd57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505090509291505056fea2646970667358221220fa09119fa13c8df37a523851a236b913e5d00bf3274d5619daad516f510c8a9264736f6c63430006080033",
43
- "linkReferences": [
44
- {
45
- "offsets": [
46
- 583
47
- ],
48
- "length": 20,
49
- "name": "safe-math-lib:SafeMathLib"
50
- }
51
- ]
52
- },
53
- "abi": [
54
- {
55
- "stateMutability": "nonpayable",
56
- "type": "fallback"
57
- },
58
- {
59
- "inputs": [
60
- {
61
- "internalType": "address",
62
- "name": "recipient",
63
- "type": "address"
64
- },
65
- {
66
- "internalType": "uint256",
67
- "name": "value",
68
- "type": "uint256"
69
- }
70
- ],
71
- "name": "approve",
72
- "outputs": [
73
- {
74
- "internalType": "bool",
75
- "name": "",
76
- "type": "bool"
77
- }
78
- ],
79
- "stateMutability": "nonpayable",
80
- "type": "function"
81
- },
82
- {
83
- "inputs": [
84
- {
85
- "internalType": "address payable",
86
- "name": "recipient",
87
- "type": "address"
88
- },
89
- {
90
- "internalType": "uint256",
91
- "name": "value",
92
- "type": "uint256"
93
- }
94
- ],
95
- "name": "send",
96
- "outputs": [
97
- {
98
- "internalType": "bool",
99
- "name": "",
100
- "type": "bool"
101
- }
102
- ],
103
- "stateMutability": "nonpayable",
104
- "type": "function"
105
- },
106
- {
107
- "inputs": [
108
- {
109
- "internalType": "uint256",
110
- "name": "value",
111
- "type": "uint256"
112
- }
113
- ],
114
- "name": "withdraw",
115
- "outputs": [
116
- {
117
- "internalType": "bool",
118
- "name": "",
119
- "type": "bool"
120
- }
121
- ],
122
- "stateMutability": "nonpayable",
123
- "type": "function"
124
- }
125
- ],
126
- "devdoc": {
127
- "author": "Piper Merriam <pipermerriam@gmail.com>",
128
- "methods": {
129
- "approve(address,uint256)": {
130
- "details": "Sets recipient to be approved to withdraw the specified amount"
131
- },
132
- "send(address,uint256)": {
133
- "details": "Sends the recipient the specified amount"
134
- },
135
- "withdraw(uint256)": {
136
- "details": "Lets caller withdraw up to their approved amount"
137
- }
138
- },
139
- "title": "Contract for holding funds in escrow between two semi trusted parties."
140
- },
141
- "userdoc": {
142
- "methods": {
143
- "approve(address,uint256)": {
144
- "notice": "This will set the recipient to be approved to withdraw the specified amount."
145
- },
146
- "send(address,uint256)": {
147
- "notice": "This will send the reciepient the specified amount."
148
- },
149
- "withdraw(uint256)": {
150
- "notice": "This will withdraw provided value, deducting it from your total allowance."
151
- }
152
- }
153
- }
154
- }
155
- },
156
- "deployments": {
157
- "blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/e30e4ef1dd1e73e788c3d094859f14ddd139a19e8a3667e2ee4831d9bd1113ac": {
158
- "Wallet": {
159
- "contractType": "Wallet",
160
- "address": "0x491CB3AC79d0f5D7078C3cF6EF3daEcE9623CD21",
161
- "transaction": "0x8648f43125776ec2b727eda84d10c67db1693fce8bc1e7b3f84f9e40086e4773",
162
- "block": "0x77adadc004c1a830682f3237b42ce81a379d11dfd88292c97ad80658f470717a",
163
- "runtimeBytecode": {
164
- "linkDependencies": [
165
- {
166
- "offsets": [
167
- 583
168
- ],
169
- "type": "reference",
170
- "value": "safe-math-lib:SafeMathLib"
171
- }
172
- ]
173
- }
174
- }
175
- }
176
- },
177
- "buildDependencies": {
178
- "owned": "ipfs://QmcxvhkJJVpbxEAa6cgW3B6XwPJb79w9GpNUv2P2THUzZR",
179
- "safe-math-lib": "ipfs://QmWnPsiS3Xb8GvCDEBFnnKs8Yk4HaAX6rCqJAaQXGbCoPk"
180
- }
181
- }
@@ -1 +0,0 @@
1
- {"buildDependencies":{"owned":"ipfs://QmcxvhkJJVpbxEAa6cgW3B6XwPJb79w9GpNUv2P2THUzZR","safe-math-lib":"ipfs://QmWnPsiS3Xb8GvCDEBFnnKs8Yk4HaAX6rCqJAaQXGbCoPk"},"compilers":[{"contractTypes":["Wallet"],"name":"solc","settings":{"optimize":false},"version":"0.6.8+commit.0bbfe453"}],"contractTypes":{"Wallet":{"abi":[{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"send","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"deploymentBytecode":{"bytecode":"0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610430806100606000396000f3fe608060405234801561001057600080fd5b50600436106100455760003560e01c8063095ea7b3146100485780632e1a7d4d146100ae578063d0679d34146100f457610046565b5b005b6100946004803603604081101561005e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061015a565b604051808215151515815260200191505060405180910390f35b6100da600480360360208110156100c457600080fd5b8101908080359060200190929190505050610203565b604051808215151515815260200191505060405180910390f35b6101406004803603604081101561010a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610362565b604051808215151515815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101b557600080fd5b81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473000000000000000000000000000000000000000063a293d1e89091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561029d57600080fd5b505af41580156102b1573d6000803e3d6000fd5b505050506040513d60208110156102c757600080fd5b8101908080519060200190929190505050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505061035957600080fd5b60019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103bd57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505090509291505056fea2646970667358221220fa09119fa13c8df37a523851a236b913e5d00bf3274d5619daad516f510c8a9264736f6c63430006080033","linkReferences":[{"length":20,"name":"safe-math-lib:SafeMathLib","offsets":[679]}]},"devdoc":{"author":"Piper Merriam <pipermerriam@gmail.com>","methods":{"approve(address,uint256)":{"details":"Sets recipient to be approved to withdraw the specified amount"},"send(address,uint256)":{"details":"Sends the recipient the specified amount"},"withdraw(uint256)":{"details":"Lets caller withdraw up to their approved amount"}},"title":"Contract for holding funds in escrow between two semi trusted parties."},"runtimeBytecode":{"bytecode":"0x608060405234801561001057600080fd5b50600436106100455760003560e01c8063095ea7b3146100485780632e1a7d4d146100ae578063d0679d34146100f457610046565b5b005b6100946004803603604081101561005e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061015a565b604051808215151515815260200191505060405180910390f35b6100da600480360360208110156100c457600080fd5b8101908080359060200190929190505050610203565b604051808215151515815260200191505060405180910390f35b6101406004803603604081101561010a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610362565b604051808215151515815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101b557600080fd5b81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473000000000000000000000000000000000000000063a293d1e89091846040518363ffffffff1660e01b8152600401808381526020018281526020019250505060206040518083038186803b15801561029d57600080fd5b505af41580156102b1573d6000803e3d6000fd5b505050506040513d60208110156102c757600080fd5b8101908080519060200190929190505050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505061035957600080fd5b60019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103bd57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505090509291505056fea2646970667358221220fa09119fa13c8df37a523851a236b913e5d00bf3274d5619daad516f510c8a9264736f6c63430006080033","linkReferences":[{"length":20,"name":"safe-math-lib:SafeMathLib","offsets":[583]}]},"sourceId":"Wallet.sol","userdoc":{"methods":{"approve(address,uint256)":{"notice":"This will set the recipient to be approved to withdraw the specified amount."},"send(address,uint256)":{"notice":"This will send the reciepient the specified amount."},"withdraw(uint256)":{"notice":"This will withdraw provided value, deducting it from your total allowance."}}}}},"deployments":{"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/e30e4ef1dd1e73e788c3d094859f14ddd139a19e8a3667e2ee4831d9bd1113ac":{"Wallet":{"address":"0x491CB3AC79d0f5D7078C3cF6EF3daEcE9623CD21","block":"0x77adadc004c1a830682f3237b42ce81a379d11dfd88292c97ad80658f470717a","contractType":"Wallet","runtimeBytecode":{"linkDependencies":[{"offsets":[583],"type":"reference","value":"safe-math-lib:SafeMathLib"}]},"transaction":"0x8648f43125776ec2b727eda84d10c67db1693fce8bc1e7b3f84f9e40086e4773"}}},"manifest":"ethpm/3","name":"wallet","sources":{"Wallet.sol":{"installPath":"./Wallet.sol","type":"solidity","urls":["ipfs://QmfTZzHLSShTS1woD7JNszAyhjtS7ErFDT4QmtwEQQ1qpa"]}},"version":"1.0.0"}
@@ -1,135 +0,0 @@
1
- {
2
- "manifest_version": "2",
3
- "version": "1.0.0",
4
- "package_name": "wallet-with-send",
5
- "sources": {
6
- "./contracts/WalletWithSend.sol": "ipfs://QmRvVRn6USxJu1H4L51KyzxbQFVmCFqdzB4RAG9VeJ2s4W"
7
- },
8
- "contract_types": {
9
- "WalletWithSend": {
10
- "deployment_bytecode": {
11
- "bytecode": "0x608060405260008054600160a060020a03191633179055610395806100256000396000f3006080604052600436106100615763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100705780632e1a7d4d146100a8578063c577ff8b146100c0578063d0679d34146100e6575b34801561006d57600080fd5b50005b34801561007c57600080fd5b50610094600160a060020a036004351660243561010a565b604080519115158252519081900360200190f35b3480156100b457600080fd5b50610094600435610147565b3480156100cc57600080fd5b506100e4600435600160a060020a0360243516610233565b005b3480156100f257600080fd5b50610094600160a060020a0360043516602435610326565b60008054600160a060020a0316331461012257600080fd5b50600160a060020a038216600090815260016020819052604090912082905592915050565b3360009081526001602090815260408083205481517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905290517300000000000000000000000000000000000000009263a293d1e89260448082019391829003018186803b1580156101c757600080fd5b505af41580156101db573d6000803e3d6000fd5b505050506040513d60208110156101f157600080fd5b505133600081815260016020526040808220939093559151909184156108fc02918591818181858888f19350505050151561022b57600080fd5b506001919050565b336000908152600160209081526040918290205482517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905291517300000000000000000000000000000000000000009263a293d1e8926044808301939192829003018186803b1580156102b557600080fd5b505af41580156102c9573d6000803e3d6000fd5b505050506040513d60208110156102df57600080fd5b505133600090815260016020526040808220929092559051600160a060020a0383169184156108fc02918591818181858888f19350505050151561032257600080fd5b5050565b60008054600160a060020a0316331461033e57600080fd5b604051600160a060020a0384169083156108fc029084906000818181858888f19796505050505050505600a165627a7a72305820127a404b857b83aa26a51d55d8283bff1dfb5c18217a999c5fbd2862d240fb760029",
12
- "link_references": [{
13
- "offsets": [439, 676],
14
- "length": 20,
15
- "name": "SafeSendLib"
16
- }]
17
- },
18
- "runtime_bytecode": {
19
- "bytecode": "0x6080604052600436106100615763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100705780632e1a7d4d146100a8578063c577ff8b146100c0578063d0679d34146100e6575b34801561006d57600080fd5b50005b34801561007c57600080fd5b50610094600160a060020a036004351660243561010a565b604080519115158252519081900360200190f35b3480156100b457600080fd5b50610094600435610147565b3480156100cc57600080fd5b506100e4600435600160a060020a0360243516610233565b005b3480156100f257600080fd5b50610094600160a060020a0360043516602435610326565b60008054600160a060020a0316331461012257600080fd5b50600160a060020a038216600090815260016020819052604090912082905592915050565b3360009081526001602090815260408083205481517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905290517300000000000000000000000000000000000000009263a293d1e89260448082019391829003018186803b1580156101c757600080fd5b505af41580156101db573d6000803e3d6000fd5b505050506040513d60208110156101f157600080fd5b505133600081815260016020526040808220939093559151909184156108fc02918591818181858888f19350505050151561022b57600080fd5b506001919050565b336000908152600160209081526040918290205482517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905291517300000000000000000000000000000000000000009263a293d1e8926044808301939192829003018186803b1580156102b557600080fd5b505af41580156102c9573d6000803e3d6000fd5b505050506040513d60208110156102df57600080fd5b505133600090815260016020526040808220929092559051600160a060020a0383169184156108fc02918591818181858888f19350505050151561032257600080fd5b5050565b60008054600160a060020a0316331461033e57600080fd5b604051600160a060020a0384169083156108fc029084906000818181858888f19796505050505050505600a165627a7a72305820127a404b857b83aa26a51d55d8283bff1dfb5c18217a999c5fbd2862d240fb760029",
20
- "link_references": [{
21
- "offsets": [402, 639],
22
- "length": 20,
23
- "name": "SafeSendLib"
24
- }]
25
- },
26
- "abi": [
27
- {
28
- "constant": false,
29
- "inputs": [
30
- {"name": "recipient", "type": "address"},
31
- {"name": "value", "type": "uint256"}
32
- ],
33
- "name": "approve",
34
- "outputs": [
35
- {"name": "", "type": "bool"}
36
- ],
37
- "payable": false,
38
- "stateMutability": "nonpayable",
39
- "type": "function"
40
- },
41
- {
42
- "constant": false,
43
- "inputs": [
44
- {"name": "value", "type": "uint256"}
45
- ],
46
- "name": "withdraw",
47
- "outputs": [
48
- {"name": "", "type": "bool"}
49
- ],
50
- "payable": false,
51
- "stateMutability": "nonpayable",
52
- "type": "function"
53
- },
54
- {
55
- "constant": false,
56
- "inputs": [
57
- {"name": "value", "type": "uint256"},
58
- {"name": "to", "type": "address"}
59
- ],
60
- "name": "approvedSend",
61
- "outputs": [],
62
- "payable": false,
63
- "stateMutability": "nonpayable",
64
- "type": "function"
65
- },
66
- {
67
- "constant": false,
68
- "inputs": [
69
- {"name": "recipient", "type": "address"},
70
- {"name": "value", "type": "uint256"}
71
- ],
72
- "name": "send",
73
- "outputs": [
74
- {"name": "","type": "bool"}
75
- ],
76
- "payable": false,
77
- "stateMutability": "nonpayable",
78
- "type": "function"
79
- },
80
- {
81
- "payable": false,
82
- "stateMutability": "nonpayable",
83
- "type": "fallback"
84
- }
85
- ],
86
- "compiler": {
87
- "name": "solc",
88
- "version": "0.4.24+commit.e67f0147.Emscripten.clang",
89
- "settings": {
90
- "optimize": true
91
- }
92
- },
93
- "natspec": {
94
- "author": "Piper Merriam <pipermerriam@gmail.com>",
95
- "methods": {
96
- "approve(address,uint256)": {
97
- "details": "Sets recipient to be approved to withdraw the specified amount",
98
- "notice": "This will set the recipient to be approved to withdraw the specified amount."
99
- },
100
- "send(address,uint256)": {
101
- "details": "Sends the recipient the specified amount",
102
- "notice": "This will send the reciepient the specified amount."
103
- },
104
- "approvedSend(uint256,address)" : {
105
- "details" : "Sends funds that have been approved to the specified address",
106
- "notice" : "This will send the reciepient the specified amount."
107
- },
108
- "withdraw(uint256)": {
109
- "details": "Lets caller withdraw up to their approved amount",
110
- "notice": "This will withdraw provided value, deducting it from your total allowance."
111
- }
112
- },
113
- "title" : "Wallet contract with simple send and approval spending functionality"
114
- }
115
- }
116
- },
117
- "deployments": {
118
- "blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/32a617527c183587710e28a6b66eb709a34e3cbc5ae5e3f1ed564ba1b46ab00c": {
119
- "Wallet": {
120
- "contract_type": "WalletWithSend",
121
- "address": "0xae97b967ae51e50f80aaed254b3190dd2d8520ca",
122
- "transaction": "0xb44bb94b553c8c63c6a2f0b3b5bea92c69621e65af56069254b36f6b5272e7d0",
123
- "block": "0xb44bb94b553c8c63c6a2f0b3b5bea92c69621e65af56069254b36f6b5272e7d0",
124
- "runtime_bytecode": {
125
- "link_dependencies": [
126
- {"offsets": [402, 639], "type": "reference", "value": "wallet:safe-math-lib:SafeMathLib"}
127
- ]
128
- }
129
- }
130
- }
131
- },
132
- "build_dependencies": {
133
- "wallet": "ipfs://QmPZ98R6wnyhiHAfE3D9eGnZDvUCBnhi2Vp5Wkdtax6cSn"
134
- }
135
- }
@@ -1 +0,0 @@
1
- {"build_dependencies":{"wallet":"ipfs://QmPZ98R6wnyhiHAfE3D9eGnZDvUCBnhi2Vp5Wkdtax6cSn"},"contract_types":{"WalletWithSend":{"abi":[{"constant":false,"inputs":[{"name":"recipient","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"withdraw","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"},{"name":"to","type":"address"}],"name":"approvedSend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"recipient","type":"address"},{"name":"value","type":"uint256"}],"name":"send","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"}],"compiler":{"name":"solc","settings":{"optimize":true},"version":"0.4.24+commit.e67f0147.Emscripten.clang"},"deployment_bytecode":{"bytecode":"0x608060405260008054600160a060020a03191633179055610395806100256000396000f3006080604052600436106100615763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100705780632e1a7d4d146100a8578063c577ff8b146100c0578063d0679d34146100e6575b34801561006d57600080fd5b50005b34801561007c57600080fd5b50610094600160a060020a036004351660243561010a565b604080519115158252519081900360200190f35b3480156100b457600080fd5b50610094600435610147565b3480156100cc57600080fd5b506100e4600435600160a060020a0360243516610233565b005b3480156100f257600080fd5b50610094600160a060020a0360043516602435610326565b60008054600160a060020a0316331461012257600080fd5b50600160a060020a038216600090815260016020819052604090912082905592915050565b3360009081526001602090815260408083205481517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905290517300000000000000000000000000000000000000009263a293d1e89260448082019391829003018186803b1580156101c757600080fd5b505af41580156101db573d6000803e3d6000fd5b505050506040513d60208110156101f157600080fd5b505133600081815260016020526040808220939093559151909184156108fc02918591818181858888f19350505050151561022b57600080fd5b506001919050565b336000908152600160209081526040918290205482517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905291517300000000000000000000000000000000000000009263a293d1e8926044808301939192829003018186803b1580156102b557600080fd5b505af41580156102c9573d6000803e3d6000fd5b505050506040513d60208110156102df57600080fd5b505133600090815260016020526040808220929092559051600160a060020a0383169184156108fc02918591818181858888f19350505050151561032257600080fd5b5050565b60008054600160a060020a0316331461033e57600080fd5b604051600160a060020a0384169083156108fc029084906000818181858888f19796505050505050505600a165627a7a72305820127a404b857b83aa26a51d55d8283bff1dfb5c18217a999c5fbd2862d240fb760029","link_references":[{"length":20,"name":"SafeSendLib","offsets":[439,676]}]},"natspec":{"author":"Piper Merriam <pipermerriam@gmail.com>","methods":{"approve(address,uint256)":{"details":"Sets recipient to be approved to withdraw the specified amount","notice":"This will set the recipient to be approved to withdraw the specified amount."},"approvedSend(uint256,address)":{"details":"Sends funds that have been approved to the specified address","notice":"This will send the reciepient the specified amount."},"send(address,uint256)":{"details":"Sends the recipient the specified amount","notice":"This will send the reciepient the specified amount."},"withdraw(uint256)":{"details":"Lets caller withdraw up to their approved amount","notice":"This will withdraw provided value, deducting it from your total allowance."}},"title":"Wallet contract with simple send and approval spending functionality"},"runtime_bytecode":{"bytecode":"0x6080604052600436106100615763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b381146100705780632e1a7d4d146100a8578063c577ff8b146100c0578063d0679d34146100e6575b34801561006d57600080fd5b50005b34801561007c57600080fd5b50610094600160a060020a036004351660243561010a565b604080519115158252519081900360200190f35b3480156100b457600080fd5b50610094600435610147565b3480156100cc57600080fd5b506100e4600435600160a060020a0360243516610233565b005b3480156100f257600080fd5b50610094600160a060020a0360043516602435610326565b60008054600160a060020a0316331461012257600080fd5b50600160a060020a038216600090815260016020819052604090912082905592915050565b3360009081526001602090815260408083205481517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905290517300000000000000000000000000000000000000009263a293d1e89260448082019391829003018186803b1580156101c757600080fd5b505af41580156101db573d6000803e3d6000fd5b505050506040513d60208110156101f157600080fd5b505133600081815260016020526040808220939093559151909184156108fc02918591818181858888f19350505050151561022b57600080fd5b506001919050565b336000908152600160209081526040918290205482517fa293d1e800000000000000000000000000000000000000000000000000000000815260048101919091526024810185905291517300000000000000000000000000000000000000009263a293d1e8926044808301939192829003018186803b1580156102b557600080fd5b505af41580156102c9573d6000803e3d6000fd5b505050506040513d60208110156102df57600080fd5b505133600090815260016020526040808220929092559051600160a060020a0383169184156108fc02918591818181858888f19350505050151561032257600080fd5b5050565b60008054600160a060020a0316331461033e57600080fd5b604051600160a060020a0384169083156108fc029084906000818181858888f19796505050505050505600a165627a7a72305820127a404b857b83aa26a51d55d8283bff1dfb5c18217a999c5fbd2862d240fb760029","link_references":[{"length":20,"name":"SafeSendLib","offsets":[402,639]}]}}},"deployments":{"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/32a617527c183587710e28a6b66eb709a34e3cbc5ae5e3f1ed564ba1b46ab00c":{"Wallet":{"address":"0xae97b967ae51e50f80aaed254b3190dd2d8520ca","block":"0xb44bb94b553c8c63c6a2f0b3b5bea92c69621e65af56069254b36f6b5272e7d0","contract_type":"WalletWithSend","runtime_bytecode":{"link_dependencies":[{"offsets":[402,639],"type":"reference","value":"wallet:safe-math-lib:SafeMathLib"}]},"transaction":"0xb44bb94b553c8c63c6a2f0b3b5bea92c69621e65af56069254b36f6b5272e7d0"}}},"manifest_version":"2","package_name":"wallet-with-send","sources":{"./contracts/WalletWithSend.sol":"ipfs://QmRvVRn6USxJu1H4L51KyzxbQFVmCFqdzB4RAG9VeJ2s4W"},"version":"1.0.0"}
@@ -1,18 +0,0 @@
1
- // SPDX-License-Identifier: MIT
2
- pragma solidity ^0.6.8;
3
-
4
-
5
- import {Wallet} from "./wallet/contracts/Wallet.sol";
6
-
7
-
8
- /// @title Wallet contract with simple send and approval spending functionality
9
- /// @author Piper Merriam <pipermerriam@gmail.com>
10
- contract WalletWithSend is Wallet {
11
- /// @dev Sends funds that have been approved to the specified address
12
- /// @notice This will send the reciepient the specified amount.
13
- function approvedSend(uint value, address payable to) public {
14
- allowances[msg.sender] = allowances[msg.sender].safeSub(value);
15
- if (!to.send(value))
16
- revert();
17
- }
18
- }