mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
feat: Add deployment curve atoken scripts
This commit is contained in:
parent
823aeb6b47
commit
db9a5b64dd
|
@ -1,4 +1,5 @@
|
|||
import BigNumber from 'bignumber.js';
|
||||
import { eEthereumNetwork } from './types';
|
||||
|
||||
// ----------------
|
||||
// MATH
|
||||
|
@ -72,3 +73,7 @@ export const MOCK_CHAINLINK_AGGREGATORS_PRICES = {
|
|||
USD: '5848466240000000',
|
||||
REW: oneEther.multipliedBy('0.00137893825230').toFixed(),
|
||||
};
|
||||
|
||||
export const CRV_TOKEN = {
|
||||
[eEthereumNetwork.main]: '0xD533a949740bb3306d119CC777fa900bA034cd52',
|
||||
};
|
||||
|
|
|
@ -51,6 +51,7 @@ import {
|
|||
FlashLiquidationAdapterFactory,
|
||||
RewardsTokenFactory,
|
||||
RewardsATokenMockFactory,
|
||||
CurveRewardsAwareATokenFactory,
|
||||
} from '../types';
|
||||
import {
|
||||
withSaveAndVerify,
|
||||
|
@ -68,6 +69,7 @@ import { readArtifact as buidlerReadArtifact } from '@nomiclabs/buidler/plugins'
|
|||
import { HardhatRuntimeEnvironment } from 'hardhat/types';
|
||||
import { LendingPoolLibraryAddresses } from '../types/LendingPoolFactory';
|
||||
import { UiPoolDataProvider } from '../types';
|
||||
import { CRV_TOKEN } from './constants';
|
||||
|
||||
export const deployUiPoolDataProvider = async (
|
||||
[incentivesController, aaveOracle]: [tEthereumAddress, tEthereumAddress],
|
||||
|
@ -662,6 +664,8 @@ export const chooseATokenDeployment = (id: eContractid) => {
|
|||
return deployDelegationAwareATokenImpl;
|
||||
case eContractid.RewardsATokenMock:
|
||||
return deployRewardATokenMock;
|
||||
case eContractid.CurveRewardsAwareAToken:
|
||||
return deployCurveRewardsAwareATokenByNetwork;
|
||||
default:
|
||||
throw Error(`Missing aToken implementation deployment script for: ${id}`);
|
||||
}
|
||||
|
@ -714,3 +718,21 @@ export const deployATokenImplementations = async (
|
|||
await deployGenericVariableDebtToken(verify);
|
||||
}
|
||||
};
|
||||
|
||||
export const deployCurveRewardsAwareAToken = async (
|
||||
crvToken: tEthereumAddress,
|
||||
verify?: boolean
|
||||
) => {
|
||||
const args: [tEthereumAddress] = [crvToken];
|
||||
return withSaveAndVerify(
|
||||
await new CurveRewardsAwareATokenFactory(await getFirstSigner()).deploy(...args),
|
||||
eContractid.CurveRewardsAwareAToken,
|
||||
args,
|
||||
verify
|
||||
);
|
||||
};
|
||||
|
||||
export const deployCurveRewardsAwareATokenByNetwork = async (verify?: boolean) => {
|
||||
const network = DRE.network.name as eEthereumNetwork;
|
||||
return deployCurveRewardsAwareAToken(CRV_TOKEN[network], verify);
|
||||
};
|
||||
|
|
|
@ -89,6 +89,7 @@ export enum eContractid {
|
|||
FlashLiquidationAdapter = 'FlashLiquidationAdapter',
|
||||
RewardsATokenMock = 'RewardsATokenMock',
|
||||
RewardsToken = 'RewardsToken',
|
||||
CurveRewardsAwareAToken = 'CurveRewardsAwareAToken',
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue
Block a user