deploy script fixup

Signed-off-by: T-Hax <>
This commit is contained in:
T-Hax 2023-06-12 16:13:21 +00:00
parent 728eb71388
commit bc7fa5e887
3 changed files with 17 additions and 55 deletions

@ -69,9 +69,9 @@ contract MinimalInstanceFactory {
uint32 _merkleTreeHeight uint32 _merkleTreeHeight
) { ) {
// Store instance parameters // Store instance parameters
merkleTreeHeight = _merkleTreeHeight;
verifier = _verifierAddress; verifier = _verifierAddress;
hasher = _hasherAddress; hasher = _hasherAddress;
merkleTreeHeight = _merkleTreeHeight;
// Store router addresses // Store router addresses
router = _routerAddresss; router = _routerAddresss;

@ -1,5 +1,5 @@
{ {
"name": "tornado-instances", "name": "@AlienTornadosaurusHex/instances",
"version": "1.0.0", "version": "1.0.0",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {

@ -54,24 +54,23 @@ const promptMessageBase = (middle) => `\n${middle}\n\nAre you sure you would lik
async function main() { async function main() {
const minimalFactoryFactory = await ethers.getContractFactory('MinimalInstanceFactory') const minimalFactoryFactory = await ethers.getContractFactory('MinimalInstanceFactory')
const proposalFactoryFactory = await ethers.getContractFactory('InstanceProposalFactory')
const chainId = (await ethers.provider.getNetwork()).chainId const chainId = (await ethers.provider.getNetwork()).chainId
const signer = await ethers.getSigner() let minimalFactory, ethImplAddr, ERC20ImplAddr
let minimalFactory, proposalFactory, nativeCloneableImplAddr, erc20CloneableImplAddr
if (await prompt(promptMessageBase('Continuing to MinimalInstanceFactory deployment.'))) { if (await prompt(promptMessageBase('Continuing to MinimalInstanceFactory deployment.'))) {
minimalFactory = await minimalFactoryFactory.deploy( minimalFactory = await minimalFactoryFactory.deploy(
config.verifier, config.verifier,
config.hasher, config.hasher,
config.router,
config.merkleTreeHeight, config.merkleTreeHeight,
) )
console.log(happyDeployedMessage('MinimalInstanceFactory', chainId, minimalFactory.address)) console.log(happyDeployedMessage('MinimalInstanceFactory', chainId, minimalFactory.address))
await hre.run('verify:verify', { await hre.run('verify:verify', {
address: minimalFactory.address, address: minimalFactory.address,
constructorArguments: [config.verifier, config.hasher, config.merkleTreeHeight], constructorArguments: [config.verifier, config.hasher, config.router, config.merkleTreeHeight],
}) })
} else { } else {
return '\nDecided to stop at MinimalInstanceFactory deployment.\n' return '\nDecided to stop at MinimalInstanceFactory deployment.\n'
@ -79,68 +78,31 @@ async function main() {
console.log(happyDeployedMessage('MinimalInstanceFactory', chainId, minimalFactory.address)) console.log(happyDeployedMessage('MinimalInstanceFactory', chainId, minimalFactory.address))
nativeCloneableImplAddr = await minimalFactory.nativeCurImpl() ethImplAddr = await minimalFactory.ethImpl()
erc20CloneableImplAddr = await minimalFactory.ERC20Impl() ERC20ImplAddr = await minimalFactory.ERC20Impl()
console.log(happyDeployedMessage('ETHTornadoCloneable', chainId, nativeCloneableImplAddr)) console.log(happyDeployedMessage('ETHTornadoCloneable', chainId, ethImplAddr))
console.log(happyDeployedMessage('ERC20TornadoCloneable', chainId, erc20CloneableImplAddr)) console.log(happyDeployedMessage('ERC20TornadoCloneable', chainId, ERC20ImplAddr))
if (await prompt(promptMessageBase('Continuing to InstanceProposalFactory deployment.'))) { if (await prompt(promptMessageBase('Continuing to impl verifications.'))) {
proposalFactory = await proposalFactoryFactory.deploy( console.log('\nWaiting 3 seconds.\n')
config.governance, await timeout(3)
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)
await hre.run('verify:verify', { await hre.run('verify:verify', {
address: proposalFactory.address, address: ethImplAddr,
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,
constructorArguments: [config.verifier, config.hasher], constructorArguments: [config.verifier, config.hasher],
}) })
console.log(happyVerifiedMessage('ETHTornadoCloneable', nativeCloneableImplAddr)) console.log(happyVerifiedMessage('ETHTornadoCloneable', ethImplAddr))
console.log('\nWaiting 5 seconds.\n') console.log('\nWaiting 5 seconds.\n')
await timeout(5) await timeout(5)
await hre.run('verify:verify', { await hre.run('verify:verify', {
address: erc20CloneableImplAddr, address: ERC20ImplAddr,
constructorArguments: [config.verifier, config.hasher], constructorArguments: [config.verifier, config.hasher],
}) })
console.log(happyVerifiedMessage('ERC20TornadoCloneable', erc20CloneableImplAddr)) console.log(happyVerifiedMessage('ERC20TornadoCloneable', ERC20ImplAddr))
} else { } else {
return '\nDecided to stop at contract verification.\n' return '\nDecided to stop at contract verification.\n'
} }