diff --git a/helpers/contracts-accessors.ts b/helpers/contracts-accessors.ts index 721cb41..ce49a0c 100644 --- a/helpers/contracts-accessors.ts +++ b/helpers/contracts-accessors.ts @@ -238,16 +238,11 @@ export const deployStakedAaveV3 = async ( }; export const deployAaveIncentivesController = async ( - [rewardToken, aavePsm, extraPsmReward, emissionManager]: [ - tEthereumAddress, - tEthereumAddress, - string, - tEthereumAddress - ], + [rewardToken, emissionManager]: [tEthereumAddress, tEthereumAddress], verify?: boolean ) => { const id = eContractid.AaveIncentivesController; - const args: string[] = [rewardToken, aavePsm, extraPsmReward, emissionManager]; + const args: string[] = [rewardToken, emissionManager]; const instance = await deployContract(id, args); await instance.deployTransaction.wait(); if (verify) { diff --git a/tasks/deployments/deploy-incentives.ts b/tasks/deployments/deploy-incentives.ts index b9eed66..f92807a 100644 --- a/tasks/deployments/deploy-incentives.ts +++ b/tasks/deployments/deploy-incentives.ts @@ -13,75 +13,64 @@ const { AaveIncentivesController: id } = eContractid; task(`deploy-incentives`, `Deploy and initializes the ${id} contract`) .addFlag('verify') + .addFlag('deployProxy') .addParam('rewardToken') - .addParam('rewardsVault') - .addOptionalParam('psm') - .addOptionalParam('extraPsmReward') - .addOptionalParam('emissionManager') - .addOptionalParam('distributionDuration') - .addParam('proxyAdmin', `The address to be added as an Admin role in ${id} Transparent Proxy.`) - .addParam('rewardsAdmin', `The address to be added as an Admin role in ${id} Transparent Proxy.`) + .addParam('emissionManager') + .addOptionalParam('rewardsVault') + .addOptionalParam( + 'proxyAdmin', + `The address to be added as an Admin role in ${id} Transparent Proxy.` + ) .setAction( async ( - { - verify, - rewardToken, - rewardsVault, - psm, - extraPsmReward, - emissionManager, - distributionDuration, - proxyAdmin, - rewardsAdmin, - }, + { deployProxy, verify, rewardToken, rewardsVault, emissionManager, proxyAdmin }, localBRE ) => { await localBRE.run('set-dre'); - if (!isAddress(proxyAdmin)) { - throw Error('Missing or incorrect admin param'); - } - if (!isAddress(rewardsAdmin)) { - throw Error('Missing or incorrect admin param'); - } + if (!isAddress(rewardToken)) { throw Error('Missing or incorrect rewardToken param'); } - if (!isAddress(rewardsVault)) { + if (!isAddress(emissionManager)) { + throw Error('Missing or incorrect emissionManager param'); + } + if (deployProxy && !isAddress(proxyAdmin)) { + throw Error('Missing or incorrect admin param'); + } + if (deployProxy && !isAddress(rewardsVault)) { throw Error('Missing or incorrect rewardsVault param'); } - psm = isAddress(psm) ? psm : ZERO_ADDRESS; - extraPsmReward = extraPsmReward ? BigNumber.from(extraPsmReward) : BigNumber.from('0'); - emissionManager = isAddress(emissionManager) ? emissionManager : ZERO_ADDRESS; - distributionDuration = distributionDuration - ? BigNumber.from(distributionDuration) - : BigNumber.from('0'); console.log(`\n- ${id} implementation deployment:`); const aaveIncentivesControllerImpl = await deployAaveIncentivesController( - [rewardToken, psm, extraPsmReward, emissionManager], + [rewardToken, emissionManager], verify ); - console.log(`\tInitializing ${id} proxy`); - - const aaveIncentivesProxy = await deployInitializableAdminUpgradeabilityProxy(verify); - - const encodedParams = aaveIncentivesControllerImpl.interface.encodeFunctionData( - 'initialize', - [rewardsVault, distributionDuration, rewardsAdmin] - ); + if (deployProxy) { + console.log(`\tDeploying${id} proxy`); + const aaveIncentivesProxy = await deployInitializableAdminUpgradeabilityProxy(verify); - await waitForTx( - await aaveIncentivesProxy.functions['initialize(address,address,bytes)']( - aaveIncentivesControllerImpl.address, - proxyAdmin, - encodedParams - ) - ); + console.log(`\tInitializing ${id} proxy`); + const encodedParams = aaveIncentivesControllerImpl.interface.encodeFunctionData( + 'initialize', + [rewardsVault] + ); - console.log(`\tFinished ${id} deployment and initialization`); - console.log(`\t- Proxy: ${aaveIncentivesProxy.address}`); - console.log(`\t- Impl: ${aaveIncentivesControllerImpl.address}`); + await waitForTx( + await aaveIncentivesProxy.functions['initialize(address,address,bytes)']( + aaveIncentivesControllerImpl.address, + proxyAdmin, + encodedParams + ) + ); + console.log(`\tFinished ${id} deployment and initialization`); + console.log(`\t- Proxy: ${aaveIncentivesProxy.address}`); + console.log(`\t- Impl: ${aaveIncentivesControllerImpl.address}`); + } else { + console.log(`\tFinished ${id} deployment and initialization`); + console.log(`\t- Impl: ${aaveIncentivesControllerImpl.address}`); + } } ); diff --git a/tasks/migrations/configure-assets.ts b/tasks/migrations/configure-assets.ts index b5c2e00..d66c34e 100644 --- a/tasks/migrations/configure-assets.ts +++ b/tasks/migrations/configure-assets.ts @@ -44,7 +44,10 @@ task('configure-asset', 'Deployment in for Main, Kovan and Ropsten networks') console.log('CONFIGURATION: \n ', config); if (execute) { - await incentivesControllerContract.configureAssets(config); + await incentivesControllerContract.configureAssets( + config.map((x) => x.underlyingAsset), + config.map((x) => x.emissionPerSecond) + ); console.log('\n INCENTIVES CONTROLLER CONFIGURED'); } });