Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chainlink has incorrect balance #195

Open
bromulous opened this issue Aug 11, 2023 · 1 comment
Open

Chainlink has incorrect balance #195

bromulous opened this issue Aug 11, 2023 · 1 comment

Comments

@bromulous
Copy link

Chainlink uses a slightly different erc20 transfer signature which breaks how many tokens it thinks were transferred.
Compare
https://ethtx.info/mainnet/0xbaf08c360fc8f6098adbe2c7c3612106432123397dd2d5b84d042c1786261207/

Screenshot 2023-08-11 at 6 00 15 PM

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

Screenshot 2023-08-11 at 6 00 33 PM

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:
Screenshot 2023-08-11 at 6 06 37 PM

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.

@bromulous
Copy link
Author

Pull request #196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant