Skip to content

Commit

Permalink
fix: fixed deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
The-3D committed May 6, 2021
1 parent c809449 commit ff2e0a8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions tasks/proposals/proposal-stk-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { Signer } from 'ethers';
import { getDefenderRelaySigner } from '../../helpers/defender-utils';

task('proposal-stk-extensions', 'Deploy implementations and create proposal')
.addOptionalParam('stkAaveImpl')
.addOptionalParam('stkBptImpl')
.addOptionalParam('stkaaveimpl')
.addOptionalParam('stkbptimpl')
.addFlag('defender')
.setAction(async ({ defender, stkAaveImpl, stkBptImpl }, localBRE: any) => {
.setAction(async ({ defender, stkaaveimpl, stkbptimpl }, localBRE: any) => {
await localBRE.run('set-dre');

let deployer: Signer;
Expand All @@ -21,7 +21,7 @@ task('proposal-stk-extensions', 'Deploy implementations and create proposal')

const {
AAVE_TOKEN = '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9',
IPFS_HASH = 'QmT9qk3CRYbFDWpDFYeAv8T8H1gnongwKhh5J68NLkLir6', // WIP
IPFS_HASH = '0x4d4a4bda3036f8da3f6911941df8c185f0e4ec248de44b44253dae5a4798a001',
AAVE_GOVERNANCE_V2 = '0xEC568fffba86c094cf06b22134B23074DFE2252c', // mainnet
AAVE_LONG_EXECUTOR = '0x61910ecd7e8e942136ce7fe7943f956cea1cc2f7', // mainnet
} = process.env;
Expand All @@ -33,26 +33,26 @@ task('proposal-stk-extensions', 'Deploy implementations and create proposal')
const AAVE_STAKE = '0x4da27a545c0c5B758a6BA100e3a049001de870f5';
const STK_BPT_STAKE = '0xa1116930326D21fB917d5A27F1E9943A9595fb47';

if (!stkAaveImpl) {
stkAaveImpl = await DRE.run('deploy-staked-aave-rev3', { defender: !!defender });
if (!stkaaveimpl) {
stkaaveimpl = await DRE.run('deploy-staked-aave-rev3', { defender: !!defender });
}
if (!stkBptImpl) {
stkBptImpl = await DRE.run('deploy-staked-bpt-rev2', { defender: !!defender });
if (!stkbptimpl) {
stkbptimpl = await DRE.run('deploy-staked-bpt-rev2', { defender: !!defender });
}

await DRE.run('propose-extension', {
stkAaveProxy: AAVE_STAKE,
stkAaveImpl,
stkAaveImpl: stkaaveimpl,
stkBptProxy: STK_BPT_STAKE,
stkBptImpl,
stkBptImpl: stkbptimpl,
aaveGovernance: AAVE_GOVERNANCE_V2,
longExecutor: AAVE_LONG_EXECUTOR,
ipfsHash: IPFS_HASH,
defender: !!defender,
});

return {
stkAaveImpl,
stkBptImpl,
stkaaveimpl,
stkbptimpl,
};
});
12 changes: 7 additions & 5 deletions tasks/proposals/propose-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ task('propose-extension', 'Create some proposals and votes')
.addParam('stkBptImpl')
.addParam('aaveGovernance')
.addParam('longExecutor')
.addParam('ipfsHash')
.addFlag('defender')
.setAction(
async (
Expand All @@ -28,6 +29,7 @@ task('propose-extension', 'Create some proposals and votes')
stkAaveImpl,
stkBptProxy,
stkBptImpl,
ipfsHash
},
localBRE: any
) => {
Expand Down Expand Up @@ -56,6 +58,9 @@ task('propose-extension', 'Create some proposals and votes')
if (!stkBptProxy) {
throw '[hh-task][propose-extension] stkBptProxy param is missing';
}
if (!ipfsHash) {
throw '[hh-task][propose-extension] ipfsHash param is missing';
}

// Calldata for StkAave implementation
const payloadStkAave = StakedTokenV2Rev3__factory.connect(
Expand All @@ -80,9 +85,6 @@ task('propose-extension', 'Create some proposals and votes')
const executeSignature = 'upgradeToAndCall(address,bytes)';
const gov = await IAaveGovernanceV2__factory.connect(aaveGovernance, proposer);

// WIP IPFS
const ipfsEncoded = '0xf7a1f565fcd7684fba6fea5d77c5e699653e21cb6ae25fbf8c5dbc8d694c7949';

try {
const tx = await gov.create(
longExecutor,
Expand All @@ -91,8 +93,8 @@ task('propose-extension', 'Create some proposals and votes')
[executeSignature, executeSignature],
[callDataStkAave, callDataStkBpt],
[false, false],
ipfsEncoded,
{ gasLimit: 3000000 }
ipfsHash,
{ gasLimit: 1000000 }
);
console.log('- Proposal submitted to Governance');
await tx.wait();
Expand Down

0 comments on commit ff2e0a8

Please sign in to comment.