Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 1.86 KB

README.md

File metadata and controls

58 lines (40 loc) · 1.86 KB

👻 Example listing Aave v2

This repository contains an example of a listing on Aave v2 Ethereum, including some useful helpers to test the protocol post-proposal execution.

Prepare env

cp .env.example .env

Dependencies

make update

Compilation

make build

Testing

make test

Diffing

You can use the diffing utility to generate the diff between two contracts.

sh diff.sh <pathA> <pathB> <outName>

If one of the contracts is deployed you can download the contract from etherscan via make download address=0x...

For a mainnet v2 listing you might want to diff the a/s/v implementations, with a standard implementation (like e.g. the ones of DAI) to ensure it's correct.

# LUSD vs DAI diff example
make download address=0x7b2a3cf972c3193f26cdec6217d27379b6417bd0 # aDAI impl
make download address=0xB2f4Fb41F01CdeF7c10F0e8aFbeB3cFA79d1686F # aLUSD impl

# generate aTokenDiff via
sh ./diff.sh ./etherscan/0x7b2a3cf972c3193f26cdec6217d27379b6417bd0 ./etherscan/0xB2f4Fb41F01CdeF7c10F0e8aFbeB3cFA79d1686F aLUSDimplDiff

# If the code is only available with flattened format you would need to bring the contracts in a similar format.
# You can do so by flattening the respective contract.
# In the example case of LUSD and DAI where both are verified via json this method should not be used.
forge flatten ./etherscan/0x7b2a3cf972c3193f26cdec6217d27379b6417bd0/AToken/@aave/protocol-v2/contracts/protocol/tokenization/AToken.sol --output ./etherscan/0x7b2a3cf972c3193f26cdec6217d27379b6417bd0/Flattened.sol