commit b8227f80ba17ba12dcd60a1d117a16f3ff9e89fc
parent 6afe798754105f7dc8c7fa1c2b0df347846f4568
Author: nolash <dev@holbrook.no>
Date: Sun, 10 Jan 2021 21:20:33 +0100
Implement externa signer
Diffstat:
12 files changed, 108 insertions(+), 52 deletions(-)
diff --git a/python/CHANGELOG b/python/CHANGELOG
@@ -1,3 +1,6 @@
+- 0.2.0-unreleased
+ * Add external signer
+ * Standardize arg flags
- 0.1.2
* Remove 'gimme' function
* Add 'cooldown' function (noop)
diff --git a/python/erc20_single_shot_faucet/data/ERC20SingleShotFaucet.bin b/python/erc20_single_shot_faucet/data/ERC20SingleShotFaucet.bin
@@ -1 +1 @@
-60806040523480156200001157600080fd5b506040516200137138038062001371833981810160405281019062000037919062000310565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060005b8451811015620001895760018060008784815181106200011a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080620001809062000436565b915050620000d1565b5081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050620004fc565b60006200026e6200026884620003c9565b62000395565b905080838252602082019050828560208602820111156200028e57600080fd5b60005b85811015620002c25781620002a78882620002cc565b84526020840193506020830192505060018101905062000291565b5050509392505050565b600081519050620002dd81620004e2565b92915050565b600082601f830112620002f557600080fd5b81516200030784826020860162000257565b91505092915050565b600080600080608085870312156200032757600080fd5b600085015167ffffffffffffffff8111156200034257600080fd5b6200035087828801620002e3565b94505060206200036387828801620002cc565b93505060406200037687828801620002cc565b92505060606200038987828801620002cc565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620003bf57620003be620004b3565b5b8060405250919050565b600067ffffffffffffffff821115620003e757620003e6620004b3565b5b602082029050602081019050919050565b600062000405826200040c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600062000443826200042c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141562000479576200047862000484565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620004ed81620003f8565b8114620004f957600080fd5b50565b610e65806200050c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063271f88b41461005c57806363e4bff41461008c578063787a08a6146100bc578063aa8c217c146100da578063fc0c546a146100f8575b600080fd5b61007660048036038101906100719190610a67565b610116565b6040516100839190610c89565b60405180910390f35b6100a660048036038101906100a19190610a3e565b61017e565b6040516100b39190610c89565b60405180910390f35b6100c46109de565b6040516100d19190610d44565b60405180910390f35b6100e26109e8565b6040516100ef9190610d44565b60405180910390f35b6101006109ee565b60405161010d9190610c45565b60405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661016e57600080fd5b8160028190555060019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561020d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161020490610cc4565b60405180910390fd5b60006060600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461043457600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016102b19190610c45565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161033b9190610c2e565b6000604051808303816000865af19150503d8060008114610378576040519150601f19603f3d011682016040523d82523d6000602084013e61037d565b606091505b508092508193505050600060f81b81601f815181106103c5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610433576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042a90610ca4565b60405180910390fd5b5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460405160240161047e9190610c45565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516105089190610c2e565b6000604051808303816000865af19150503d8060008114610545576040519150601f19603f3d011682016040523d82523d6000602084013e61054a565b606091505b508092508193505050600060f81b81601f81518110610592577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146105ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f690610d24565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016106499190610c45565b6040516020818303038152906040527f0a3b0a4f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516106d39190610c2e565b6000604051808303816000865af19150503d8060008114610710576040519150601f19603f3d011682016040523d82523d6000602084013e610715565b606091505b5080925081935050508161075e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075590610d04565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846002546040516024016107ac929190610c60565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516108369190610c2e565b6000604051808303816000865af19150503d8060008114610873576040519150601f19603f3d011682016040523d82523d6000602084013e610878565b606091505b5080925081935050508161094a57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d60706002546040516109079190610d44565b60405180910390a36040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094190610ce4565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f45c201a59ac545000ead84f30b2db67da23353aa1d58ac522c48505412143ffa6002546040516109cb9190610d44565b60405180910390a3600192505050919050565b6000600654905090565b60025481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081359050610a2381610e01565b92915050565b600081359050610a3881610e18565b92915050565b600060208284031215610a5057600080fd5b6000610a5e84828501610a14565b91505092915050565b600060208284031215610a7957600080fd5b6000610a8784828501610a29565b91505092915050565b610a9981610d86565b82525050565b610aa881610d98565b82525050565b6000610ab982610d5f565b610ac38185610d6a565b9350610ad3818560208601610dce565b80840191505092915050565b6000610aec601883610d75565b91507f4552525f4143434f554e545f4e4f545f494e5f494e44455800000000000000006000830152602082019050919050565b6000610b2c600a83610d75565b91507f4552525f414343455353000000000000000000000000000000000000000000006000830152602082019050919050565b6000610b6c600c83610d75565b91507f4552525f5452414e5346455200000000000000000000000000000000000000006000830152602082019050919050565b6000610bac600d83610d75565b91507f4552525f4d41524b5f4641494c000000000000000000000000000000000000006000830152602082019050919050565b6000610bec601083610d75565b91507f4552525f4143434f554e545f55534544000000000000000000000000000000006000830152602082019050919050565b610c2881610dc4565b82525050565b6000610c3a8284610aae565b915081905092915050565b6000602082019050610c5a6000830184610a90565b92915050565b6000604082019050610c756000830185610a90565b610c826020830184610c1f565b9392505050565b6000602082019050610c9e6000830184610a9f565b92915050565b60006020820190508181036000830152610cbd81610adf565b9050919050565b60006020820190508181036000830152610cdd81610b1f565b9050919050565b60006020820190508181036000830152610cfd81610b5f565b9050919050565b60006020820190508181036000830152610d1d81610b9f565b9050919050565b60006020820190508181036000830152610d3d81610bdf565b9050919050565b6000602082019050610d596000830184610c1f565b92915050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610d9182610da4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015610dec578082015181840152602081019050610dd1565b83811115610dfb576000848401525b50505050565b610e0a81610d86565b8114610e1557600080fd5b50565b610e2181610dc4565b8114610e2c57600080fd5b5056fea2646970667358221220d010396d2a5f28dd4867034197bf0a83e00770c5443b8030da0aa7902b8b1d3a64736f6c63430008000033
-\ No newline at end of file
+60806040523480156200001157600080fd5b50604051620015bb380380620015bb833981810160405281019062000037919062000337565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060005b8451811015620001895760018060008784815181106200011a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808062000180906200045d565b915050620000d1565b5081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6006819055505050505062000523565b6000620002956200028f84620003f0565b620003bc565b90508083825260208201905082856020860282011115620002b557600080fd5b60005b85811015620002e95781620002ce8882620002f3565b845260208401935060208301925050600181019050620002b8565b5050509392505050565b600081519050620003048162000509565b92915050565b600082601f8301126200031c57600080fd5b81516200032e8482602086016200027e565b91505092915050565b600080600080608085870312156200034e57600080fd5b600085015167ffffffffffffffff8111156200036957600080fd5b62000377878288016200030a565b94505060206200038a87828801620002f3565b93505060406200039d87828801620002f3565b9250506060620003b087828801620002f3565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620003e657620003e5620004da565b5b8060405250919050565b600067ffffffffffffffff8211156200040e576200040d620004da565b5b602082029050602081019050919050565b60006200042c8262000433565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006200046a8262000453565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415620004a0576200049f620004ab565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b62000514816200041f565b81146200052057600080fd5b50565b61108880620005336000396000f3fe608060405234801561001057600080fd5b5060043610610074576000357c010000000000000000000000000000000000000000000000000000000090048063271f88b41461007957806363e4bff4146100a9578063aa8c217c146100d9578063b222e0c2146100f7578063fc0c546a14610127575b600080fd5b610093600480360381019061008e9190610c8a565b610145565b6040516100a09190610eac565b60405180910390f35b6100c360048036038101906100be9190610c61565b6101ad565b6040516100d09190610eac565b60405180910390f35b6100e1610ac9565b6040516100ee9190610f67565b60405180910390f35b610111600480360381019061010c9190610c61565b610acf565b60405161011e9190610f67565b60405180910390f35b61012f610c11565b60405161013c9190610e68565b60405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661019d57600080fd5b8160028190555060019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561023c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023390610ee7565b60405180910390fd5b60006060600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c157600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016102e09190610e68565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161036a9190610e51565b6000604051808303816000865af19150503d80600081146103a7576040519150601f19603f3d011682016040523d82523d6000602084013e6103ac565b606091505b50809250819350505060007f01000000000000000000000000000000000000000000000000000000000000000281601f81518110610413577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156104c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104b790610ec7565b60405180910390fd5b5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460405160240161050b9190610e68565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516105959190610e51565b6000604051808303816000865af19150503d80600081146105d2576040519150601f19603f3d011682016040523d82523d6000602084013e6105d7565b606091505b50809250819350505060007f01000000000000000000000000000000000000000000000000000000000000000281601f8151811061063e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146106ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e190610f47565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016107349190610e68565b6040516020818303038152906040527f0a3b0a4f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516107be9190610e51565b6000604051808303816000865af19150503d80600081146107fb576040519150601f19603f3d011682016040523d82523d6000602084013e610800565b606091505b50809250819350505081610849576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084090610f27565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684600254604051602401610897929190610e83565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516109219190610e51565b6000604051808303816000865af19150503d806000811461095e576040519150601f19603f3d011682016040523d82523d6000602084013e610963565b606091505b50809250819350505081610a3557600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d60706002546040516109f29190610f67565b60405180910390a36040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2c90610f07565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f45c201a59ac545000ead84f30b2db67da23353aa1d58ac522c48505412143ffa600254604051610ab69190610f67565b60405180910390a3600192505050919050565b60025481565b6000806060600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684604051602401610b1e9190610e68565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610ba89190610e51565b6000604051808303816000865af19150503d8060008114610be5576040519150601f19603f3d011682016040523d82523d6000602084013e610bea565b606091505b5080925081935050508115610c055760065492505050610c0c565b6000925050505b919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081359050610c4681611024565b92915050565b600081359050610c5b8161103b565b92915050565b600060208284031215610c7357600080fd5b6000610c8184828501610c37565b91505092915050565b600060208284031215610c9c57600080fd5b6000610caa84828501610c4c565b91505092915050565b610cbc81610fa9565b82525050565b610ccb81610fbb565b82525050565b6000610cdc82610f82565b610ce68185610f8d565b9350610cf6818560208601610ff1565b80840191505092915050565b6000610d0f601883610f98565b91507f4552525f4143434f554e545f4e4f545f494e5f494e44455800000000000000006000830152602082019050919050565b6000610d4f600a83610f98565b91507f4552525f414343455353000000000000000000000000000000000000000000006000830152602082019050919050565b6000610d8f600c83610f98565b91507f4552525f5452414e5346455200000000000000000000000000000000000000006000830152602082019050919050565b6000610dcf600d83610f98565b91507f4552525f4d41524b5f4641494c000000000000000000000000000000000000006000830152602082019050919050565b6000610e0f601083610f98565b91507f4552525f4143434f554e545f55534544000000000000000000000000000000006000830152602082019050919050565b610e4b81610fe7565b82525050565b6000610e5d8284610cd1565b915081905092915050565b6000602082019050610e7d6000830184610cb3565b92915050565b6000604082019050610e986000830185610cb3565b610ea56020830184610e42565b9392505050565b6000602082019050610ec16000830184610cc2565b92915050565b60006020820190508181036000830152610ee081610d02565b9050919050565b60006020820190508181036000830152610f0081610d42565b9050919050565b60006020820190508181036000830152610f2081610d82565b9050919050565b60006020820190508181036000830152610f4081610dc2565b9050919050565b60006020820190508181036000830152610f6081610e02565b9050919050565b6000602082019050610f7c6000830184610e42565b92915050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610fb482610fc7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561100f578082015181840152602081019050610ff4565b8381111561101e576000848401525b50505050565b61102d81610fa9565b811461103857600080fd5b50565b61104481610fe7565b811461104f57600080fd5b5056fea26469706673582212200b1f0c589921b53409bb66c659727ec4bc227ac653cebb5ada8127dc7a92330364736f6c63430008000033
+\ No newline at end of file
diff --git a/python/erc20_single_shot_faucet/data/ERC20SingleShotFaucet.json b/python/erc20_single_shot_faucet/data/ERC20SingleShotFaucet.json
@@ -1 +1 @@
-[{"inputs":[{"internalType":"address[]","name":"_overriders","type":"address[]"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_store","type":"address"},{"internalType":"address","name":"_accountsIndex","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetAmountChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetUsed","type":"event"},{"inputs":[],"name":"amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cooldown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
+[{"inputs":[{"internalType":"address[]","name":"_overriders","type":"address[]"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_store","type":"address"},{"internalType":"address","name":"_accountsIndex","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetAmountChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetUsed","type":"event"},{"inputs":[],"name":"amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"cooldown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
diff --git a/python/erc20_single_shot_faucet/data/ERC20SingleShotFaucetStorage.bin b/python/erc20_single_shot_faucet/data/ERC20SingleShotFaucetStorage.bin
@@ -1 +1 @@
-608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610547806100606000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630a3b0a4f146100675780633ef2501314610097578063764b07e7146100c757806379ba5097146100f75780638da5cb5b14610115578063f2fde38b14610133575b600080fd5b610081600480360381019061007c919061043f565b61014f565b60405161008e91906104a1565b60405180910390f35b6100b160048036038101906100ac919061043f565b6101b2565b6040516100be91906104a1565b60405180910390f35b6100e160048036038101906100dc919061043f565b610208565b6040516100ee91906104a1565b60405180910390f35b6100ff610228565b60405161010c91906104a1565b60405180910390f35b61011d61036a565b60405161012a9190610486565b60405180910390f35b61014d6004803603810190610148919061043f565b61038e565b005b60006001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60026020528060005260406000206000915054906101000a900460ff1681565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102a857600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600191505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103e657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081359050610439816104fa565b92915050565b60006020828403121561045157600080fd5b600061045f8482850161042a565b91505092915050565b610471816104bc565b82525050565b610480816104ce565b82525050565b600060208201905061049b6000830184610468565b92915050565b60006020820190506104b66000830184610477565b92915050565b60006104c7826104da565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b610503816104bc565b811461050e57600080fd5b5056fea2646970667358221220dc93d6966dbb68be7d5bf110ec4c45adb64952fd923a943b07463b1421646b1764736f6c63430008000033
-\ No newline at end of file
+608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610564806100606000396000f3fe608060405234801561001057600080fd5b506004361061007f576000357c0100000000000000000000000000000000000000000000000000000000900480630a3b0a4f146100845780633ef25013146100b4578063764b07e7146100e457806379ba5097146101145780638da5cb5b14610132578063f2fde38b14610150575b600080fd5b61009e6004803603810190610099919061045c565b61016c565b6040516100ab91906104be565b60405180910390f35b6100ce60048036038101906100c9919061045c565b6101cf565b6040516100db91906104be565b60405180910390f35b6100fe60048036038101906100f9919061045c565b610225565b60405161010b91906104be565b60405180910390f35b61011c610245565b60405161012991906104be565b60405180910390f35b61013a610387565b60405161014791906104a3565b60405180910390f35b61016a6004803603810190610165919061045c565b6103ab565b005b60006001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60026020528060005260406000206000915054906101000a900460ff1681565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102c557600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600191505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461040357600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008135905061045681610517565b92915050565b60006020828403121561046e57600080fd5b600061047c84828501610447565b91505092915050565b61048e816104d9565b82525050565b61049d816104eb565b82525050565b60006020820190506104b86000830184610485565b92915050565b60006020820190506104d36000830184610494565b92915050565b60006104e4826104f7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b610520816104d9565b811461052b57600080fd5b5056fea2646970667358221220a567f739e1266b917dd227567ff6caeede292b0bc481364bff4c7a1089bf66cd64736f6c63430008000033
+\ No newline at end of file
diff --git a/python/erc20_single_shot_faucet/runnable/deploy.py b/python/erc20_single_shot_faucet/runnable/deploy.py
@@ -13,7 +13,9 @@ import logging
# third-party imports
import web3
-
+from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer
+from crypto_dev_signer.keystore import DictKeystore
+from crypto_dev_signer.eth.helper import EthTxExecutor
logging.basicConfig(level=logging.WARNING)
logg = logging.getLogger()
@@ -26,25 +28,52 @@ data_dir = os.path.join(script_dir, '..', 'data')
argparser = argparse.ArgumentParser()
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
-argparser.add_argument('-a', '--approvers', dest='a', action='append', type=str, help='Approver account to add')
-argparser.add_argument('-o', '--owner', dest='o', type=str, help='Owner account (provider must have private key)')
-argparser.add_argument('-t', '--token-address', dest='t', required=True, type=str, help='Token to add faucet for')
-argparser.add_argument('--set-amount', dest='amount', default=0, type=int, help='Initial amount to set. Will be 0 if not set!')
-argparser.add_argument('-i', '--account-index-address', dest='i', required=False, type=str, help='Accounts index to verify requesting address against (if not specified, any address may use the faucet')
+argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed')
+argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed')
+argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='Ethereum:1', help='Chain specification string')
+argparser.add_argument('--editor', action='append', type=str, help='Amount editor account to add')
+argparser.add_argument('-a', '--signer-address', dest='a', type=str, help='Owner account (provider must have private key)')
+argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing')
+argparser.add_argument('--token-address', dest='token_address', required=True, type=str, help='Token to add faucet for')
+argparser.add_argument('--set-amount', dest='set_amount', default=0, type=int, help='Initial amount to set. Will be 0 if not set!')
+argparser.add_argument('--accounts-index-address', dest='accounts_index_address', required=False, type=str, help='Accounts index to verify requesting address against (if not specified, any address may use the faucet')
argparser.add_argument('--abi-dir', dest='abi_dir', type=str, default=data_dir, help='Directory containing bytecode and abi (default: {})'.format(data_dir))
argparser.add_argument('-v', action='store_true', help='Be verbose')
+argparser.add_argument('-vv', action='store_true', help='Be more verbose')
args = argparser.parse_args()
-if args.v:
+if args.vv:
logg.setLevel(logging.DEBUG)
+elif args.v:
+ logg.setLevel(logging.INFO)
-def main():
- w3 = web3.Web3(web3.Web3.HTTPProvider(args.p))
- w3.eth.defaultAccount = w3.eth.accounts[0]
- if args.o != None:
- w3.eth.defaultAccount = web3.Web3.toChecksumAddress(args.o)
+block_last = args.w
+block_all = args.ww
+
+w3 = web3.Web3(web3.Web3.HTTPProvider(args.p))
+
+signer_address = None
+keystore = DictKeystore()
+if args.y != None:
+ logg.debug('loading keystore file {}'.format(args.y))
+ signer_address = keystore.import_keystore_file(args.y)
+ logg.debug('now have key for signer address {}'.format(signer_address))
+signer = EIP155Signer(keystore)
+
+chain_pair = args.i.split(':')
+chain_id = int(chain_pair[1])
- token_address = args.t
+helper = EthTxExecutor(
+ w3,
+ signer_address,
+ signer,
+ chain_id,
+ block=args.ww,
+ )
+
+
+def main():
+ token_address = args.token_address
f = open(os.path.join(args.abi_dir, 'ERC20SingleShotFaucetStorage.json'), 'r')
abi = json.load(f)
@@ -55,9 +84,13 @@ def main():
f.close()
c = w3.eth.contract(abi=abi, bytecode=bytecode)
- tx_hash = c.constructor().transact()
- r = w3.eth.getTransactionReceipt(tx_hash)
- store_address = r.contractAddress
+ (tx_hash, rcpt) = helper.sign_and_send(
+ [
+ c.constructor().buildTransaction
+ ],
+ force_wait=True,
+ )
+ store_address = rcpt.contractAddress
f = open(os.path.join(args.abi_dir, 'ERC20SingleShotFaucet.json'), 'r')
abi = json.load(f)
@@ -69,25 +102,34 @@ def main():
c = w3.eth.contract(abi=abi, bytecode=bytecode)
- approvers = [w3.eth.accounts[0]]
- if args.a != None:
- for a in args.a:
- approvers.append(a)
+ editors = [signer_address]
+ if args.editor != None:
+ for a in args.editor:
+ editors.append(a)
logg.info('add approver {}'.format(a))
accounts_index_address = '0x0000000000000000000000000000000000000000'
- if args.i != None:
- accounts_index_address = args.i
-
- tx_hash = c.constructor(approvers, token_address, store_address, accounts_index_address).transact()
- rcpt = w3.eth.getTransactionReceipt(tx_hash)
+ if args.accounts_index_address != None:
+ accounts_index_address = args.accounts_index_address
+
+ (tx_hash, rcpt) = helper.sign_and_send(
+ [
+ c.constructor(editors, token_address, store_address, accounts_index_address).buildTransaction,
+ ],
+ force_wait=True,
+ )
address = rcpt.contractAddress
- if args.amount > 0:
+ if args.set_amount > 0:
c = w3.eth.contract(abi=abi, address=address)
- tx_hash = c.functions.setAmount(args.amount).transact()
- logg.debug('setting initial ammount to {} tx_hash {}'.format(args.amount, tx_hash))
- r = w3.eth.getTransactionReceipt(tx_hash)
+ (tx_hash, rcpt) = helper.sign_and_send(
+ [
+ c.functions.setAmount(args.set_amount).buildTransaction,
+ ],
+ force_wait=True,
+ )
+
+ logg.debug('setting initial ammount to {} tx_hash {}'.format(args.set_amount, tx_hash))
amount = c.functions.amount().call()
logg.info('set initial ammount tx_hash {}'.format(amount))
diff --git a/python/setup.cfg b/python/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = erc20-single-shot-faucet
-version = 0.1.2
+version = 0.2.0a1
description = ERC20 token faucet that can be used once per account
author = Louis Holbrook
author_email = dev@holbrook.no
@@ -28,6 +28,7 @@ packages =
erc20_single_shot_faucet.runnable
install_requires =
web3==5.12.2
+ crypto-dev-signer~=0.4.13b2
tests_require =
eth-tester==0.5.0b2
py-evm==0.3.0a20
diff --git a/solidity/ERC20SingleShotFaucet.bin b/solidity/ERC20SingleShotFaucet.bin
@@ -1 +1 @@
-60806040523480156200001157600080fd5b506040516200137138038062001371833981810160405281019062000037919062000310565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060005b8451811015620001895760018060008784815181106200011a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080620001809062000436565b915050620000d1565b5081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050620004fc565b60006200026e6200026884620003c9565b62000395565b905080838252602082019050828560208602820111156200028e57600080fd5b60005b85811015620002c25781620002a78882620002cc565b84526020840193506020830192505060018101905062000291565b5050509392505050565b600081519050620002dd81620004e2565b92915050565b600082601f830112620002f557600080fd5b81516200030784826020860162000257565b91505092915050565b600080600080608085870312156200032757600080fd5b600085015167ffffffffffffffff8111156200034257600080fd5b6200035087828801620002e3565b94505060206200036387828801620002cc565b93505060406200037687828801620002cc565b92505060606200038987828801620002cc565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620003bf57620003be620004b3565b5b8060405250919050565b600067ffffffffffffffff821115620003e757620003e6620004b3565b5b602082029050602081019050919050565b600062000405826200040c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600062000443826200042c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141562000479576200047862000484565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620004ed81620003f8565b8114620004f957600080fd5b50565b610e65806200050c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063271f88b41461005c57806363e4bff41461008c578063787a08a6146100bc578063aa8c217c146100da578063fc0c546a146100f8575b600080fd5b61007660048036038101906100719190610a67565b610116565b6040516100839190610c89565b60405180910390f35b6100a660048036038101906100a19190610a3e565b61017e565b6040516100b39190610c89565b60405180910390f35b6100c46109de565b6040516100d19190610d44565b60405180910390f35b6100e26109e8565b6040516100ef9190610d44565b60405180910390f35b6101006109ee565b60405161010d9190610c45565b60405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661016e57600080fd5b8160028190555060019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561020d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161020490610cc4565b60405180910390fd5b60006060600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461043457600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016102b19190610c45565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161033b9190610c2e565b6000604051808303816000865af19150503d8060008114610378576040519150601f19603f3d011682016040523d82523d6000602084013e61037d565b606091505b508092508193505050600060f81b81601f815181106103c5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610433576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042a90610ca4565b60405180910390fd5b5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460405160240161047e9190610c45565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516105089190610c2e565b6000604051808303816000865af19150503d8060008114610545576040519150601f19603f3d011682016040523d82523d6000602084013e61054a565b606091505b508092508193505050600060f81b81601f81518110610592577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146105ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f690610d24565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016106499190610c45565b6040516020818303038152906040527f0a3b0a4f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516106d39190610c2e565b6000604051808303816000865af19150503d8060008114610710576040519150601f19603f3d011682016040523d82523d6000602084013e610715565b606091505b5080925081935050508161075e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075590610d04565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846002546040516024016107ac929190610c60565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516108369190610c2e565b6000604051808303816000865af19150503d8060008114610873576040519150601f19603f3d011682016040523d82523d6000602084013e610878565b606091505b5080925081935050508161094a57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d60706002546040516109079190610d44565b60405180910390a36040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094190610ce4565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f45c201a59ac545000ead84f30b2db67da23353aa1d58ac522c48505412143ffa6002546040516109cb9190610d44565b60405180910390a3600192505050919050565b6000600654905090565b60025481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081359050610a2381610e01565b92915050565b600081359050610a3881610e18565b92915050565b600060208284031215610a5057600080fd5b6000610a5e84828501610a14565b91505092915050565b600060208284031215610a7957600080fd5b6000610a8784828501610a29565b91505092915050565b610a9981610d86565b82525050565b610aa881610d98565b82525050565b6000610ab982610d5f565b610ac38185610d6a565b9350610ad3818560208601610dce565b80840191505092915050565b6000610aec601883610d75565b91507f4552525f4143434f554e545f4e4f545f494e5f494e44455800000000000000006000830152602082019050919050565b6000610b2c600a83610d75565b91507f4552525f414343455353000000000000000000000000000000000000000000006000830152602082019050919050565b6000610b6c600c83610d75565b91507f4552525f5452414e5346455200000000000000000000000000000000000000006000830152602082019050919050565b6000610bac600d83610d75565b91507f4552525f4d41524b5f4641494c000000000000000000000000000000000000006000830152602082019050919050565b6000610bec601083610d75565b91507f4552525f4143434f554e545f55534544000000000000000000000000000000006000830152602082019050919050565b610c2881610dc4565b82525050565b6000610c3a8284610aae565b915081905092915050565b6000602082019050610c5a6000830184610a90565b92915050565b6000604082019050610c756000830185610a90565b610c826020830184610c1f565b9392505050565b6000602082019050610c9e6000830184610a9f565b92915050565b60006020820190508181036000830152610cbd81610adf565b9050919050565b60006020820190508181036000830152610cdd81610b1f565b9050919050565b60006020820190508181036000830152610cfd81610b5f565b9050919050565b60006020820190508181036000830152610d1d81610b9f565b9050919050565b60006020820190508181036000830152610d3d81610bdf565b9050919050565b6000602082019050610d596000830184610c1f565b92915050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610d9182610da4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015610dec578082015181840152602081019050610dd1565b83811115610dfb576000848401525b50505050565b610e0a81610d86565b8114610e1557600080fd5b50565b610e2181610dc4565b8114610e2c57600080fd5b5056fea2646970667358221220d010396d2a5f28dd4867034197bf0a83e00770c5443b8030da0aa7902b8b1d3a64736f6c63430008000033
-\ No newline at end of file
+60806040523480156200001157600080fd5b50604051620015bb380380620015bb833981810160405281019062000037919062000337565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060005b8451811015620001895760018060008784815181106200011a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808062000180906200045d565b915050620000d1565b5081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6006819055505050505062000523565b6000620002956200028f84620003f0565b620003bc565b90508083825260208201905082856020860282011115620002b557600080fd5b60005b85811015620002e95781620002ce8882620002f3565b845260208401935060208301925050600181019050620002b8565b5050509392505050565b600081519050620003048162000509565b92915050565b600082601f8301126200031c57600080fd5b81516200032e8482602086016200027e565b91505092915050565b600080600080608085870312156200034e57600080fd5b600085015167ffffffffffffffff8111156200036957600080fd5b62000377878288016200030a565b94505060206200038a87828801620002f3565b93505060406200039d87828801620002f3565b9250506060620003b087828801620002f3565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620003e657620003e5620004da565b5b8060405250919050565b600067ffffffffffffffff8211156200040e576200040d620004da565b5b602082029050602081019050919050565b60006200042c8262000433565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006200046a8262000453565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415620004a0576200049f620004ab565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b62000514816200041f565b81146200052057600080fd5b50565b61108880620005336000396000f3fe608060405234801561001057600080fd5b5060043610610074576000357c010000000000000000000000000000000000000000000000000000000090048063271f88b41461007957806363e4bff4146100a9578063aa8c217c146100d9578063b222e0c2146100f7578063fc0c546a14610127575b600080fd5b610093600480360381019061008e9190610c8a565b610145565b6040516100a09190610eac565b60405180910390f35b6100c360048036038101906100be9190610c61565b6101ad565b6040516100d09190610eac565b60405180910390f35b6100e1610ac9565b6040516100ee9190610f67565b60405180910390f35b610111600480360381019061010c9190610c61565b610acf565b60405161011e9190610f67565b60405180910390f35b61012f610c11565b60405161013c9190610e68565b60405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661019d57600080fd5b8160028190555060019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561023c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023390610ee7565b60405180910390fd5b60006060600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c157600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016102e09190610e68565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161036a9190610e51565b6000604051808303816000865af19150503d80600081146103a7576040519150601f19603f3d011682016040523d82523d6000602084013e6103ac565b606091505b50809250819350505060007f01000000000000000000000000000000000000000000000000000000000000000281601f81518110610413577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156104c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104b790610ec7565b60405180910390fd5b5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460405160240161050b9190610e68565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516105959190610e51565b6000604051808303816000865af19150503d80600081146105d2576040519150601f19603f3d011682016040523d82523d6000602084013e6105d7565b606091505b50809250819350505060007f01000000000000000000000000000000000000000000000000000000000000000281601f8151811061063e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146106ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e190610f47565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016107349190610e68565b6040516020818303038152906040527f0a3b0a4f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516107be9190610e51565b6000604051808303816000865af19150503d80600081146107fb576040519150601f19603f3d011682016040523d82523d6000602084013e610800565b606091505b50809250819350505081610849576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084090610f27565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684600254604051602401610897929190610e83565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516109219190610e51565b6000604051808303816000865af19150503d806000811461095e576040519150601f19603f3d011682016040523d82523d6000602084013e610963565b606091505b50809250819350505081610a3557600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d60706002546040516109f29190610f67565b60405180910390a36040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2c90610f07565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f45c201a59ac545000ead84f30b2db67da23353aa1d58ac522c48505412143ffa600254604051610ab69190610f67565b60405180910390a3600192505050919050565b60025481565b6000806060600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684604051602401610b1e9190610e68565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610ba89190610e51565b6000604051808303816000865af19150503d8060008114610be5576040519150601f19603f3d011682016040523d82523d6000602084013e610bea565b606091505b5080925081935050508115610c055760065492505050610c0c565b6000925050505b919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081359050610c4681611024565b92915050565b600081359050610c5b8161103b565b92915050565b600060208284031215610c7357600080fd5b6000610c8184828501610c37565b91505092915050565b600060208284031215610c9c57600080fd5b6000610caa84828501610c4c565b91505092915050565b610cbc81610fa9565b82525050565b610ccb81610fbb565b82525050565b6000610cdc82610f82565b610ce68185610f8d565b9350610cf6818560208601610ff1565b80840191505092915050565b6000610d0f601883610f98565b91507f4552525f4143434f554e545f4e4f545f494e5f494e44455800000000000000006000830152602082019050919050565b6000610d4f600a83610f98565b91507f4552525f414343455353000000000000000000000000000000000000000000006000830152602082019050919050565b6000610d8f600c83610f98565b91507f4552525f5452414e5346455200000000000000000000000000000000000000006000830152602082019050919050565b6000610dcf600d83610f98565b91507f4552525f4d41524b5f4641494c000000000000000000000000000000000000006000830152602082019050919050565b6000610e0f601083610f98565b91507f4552525f4143434f554e545f55534544000000000000000000000000000000006000830152602082019050919050565b610e4b81610fe7565b82525050565b6000610e5d8284610cd1565b915081905092915050565b6000602082019050610e7d6000830184610cb3565b92915050565b6000604082019050610e986000830185610cb3565b610ea56020830184610e42565b9392505050565b6000602082019050610ec16000830184610cc2565b92915050565b60006020820190508181036000830152610ee081610d02565b9050919050565b60006020820190508181036000830152610f0081610d42565b9050919050565b60006020820190508181036000830152610f2081610d82565b9050919050565b60006020820190508181036000830152610f4081610dc2565b9050919050565b60006020820190508181036000830152610f6081610e02565b9050919050565b6000602082019050610f7c6000830184610e42565b92915050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610fb482610fc7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b8381101561100f578082015181840152602081019050610ff4565b8381111561101e576000848401525b50505050565b61102d81610fa9565b811461103857600080fd5b50565b61104481610fe7565b811461104f57600080fd5b5056fea26469706673582212200b1f0c589921b53409bb66c659727ec4bc227ac653cebb5ada8127dc7a92330364736f6c63430008000033
+\ No newline at end of file
diff --git a/solidity/ERC20SingleShotFaucet.json b/solidity/ERC20SingleShotFaucet.json
@@ -1 +1 @@
-[{"inputs":[{"internalType":"address[]","name":"_overriders","type":"address[]"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_store","type":"address"},{"internalType":"address","name":"_accountsIndex","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetAmountChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetUsed","type":"event"},{"inputs":[],"name":"amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cooldown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
+[{"inputs":[{"internalType":"address[]","name":"_overriders","type":"address[]"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_store","type":"address"},{"internalType":"address","name":"_accountsIndex","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetAmountChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"FaucetUsed","type":"event"},{"inputs":[],"name":"amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"cooldown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
diff --git a/solidity/ERC20SingleShotFaucet.sol b/solidity/ERC20SingleShotFaucet.sol
@@ -1,4 +1,4 @@
-pragma solidity >=0.6.21;
+pragma solidity >0.6.11;
// SPDX-License-Identifier: GPL-3.0-or-later
@@ -10,13 +10,13 @@ contract SingleShotFaucet {
address public token;
address store;
address accountsIndex;
- uint256 zero;
+ uint256 cooldownDisabled;
event FaucetUsed(address indexed _recipient, address indexed _token, uint256 _value);
event FaucetFail(address indexed _recipient, address indexed _token, uint256 _value);
event FaucetAmountChange(address indexed _recipient, uint256 _value);
- constructor(address[] memory _overriders, address _token, address _store, address _accountsIndex) {
+ constructor(address[] memory _overriders, address _token, address _store, address _accountsIndex) public {
owner = msg.sender;
overriders[msg.sender] = true;
for (uint i = 0; i < _overriders.length; i++) {
@@ -25,6 +25,7 @@ contract SingleShotFaucet {
store = _store;
token = _token;
accountsIndex = _accountsIndex;
+ cooldownDisabled = uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
}
function setAmount(uint256 _amount) public returns (bool) {
@@ -62,7 +63,15 @@ contract SingleShotFaucet {
return true;
}
- function cooldown() public view returns (uint256) {
- return zero;
+ function cooldown(address _recipient) public returns (uint256) {
+ bool _ok;
+ bytes memory _result;
+
+ (_ok, _result) = store.call(abi.encodeWithSignature("have(address)", _recipient));
+ if (_ok) {
+ return cooldownDisabled;
+ } else {
+ return 0;
+ }
}
}
diff --git a/solidity/ERC20SingleShotFaucetStorage.bin b/solidity/ERC20SingleShotFaucetStorage.bin
@@ -1 +1 @@
-608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610547806100606000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630a3b0a4f146100675780633ef2501314610097578063764b07e7146100c757806379ba5097146100f75780638da5cb5b14610115578063f2fde38b14610133575b600080fd5b610081600480360381019061007c919061043f565b61014f565b60405161008e91906104a1565b60405180910390f35b6100b160048036038101906100ac919061043f565b6101b2565b6040516100be91906104a1565b60405180910390f35b6100e160048036038101906100dc919061043f565b610208565b6040516100ee91906104a1565b60405180910390f35b6100ff610228565b60405161010c91906104a1565b60405180910390f35b61011d61036a565b60405161012a9190610486565b60405180910390f35b61014d6004803603810190610148919061043f565b61038e565b005b60006001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60026020528060005260406000206000915054906101000a900460ff1681565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102a857600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600191505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103e657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081359050610439816104fa565b92915050565b60006020828403121561045157600080fd5b600061045f8482850161042a565b91505092915050565b610471816104bc565b82525050565b610480816104ce565b82525050565b600060208201905061049b6000830184610468565b92915050565b60006020820190506104b66000830184610477565b92915050565b60006104c7826104da565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b610503816104bc565b811461050e57600080fd5b5056fea2646970667358221220dc93d6966dbb68be7d5bf110ec4c45adb64952fd923a943b07463b1421646b1764736f6c63430008000033
-\ No newline at end of file
+608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610564806100606000396000f3fe608060405234801561001057600080fd5b506004361061007f576000357c0100000000000000000000000000000000000000000000000000000000900480630a3b0a4f146100845780633ef25013146100b4578063764b07e7146100e457806379ba5097146101145780638da5cb5b14610132578063f2fde38b14610150575b600080fd5b61009e6004803603810190610099919061045c565b61016c565b6040516100ab91906104be565b60405180910390f35b6100ce60048036038101906100c9919061045c565b6101cf565b6040516100db91906104be565b60405180910390f35b6100fe60048036038101906100f9919061045c565b610225565b60405161010b91906104be565b60405180910390f35b61011c610245565b60405161012991906104be565b60405180910390f35b61013a610387565b60405161014791906104a3565b60405180910390f35b61016a6004803603810190610165919061045c565b6103ab565b005b60006001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60026020528060005260406000206000915054906101000a900460ff1681565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102c557600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600191505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461040357600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008135905061045681610517565b92915050565b60006020828403121561046e57600080fd5b600061047c84828501610447565b91505092915050565b61048e816104d9565b82525050565b61049d816104eb565b82525050565b60006020820190506104b86000830184610485565b92915050565b60006020820190506104d36000830184610494565b92915050565b60006104e4826104f7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b610520816104d9565b811461052b57600080fd5b5056fea2646970667358221220a567f739e1266b917dd227567ff6caeede292b0bc481364bff4c7a1089bf66cd64736f6c63430008000033
+\ No newline at end of file
diff --git a/solidity/ERC20SingleShotFaucetStorage.sol b/solidity/ERC20SingleShotFaucetStorage.sol
@@ -1,4 +1,4 @@
-pragma solidity >=0.6.21;
+pragma solidity >0.6.11;
// SPDX-License-Identifier: GPL-3.0-or-later
@@ -12,7 +12,7 @@ contract SingleShotFaucetStorage {
// EIP 173
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
- constructor() {
+ constructor() public {
owner = msg.sender;
}
diff --git a/solidity/Makefile b/solidity/Makefile
@@ -1,11 +1,12 @@
+SOLC = /usr/bin/solc
+
all:
- solc --bin ERC20SingleShotFaucetStorage.sol | awk 'NR>3' > ERC20SingleShotFaucetStorage.bin
+ $(SOLC) --bin ERC20SingleShotFaucetStorage.sol --evm-version byzantium | awk 'NR>3' > ERC20SingleShotFaucetStorage.bin
truncate -s -1 ERC20SingleShotFaucetStorage.bin
- solc --abi ERC20SingleShotFaucetStorage.sol | awk 'NR>3' > ERC20SingleShotFaucetStorage.json
- solc --bin ERC20SingleShotFaucet.sol | awk 'NR>3' > ERC20SingleShotFaucet.bin
+ $(SOLC) --abi ERC20SingleShotFaucetStorage.sol --evm-version byzantium | awk 'NR>3' > ERC20SingleShotFaucetStorage.json
+ $(SOLC) --bin ERC20SingleShotFaucet.sol --evm-version byzantium | awk 'NR>3' > ERC20SingleShotFaucet.bin
truncate -s -1 ERC20SingleShotFaucet.bin
- solc --abi ERC20SingleShotFaucet.sol | awk 'NR==4' > ERC20SingleShotFaucet.json
- #solc --abi IERC20SingleShotFaucetStorage.sol | awk 'NR>3' > IERC20SingleShotFaucetStorage.abi.json
+ $(SOLC) --abi ERC20SingleShotFaucet.sol --evm-version byzantium | awk 'NR==4' > ERC20SingleShotFaucet.json
install: all
cp -v *{json,bin} ../python/erc20_single_shot_faucet/data/