erc20-faucet

ERC20 token faucet
Log | Files | Refs

commit 4d33821358deff2ed70f51ea16e1b083d7067481
parent 6efa2e5ae3d008eccbb931ca2c6cd04da0f9e39c
Author: nolash <dev@holbrook.no>
Date:   Wed, 14 Apr 2021 18:52:43 +0200

Add token viewm method

Diffstat:
Mpython/erc20_single_shot_faucet/faucet.py | 19+++++++++++++++++++
Mpython/requirements.txt | 2+-
Mpython/setup.cfg | 2+-
3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/python/erc20_single_shot_faucet/faucet.py b/python/erc20_single_shot_faucet/faucet.py @@ -89,3 +89,22 @@ class SingleShotFaucet(TxFactory): def parse_usable_for(self, v): r = abi_decode_single(ABIContractType.UINT256, v) return r == 0 + + + def token(self, contract_address, sender_address=ZERO_ADDRESS): + o = jsonrpc_template() + o['method'] = 'eth_call' + enc = ABIContractEncoder() + enc.method('token') + data = add_0x(enc.get()) + tx = self.template(sender_address, contract_address) + tx = self.set_code(tx, data) + o['params'].append(self.normalize(tx)) + return o + + + @classmethod + def parse_token(self, v): + return abi_decode_single(ABIContractType.ADDRESS, v) + + diff --git a/python/requirements.txt b/python/requirements.txt @@ -1,3 +1,3 @@ confini~=0.3.6rc3 crypto-dev-signer~=0.4.14b2 -chainlib~=0.0.2a12 +chainlib~=0.0.2a13 diff --git a/python/setup.cfg b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = erc20-single-shot-faucet -version = 0.2.0a12 +version = 0.2.0a13 description = ERC20 token faucet that can be used once per account author = Louis Holbrook author_email = dev@holbrook.no