-
Notifications
You must be signed in to change notification settings - Fork 76
Description
Chainlink uses a slightly different erc20 transfer signature which breaks how many tokens it thinks were transferred.
Compare
https://ethtx.info/mainnet/0xbaf08c360fc8f6098adbe2c7c3612106432123397dd2d5b84d042c1786261207/

https://etherscan.io/tx/0xbaf08c360fc8f6098adbe2c7c3612106432123397dd2d5b84d042c1786261207

Potential Solution
Add in an additional signature to look for.
In erc20.py add
erc20_modified_transfer_event = EventSemantics( signature="0xe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16", anonymous=False, name="Transfer", parameters=[ ParameterSemantics( parameter_name="src", parameter_type="address", indexed=True ), ParameterSemantics( parameter_name="dst", parameter_type="address", indexed=True ), ParameterSemantics( parameter_name="value", parameter_type="uint256", indexed=False ), ParameterSemantics( parameter_name="data", parameter_type="bytes", indexed=False,dynamic=True ), ], )
and
ERC20_MODIFIED_EVENTS = { erc20_modified_transfer_event.signature: erc20_modified_transfer_event, erc20_approval_event.signature: erc20_approval_event, }
And then in repository.py modify line 214
from
if all(erc20_event in events for erc20_event in ERC20_EVENTS) and all(
to
if (all(erc20_event in events for erc20_event in ERC20_EVENTS) or all(erc20_event in events for erc20_event in ERC20_MODIFIED_EVENTS)) and all(
This will pull the correct balance:
I don't know if this is where you actually want to put it but it does solve the issue. I can submit a pull request if you'd like.