From bc7fa5e8872bf0d2bf8fcbcb8053e312ab3e407f Mon Sep 17 00:00:00 2001 From: T-Hax <> Date: Mon, 12 Jun 2023 16:13:21 +0000 Subject: [PATCH] deploy script fixup Signed-off-by: T-Hax <> --- contracts/MinimalInstanceFactory.sol | 2 +- package.json | 2 +- scripts/deploy.js | 68 ++++++---------------------- 3 files changed, 17 insertions(+), 55 deletions(-) diff --git a/contracts/MinimalInstanceFactory.sol b/contracts/MinimalInstanceFactory.sol index 386ef8e..d09f759 100644 --- a/contracts/MinimalInstanceFactory.sol +++ b/contracts/MinimalInstanceFactory.sol @@ -69,9 +69,9 @@ contract MinimalInstanceFactory { uint32 _merkleTreeHeight ) { // Store instance parameters - merkleTreeHeight = _merkleTreeHeight; verifier = _verifierAddress; hasher = _hasherAddress; + merkleTreeHeight = _merkleTreeHeight; // Store router addresses router = _routerAddresss; diff --git a/package.json b/package.json index ef37bb7..29db03e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "tornado-instances", + "name": "@AlienTornadosaurusHex/instances", "version": "1.0.0", "license": "MIT", "scripts": { diff --git a/scripts/deploy.js b/scripts/deploy.js index 4167c05..035f279 100755 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -54,24 +54,23 @@ const promptMessageBase = (middle) => `\n${middle}\n\nAre you sure you would lik async function main() { const minimalFactoryFactory = await ethers.getContractFactory('MinimalInstanceFactory') - const proposalFactoryFactory = await ethers.getContractFactory('InstanceProposalFactory') const chainId = (await ethers.provider.getNetwork()).chainId - const signer = await ethers.getSigner() - - let minimalFactory, proposalFactory, nativeCloneableImplAddr, erc20CloneableImplAddr + let minimalFactory, ethImplAddr, ERC20ImplAddr if (await prompt(promptMessageBase('Continuing to MinimalInstanceFactory deployment.'))) { minimalFactory = await minimalFactoryFactory.deploy( config.verifier, config.hasher, + config.router, config.merkleTreeHeight, ) + console.log(happyDeployedMessage('MinimalInstanceFactory', chainId, minimalFactory.address)) await hre.run('verify:verify', { address: minimalFactory.address, - constructorArguments: [config.verifier, config.hasher, config.merkleTreeHeight], + constructorArguments: [config.verifier, config.hasher, config.router, config.merkleTreeHeight], }) } else { return '\nDecided to stop at MinimalInstanceFactory deployment.\n' @@ -79,68 +78,31 @@ async function main() { console.log(happyDeployedMessage('MinimalInstanceFactory', chainId, minimalFactory.address)) - nativeCloneableImplAddr = await minimalFactory.nativeCurImpl() - erc20CloneableImplAddr = await minimalFactory.ERC20Impl() + ethImplAddr = await minimalFactory.ethImpl() + ERC20ImplAddr = await minimalFactory.ERC20Impl() - console.log(happyDeployedMessage('ETHTornadoCloneable', chainId, nativeCloneableImplAddr)) - console.log(happyDeployedMessage('ERC20TornadoCloneable', chainId, erc20CloneableImplAddr)) + console.log(happyDeployedMessage('ETHTornadoCloneable', chainId, ethImplAddr)) + console.log(happyDeployedMessage('ERC20TornadoCloneable', chainId, ERC20ImplAddr)) - if (await prompt(promptMessageBase('Continuing to InstanceProposalFactory deployment.'))) { - proposalFactory = await proposalFactoryFactory.deploy( - config.governance, - minimalFactory.address, - config.instanceRegistry, - config.UniswapV3Factory, - config.WETH, - config.TWAPSlotsMin, - ) - - console.log(happyDeployedMessage('InstanceProposalFactory', chainId, proposalFactory.address)) - } else { - return '\nDecided to stop at InstanceProposalFactory deployment.\n' - } - - if (await prompt(promptMessageBase('Continuing to contract verification.'))) { - await hre.run('verify:verify', { - address: minimalFactory.address, - constructorArguments: [config.verifier, config.hasher, config.merkleTreeHeight.config.router], - }) - - console.log(happyVerifiedMessage('MinimalInstanceFactory', minimalFactory.address)) - console.log('\nWaiting 5 seconds.\n') - await timeout(5) + if (await prompt(promptMessageBase('Continuing to impl verifications.'))) { + console.log('\nWaiting 3 seconds.\n') + await timeout(3) await hre.run('verify:verify', { - address: proposalFactory.address, - constructorArguments: [ - config.governance, - minimalFactory.address, - config.instanceRegistry, - config.UniswapV3Factory, - config.WETH, - config.TWAPSlotsMin, - ], - }) - - console.log(happyVerifiedMessage('InstanceProposalFactory', proposalFactory.address)) - console.log('\nWaiting 5 seconds.\n') - await timeout(5) - - await hre.run('verify:verify', { - address: nativeCloneableImplAddr, + address: ethImplAddr, constructorArguments: [config.verifier, config.hasher], }) - console.log(happyVerifiedMessage('ETHTornadoCloneable', nativeCloneableImplAddr)) + console.log(happyVerifiedMessage('ETHTornadoCloneable', ethImplAddr)) console.log('\nWaiting 5 seconds.\n') await timeout(5) await hre.run('verify:verify', { - address: erc20CloneableImplAddr, + address: ERC20ImplAddr, constructorArguments: [config.verifier, config.hasher], }) - console.log(happyVerifiedMessage('ERC20TornadoCloneable', erc20CloneableImplAddr)) + console.log(happyVerifiedMessage('ERC20TornadoCloneable', ERC20ImplAddr)) } else { return '\nDecided to stop at contract verification.\n' }