0xSpraggins / atoken-wrapper-deployer

Script for deploying Aave aTokens on Avalanche using Gnosis Safe batch transactions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

atoken-wrapper-deployer

npm

This repo provides easy to use scripts for deploying multiple Aave V3 aToken wrappers on Avalanche C-Chain using batched transactions via a Safe multisig wallet.

Warning This repo is a work in progress. Due to the Safe-SDK compatibility issues the BatchDeployment script is not yet functional. The GenerateAvaxDeployMetadata script is functional and can be used to generate the metadata for a batch deployment as well as deploy the necessary Aave V3 aToken wrappers.

Repository Setup

Install dependencies

yarn install

Create .env file

A sample .env file is provided in the repo. Copy it and fill in the values.

AVALANCHE_URL=
PRIVATE_KEY=
ETHERSCAN_API_KEY=

Add tokens to be deployed

Within helpers/tokenRegistry is a list of tokens to be deployed. Edit this list if these tokens need to be changed.

Obtain the necessary underlying tokens to use as an initial deposit

Initial deposits are required in order to help prevent exchange rate attacks on the aToken. A recommended deposit amount is between $50 and $100 per asset. The initial depsit values are already set within the tokenRegistry but can be changed if necessary. Please make sure the account you are deploying from contains these tokens before running the deployment script.

Available Scripts

GenerateAvaxDeployMetadata

This script generates the metadata for the Avax deployment. This metadata is used by the Safe multisig wallet to execute a batch transaction to deploy the aToken wrappers.

This scripted should be run before batchDeployment on with hardhat and will generate a file called aave_v3_wrapper_output.json in the txFiles directory.

Warning If you run this script on a production network it will deploy all tokens and generate an overwriting aave_v3_wrapper_output.json file. Please only run this script on hardhat if you wish to deploy using batch transactions.

yarn hardhat run scripts/GenerateAvaxDeployMetadata.ts --network <network-name>

BatchDeployment

This script deploys the aToken wrappers to the Avalanche C-Chain using a Safe multisig wallet. The script will read the aave_v3_wrapper_output.json file generated by GenerateAvaxDeployMetadata and deploy the aToken wrappers.

yarn hardhat run scripts/BatchDeployment.ts --network <network-name>

Warning This script is not yet functional due to Safe-SDK compatibility issues. Please use GenerateAvaxDeployMetadata to deploy wrappers.

About

Script for deploying Aave aTokens on Avalanche using Gnosis Safe batch transactions


Languages

Language:Solidity 79.8%Language:TypeScript 20.2%