mirror of
https://github.com/chaintool-py/eth-erc20.git
synced 2026-04-20 18:34:39 +02:00
Compare commits
2 Commits
sohail/hei
...
dev-0.5.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e7e539bb9 | |||
|
|
a87fbb13bc
|
@@ -9,12 +9,14 @@ from chainlib.eth.contract import (
|
|||||||
ABIContractType,
|
ABIContractType,
|
||||||
abi_decode_single,
|
abi_decode_single,
|
||||||
)
|
)
|
||||||
|
from chainlib.eth.jsonrpc import to_blockheight_param
|
||||||
from chainlib.eth.error import RequestMismatchException
|
from chainlib.eth.error import RequestMismatchException
|
||||||
from chainlib.eth.tx import (
|
from chainlib.eth.tx import (
|
||||||
TxFactory,
|
TxFactory,
|
||||||
TxFormat,
|
TxFormat,
|
||||||
)
|
)
|
||||||
from chainlib.jsonrpc import JSONRPCRequest
|
from chainlib.jsonrpc import JSONRPCRequest
|
||||||
|
from chainlib.block import BlockSpec
|
||||||
from hexathon import (
|
from hexathon import (
|
||||||
add_0x,
|
add_0x,
|
||||||
strip_0x,
|
strip_0x,
|
||||||
@@ -26,7 +28,7 @@ logg = logging.getLogger()
|
|||||||
class ERC20(TxFactory):
|
class ERC20(TxFactory):
|
||||||
|
|
||||||
|
|
||||||
def balance_of(self, contract_address, address, sender_address=ZERO_ADDRESS, id_generator=None):
|
def balance_of(self, contract_address, address, sender_address=ZERO_ADDRESS, id_generator=None, height=BlockSpec.LATEST):
|
||||||
j = JSONRPCRequest(id_generator)
|
j = JSONRPCRequest(id_generator)
|
||||||
o = j.template()
|
o = j.template()
|
||||||
o['method'] = 'eth_call'
|
o['method'] = 'eth_call'
|
||||||
@@ -38,7 +40,8 @@ class ERC20(TxFactory):
|
|||||||
tx = self.template(sender_address, contract_address)
|
tx = self.template(sender_address, contract_address)
|
||||||
tx = self.set_code(tx, data)
|
tx = self.set_code(tx, data)
|
||||||
o['params'].append(self.normalize(tx))
|
o['params'].append(self.normalize(tx))
|
||||||
o['params'].append('latest')
|
height = to_blockheight_param(height)
|
||||||
|
o['params'].append(height)
|
||||||
o = j.finalize(o)
|
o = j.finalize(o)
|
||||||
return o
|
return o
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = eth-erc20
|
name = eth-erc20
|
||||||
version = 0.5.1
|
version = 0.5.2
|
||||||
description = ERC20 interface and simple contract with deployment script that lets any address mint and gift itself tokens.
|
description = ERC20 interface and simple contract with deployment script that lets any address mint and gift itself tokens.
|
||||||
author = Louis Holbrook
|
author = Louis Holbrook
|
||||||
author_email = dev@holbrook.no
|
author_email = dev@holbrook.no
|
||||||
@@ -20,7 +20,7 @@ classifiers =
|
|||||||
License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
||||||
Topic :: Internet
|
Topic :: Internet
|
||||||
#Topic :: Blockchain :: EVM
|
#Topic :: Blockchain :: EVM
|
||||||
license = OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
license = AGPLv3+
|
||||||
licence_files =
|
licence_files =
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user