kopia lustrzana https://github.com/bugout-dev/moonstream
Icorrect response from getCode will set is_contract to zero.
rodzic
49f99bb6e2
commit
d7281b6d14
|
@ -949,8 +949,15 @@ def check_if_smart_contract(
|
||||||
web3_client = connect(blockchain_type, user_token=user_token)
|
web3_client = connect(blockchain_type, user_token=user_token)
|
||||||
|
|
||||||
is_contract = False
|
is_contract = False
|
||||||
|
breakpoint()
|
||||||
|
try:
|
||||||
code = web3_client.eth.getCode(address)
|
code = web3_client.eth.getCode(address)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(
|
||||||
|
f"Error while getting code of address: {e} in blockchain: {blockchain_type}"
|
||||||
|
)
|
||||||
|
code = b""
|
||||||
|
|
||||||
if code != b"":
|
if code != b"":
|
||||||
is_contract = True
|
is_contract = True
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue