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

Add Aave #94

Merged
merged 3 commits into from
May 21, 2020
Merged

Conversation

sebastiantf
Copy link
Contributor

@sebastiantf sebastiantf commented May 16, 2020

Added Aave

Used the Contract Parser: https://contract-parser.d5.ai

Found two proxy addresses:

  1. 0x398eC7346DcD622eDc5ae82352F02bE94C62d119 --> 0x6d252baea75459ed0077410613c5f6e51cab4750

  2. 0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3 --> 0x5766067108e534419ce13f05899bc3e3f4344948

Also found 16 smart contracts with the same contract name AToken and the same events. Named them with suffixes _v2.json to _v16.json

Fixes #93

@sebastiantf
Copy link
Contributor Author

@askeluv Please review

@askeluv
Copy link
Member

askeluv commented May 16, 2020

Nice work @sebastiantf ! Just to double-check: you handled the proxy addresses as described here, correct?

Also I wonder if we should leave the ATokens out and instead see if there's some kind of factory event we could use to automatically detect them (similar to how we handle Uniswap pools, etc).

Will let @medvedev1088 do the final review before deployment.

@sebastiantf
Copy link
Contributor Author

Yes @askeluv. I found that post from your original post on adding smart contracts to BigQuery and followed it.

@askeluv askeluv requested a review from medvedev1088 May 19, 2020 20:04
@medvedev1088
Copy link
Member

Also I wonder if we should leave the ATokens out and instead see if there's some kind of factory event we could use to automatically detect them (similar to how we handle Uniswap pools, etc).

I agree we should look deeper into it and find some factory method. Or combine multiple tables if they have the same interface. Having 13 version of the table will be difficult to maintain.

@askeluv
Copy link
Member

askeluv commented May 20, 2020

I've asked for a factory in the Aave Discord: https://discordapp.com/channels/602826299974877205/636902500041228309/712685702285885502

One pragmatic alternative would be to keep 1 table, but list multiple contract addresses, similar to this:

"contract_address": "SELECT * FROM UNNEST(['0x595b34c93aa2c2ba0a38daeede629a0dfbdcc559', '0xc29f0599df12eb4cbe1a34354c4bac6d944071d1', '0xb9da44c051c6cc9e04b7e0f95e95d69c6a6d8031'])",

@askeluv
Copy link
Member

askeluv commented May 20, 2020

@sebastiantf would you mind doing the following:

  1. Delete the "duplicates" of aToken contracts, and just keep 1 version for each event.
  2. Replace the contract_address field similarly to what we've done here, where the list of addresses should be every aToken (16 in total?):
    "contract_address": "SELECT * FROM UNNEST(['0x595b34c93aa2c2ba0a38daeede629a0dfbdcc559', '0xc29f0599df12eb4cbe1a34354c4bac6d944071d1', '0xb9da44c051c6cc9e04b7e0f95e95d69c6a6d8031'])",

I will add another $20 as tip for your trouble! Hope you don't mind.

@sebastiantf
Copy link
Contributor Author

I can do that @askeluv. I shall look into it now.

@sebastiantf
Copy link
Contributor Author

sebastiantf commented May 20, 2020

@askeluv Just to make sure, there are 9 events that have 16 duplicates. I have to modify the contract_address field of the first version of each of those 9 events' json to include the 16 addresses.
Is that correct?

@sebastiantf
Copy link
Contributor Author

@askeluv I have made the changes. Please review.

@askeluv
Copy link
Member

askeluv commented May 20, 2020

Great stuff, LGTM. Will let @medvedev1088 make the final review.

Copy link
Member

@medvedev1088 medvedev1088 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@medvedev1088 medvedev1088 merged commit 3163d46 into blockchain-etl:master May 21, 2020
@askeluv
Copy link
Member

askeluv commented May 21, 2020

Paid out the bounty plus $20 tip as promised @sebastiantf - great work! Thanks

@sebastiantf
Copy link
Contributor Author

Thanks @askeluv! Looking forward for more opportunities to work with you.

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

Successfully merging this pull request may close these issues.

Add Aave to contract parser
3 participants