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

fix: Requesting ERC-20 or ERC-677 Transfer events in log filter. #186

Merged
merged 5 commits into from
Jan 19, 2022

Conversation

mariuspod
Copy link
Contributor

This PR fixes some issues in the treasury_exporter for ERC-677 transfer events which have a different signature than usual Transfer events:
function transferAndCall(address receiver, uint amount, bytes data) returns (bool success)

ethereum/EIPs#677

Prior to this fix, these events fail the exporter because the topic filter for the usual ERC-20 transfer event doesn't match with the first topic of the received event.

@banteg
Copy link
Member

banteg commented Dec 20, 2021

I'm looking at the specific example with LINK and it appears we just have the wrong ABI cached.

>>> Contract('0x514910771AF9Ca656af840dff83E8264EcF986CA')
<ERC20 Contract '0x514910771AF9Ca656af840dff83E8264EcF986CA'>  # wrong

>>> Contract('0x514910771AF9Ca656af840dff83E8264EcF986CA')
<LinkToken Contract '0x514910771AF9Ca656af840dff83E8264EcF986CA'>  # right

yearn/treasury/treasury.py Outdated Show resolved Hide resolved
yearn/treasury/treasury.py Show resolved Hide resolved
yearn/treasury/treasury.py Outdated Show resolved Hide resolved
mariuspod and others added 4 commits December 23, 2021 10:41
…test solc compiler patch version for contract compilations and remove handling of '(unknown)' events.
… in which fix event decoding for the given chainlink contract.
@mariuspod
Copy link
Contributor Author

@banteg
updated according to recommendations from review

@banteg banteg merged commit 7499252 into master Jan 19, 2022
mariuspod added a commit to BobTheBuidler/yearn-exporter that referenced this pull request Jan 27, 2022
…rn#186)

* fix: Requesting ERC-20 or ERC-677 Transfer events in log filter.

* fix: use brownie version that contains the ability to download the latest solc compiler patch version for contract compilations and remove handling of '(unknown)' events.

* fix: don't import relative parts and use encode_* methods to encode the addresses for the log filter.

* fix: typo in yaml file

* feat: use brownie master branch which has the required changes merged in which fix event decoding for the given chainlink contract.
@BobTheBuidler BobTheBuidler deleted the fix/erc677_transfers branch February 1, 2022 01:19
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

Successfully merging this pull request may close these issues.

2 participants