mirror of
https://github.com/chaintool-py/eth-erc20.git
synced 2026-04-28 21:21:06 +02:00
Add id generator for approve, transfer from
This commit is contained in:
@@ -148,7 +148,7 @@ class ERC20(TxFactory):
|
||||
return tx
|
||||
|
||||
|
||||
def transfer_from(self, contract_address, sender_address, holder_address, recipient_address, value, tx_format=TxFormat.JSONRPC):
|
||||
def transfer_from(self, contract_address, sender_address, holder_address, recipient_address, value, tx_format=TxFormat.JSONRPC, id_generator=None):
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('transferFrom')
|
||||
enc.typ(ABIContractType.ADDRESS)
|
||||
@@ -164,7 +164,7 @@ class ERC20(TxFactory):
|
||||
return tx
|
||||
|
||||
|
||||
def approve(self, contract_address, sender_address, spender_address, value, tx_format=TxFormat.JSONRPC):
|
||||
def approve(self, contract_address, sender_address, spender_address, value, tx_format=TxFormat.JSONRPC, id_generator=None):
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('approve')
|
||||
enc.typ(ABIContractType.ADDRESS)
|
||||
|
||||
@@ -61,7 +61,7 @@ token_address = config.get('_EXEC_ADDRESS')
|
||||
|
||||
|
||||
def main():
|
||||
g = ERC20(chain_spec=chain_spec)
|
||||
g = ERC20(chain_spec=chain_spec, gas_oracle=rpc.get_gas_oracle())
|
||||
|
||||
# determine decimals
|
||||
decimals_o = g.decimals(token_address)
|
||||
|
||||
Reference in New Issue
Block a user