llamaxyz / aave-v3-crosschain-maticx-listing

AAVE v3 crosschain MaticX listing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aave v3 cross-chain listing template

This template contains an opinionated smart contract template for creating proposals to list assets on the aave polygon v3 market.

For a proposal to be executed on polygon it needs to pass mainnet governance proposal that sends an encoded payload via sendMessageToChild(address,bytes) on FX_ROOT(mainnet) to FX_CHILD(polygon). Once the state is synced to FX_CHILD on polygon network it will queue the payload on POLYGON_BRIDGE_EXECUTOR.

About

To simplify the process of creating a cross chain proposal this repository contains an opinionated CrosschainForwarderPolygon which expects a payload address deployed on the polygon network as the only parameter. The mainnet proposal payload will then be a simple execute() signature with DELEGATECALL enabled.

visualization

Getting started

Setup environment

cp .env.example .env

Build

forge build

Test

forge test

Deploy L2 proposal

# Deploy proposal
make deploy-<mai|frax>-<ledger|pk>
# Verify proposal
make verify-<mai|frax>

Deploy L1 proposal

Make sure the referenced IPFS_HASH is properly encoded (check if the ipfs file is in json format and renders nicely on https://app.aave.com/governance/ipfs-preview/?ipfsHash=).

make deploy-l1-<mai|frax>-proposal-<ledger|pk>

Creating the proposal

To create a proposal you have to do two things:

  1. deploy the Polygon Payload (see MiMatic)
  2. create the mainnet proposal (see DeployL1Proposal)

While the order of actions is important as the mainnet proposal needs the l2 payload address, both actions can be performed by different parties / addresses. The address creating the mainnet proposal requires 80k AAVE of proposition power.

Deployed addresses

References

Misc

About

AAVE v3 crosschain MaticX listing

License:MIT License


Languages

Language:Solidity 97.6%Language:TypeScript 2.1%Language:Makefile 0.2%Language:Shell 0.0%Language:Nix 0.0%