Skip to content

Commit

Permalink
update encodeOperation
Browse files Browse the repository at this point in the history
  • Loading branch information
zkbenny committed Apr 3, 2024
1 parent 8ebeaa1 commit 7a8d04e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions script/deploy_governance.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ task('encodeERC20Approve', 'Encode calldata for erc20 approve')
});

task('encodeOperation', 'Encode operation')
.addParam('governance', 'The governance address(default get from deploy log)', undefined, types.string, true)
.addParam('target', 'The target address', undefined, types.string, false)
.addParam('value', 'The call value to target', undefined, types.int, false)
.addParam('data', 'The call data to target', undefined, types.string, false)
Expand All @@ -120,6 +121,7 @@ task('encodeOperation', 'Encode operation')
)
.addParam('delay', 'The delay', 0, types.int, true)
.setAction(async (taskArgs, hardhat) => {
let governanceAddr = taskArgs.governance;
let target = taskArgs.target;
let value = taskArgs.value;
let data = taskArgs.data;
Expand All @@ -133,10 +135,8 @@ task('encodeOperation', 'Encode operation')
console.log('salt', salt);
console.log('delay', delay);

const governanceAddr = readDeployContract(logName.DEPLOY_GOVERNANCE_LOG_PREFIX, logName.DEPLOY_LOG_GOVERNANCE);
if (!governanceAddr) {
console.log('governance address not found');
return;
governanceAddr = readDeployContract(logName.DEPLOY_GOVERNANCE_LOG_PREFIX, logName.DEPLOY_LOG_GOVERNANCE);
}
console.log('governance', governanceAddr);
const governance = await hardhat.ethers.getContractAt('Governance', governanceAddr);
Expand Down

0 comments on commit 7a8d04e

Please sign in to comment.