From bdd4f72b546a8ad782b5978b86b76fa2316d0e1c Mon Sep 17 00:00:00 2001 From: zkbenny Date: Thu, 27 Jun 2024 21:53:19 +0800 Subject: [PATCH] add deployZkLinkTokenTarget --- script/deploy_zklink_token.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/script/deploy_zklink_token.js b/script/deploy_zklink_token.js index c04918e..6bc63f6 100644 --- a/script/deploy_zklink_token.js +++ b/script/deploy_zklink_token.js @@ -59,3 +59,24 @@ task('deployZkLinkToken', 'Deploy zkLink token') fs.writeFileSync(deployLogPath, JSON.stringify(deployLog, null, 2)); } }); + +task('deployZkLinkTokenTarget', 'Deploy zkLink token target') + .addOptionalParam('skipVerify', 'Skip verify', false, types.boolean) + .setAction(async (taskArgs, hardhat) => { + let skipVerify = taskArgs.skipVerify; + console.log('skip verify contracts?', skipVerify); + + const contractDeployer = new ChainContractDeployer(hardhat); + await contractDeployer.init(); + + // deploy zkLink token target + console.log('deploy zkLink token target...'); + const contract = await contractDeployer.deployContract('ZkLinkToken', [], []); + const zkLinkTokenTargetAddr = await contract.getAddress(); + console.log('zkLinkTokenTarget', zkLinkTokenTargetAddr); + + // verify target contract + if (!skipVerify) { + await verifyContractCode(hardhat, zkLinkTokenTargetAddr, []); + } + });