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
) {
// Store instance parameters
merkleTreeHeight = _merkleTreeHeight;
verifier = _verifierAddress;
hasher = _hasherAddress;
merkleTreeHeight = _merkleTreeHeight;
// Store router addresses
router = _routerAddresss;

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

@ -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'
}