mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
wip: tests changes due new curve treasury
This commit is contained in:
parent
ba68afc1fc
commit
a693e0b767
|
@ -10,18 +10,14 @@ import { waitForTx } from '../../helpers/misc-utils';
|
||||||
task(`deploy-curve-treasury`, `Deploys the CurveTreasury contract`)
|
task(`deploy-curve-treasury`, `Deploys the CurveTreasury contract`)
|
||||||
.addParam('proxyAdmin')
|
.addParam('proxyAdmin')
|
||||||
.addParam('treasuryAdmin')
|
.addParam('treasuryAdmin')
|
||||||
.addOptionalParam('pool')
|
.addOptionalParam('collector')
|
||||||
.addFlag('verify', `Verify contract via Etherscan API.`)
|
.addFlag('verify', `Verify contract via Etherscan API.`)
|
||||||
.setAction(async ({ verify, proxyAdmin, treasuryAdmin, pool }, localBRE) => {
|
.setAction(async ({ verify, proxyAdmin, treasuryAdmin, collector }, localBRE) => {
|
||||||
await localBRE.run('set-DRE');
|
await localBRE.run('set-DRE');
|
||||||
|
|
||||||
const net = localBRE.network.name;
|
const net = localBRE.network.name;
|
||||||
console.log(`\n- Curve Treasury deployment`);
|
console.log(`\n- Curve Treasury deployment`);
|
||||||
let aaveCollector = ZERO_ADDRESS;
|
const aaveCollector = collector || ZERO_ADDRESS;
|
||||||
|
|
||||||
if (pool) {
|
|
||||||
aaveCollector = loadPoolConfig(pool).ReserveFactorTreasuryAddress[net];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deploy implementation
|
// Deploy implementation
|
||||||
const implementation = await deployCurveTreasury(
|
const implementation = await deployCurveTreasury(
|
||||||
|
@ -50,4 +46,6 @@ task(`deploy-curve-treasury`, `Deploys the CurveTreasury contract`)
|
||||||
console.log(`\tFinished CurveTreasury deployment`);
|
console.log(`\tFinished CurveTreasury deployment`);
|
||||||
console.log(`\tProxy:`, proxy.address);
|
console.log(`\tProxy:`, proxy.address);
|
||||||
console.log(`\tImpl:`, implementation.address);
|
console.log(`\tImpl:`, implementation.address);
|
||||||
|
|
||||||
|
return { implementation: implementation.address, proxy: proxy.address };
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { ZERO_ADDRESS } from '../../../helpers/constants';
|
||||||
import { makeSuite, SignerWithAddress, TestEnv } from '../helpers/make-suite';
|
import { makeSuite, SignerWithAddress, TestEnv } from '../helpers/make-suite';
|
||||||
import {
|
import {
|
||||||
advanceTimeAndBlock,
|
advanceTimeAndBlock,
|
||||||
|
DRE,
|
||||||
evmRevert,
|
evmRevert,
|
||||||
evmSnapshot,
|
evmSnapshot,
|
||||||
impersonateAddress,
|
impersonateAddress,
|
||||||
|
@ -46,6 +47,12 @@ const USER_ADDRESS = '0x9c5083dd4838E120Dbeac44C052179692Aa5dAC5';
|
||||||
const CRV_TOKEN = '0xd533a949740bb3306d119cc777fa900ba034cd52';
|
const CRV_TOKEN = '0xd533a949740bb3306d119cc777fa900ba034cd52';
|
||||||
const SNX_TOKEN = '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f';
|
const SNX_TOKEN = '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f';
|
||||||
|
|
||||||
|
const GAUGE_3POOL: GaugeInfo = {
|
||||||
|
address: '0xbFcF63294aD7105dEa65aA58F8AE5BE2D9d0952A',
|
||||||
|
name: 'aToken 3pool Gauge Deposit',
|
||||||
|
rewardTokens: [],
|
||||||
|
};
|
||||||
|
|
||||||
const GAUGE_AAVE3: GaugeInfo = {
|
const GAUGE_AAVE3: GaugeInfo = {
|
||||||
address: '0xd662908ADA2Ea1916B3318327A97eB18aD588b5d',
|
address: '0xd662908ADA2Ea1916B3318327A97eB18aD588b5d',
|
||||||
name: 'aToken a3CRV Gauge Deposit',
|
name: 'aToken a3CRV Gauge Deposit',
|
||||||
|
@ -70,7 +77,7 @@ const GAUGE_ANKR: GaugeInfo = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
const listGauge = async (gauge: GaugeInfo) => {
|
const listCurveLPToken = async (gauge: GaugeInfo, curveTreasury: tEthereumAddress) => {
|
||||||
const { symbol } = gauge;
|
const { symbol } = gauge;
|
||||||
const poolConfig = loadPoolConfig(ConfigNames.Aave);
|
const poolConfig = loadPoolConfig(ConfigNames.Aave);
|
||||||
const {
|
const {
|
||||||
|
@ -86,8 +93,12 @@ const listGauge = async (gauge: GaugeInfo) => {
|
||||||
poolConfig.ReserveFactorTreasuryAddress,
|
poolConfig.ReserveFactorTreasuryAddress,
|
||||||
eEthereumNetwork.main
|
eEthereumNetwork.main
|
||||||
);
|
);
|
||||||
|
|
||||||
const aTokenImpl = (
|
const aTokenImpl = (
|
||||||
await new CurveGaugeRewardsAwareATokenFactory(await getFirstSigner()).deploy(CRV_TOKEN)
|
await new CurveGaugeRewardsAwareATokenFactory(await getFirstSigner()).deploy(
|
||||||
|
CRV_TOKEN,
|
||||||
|
curveTreasury
|
||||||
|
)
|
||||||
).address;
|
).address;
|
||||||
const stableDebtTokenImpl = await getContractAddressWithJsonFallback(
|
const stableDebtTokenImpl = await getContractAddressWithJsonFallback(
|
||||||
eContractid.StableDebtToken,
|
eContractid.StableDebtToken,
|
||||||
|
@ -240,10 +251,22 @@ makeSuite('Curve Rewards Aware aToken', (testEnv: TestEnv) => {
|
||||||
expect(gaugeAave3Balance).to.be.gt('0');
|
expect(gaugeAave3Balance).to.be.gt('0');
|
||||||
expect(gaugeAnkrBalance).to.be.gt('0');
|
expect(gaugeAnkrBalance).to.be.gt('0');
|
||||||
|
|
||||||
|
// Deploy Curve Treasury
|
||||||
|
const poolConfig = loadPoolConfig(ConfigNames.Aave);
|
||||||
|
const collector = await getParamPerNetwork(
|
||||||
|
poolConfig.ReserveFactorTreasuryAddress,
|
||||||
|
eEthereumNetwork.main
|
||||||
|
);
|
||||||
|
|
||||||
|
const { proxy: curveTreasury } = await DRE.run('deploy-curve-treasury', {
|
||||||
|
proxyAdmin: ZERO_ADDRESS,
|
||||||
|
treasuryAdmin: ZERO_ADDRESS,
|
||||||
|
collector,
|
||||||
|
});
|
||||||
// Gauge tokens should be listed at Aave test deployment
|
// Gauge tokens should be listed at Aave test deployment
|
||||||
await listGauge(GAUGE_EURS);
|
await listCurveLPToken(GAUGE_EURS, curveTreasury);
|
||||||
await listGauge(GAUGE_AAVE3);
|
await listCurveLPToken(GAUGE_AAVE3, curveTreasury);
|
||||||
await listGauge(GAUGE_ANKR);
|
await listCurveLPToken(GAUGE_ANKR, curveTreasury);
|
||||||
|
|
||||||
const allTokens = await testEnv.helpersContract.getAllATokens();
|
const allTokens = await testEnv.helpersContract.getAllATokens();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user