commit 733a9f0e9f7ce300d69ca328600516ea6cc45250
parent 2c77976df8b165cf74e901ef469115ede4a560c9
Author: lash <dev@holbrook.no>
Date: Sat, 25 Mar 2023 14:28:38 +0000
Add nextbalance, update erc165 ids
Diffstat:
8 files changed, 78 insertions(+), 20 deletions(-)
diff --git a/python/eth_faucet/data/EthFaucet.bin b/python/eth_faucet/data/EthFaucet.bin
@@ -1 +1 @@
-608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611d27806100606000396000f3fe608060405260043610610109576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100a7578063d6eca01e11610076578063d6eca01e14610346578063de82efb41461036f578063eec7faa11461039a578063fc0c546a146103c557610110565b80638da5cb5b1461028a578063a91ee0dc146102b5578063c23697a8146102de578063cb10d59a1461031b57610110565b80633b1bd134116100e35780633b1bd134146101a857806363e4bff4146101e55780637b1039991461022257806386fe212d1461024d57610110565b806318cbbcfc14610115578063271f88b41461014057806331a5995d1461017d57610110565b3661011057005b600080fd5b34801561012157600080fd5b5061012a6103f0565b60405161013791906115be565b60405180910390f35b34801561014c57600080fd5b506101676004803603810190610162919061160a565b6103f5565b60405161017491906115be565b60405180910390f35b34801561018957600080fd5b5061019261051b565b60405161019f91906115be565b60405180910390f35b3480156101b457600080fd5b506101cf60048036038101906101ca9190611695565b610521565b6040516101dc91906115be565b60405180910390f35b3480156101f157600080fd5b5061020c60048036038101906102079190611695565b61069c565b60405161021991906115be565b60405180910390f35b34801561022e57600080fd5b5061023761076b565b60405161024491906116d1565b60405180910390f35b34801561025957600080fd5b50610274600480360381019061026f919061160a565b610791565b60405161028191906115be565b60405180910390f35b34801561029657600080fd5b5061029f6108b7565b6040516102ac91906116d1565b60405180910390f35b3480156102c157600080fd5b506102dc60048036038101906102d79190611695565b6108db565b005b3480156102ea57600080fd5b5061030560048036038101906103009190611695565b610a78565b6040516103129190611707565b60405180910390f35b34801561032757600080fd5b50610330610ab6565b60405161033d91906116d1565b60405180910390f35b34801561035257600080fd5b5061036d60048036038101906103689190611695565b610adc565b005b34801561037b57600080fd5b50610384610c79565b60405161039191906115be565b60405180910390f35b3480156103a657600080fd5b506103af610d46565b6040516103bc91906115be565b60405180910390f35b3480156103d157600080fd5b506103da610d50565b6040516103e791906116d1565b60405180910390f35b600781565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610486576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047d9061177f565b60405180910390fd5b6000600460ff1660035416146104d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c8906117eb565b60405180910390fd5b816004819055507f748f1cf617bdc8ef4fcd1cb516dc05cedf269e8dcad82183846d57eeec4bba5e60045460405161050991906115be565b60405180910390a16004549050919050565b60035481565b6000806060600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460405160240161057091906116d1565b6040516020818303038152906040527fab73e316000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516105fa919061187c565b6000604051808303816000865af19150503d8060008114610637576040519150601f19603f3d011682016040523d82523d6000602084013e61063c565b606091505b50809250819350505081610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c906118df565b60405180910390fd5b8061068f9061193e565b6001900492505050919050565b60006106a782610d55565b6106b057600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc6004549081150290604051600060405180830381858888f193505050501580156106f8573d6000803e3d6000fd5b50600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f26162814817e23ec5035d6a2edc6c422da2da2119e27cfca6be65cc2dc55ca4c60045460405161075991906115be565b60405180910390a36004549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600882106107d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cd906119f1565b60405180910390fd5b600060035483161461081d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081490611a5d565b60405180910390fd5b816003600082825417925050819055506003547f829c15f635123f612942c5f6ba4c6c203609473dc8b2398f38ccda8866f6ff7d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516108a5929190611a7d565b60405180910390a26003549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610969576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109609061177f565b60405180910390fd5b6000600160ff1660035416146109b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ab906117eb565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003547f829c15f635123f612942c5f6ba4c6c203609473dc8b2398f38ccda8866f6ff7d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610a6d929190611a7d565b60405180910390a250565b6000610a8382611099565b610a905760009050610ab1565b610a998261130d565b610aa65760009050610ab1565b610aae611581565b90505b919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b619061177f565b60405180910390fd5b6000600260ff166003541614610bb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bac906117eb565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003547f829c15f635123f612942c5f6ba4c6c203609473dc8b2398f38ccda8866f6ff7d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610c6e929190611a7d565b60405180910390a250565b6000610c8433610d55565b610c8d57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc6004549081150290604051600060405180830381858888f19350505050158015610cd5573d6000803e3d6000fd5b50600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f26162814817e23ec5035d6a2edc6c422da2da2119e27cfca6be65cc2dc55ca4c600454604051610d3691906115be565b60405180910390a3600454905090565b6000600454905090565b600090565b6000806060610d62611581565b610da1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9890611af2565b60405180910390fd5b610daa8461130d565b610de9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de090611b5e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610e4a57600192505050611094565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684604051602401610e9491906116d1565b6040516020818303038152906040527fb1a997ac000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610f1e919061187c565b6000604051808303816000865af19150503d8060008114610f5b576040519150601f19603f3d011682016040523d82523d6000602084013e610f60565b606091505b50809250819350505081610fa9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa090611bca565b60405180910390fd5b60007f01000000000000000000000000000000000000000000000000000000000000000281601f81518110610fe157610fe0611bea565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361108d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108490611c65565b60405180910390fd5b6001925050505b919050565b6000806060600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036110ff57600192505050611308565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460405160240161114991906116d1565b6040516020818303038152906040527fc23697a8000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516111d3919061187c565b6000604051808303816000865af19150503d8060008114611210576040519150601f19603f3d011682016040523d82523d6000602084013e611215565b606091505b5080925081935050508161125e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125590611bca565b60405180910390fd5b60017f01000000000000000000000000000000000000000000000000000000000000000281601f8151811061129657611295611bea565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614925050505b919050565b6000806060600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036113735760019250505061157c565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016113bd91906116d1565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611447919061187c565b6000604051808303816000865af19150503d8060008114611484576040519150601f19603f3d011682016040523d82523d6000602084013e611489565b606091505b508092508193505050816114d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c990611cd1565b60405180910390fd5b60017f01000000000000000000000000000000000000000000000000000000000000000281601f8151811061150a57611509611bea565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614925050505b919050565b60003073ffffffffffffffffffffffffffffffffffffffff16316004541115905090565b6000819050919050565b6115b8816115a5565b82525050565b60006020820190506115d360008301846115af565b92915050565b600080fd5b6115e7816115a5565b81146115f257600080fd5b50565b600081359050611604816115de565b92915050565b6000602082840312156116205761161f6115d9565b5b600061162e848285016115f5565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061166282611637565b9050919050565b61167281611657565b811461167d57600080fd5b50565b60008135905061168f81611669565b92915050565b6000602082840312156116ab576116aa6115d9565b5b60006116b984828501611680565b91505092915050565b6116cb81611657565b82525050565b60006020820190506116e660008301846116c2565b92915050565b60008115159050919050565b611701816116ec565b82525050565b600060208201905061171c60008301846116f8565b92915050565b600082825260208201905092915050565b7f4552525f4e4f545f4f574e455200000000000000000000000000000000000000600082015250565b6000611769600d83611722565b915061177482611733565b602082019050919050565b600060208201905081810360008301526117988161175c565b9050919050565b7f4552525f5345414c454400000000000000000000000000000000000000000000600082015250565b60006117d5600a83611722565b91506117e08261179f565b602082019050919050565b60006020820190508181036000830152611804816117c8565b9050919050565b600081519050919050565b600081905092915050565b60005b8381101561183f578082015181840152602081019050611824565b60008484015250505050565b60006118568261180b565b6118608185611816565b9350611870818560208601611821565b80840191505092915050565b6000611888828461184b565b915081905092915050565b7f4552525f504552494f445f4241434b454e445f4552524f520000000000000000600082015250565b60006118c9601883611722565b91506118d482611893565b602082019050919050565b600060208201905081810360008301526118f8816118bc565b9050919050565b6000819050602082019050919050565b6000819050919050565b6000611925825161190f565b80915050919050565b60008160020a8302905092915050565b60006119498261180b565b82611953846118ff565b905061195e81611919565b9250602082101561199e576119997fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8360200360080261192e565b831692505b5050919050565b7f4552525f494e56414c49445f5354415445000000000000000000000000000000600082015250565b60006119db601183611722565b91506119e6826119a5565b602082019050919050565b60006020820190508181036000830152611a0a816119ce565b9050919050565b7f4552525f414c52454144595f4c4f434b45440000000000000000000000000000600082015250565b6000611a47601283611722565b9150611a5282611a11565b602082019050919050565b60006020820190508181036000830152611a7681611a3a565b9050919050565b6000604082019050611a9260008301856116c2565b611a9f60208301846116c2565b9392505050565b7f4552525f494e53554646494349454e545f42414c414e43450000000000000000600082015250565b6000611adc601883611722565b9150611ae782611aa6565b602082019050919050565b60006020820190508181036000830152611b0b81611acf565b9050919050565b7f4552525f4e4f545f494e5f57484954454c495354000000000000000000000000600082015250565b6000611b48601483611722565b9150611b5382611b12565b602082019050919050565b60006020820190508181036000830152611b7781611b3b565b9050919050565b7f4552525f504552494f445f4241434b454e440000000000000000000000000000600082015250565b6000611bb4601283611722565b9150611bbf82611b7e565b602082019050919050565b60006020820190508181036000830152611be381611ba7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552525f504552494f445f434845434b00000000000000000000000000000000600082015250565b6000611c4f601083611722565b9150611c5a82611c19565b602082019050919050565b60006020820190508181036000830152611c7e81611c42565b9050919050565b7f4552525f52454749535452595f4241434b454e44000000000000000000000000600082015250565b6000611cbb601483611722565b9150611cc682611c85565b602082019050919050565b60006020820190508181036000830152611cea81611cae565b905091905056fea2646970667358221220e5ed9728ff96283e127fe7de460ec146dbbef33362f9a7cda3cd9d0cef13e81a64736f6c63430008120033
-\ No newline at end of file
+608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612053806100606000396000f3fe608060405260043610610109576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100a7578063de82efb411610076578063de82efb414610356578063eec7faa114610381578063f18e126a146103ac578063fc0c546a146103e957610110565b80638da5cb5b1461029c578063a91ee0dc146102c7578063c23697a8146102f0578063d6eca01e1461032d57610110565b806331a5995d116100e357806331a5995d146101ba5780633b1bd134146101e557806363e4bff41461022257806386fe212d1461025f57610110565b806301ffc9a71461011557806318cbbcfc14610152578063271f88b41461017d57610110565b3661011057005b600080fd5b34801561012157600080fd5b5061013c600480360381019061013791906118a9565b610414565b60405161014991906118f1565b60405180910390f35b34801561015e57600080fd5b50610167610568565b6040516101749190611925565b60405180910390f35b34801561018957600080fd5b506101a4600480360381019061019f919061196c565b61056d565b6040516101b19190611925565b60405180910390f35b3480156101c657600080fd5b506101cf610693565b6040516101dc9190611925565b60405180910390f35b3480156101f157600080fd5b5061020c600480360381019061020791906119f7565b610699565b6040516102199190611925565b60405180910390f35b34801561022e57600080fd5b50610249600480360381019061024491906119f7565b610814565b6040516102569190611925565b60405180910390f35b34801561026b57600080fd5b506102866004803603810190610281919061196c565b6108e3565b6040516102939190611925565b60405180910390f35b3480156102a857600080fd5b506102b1610a09565b6040516102be9190611a33565b60405180910390f35b3480156102d357600080fd5b506102ee60048036038101906102e991906119f7565b610a2d565b005b3480156102fc57600080fd5b50610317600480360381019061031291906119f7565b610bca565b60405161032491906118f1565b60405180910390f35b34801561033957600080fd5b50610354600480360381019061034f91906119f7565b610c08565b005b34801561036257600080fd5b5061036b610da5565b6040516103789190611925565b60405180910390f35b34801561038d57600080fd5b50610396610e72565b6040516103a39190611925565b60405180910390f35b3480156103b857600080fd5b506103d360048036038101906103ce91906119f7565b610e7c565b6040516103e09190611925565b60405180910390f35b3480156103f557600080fd5b506103fe610ff7565b60405161040b9190611a33565b60405180910390f35b60006301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104685760019050610563565b639493f8b27c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036104ba5760019050610563565b631a3ac6347c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361050c5760019050610563565b630d7491f87c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361055e5760019050610563565b600090505b919050565b600781565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590611aab565b60405180910390fd5b6000600460ff166003541614610649576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064090611b17565b60405180910390fd5b816004819055507f748f1cf617bdc8ef4fcd1cb516dc05cedf269e8dcad82183846d57eeec4bba5e6004546040516106819190611925565b60405180910390a16004549050919050565b60035481565b6000806060600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016106e89190611a33565b6040516020818303038152906040527fab73e316000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516107729190611ba8565b6000604051808303816000865af19150503d80600081146107af576040519150601f19603f3d011682016040523d82523d6000602084013e6107b4565b606091505b508092508193505050816107fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f490611c0b565b60405180910390fd5b8061080790611c6a565b6001900492505050919050565b600061081f82610ffc565b61082857600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc6004549081150290604051600060405180830381858888f19350505050158015610870573d6000803e3d6000fd5b50600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f26162814817e23ec5035d6a2edc6c422da2da2119e27cfca6be65cc2dc55ca4c6004546040516108d19190611925565b60405180910390a36004549050919050565b600060088210610928576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091f90611d1d565b60405180910390fd5b600060035483161461096f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096690611d89565b60405180910390fd5b816003600082825417925050819055506003547f829c15f635123f612942c5f6ba4c6c203609473dc8b2398f38ccda8866f6ff7d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516109f7929190611da9565b60405180910390a26003549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610abb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab290611aab565b60405180910390fd5b6000600160ff166003541614610b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afd90611b17565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003547f829c15f635123f612942c5f6ba4c6c203609473dc8b2398f38ccda8866f6ff7d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610bbf929190611da9565b60405180910390a250565b6000610bd582611340565b610be25760009050610c03565b610beb826115b4565b610bf85760009050610c03565b610c00611828565b90505b919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8d90611aab565b60405180910390fd5b6000600260ff166003541614610ce1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd890611b17565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003547f829c15f635123f612942c5f6ba4c6c203609473dc8b2398f38ccda8866f6ff7d600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051610d9a929190611da9565b60405180910390a250565b6000610db033610ffc565b610db957600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc6004549081150290604051600060405180830381858888f19350505050158015610e01573d6000803e3d6000fd5b50600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f26162814817e23ec5035d6a2edc6c422da2da2119e27cfca6be65cc2dc55ca4c600454604051610e629190611925565b60405180910390a3600454905090565b6000600454905090565b6000806060600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684604051602401610ecb9190611a33565b6040516020818303038152906040527fc3173774000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610f559190611ba8565b6000604051808303816000865af19150503d8060008114610f92576040519150601f19603f3d011682016040523d82523d6000602084013e610f97565b606091505b50809250819350505081610fe0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd790611c0b565b60405180910390fd5b80610fea90611c6a565b6001900492505050919050565b600081565b6000806060611009611828565b611048576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103f90611e1e565b60405180910390fd5b611051846115b4565b611090576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108790611e8a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036110f15760019250505061133b565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168460405160240161113b9190611a33565b6040516020818303038152906040527fb1a997ac000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516111c59190611ba8565b6000604051808303816000865af19150503d8060008114611202576040519150601f19603f3d011682016040523d82523d6000602084013e611207565b606091505b50809250819350505081611250576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124790611ef6565b60405180910390fd5b60007f01000000000000000000000000000000000000000000000000000000000000000281601f8151811061128857611287611f16565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603611334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132b90611f91565b60405180910390fd5b6001925050505b919050565b6000806060600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036113a6576001925050506115af565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016113f09190611a33565b6040516020818303038152906040527fc23697a8000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161147a9190611ba8565b6000604051808303816000865af19150503d80600081146114b7576040519150601f19603f3d011682016040523d82523d6000602084013e6114bc565b606091505b50809250819350505081611505576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114fc90611ef6565b60405180910390fd5b60017f01000000000000000000000000000000000000000000000000000000000000000281601f8151811061153d5761153c611f16565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614925050505b919050565b6000806060600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361161a57600192505050611823565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16846040516024016116649190611a33565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516116ee9190611ba8565b6000604051808303816000865af19150503d806000811461172b576040519150601f19603f3d011682016040523d82523d6000602084013e611730565b606091505b50809250819350505081611779576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177090611ffd565b60405180910390fd5b60017f01000000000000000000000000000000000000000000000000000000000000000281601f815181106117b1576117b0611f16565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614925050505b919050565b60003073ffffffffffffffffffffffffffffffffffffffff16316004541115905090565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61188681611851565b811461189157600080fd5b50565b6000813590506118a38161187d565b92915050565b6000602082840312156118bf576118be61184c565b5b60006118cd84828501611894565b91505092915050565b60008115159050919050565b6118eb816118d6565b82525050565b600060208201905061190660008301846118e2565b92915050565b6000819050919050565b61191f8161190c565b82525050565b600060208201905061193a6000830184611916565b92915050565b6119498161190c565b811461195457600080fd5b50565b60008135905061196681611940565b92915050565b6000602082840312156119825761198161184c565b5b600061199084828501611957565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119c482611999565b9050919050565b6119d4816119b9565b81146119df57600080fd5b50565b6000813590506119f1816119cb565b92915050565b600060208284031215611a0d57611a0c61184c565b5b6000611a1b848285016119e2565b91505092915050565b611a2d816119b9565b82525050565b6000602082019050611a486000830184611a24565b92915050565b600082825260208201905092915050565b7f4552525f4e4f545f4f574e455200000000000000000000000000000000000000600082015250565b6000611a95600d83611a4e565b9150611aa082611a5f565b602082019050919050565b60006020820190508181036000830152611ac481611a88565b9050919050565b7f4552525f5345414c454400000000000000000000000000000000000000000000600082015250565b6000611b01600a83611a4e565b9150611b0c82611acb565b602082019050919050565b60006020820190508181036000830152611b3081611af4565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015611b6b578082015181840152602081019050611b50565b60008484015250505050565b6000611b8282611b37565b611b8c8185611b42565b9350611b9c818560208601611b4d565b80840191505092915050565b6000611bb48284611b77565b915081905092915050565b7f4552525f504552494f445f4241434b454e445f4552524f520000000000000000600082015250565b6000611bf5601883611a4e565b9150611c0082611bbf565b602082019050919050565b60006020820190508181036000830152611c2481611be8565b9050919050565b6000819050602082019050919050565b6000819050919050565b6000611c518251611c3b565b80915050919050565b60008160020a8302905092915050565b6000611c7582611b37565b82611c7f84611c2b565b9050611c8a81611c45565b92506020821015611cca57611cc57fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83602003600802611c5a565b831692505b5050919050565b7f4552525f494e56414c49445f5354415445000000000000000000000000000000600082015250565b6000611d07601183611a4e565b9150611d1282611cd1565b602082019050919050565b60006020820190508181036000830152611d3681611cfa565b9050919050565b7f4552525f414c52454144595f4c4f434b45440000000000000000000000000000600082015250565b6000611d73601283611a4e565b9150611d7e82611d3d565b602082019050919050565b60006020820190508181036000830152611da281611d66565b9050919050565b6000604082019050611dbe6000830185611a24565b611dcb6020830184611a24565b9392505050565b7f4552525f494e53554646494349454e545f42414c414e43450000000000000000600082015250565b6000611e08601883611a4e565b9150611e1382611dd2565b602082019050919050565b60006020820190508181036000830152611e3781611dfb565b9050919050565b7f4552525f4e4f545f494e5f57484954454c495354000000000000000000000000600082015250565b6000611e74601483611a4e565b9150611e7f82611e3e565b602082019050919050565b60006020820190508181036000830152611ea381611e67565b9050919050565b7f4552525f504552494f445f4241434b454e440000000000000000000000000000600082015250565b6000611ee0601283611a4e565b9150611eeb82611eaa565b602082019050919050565b60006020820190508181036000830152611f0f81611ed3565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552525f504552494f445f434845434b00000000000000000000000000000000600082015250565b6000611f7b601083611a4e565b9150611f8682611f45565b602082019050919050565b60006020820190508181036000830152611faa81611f6e565b9050919050565b7f4552525f52454749535452595f4241434b454e44000000000000000000000000600082015250565b6000611fe7601483611a4e565b9150611ff282611fb1565b602082019050919050565b6000602082019050818103600083015261201681611fda565b905091905056fea26469706673582212201fe76eb573cd729a29a46a892a4f72f8b1ebbd32e2e1d3ecd79bf24db293a9d864736f6c63430008120033
+\ No newline at end of file
diff --git a/python/eth_faucet/data/EthFaucet.json b/python/eth_faucet/data/EthFaucet.json
@@ -1 +1 @@
-[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","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":"_amount","type":"uint256"}],"name":"Give","type":"event"},{"anonymous":false,"inputs":[],"name":"ImNotGassy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_sealState","type":"uint256"},{"indexed":false,"internalType":"address","name":"_registry","type":"address"},{"indexed":false,"internalType":"address","name":"_periodChecker","type":"address"}],"name":"SealStateChange","type":"event"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gimme","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxSealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"nextTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodChecker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"seal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_v","type":"uint256"}],"name":"setAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_checker","type":"address"}],"name":"setPeriodChecker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"tokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
+[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","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":"_amount","type":"uint256"}],"name":"Give","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_sealState","type":"uint256"},{"indexed":false,"internalType":"address","name":"_registry","type":"address"},{"indexed":false,"internalType":"address","name":"_periodChecker","type":"address"}],"name":"SealStateChange","type":"event"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gimme","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxSealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"nextBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"nextTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"seal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_v","type":"uint256"}],"name":"setAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_checker","type":"address"}],"name":"setPeriodChecker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
diff --git a/python/eth_faucet/data/EthFaucet.metadata.json b/python/eth_faucet/data/EthFaucet.metadata.json
@@ -1 +1 @@
-{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","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":"_amount","type":"uint256"}],"name":"Give","type":"event"},{"anonymous":false,"inputs":[],"name":"ImNotGassy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_sealState","type":"uint256"},{"indexed":false,"internalType":"address","name":"_registry","type":"address"},{"indexed":false,"internalType":"address","name":"_periodChecker","type":"address"}],"name":"SealStateChange","type":"event"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gimme","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxSealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"nextTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodChecker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"seal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_v","type":"uint256"}],"name":"setAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_checker","type":"address"}],"name":"setPeriodChecker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"tokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"EthFaucet.sol":"EthFacuet"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"EthFaucet.sol":{"keccak256":"0x914fa90608a36d5d6082a1bdba168c849a3ea34d70d3dd6e1fef143554840f19","license":"GPL-3.0-or-later","urls":["bzz-raw://b4efbed22465930f683933bd5b4f74a74d1f53c0c34a1231fbedcff92a3eeba2","dweb:/ipfs/QmT6szY5nAEs1megXscAsYkM9rke8M8VLj3MrQEP5hTekn"]}},"version":1}
+{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","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":"_amount","type":"uint256"}],"name":"Give","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_sealState","type":"uint256"},{"indexed":false,"internalType":"address","name":"_registry","type":"address"},{"indexed":false,"internalType":"address","name":"_periodChecker","type":"address"}],"name":"SealStateChange","type":"event"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gimme","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxSealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"nextBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"nextTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"seal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sealState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_v","type":"uint256"}],"name":"setAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_checker","type":"address"}],"name":"setPeriodChecker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"EthFaucet.sol":"EthFaucet"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"EthFaucet.sol":{"keccak256":"0x85367398c12bf0033a68f78bba295f0da103118367087818665838a544e50f5b","license":"AGPL-3.0-or-later","urls":["bzz-raw://58a2d7b0bd8ccc79cbd94b8cbe76fa5244dcec7bc9902df4806bbd65c078ea16","dweb:/ipfs/Qmex4jHTF37kL2FyeuCvumLKuK1NnHoqsFNcuyaDuwWUSz"]}},"version":1}
diff --git a/python/eth_faucet/data/PeriodSimple.bin b/python/eth_faucet/data/PeriodSimple.bin
@@ -1 +1 @@
-608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610bbd806100c16000396000f3fe608060405234801561001057600080fd5b50600436106100c6576000357c010000000000000000000000000000000000000000000000000000000090048063ab73e3161161008e578063ab73e3161461016f578063b1a997ac1461019f578063c23697a8146101cf578063c3173774146101ff578063ef78d4fd1461021d578063f4430dd81461023b576100c6565b80630f3a9f65146100cb5780634b6bdf1d146100e75780634ee577b41461010557806387020d6b146101355780638da5cb5b14610151575b600080fd5b6100e560048036038101906100e0919061085e565b610257565b005b6100ef610326565b6040516100fc91906108cc565b60405180910390f35b61011f600480360381019061011a9190610913565b61034c565b60405161012c919061094f565b60405180910390f35b61014f600480360381019061014a919061085e565b610364565b005b6101596103fd565b60405161016691906108cc565b60405180910390f35b61018960048036038101906101849190610913565b610421565b604051610196919061094f565b60405180910390f35b6101b960048036038101906101b49190610913565b610477565b6040516101c69190610985565b60405180910390f35b6101e960048036038101906101e49190610913565b610651565b6040516101f69190610985565b60405180910390f35b61020761077b565b604051610214919061094f565b60405180910390f35b610225610781565b604051610232919061094f565b60405180910390f35b61025560048036038101906102509190610913565b610787565b005b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146102e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102dc906109fd565b60405180910390fd5b806002819055507faf2decb129b74e79e086ab3d8c7bb0399bfba530c01e74fe4130ab9784e115578160405161031b919061094f565b60405180910390a150565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103bc57600080fd5b806003819055507f565196b96812774c1c5f73698d513cb6d8141ec4ecdbb428486d6ad64b4c81aa816040516103f2919061094f565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600254600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104709190610a4c565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806105215750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055790610acc565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1663c23697a8836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016105b591906108cc565b602060405180830381865afa1580156105d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f69190610b18565b610603576000905061064c565b42600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190505b919050565b60008060035411801561067d57506003548273ffffffffffffffffffffffffffffffffffffffff163110155b1561068b5760009050610776565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054036106db5760019050610776565b3073ffffffffffffffffffffffffffffffffffffffff1663ab73e316836040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161073091906108cc565b602060405180830381865afa15801561074d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107719190610b5a565b421190505b919050565b60035481565b60025481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107df57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080fd5b6000819050919050565b61083b81610828565b811461084657600080fd5b50565b60008135905061085881610832565b92915050565b60006020828403121561087457610873610823565b5b600061088284828501610849565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108b68261088b565b9050919050565b6108c6816108ab565b82525050565b60006020820190506108e160008301846108bd565b92915050565b6108f0816108ab565b81146108fb57600080fd5b50565b60008135905061090d816108e7565b92915050565b60006020828403121561092957610928610823565b5b6000610937848285016108fe565b91505092915050565b61094981610828565b82525050565b60006020820190506109646000830184610940565b92915050565b60008115159050919050565b61097f8161096a565b82525050565b600060208201905061099a6000830184610976565b92915050565b600082825260208201905092915050565b7f4552525f4e4f545f4f574e455200000000000000000000000000000000000000600082015250565b60006109e7600d836109a0565b91506109f2826109b1565b602082019050919050565b60006020820190508181036000830152610a16816109da565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610a5782610828565b9150610a6283610828565b9250828201905080821115610a7a57610a79610a1d565b5b92915050565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b6000610ab6600a836109a0565b9150610ac182610a80565b602082019050919050565b60006020820190508181036000830152610ae581610aa9565b9050919050565b610af58161096a565b8114610b0057600080fd5b50565b600081519050610b1281610aec565b92915050565b600060208284031215610b2e57610b2d610823565b5b6000610b3c84828501610b03565b91505092915050565b600081519050610b5481610832565b92915050565b600060208284031215610b7057610b6f610823565b5b6000610b7e84828501610b45565b9150509291505056fea2646970667358221220c9c559403f5d7b354fae12a3be7f60bbb86079120defa0241703f4ebce83b45664736f6c63430008120033
-\ No newline at end of file
+608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610bbd806100c16000396000f3fe608060405234801561001057600080fd5b50600436106100c6576000357c010000000000000000000000000000000000000000000000000000000090048063ab73e3161161008e578063ab73e3161461016f578063b1a997ac1461019f578063c23697a8146101cf578063c3173774146101ff578063ef78d4fd1461021d578063f4430dd81461023b576100c6565b80630f3a9f65146100cb5780634b6bdf1d146100e75780634ee577b41461010557806387020d6b146101355780638da5cb5b14610151575b600080fd5b6100e560048036038101906100e0919061085e565b610257565b005b6100ef610326565b6040516100fc91906108cc565b60405180910390f35b61011f600480360381019061011a9190610913565b61034c565b60405161012c919061094f565b60405180910390f35b61014f600480360381019061014a919061085e565b610364565b005b6101596103fd565b60405161016691906108cc565b60405180910390f35b61018960048036038101906101849190610913565b610421565b604051610196919061094f565b60405180910390f35b6101b960048036038101906101b49190610913565b610477565b6040516101c69190610985565b60405180910390f35b6101e960048036038101906101e49190610913565b610651565b6040516101f69190610985565b60405180910390f35b61020761077b565b604051610214919061094f565b60405180910390f35b610225610781565b604051610232919061094f565b60405180910390f35b61025560048036038101906102509190610913565b610787565b005b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146102e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102dc906109fd565b60405180910390fd5b806002819055507faf2decb129b74e79e086ab3d8c7bb0399bfba530c01e74fe4130ab9784e115578160405161031b919061094f565b60405180910390a150565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103bc57600080fd5b806003819055507f565196b96812774c1c5f73698d513cb6d8141ec4ecdbb428486d6ad64b4c81aa816040516103f2919061094f565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600254600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104709190610a4c565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806105215750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055790610acc565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1663c23697a8836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016105b591906108cc565b602060405180830381865afa1580156105d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f69190610b18565b610603576000905061064c565b42600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190505b919050565b60008060035411801561067d57506003548273ffffffffffffffffffffffffffffffffffffffff163110155b1561068b5760009050610776565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054036106db5760019050610776565b3073ffffffffffffffffffffffffffffffffffffffff1663ab73e316836040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161073091906108cc565b602060405180830381865afa15801561074d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107719190610b5a565b421190505b919050565b60035481565b60025481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107df57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080fd5b6000819050919050565b61083b81610828565b811461084657600080fd5b50565b60008135905061085881610832565b92915050565b60006020828403121561087457610873610823565b5b600061088284828501610849565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006108b68261088b565b9050919050565b6108c6816108ab565b82525050565b60006020820190506108e160008301846108bd565b92915050565b6108f0816108ab565b81146108fb57600080fd5b50565b60008135905061090d816108e7565b92915050565b60006020828403121561092957610928610823565b5b6000610937848285016108fe565b91505092915050565b61094981610828565b82525050565b60006020820190506109646000830184610940565b92915050565b60008115159050919050565b61097f8161096a565b82525050565b600060208201905061099a6000830184610976565b92915050565b600082825260208201905092915050565b7f4552525f4e4f545f4f574e455200000000000000000000000000000000000000600082015250565b60006109e7600d836109a0565b91506109f2826109b1565b602082019050919050565b60006020820190508181036000830152610a16816109da565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610a5782610828565b9150610a6283610828565b9250828201905080821115610a7a57610a79610a1d565b5b92915050565b7f4552525f41434345535300000000000000000000000000000000000000000000600082015250565b6000610ab6600a836109a0565b9150610ac182610a80565b602082019050919050565b60006020820190508181036000830152610ae581610aa9565b9050919050565b610af58161096a565b8114610b0057600080fd5b50565b600081519050610b1281610aec565b92915050565b600060208284031215610b2e57610b2d610823565b5b6000610b3c84828501610b03565b91505092915050565b600081519050610b5481610832565b92915050565b600060208284031215610b7057610b6f610823565b5b6000610b7e84828501610b45565b9150509291505056fea2646970667358221220ebd193aa4df2700c19b49e679f4f8228159dbaf591d0c15e6e036389fcc7eb9f64736f6c63430008120033
+\ No newline at end of file
diff --git a/python/eth_faucet/data/PeriodSimple.metadata.json b/python/eth_faucet/data/PeriodSimple.metadata.json
@@ -1 +1 @@
-{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"BalanceThresholdChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"PeriodChange","type":"event"},{"inputs":[],"name":"balanceThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastUsed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"next","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"period","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"poke","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"poker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_threshold","type":"uint256"}],"name":"setBalanceThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"setPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poker","type":"address"}],"name":"setPoker","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"PeriodSimple.sol":"PeriodSimple"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"PeriodSimple.sol":{"keccak256":"0x45faa9b0307c14cd87913aa6719092b693d47962285f659d1d01680ee9820527","license":"GPL-3.0-or-later","urls":["bzz-raw://29186cc92b9f6324e2043abe9ac74787866992c00ffeb0e3fc81d345d8c04ed1","dweb:/ipfs/QmXJaGaWBBFbdyQWaAicjXN6aC2w5Yvr97kXVVimHWAN7i"]}},"version":1}
+{"compiler":{"version":"0.8.18+commit.87f61d96"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"BalanceThresholdChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"PeriodChange","type":"event"},{"inputs":[],"name":"balanceThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"check","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastUsed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"next","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"period","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"poke","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"poker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_threshold","type":"uint256"}],"name":"setBalanceThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"setPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_poker","type":"address"}],"name":"setPoker","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"PeriodSimple.sol":"PeriodSimple"},"evmVersion":"byzantium","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"PeriodSimple.sol":{"keccak256":"0xcf2111e332486f9179cdcd0c1acd16f1e0629f5a2b99edc12acfbd68dce65d67","license":"AGPL-3.0-or-later","urls":["bzz-raw://207648e1e831cd867c1fb9630aab499bed2cbd423b058825a31ae71061dc0a1b","dweb:/ipfs/Qmc5WdJo3MKYmEuc7SfVpXiEaKeTYfGFDA4fnwYPa5N2h9"]}},"version":1}
diff --git a/python/setup.cfg b/python/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = eth-faucet
-version = 0.3.2
+version = 0.3.3
description = Gas token gifter with controls from time intervals, amounts and access.
author = Louis Holbrook
author_email = dev@holbrook.no
diff --git a/solidity/EthFaucet.sol b/solidity/EthFaucet.sol
@@ -1,29 +1,42 @@
-pragma solidity >0.8.0;
+pragma solidity >=0.8.0;
-// SPDX-License-Identifier: GPL-3.0-or-later
+// SPDX-License-Identifier: AGPL-3.0-or-later
-contract EthFacuet {
+contract EthFaucet {
+ // Implements ERC173
address public owner;
- address public registry;
- address public periodChecker;
+ address registry;
+ address periodChecker;
+
+ // Implements Faucet
+ address constant public token = address(0);
+
+ // Implements Seal
uint256 public sealState;
+
uint256 amount;
uint8 constant REGISTRY_STATE = 1;
uint8 constant PERIODCHECKER_STATE = 2;
uint8 constant VALUE_STATE = 4;
+ // Implements Seal
uint256 constant public maxSealState = 7;
+ // Implements Faucet
event Give(address indexed _recipient, address indexed _token, uint256 _amount);
+ // Implements Faucet
event FaucetAmountChange(uint256 _amount);
+
+ // Implements Seal
event SealStateChange(uint256 indexed _sealState, address _registry, address _periodChecker);
- event ImNotGassy();
constructor() {
owner = msg.sender;
}
+ // Set the given seal bits.
+ // Reverts if any bits are already set, if bit value is out of bounds.
function seal(uint256 _state) public returns(uint256) {
require(_state < 8, 'ERR_INVALID_STATE');
require(_state & sealState == 0, 'ERR_ALREADY_LOCKED');
@@ -32,6 +45,8 @@ contract EthFacuet {
return uint256(sealState);
}
+ // Change faucet amount.
+ // Reverts if VALUE_STATE seal is set.
function setAmount(uint256 _v) public returns(uint256) {
require(msg.sender == owner, 'ERR_NOT_OWNER');
require(sealState & VALUE_STATE == 0, 'ERR_SEALED');
@@ -40,6 +55,8 @@ contract EthFacuet {
return amount;
}
+ // Set period checker contract backend.
+ // Reverts if PERIODCHECKER_STATE seal is set
function setPeriodChecker(address _checker) public {
require(msg.sender == owner, 'ERR_NOT_OWNER');
require(sealState & PERIODCHECKER_STATE == 0, 'ERR_SEALED');
@@ -47,6 +64,8 @@ contract EthFacuet {
emit SealStateChange(sealState, registry, periodChecker);
}
+ // Set accounts index (Access Control List - ACL) backend.
+ // Reverts if REGISTRY_STATE seal is set
function setRegistry(address _registry) public {
require(msg.sender == owner, 'ERR_NOT_OWNER');
require(sealState & REGISTRY_STATE == 0, 'ERR_SEALED');
@@ -54,6 +73,8 @@ contract EthFacuet {
emit SealStateChange(sealState, registry, periodChecker);
}
+ // Return true if period checker backend allows usage of the faucet.
+ // Will always return true if period checker contract address has not been set.
function checkPeriod(address _recipient) private returns(bool) {
bool _ok;
bytes memory _result;
@@ -69,6 +90,8 @@ contract EthFacuet {
return _result[31] == 0x01;
}
+ // Return true if recipient has been added to the ACL.
+ // Will always return true if ACL contract address has not been set.
function checkRegistry(address _recipient) private returns(bool) {
bool _ok;
bytes memory _result;
@@ -84,10 +107,13 @@ contract EthFacuet {
return _result[31] == 0x01;
}
+ // Return false if contract does not have sufficient gas token balance to cover a single use.
+ // Used as backend for check.
function checkBalance() private view returns(bool) {
return amount <= address(this).balance;
}
+ // Check if a faucet usage attempt would succeed for the given recipient in the current contract state.
function check(address _recipient) public returns(bool) {
if (!checkPeriod(_recipient)) {
return false;
@@ -97,7 +123,8 @@ contract EthFacuet {
}
return checkBalance();
}
-
+
+ // Execute a single faucet usage for recipient.
function checkAndPoke(address _recipient) private returns(bool){
bool _ok;
bytes memory _result;
@@ -124,6 +151,7 @@ contract EthFacuet {
return true;
}
+ // Implements Faucet
function gimme() public returns(uint256) {
require(checkAndPoke(msg.sender));
payable(msg.sender).transfer(amount);
@@ -131,6 +159,7 @@ contract EthFacuet {
return amount;
}
+ // Implements Faucet
function giveTo(address _recipient) public returns(uint256) {
require(checkAndPoke(_recipient));
payable(_recipient).transfer(amount);
@@ -138,6 +167,7 @@ contract EthFacuet {
return amount;
}
+ // Implements Faucet
function nextTime(address _subject) public returns(uint256) {
bool _ok;
bytes memory _result;
@@ -149,14 +179,41 @@ contract EthFacuet {
return uint256(bytes32(_result));
}
+ // Implements Faucet
+ function nextBalance(address _subject) public returns(uint256) {
+ bool _ok;
+ bytes memory _result;
+
+ (_ok, _result) = periodChecker.call(abi.encodeWithSignature("balanceThreshold()", _subject));
+ if (!_ok) {
+ revert('ERR_PERIOD_BACKEND_ERROR');
+ }
+ return uint256(bytes32(_result));
+
+ }
+
+ // Implements Faucet
function tokenAmount() public view returns(uint256) {
return amount;
}
- function token() public pure returns(address) {
- return address(0);
+ receive () payable external {
}
- receive () payable external {
+ // Implements ERC165
+ function supportsInterface(bytes4 _sum) public pure returns (bool) {
+ if (_sum == 0x01ffc9a7) { // ERC165
+ return true;
+ }
+ if (_sum == 0x9493f8b2) { // ERC173
+ return true;
+ }
+ if (_sum == 0x1a3ac634) { // Faucet
+ return true;
+ }
+ if (_sum == 0x0d7491f8) { // Seal
+ return true;
+ }
+ return false;
}
}
diff --git a/solidity/PeriodSimple.sol b/solidity/PeriodSimple.sol
@@ -1,6 +1,6 @@
-pragma solidity >0.8.0;
+pragma solidity >=0.8.0;
-// SPDX-License-Identifier: GPL-3.0-or-later
+// SPDX-License-Identifier: AGPL-3.0-or-later
contract PeriodSimple {
@@ -12,6 +12,7 @@ contract PeriodSimple {
event PeriodChange(uint256 _value);
event BalanceThresholdChange(uint256 _value);
+
constructor() {
owner = msg.sender;
poker = owner;