commit 0c023ac3633481a58a99b6f11a6b7ade7c53581b
parent ac7054965effaa293d5064f98a2879db81227e7d
Author: nolash <dev@holbrook.no>
Date: Fri, 1 Jan 2021 21:05:59 +0100
Clear up owner interface, remove gimme function
Diffstat:
8 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/python/CHANGELOG b/python/CHANGELOG
@@ -1,3 +1,5 @@
+- 0.1.2
+ * Remove 'gimme' function
- 0.1.1
* Add set amount on deploy executable
- 0.1.0
diff --git a/python/setup.cfg b/python/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = erc20-single-shot-faucet
-version = 0.1.1
+version = 0.1.2
description = ERC20 token faucet that can be used once per account
author = Louis Holbrook
author_email = dev@holbrook.no
diff --git a/solidity/ERC20SingleShotFaucet.bin b/solidity/ERC20SingleShotFaucet.bin
@@ -1 +1 @@
-60806040523480156200001157600080fd5b506040516200137738038062001377833981810160405281019062000037919062000310565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060005b8451811015620001895760018060008784815181106200011a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080620001809062000436565b915050620000d1565b5081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050620004fc565b60006200026e6200026884620003c9565b62000395565b905080838252602082019050828560208602820111156200028e57600080fd5b60005b85811015620002c25781620002a78882620002cc565b84526020840193506020830192505060018101905062000291565b5050509392505050565b600081519050620002dd81620004e2565b92915050565b600082601f830112620002f557600080fd5b81516200030784826020860162000257565b91505092915050565b600080600080608085870312156200032757600080fd5b600085015167ffffffffffffffff8111156200034257600080fd5b6200035087828801620002e3565b94505060206200036387828801620002cc565b93505060406200037687828801620002cc565b92505060606200038987828801620002cc565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620003bf57620003be620004b3565b5b8060405250919050565b600067ffffffffffffffff821115620003e757620003e6620004b3565b5b602082029050602081019050919050565b600062000405826200040c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600062000443826200042c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141562000479576200047862000484565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620004ed81620003f8565b8114620004f957600080fd5b50565b610e6b806200050c6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063271f88b41461005c57806363e4bff41461008c578063aa8c217c146100bc578063de82efb4146100da578063fc0c546a146100f8575b600080fd5b61007660048036038101906100719190610a6d565b610116565b6040516100839190610c8f565b60405180910390f35b6100a660048036038101906100a19190610a44565b61017e565b6040516100b39190610c8f565b60405180910390f35b6100c46109de565b6040516100d19190610d4a565b60405180910390f35b6100e26109e4565b6040516100ef9190610c8f565b60405180910390f35b6101006109f4565b60405161010d9190610c4b565b60405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661016e57600080fd5b8160028190555060019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561020d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161020490610cca565b60405180910390fd5b60006060600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461043457600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016102b19190610c4b565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161033b9190610c34565b6000604051808303816000865af19150503d8060008114610378576040519150601f19603f3d011682016040523d82523d6000602084013e61037d565b606091505b508092508193505050600060f81b81601f815181106103c5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415610433576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042a90610caa565b60405180910390fd5b5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460405160240161047e9190610c4b565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516105089190610c34565b6000604051808303816000865af19150503d8060008114610545576040519150601f19603f3d011682016040523d82523d6000602084013e61054a565b606091505b508092508193505050600060f81b81601f81518110610592577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146105ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f690610d2a565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016106499190610c4b565b6040516020818303038152906040527f0a3b0a4f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516106d39190610c34565b6000604051808303816000865af19150503d8060008114610710576040519150601f19603f3d011682016040523d82523d6000602084013e610715565b606091505b5080925081935050508161075e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075590610d0a565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846002546040516024016107ac929190610c66565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516108369190610c34565b6000604051808303816000865af19150503d8060008114610873576040519150601f19603f3d011682016040523d82523d6000602084013e610878565b606091505b5080925081935050508161094a57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d60706002546040516109079190610d4a565b60405180910390a36040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094190610cea565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f45c201a59ac545000ead84f30b2db67da23353aa1d58ac522c48505412143ffa6002546040516109cb9190610d4a565b60405180910390a3600192505050919050565b60025481565b60006109ef3361017e565b905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081359050610a2981610e07565b92915050565b600081359050610a3e81610e1e565b92915050565b600060208284031215610a5657600080fd5b6000610a6484828501610a1a565b91505092915050565b600060208284031215610a7f57600080fd5b6000610a8d84828501610a2f565b91505092915050565b610a9f81610d8c565b82525050565b610aae81610d9e565b82525050565b6000610abf82610d65565b610ac98185610d70565b9350610ad9818560208601610dd4565b80840191505092915050565b6000610af2601883610d7b565b91507f4552525f4143434f554e545f4e4f545f494e5f494e44455800000000000000006000830152602082019050919050565b6000610b32600a83610d7b565b91507f4552525f414343455353000000000000000000000000000000000000000000006000830152602082019050919050565b6000610b72600c83610d7b565b91507f4552525f5452414e5346455200000000000000000000000000000000000000006000830152602082019050919050565b6000610bb2600d83610d7b565b91507f4552525f4d41524b5f4641494c000000000000000000000000000000000000006000830152602082019050919050565b6000610bf2601083610d7b565b91507f4552525f4143434f554e545f55534544000000000000000000000000000000006000830152602082019050919050565b610c2e81610dca565b82525050565b6000610c408284610ab4565b915081905092915050565b6000602082019050610c606000830184610a96565b92915050565b6000604082019050610c7b6000830185610a96565b610c886020830184610c25565b9392505050565b6000602082019050610ca46000830184610aa5565b92915050565b60006020820190508181036000830152610cc381610ae5565b9050919050565b60006020820190508181036000830152610ce381610b25565b9050919050565b60006020820190508181036000830152610d0381610b65565b9050919050565b60006020820190508181036000830152610d2381610ba5565b9050919050565b60006020820190508181036000830152610d4381610be5565b9050919050565b6000602082019050610d5f6000830184610c25565b92915050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610d9782610daa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015610df2578082015181840152602081019050610dd7565b83811115610e01576000848401525b50505050565b610e1081610d8c565b8114610e1b57600080fd5b50565b610e2781610dca565b8114610e3257600080fd5b5056fea26469706673582212204e2aa7962fa1a8b087c473c1b55b4176c808a1fee1b7a281257718c4d337985464736f6c63430008000033
-\ No newline at end of file
+60806040523480156200001157600080fd5b506040516200133e3803806200133e833981810160405281019062000037919062000310565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060005b8451811015620001895760018060008784815181106200011a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080620001809062000436565b915050620000d1565b5081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050620004fc565b60006200026e6200026884620003c9565b62000395565b905080838252602082019050828560208602820111156200028e57600080fd5b60005b85811015620002c25781620002a78882620002cc565b84526020840193506020830192505060018101905062000291565b5050509392505050565b600081519050620002dd81620004e2565b92915050565b600082601f830112620002f557600080fd5b81516200030784826020860162000257565b91505092915050565b600080600080608085870312156200032757600080fd5b600085015167ffffffffffffffff8111156200034257600080fd5b6200035087828801620002e3565b94505060206200036387828801620002cc565b93505060406200037687828801620002cc565b92505060606200038987828801620002cc565b91505092959194509250565b6000604051905081810181811067ffffffffffffffff82111715620003bf57620003be620004b3565b5b8060405250919050565b600067ffffffffffffffff821115620003e757620003e6620004b3565b5b602082029050602081019050919050565b600062000405826200040c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600062000443826200042c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141562000479576200047862000484565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620004ed81620003f8565b8114620004f957600080fd5b50565b610e32806200050c6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063271f88b41461005157806363e4bff414610081578063aa8c217c146100b1578063fc0c546a146100cf575b600080fd5b61006b60048036038101906100669190610a34565b6100ed565b6040516100789190610c56565b60405180910390f35b61009b60048036038101906100969190610a0b565b610155565b6040516100a89190610c56565b60405180910390f35b6100b96109b5565b6040516100c69190610d11565b60405180910390f35b6100d76109bb565b6040516100e49190610c12565b60405180910390f35b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661014557600080fd5b8160028190555060019050919050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156101e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101db90610c91565b60405180910390fd5b60006060600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461040b57600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016102889190610c12565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516103129190610bfb565b6000604051808303816000865af19150503d806000811461034f576040519150601f19603f3d011682016040523d82523d6000602084013e610354565b606091505b508092508193505050600060f81b81601f8151811061039c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141561040a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040190610c71565b60405180910390fd5b5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016104559190610c12565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516104df9190610bfb565b6000604051808303816000865af19150503d806000811461051c576040519150601f19603f3d011682016040523d82523d6000602084013e610521565b606091505b508092508193505050600060f81b81601f81518110610569577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146105d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105cd90610cf1565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016106209190610c12565b6040516020818303038152906040527f0a3b0a4f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516106aa9190610bfb565b6000604051808303816000865af19150503d80600081146106e7576040519150601f19603f3d011682016040523d82523d6000602084013e6106ec565b606091505b50809250819350505081610735576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072c90610cd1565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684600254604051602401610783929190610c2d565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161080d9190610bfb565b6000604051808303816000865af19150503d806000811461084a576040519150601f19603f3d011682016040523d82523d6000602084013e61084f565b606091505b5080925081935050508161092157600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d60706002546040516108de9190610d11565b60405180910390a36040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091890610cb1565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f45c201a59ac545000ead84f30b2db67da23353aa1d58ac522c48505412143ffa6002546040516109a29190610d11565b60405180910390a3600192505050919050565b60025481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000813590506109f081610dce565b92915050565b600081359050610a0581610de5565b92915050565b600060208284031215610a1d57600080fd5b6000610a2b848285016109e1565b91505092915050565b600060208284031215610a4657600080fd5b6000610a54848285016109f6565b91505092915050565b610a6681610d53565b82525050565b610a7581610d65565b82525050565b6000610a8682610d2c565b610a908185610d37565b9350610aa0818560208601610d9b565b80840191505092915050565b6000610ab9601883610d42565b91507f4552525f4143434f554e545f4e4f545f494e5f494e44455800000000000000006000830152602082019050919050565b6000610af9600a83610d42565b91507f4552525f414343455353000000000000000000000000000000000000000000006000830152602082019050919050565b6000610b39600c83610d42565b91507f4552525f5452414e5346455200000000000000000000000000000000000000006000830152602082019050919050565b6000610b79600d83610d42565b91507f4552525f4d41524b5f4641494c000000000000000000000000000000000000006000830152602082019050919050565b6000610bb9601083610d42565b91507f4552525f4143434f554e545f55534544000000000000000000000000000000006000830152602082019050919050565b610bf581610d91565b82525050565b6000610c078284610a7b565b915081905092915050565b6000602082019050610c276000830184610a5d565b92915050565b6000604082019050610c426000830185610a5d565b610c4f6020830184610bec565b9392505050565b6000602082019050610c6b6000830184610a6c565b92915050565b60006020820190508181036000830152610c8a81610aac565b9050919050565b60006020820190508181036000830152610caa81610aec565b9050919050565b60006020820190508181036000830152610cca81610b2c565b9050919050565b60006020820190508181036000830152610cea81610b6c565b9050919050565b60006020820190508181036000830152610d0a81610bac565b9050919050565b6000602082019050610d266000830184610bec565b92915050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610d5e82610d71565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015610db9578082015181840152602081019050610d9e565b83811115610dc8576000848401525b50505050565b610dd781610d53565b8114610de257600080fd5b50565b610dee81610d91565b8114610df957600080fd5b5056fea26469706673582212200bda328ee8729db37bc760cc22d4027c4afb227a96eb3c6c22a2ef46ee66724464736f6c63430008000033
+\ 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":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":"gimme","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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"}]
+[{"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":"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
@@ -13,6 +13,7 @@ contract SingleShotFaucet {
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) {
owner = msg.sender;
@@ -31,10 +32,6 @@ contract SingleShotFaucet {
return true;
}
- function gimme() public returns (bool) {
- return giveTo(msg.sender);
- }
-
function giveTo(address _recipient) public returns (bool) {
require(!overriders[_recipient], 'ERR_ACCESS');
diff --git a/solidity/ERC20SingleShotFaucetStorage.bin b/solidity/ERC20SingleShotFaucetStorage.bin
@@ -1 +1 @@
-608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061044e806100606000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630a3b0a4f1461005c5780633ef250131461008c57806379ba5097146100bc5780637ff2f063146100da578063f2fde38b1461010a575b600080fd5b61007660048036038101906100719190610370565b61013a565b60405161008391906103a8565b60405180910390f35b6100a660048036038101906100a19190610370565b61019d565b6040516100b391906103a8565b60405180910390f35b6100c46101f3565b6040516100d191906103a8565b60405180910390f35b6100f460048036038101906100ef9190610370565b610296565b60405161010191906103a8565b60405180910390f35b610124600480360381019061011f9190610370565b6102b6565b60405161013191906103a8565b60405180910390f35b60006001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461024f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001905090565b60026020528060005260406000206000915054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461031157600080fd5b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60008135905061036a81610401565b92915050565b60006020828403121561038257600080fd5b60006103908482850161035b565b91505092915050565b6103a2816103d5565b82525050565b60006020820190506103bd6000830184610399565b92915050565b60006103ce826103e1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b61040a816103c3565b811461041557600080fd5b5056fea264697066735822122089d9d92d0f952459388e88c1e7d529a3f3153b399bf5949f24ff8ff0258880ca64736f6c63430008000033
-\ No newline at end of file
+608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610547806100606000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630a3b0a4f146100675780633ef2501314610097578063764b07e7146100c757806379ba5097146100f75780638da5cb5b14610115578063f2fde38b14610133575b600080fd5b610081600480360381019061007c919061043f565b61014f565b60405161008e91906104a1565b60405180910390f35b6100b160048036038101906100ac919061043f565b6101b2565b6040516100be91906104a1565b60405180910390f35b6100e160048036038101906100dc919061043f565b610208565b6040516100ee91906104a1565b60405180910390f35b6100ff610228565b60405161010c91906104a1565b60405180910390f35b61011d61036a565b60405161012a9190610486565b60405180910390f35b61014d6004803603810190610148919061043f565b61038e565b005b60006001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60026020528060005260406000206000915054906101000a900460ff1681565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102a857600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600191505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103e657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081359050610439816104fa565b92915050565b60006020828403121561045157600080fd5b600061045f8482850161042a565b91505092915050565b610471816104bc565b82525050565b610480816104ce565b82525050565b600060208201905061049b6000830184610468565b92915050565b60006020820190506104b66000830184610477565b92915050565b60006104c7826104da565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b610503816104bc565b811461050e57600080fd5b5056fea2646970667358221220dc93d6966dbb68be7d5bf110ec4c45adb64952fd923a943b07463b1421646b1764736f6c63430008000033
+\ No newline at end of file
diff --git a/solidity/ERC20SingleShotFaucetStorage.json b/solidity/ERC20SingleShotFaucetStorage.json
@@ -1 +1 @@
-[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"acceptOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"add","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"have","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_new_owner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"used_accounts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
+[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"add","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"have","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"usedAccounts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
diff --git a/solidity/ERC20SingleShotFaucetStorage.sol b/solidity/ERC20SingleShotFaucetStorage.sol
@@ -3,33 +3,39 @@ pragma solidity >=0.6.21;
// SPDX-License-Identifier: GPL-3.0-or-later
contract SingleShotFaucetStorage {
- address owner;
- address new_owner;
+ // EIP 173
+ address public owner;
+ address newOwner;
- mapping (address => bool) public used_accounts;
+ mapping (address => bool) public usedAccounts;
+
+ // EIP 173
+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
owner = msg.sender;
}
- function transferOwnership(address _new_owner) external returns (bool) {
+ // EIP 173
+ function transferOwnership(address _newOwner) external {
require(msg.sender == owner);
- new_owner = _new_owner;
- return true;
+ newOwner = _newOwner;
}
function acceptOwnership() external returns (bool) {
- require(msg.sender == new_owner);
+ address previousOwner = owner;
+ require(msg.sender == newOwner);
owner = msg.sender;
+ emit OwnershipTransferred(previousOwner, owner);
return true;
}
function add(address _account) external returns (bool) {
- used_accounts[_account] = true;
+ usedAccounts[_account] = true;
return true;
}
function have(address _account) external view returns (bool) {
- return used_accounts[_account];
+ return usedAccounts[_account];
}
}