This repository contains an example of a listing on Aave v2 Ethereum, including some useful helpers to test the protocol post-proposal execution.
- Implementations deploy script: DeployImplementations
- Proposal payload: ENSListingPayload
- Listing tests: ValidationENSListing
- Aave v2 pool helpers: AaveV2Helpers
cp .env.example .env
forge update
forge build
forge test
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.
# ENS vs DAI diff example
make download address=0x7b2a3cf972c3193f26cdec6217d27379b6417bd0 # aDAI impl
make download address=0xB2f4Fb41F01CdeF7c10F0e8aFbeB3cFA79d1686F # aENS impl
# generate aTokenDiff via
sh ./diff.sh ./etherscan/0x7b2a3cf972c3193f26cdec6217d27379b6417bd0 ./etherscan/0xB2f4Fb41F01CdeF7c10F0e8aFbeB3cFA79d1686F aENSimplDiff
# 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 ENS 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
-
You first need to deploy the implementations for your asset and initialize them. You can do so by altering this line in the implementations deployment script to suite your needs and deploying the implementations via
make deploy-implementations
. -
You then need to create & deploy your payload based on the ENSListingPayload example. The Payload expects the 3 addresses deployed in step 1) as input on the constructor.
-
You then need to create the on-chain proposal following the example in ProposalCreation.
While these steps build on each other, they don't have to be performed by the same address.