commit 68b4314ef33093432cf46e7167a758d817d1a537
parent 80fb3c98b53f74028165df1da6ca963108556fe6
Author: lash <dev@holbrook.no>
Date: Sun, 5 Feb 2023 10:16:23 +0000
Add balance fail event
Diffstat:
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/python/eth_faucet/data/EthFaucet.bin b/python/eth_faucet/data/EthFaucet.bin
@@ -1 +1 @@
-608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611958806100606000396000f3fe6080604052600436106100c8576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100815780638da5cb5b1461020c578063a91ee0dc14610237578063aa8c217c14610260578063cb10d59a1461028b578063d6eca01e146102b6578063de82efb4146102df576100cf565b806318cbbcfc146100d4578063271f88b4146100ff57806331a5995d1461013c57806363e4bff4146101675780637b103999146101a457806386fe212d146101cf576100cf565b366100cf57005b600080fd5b3480156100e057600080fd5b506100e961030a565b6040516100f69190611337565b60405180910390f35b34801561010b57600080fd5b5061012660048036038101906101219190611383565b61030f565b6040516101339190611337565b60405180910390f35b34801561014857600080fd5b50610151610435565b60405161015e9190611337565b60405180910390f35b34801561017357600080fd5b5061018e6004803603810190610189919061140e565b61043b565b60405161019b9190611337565b60405180910390f35b3480156101b057600080fd5b506101b96104a2565b6040516101c6919061144a565b60405180910390f35b3480156101db57600080fd5b506101f660048036038101906101f19190611383565b6104c8565b6040516102039190611337565b60405180910390f35b34801561021857600080fd5b506102216105ee565b60405161022e919061144a565b60405180910390f35b34801561024357600080fd5b5061025e6004803603810190610259919061140e565b610612565b005b34801561026c57600080fd5b506102756107af565b6040516102829190611337565b60405180910390f35b34801561029757600080fd5b506102a06107b5565b6040516102ad919061144a565b60405180910390f35b3480156102c257600080fd5b506102dd60048036038101906102d8919061140e565b6107db565b005b3480156102eb57600080fd5b506102f4610978565b6040516103019190611337565b60405180910390f35b600781565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610397906114c2565b60405180910390fd5b6000600460ff1660035416146103eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103e29061152e565b60405180910390fd5b816004819055507f748f1cf617bdc8ef4fcd1cb516dc05cedf269e8dcad82183846d57eeec4bba5e6004546040516104239190611337565b60405180910390a16004549050919050565b60035481565b6000610446826109dd565b61044f57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc6004549081150290604051600060405180830381858888f19350505050158015610497573d6000803e3d6000fd5b506004549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006008821061050d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105049061159a565b60405180910390fd5b6000600354831614610554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054b90611606565b60405180910390fd5b816003600082825417925050819055506003547fe4b3d0535ec4cfd7bbe7b41fc94f6ee6bd15e97724854e3c3db2beb336d23a95600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516105dc929190611626565b60405180910390a26003549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610697906114c2565b60405180910390fd5b6000600160ff1660035416146106eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e29061152e565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003547fe4b3d0535ec4cfd7bbe7b41fc94f6ee6bd15e97724854e3c3db2beb336d23a95600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516107a4929190611626565b60405180910390a250565b60045481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610860906114c2565b60405180910390fd5b6000600260ff1660035416146108b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ab9061152e565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003547fe4b3d0535ec4cfd7bbe7b41fc94f6ee6bd15e97724854e3c3db2beb336d23a95600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405161096d929190611626565b60405180910390a250565b6000610983336109dd565b61098c57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc6004549081150290604051600060405180830381858888f193505050501580156109d4573d6000803e3d6000fd5b50600454905090565b60008073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f57610a3d82610aa9565b505b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aa057610a9e82610f93565b505b60019050919050565b6000806060600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684604051602401610af8919061144a565b6040516020818303038152906040527fc23697a8000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610b8291906116c0565b6000604051808303816000865af19150503d8060008114610bbf576040519150601f19603f3d011682016040523d82523d6000602084013e610bc4565b606091505b50809250819350505081610c7557600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d6070600454604051610c329190611337565b60405180910390a36040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6c90611723565b60405180910390fd5b60007f01000000000000000000000000000000000000000000000000000000000000000281601f81518110610cad57610cac611743565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610dc157600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d6070600454604051610d7e9190611337565b60405180910390a36040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db8906117be565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684604051602401610e0b919061144a565b6040516020818303038152906040527fb1a997ac000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610e9591906116c0565b6000604051808303816000865af19150503d8060008114610ed2576040519150601f19603f3d011682016040523d82523d6000602084013e610ed7565b606091505b50809250819350505081610f8857600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d6070600454604051610f459190611337565b60405180910390a36040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7f9061182a565b60405180910390fd5b600192505050919050565b6000806060600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684604051602401610fe2919061144a565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161106c91906116c0565b6000604051808303816000865af19150503d80600081146110a9576040519150601f19603f3d011682016040523d82523d6000602084013e6110ae565b606091505b5080925081935050508161115f57600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d607060045460405161111c9190611337565b60405180910390a36040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115690611896565b60405180910390fd5b60007f01000000000000000000000000000000000000000000000000000000000000000281601f8151811061119757611196611743565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036112ab57600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d60706004546040516112689190611337565b60405180910390a36040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a290611902565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f45c201a59ac545000ead84f30b2db67da23353aa1d58ac522c48505412143ffa60045460405161130b9190611337565b60405180910390a3600192505050919050565b6000819050919050565b6113318161131e565b82525050565b600060208201905061134c6000830184611328565b92915050565b600080fd5b6113608161131e565b811461136b57600080fd5b50565b60008135905061137d81611357565b92915050565b60006020828403121561139957611398611352565b5b60006113a78482850161136e565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113db826113b0565b9050919050565b6113eb816113d0565b81146113f657600080fd5b50565b600081359050611408816113e2565b92915050565b60006020828403121561142457611423611352565b5b6000611432848285016113f9565b91505092915050565b611444816113d0565b82525050565b600060208201905061145f600083018461143b565b92915050565b600082825260208201905092915050565b7f4552525f4e4f545f4f574e455200000000000000000000000000000000000000600082015250565b60006114ac600d83611465565b91506114b782611476565b602082019050919050565b600060208201905081810360008301526114db8161149f565b9050919050565b7f4552525f5345414c454400000000000000000000000000000000000000000000600082015250565b6000611518600a83611465565b9150611523826114e2565b602082019050919050565b600060208201905081810360008301526115478161150b565b9050919050565b7f4552525f494e56414c49445f5354415445000000000000000000000000000000600082015250565b6000611584601183611465565b915061158f8261154e565b602082019050919050565b600060208201905081810360008301526115b381611577565b9050919050565b7f4552525f414c52454144595f4c4f434b45440000000000000000000000000000600082015250565b60006115f0601283611465565b91506115fb826115ba565b602082019050919050565b6000602082019050818103600083015261161f816115e3565b9050919050565b600060408201905061163b600083018561143b565b611648602083018461143b565b9392505050565b600081519050919050565b600081905092915050565b60005b83811015611683578082015181840152602081019050611668565b60008484015250505050565b600061169a8261164f565b6116a4818561165a565b93506116b4818560208601611665565b80840191505092915050565b60006116cc828461168f565b915081905092915050565b7f4552525f504552494f445f4241434b454e445f4552524f520000000000000000600082015250565b600061170d601883611465565b9150611718826116d7565b602082019050919050565b6000602082019050818103600083015261173c81611700565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552525f504552494f445f434845434b00000000000000000000000000000000600082015250565b60006117a8601083611465565b91506117b382611772565b602082019050919050565b600060208201905081810360008301526117d78161179b565b9050919050565b7f4552525f52454749535452595f4241434b454e445f4552524f52000000000000600082015250565b6000611814601a83611465565b915061181f826117de565b602082019050919050565b6000602082019050818103600083015261184381611807565b9050919050565b7f4552525f5452414e534645520000000000000000000000000000000000000000600082015250565b6000611880600c83611465565b915061188b8261184a565b602082019050919050565b600060208201905081810360008301526118af81611873565b9050919050565b7f4552525f52454749535452595f434845434b0000000000000000000000000000600082015250565b60006118ec601283611465565b91506118f7826118b6565b602082019050919050565b6000602082019050818103600083015261191b816118df565b905091905056fea264697066735822122036e2826b03a3a47beaafacafc9a98657c63dbf5ebde0d91c57b409a38eba29ed64736f6c63430008110033
-\ No newline at end of file
+608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a56806100606000396000f3fe6080604052600436106100c8576000357c0100000000000000000000000000000000000000000000000000000000900480638da5cb5b116100815780638da5cb5b1461020c578063a91ee0dc14610237578063aa8c217c14610260578063cb10d59a1461028b578063d6eca01e146102b6578063de82efb4146102df576100cf565b806318cbbcfc146100d4578063271f88b4146100ff57806331a5995d1461013c57806363e4bff4146101675780637b103999146101a457806386fe212d146101cf576100cf565b366100cf57005b600080fd5b3480156100e057600080fd5b506100e961030a565b6040516100f691906113c9565b60405180910390f35b34801561010b57600080fd5b5061012660048036038101906101219190611415565b61030f565b60405161013391906113c9565b60405180910390f35b34801561014857600080fd5b50610151610435565b60405161015e91906113c9565b60405180910390f35b34801561017357600080fd5b5061018e600480360381019061018991906114a0565b61043b565b60405161019b91906113c9565b60405180910390f35b3480156101b057600080fd5b506101b96104a2565b6040516101c691906114dc565b60405180910390f35b3480156101db57600080fd5b506101f660048036038101906101f19190611415565b6104c8565b60405161020391906113c9565b60405180910390f35b34801561021857600080fd5b506102216105ee565b60405161022e91906114dc565b60405180910390f35b34801561024357600080fd5b5061025e600480360381019061025991906114a0565b610612565b005b34801561026c57600080fd5b506102756107af565b60405161028291906113c9565b60405180910390f35b34801561029757600080fd5b506102a06107b5565b6040516102ad91906114dc565b60405180910390f35b3480156102c257600080fd5b506102dd60048036038101906102d891906114a0565b6107db565b005b3480156102eb57600080fd5b506102f4610978565b60405161030191906113c9565b60405180910390f35b600781565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161039790611554565b60405180910390fd5b6000600460ff1660035416146103eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103e2906115c0565b60405180910390fd5b816004819055507f748f1cf617bdc8ef4fcd1cb516dc05cedf269e8dcad82183846d57eeec4bba5e60045460405161042391906113c9565b60405180910390a16004549050919050565b60035481565b6000610446826109dd565b61044f57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc6004549081150290604051600060405180830381858888f19350505050158015610497573d6000803e3d6000fd5b506004549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006008821061050d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105049061162c565b60405180910390fd5b6000600354831614610554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054b90611698565b60405180910390fd5b816003600082825417925050819055506003547fe4b3d0535ec4cfd7bbe7b41fc94f6ee6bd15e97724854e3c3db2beb336d23a95600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516105dc9291906116b8565b60405180910390a26003549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069790611554565b60405180910390fd5b6000600160ff1660035416146106eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e2906115c0565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003547fe4b3d0535ec4cfd7bbe7b41fc94f6ee6bd15e97724854e3c3db2beb336d23a95600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516107a49291906116b8565b60405180910390a250565b60045481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090611554565b60405180910390fd5b6000600260ff1660035416146108b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ab906115c0565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003547fe4b3d0535ec4cfd7bbe7b41fc94f6ee6bd15e97724854e3c3db2beb336d23a95600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405161096d9291906116b8565b60405180910390a250565b6000610983336109dd565b61098c57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc6004549081150290604051600060405180830381858888f193505050501580156109d4573d6000803e3d6000fd5b50600454905090565b60008073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f57610a3d82610ab1565b505b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aa057610a9e82610f9b565b505b610aa8611326565b60019050919050565b6000806060600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684604051602401610b0091906114dc565b6040516020818303038152906040527fc23697a8000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610b8a9190611752565b6000604051808303816000865af19150503d8060008114610bc7576040519150601f19603f3d011682016040523d82523d6000602084013e610bcc565b606091505b50809250819350505081610c7d57600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d6070600454604051610c3a91906113c9565b60405180910390a36040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c74906117b5565b60405180910390fd5b60007f01000000000000000000000000000000000000000000000000000000000000000281601f81518110610cb557610cb46117d5565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603610dc957600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d6070600454604051610d8691906113c9565b60405180910390a36040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc090611850565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684604051602401610e1391906114dc565b6040516020818303038152906040527fb1a997ac000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610e9d9190611752565b6000604051808303816000865af19150503d8060008114610eda576040519150601f19603f3d011682016040523d82523d6000602084013e610edf565b606091505b50809250819350505081610f9057600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d6070600454604051610f4d91906113c9565b60405180910390a36040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f87906118bc565b60405180910390fd5b600192505050919050565b6000806060600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1684604051602401610fea91906114dc565b6040516020818303038152906040527f3ef25013000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516110749190611752565b6000604051808303816000865af19150503d80600081146110b1576040519150601f19603f3d011682016040523d82523d6000602084013e6110b6565b606091505b5080925081935050508161116757600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d607060045460405161112491906113c9565b60405180910390a36040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115e90611928565b60405180910390fd5b60007f01000000000000000000000000000000000000000000000000000000000000000281601f8151811061119f5761119e6117d5565b5b60200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036112b357600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f2a56a00a5c532c49314f19361f71cdca8a5d10fdcb42c3fa52800d13419d607060045460405161127091906113c9565b60405180910390a36040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112aa90611994565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f45c201a59ac545000ead84f30b2db67da23353aa1d58ac522c48505412143ffa60045460405161131391906113c9565b60405180910390a3600192505050919050565b3073ffffffffffffffffffffffffffffffffffffffff163160045411156113ae577fd5fc280270ad7a4858a11280d5228b85502cacf121cc91fd35436bed31bb659c60405160405180910390a16040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a590611a00565b60405180910390fd5b565b6000819050919050565b6113c3816113b0565b82525050565b60006020820190506113de60008301846113ba565b92915050565b600080fd5b6113f2816113b0565b81146113fd57600080fd5b50565b60008135905061140f816113e9565b92915050565b60006020828403121561142b5761142a6113e4565b5b600061143984828501611400565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061146d82611442565b9050919050565b61147d81611462565b811461148857600080fd5b50565b60008135905061149a81611474565b92915050565b6000602082840312156114b6576114b56113e4565b5b60006114c48482850161148b565b91505092915050565b6114d681611462565b82525050565b60006020820190506114f160008301846114cd565b92915050565b600082825260208201905092915050565b7f4552525f4e4f545f4f574e455200000000000000000000000000000000000000600082015250565b600061153e600d836114f7565b915061154982611508565b602082019050919050565b6000602082019050818103600083015261156d81611531565b9050919050565b7f4552525f5345414c454400000000000000000000000000000000000000000000600082015250565b60006115aa600a836114f7565b91506115b582611574565b602082019050919050565b600060208201905081810360008301526115d98161159d565b9050919050565b7f4552525f494e56414c49445f5354415445000000000000000000000000000000600082015250565b60006116166011836114f7565b9150611621826115e0565b602082019050919050565b6000602082019050818103600083015261164581611609565b9050919050565b7f4552525f414c52454144595f4c4f434b45440000000000000000000000000000600082015250565b60006116826012836114f7565b915061168d8261164c565b602082019050919050565b600060208201905081810360008301526116b181611675565b9050919050565b60006040820190506116cd60008301856114cd565b6116da60208301846114cd565b9392505050565b600081519050919050565b600081905092915050565b60005b838110156117155780820151818401526020810190506116fa565b60008484015250505050565b600061172c826116e1565b61173681856116ec565b93506117468185602086016116f7565b80840191505092915050565b600061175e8284611721565b915081905092915050565b7f4552525f504552494f445f4241434b454e445f4552524f520000000000000000600082015250565b600061179f6018836114f7565b91506117aa82611769565b602082019050919050565b600060208201905081810360008301526117ce81611792565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552525f504552494f445f434845434b00000000000000000000000000000000600082015250565b600061183a6010836114f7565b915061184582611804565b602082019050919050565b600060208201905081810360008301526118698161182d565b9050919050565b7f4552525f52454749535452595f4241434b454e445f4552524f52000000000000600082015250565b60006118a6601a836114f7565b91506118b182611870565b602082019050919050565b600060208201905081810360008301526118d581611899565b9050919050565b7f4552525f5452414e534645520000000000000000000000000000000000000000600082015250565b6000611912600c836114f7565b915061191d826118dc565b602082019050919050565b6000602082019050818103600083015261194181611905565b9050919050565b7f4552525f52454749535452595f434845434b0000000000000000000000000000600082015250565b600061197e6012836114f7565b915061198982611948565b602082019050919050565b600060208201905081810360008301526119ad81611971565b9050919050565b7f4552525f4954534e4f5441474153000000000000000000000000000000000000600082015250565b60006119ea600e836114f7565b91506119f5826119b4565b602082019050919050565b60006020820190508181036000830152611a19816119dd565b905091905056fea26469706673582212204b38810c2c4b5bced9020cf10279d8df5bfb76187bead441eaff390edb1cbdd964736f6c63430008110033
+\ 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":"FaucetFail","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":"FaucetStateChange","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":"FaucetUsed","type":"event"},{"inputs":[],"name":"amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[],"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"},{"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":"FaucetFail","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":"FaucetStateChange","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":"FaucetUsed","type":"event"},{"anonymous":false,"inputs":[],"name":"ImNotGassy","type":"event"},{"inputs":[],"name":"amount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[],"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"},{"stateMutability":"payable","type":"receive"}]
diff --git a/solidity/EthFaucet.sol b/solidity/EthFaucet.sol
@@ -19,6 +19,7 @@ contract EthFacuet {
event FaucetFail(address indexed _recipient, address indexed _token, uint256 _amount);
event FaucetAmountChange(uint256 _amount);
event FaucetStateChange(uint256 indexed _sealState, address _registry, address _periodChecker);
+ event ImNotGassy();
constructor() {
owner = msg.sender;
@@ -94,6 +95,13 @@ contract EthFacuet {
return true;
}
+ function checkBalance() private {
+ if (amount > address(this).balance) {
+ emit ImNotGassy();
+ revert('ERR_ITSNOTAGAS');
+ }
+ }
+
function check(address _recipient) private returns(bool) {
if (periodChecker != address(0)) {
checkPeriod(_recipient);
@@ -101,10 +109,10 @@ contract EthFacuet {
if (registry != address(0)) {
checkRegistry(_recipient);
}
+ checkBalance();
return true;
}
-
function gimme() public returns(uint256) {
require(check(msg.sender));
payable(msg.sender).transfer(amount);