From 476c8a5f274e5916c48e0a92ff35eaec04ff9119 Mon Sep 17 00:00:00 2001 From: AlienTornadosaurusHex <> Date: Thu, 29 Jun 2023 19:32:30 +0000 Subject: [PATCH] FeeOracleManager not deploying still Signed-off-by: AlienTornadosaurusHex <> --- .env.example | 1 + config.js | 14 ++++++ hardhat.config.js | 50 +++++++++++++++++++ package.json | 8 ++- script/DeployFeeOracleManager.js | 35 +++++++++++++ script/DeployInfrastructureUpgradeProposal.js | 45 +++++++++++++++++ script/DeployInstanceRegistry.js | 31 ++++++++++++ script/DeployRelayerRegistry.js | 37 ++++++++++++++ script/DeployRouter.js | 31 ++++++++++++ script/DeployStaking.js | 39 +++++++++++++++ script/DeployUniswapFeeOracle.js | 37 ++++++++++++++ script/Deploys.sol | 0 12 files changed, 327 insertions(+), 1 deletion(-) create mode 100644 config.js create mode 100644 hardhat.config.js create mode 100644 script/DeployFeeOracleManager.js create mode 100644 script/DeployInfrastructureUpgradeProposal.js create mode 100755 script/DeployInstanceRegistry.js create mode 100755 script/DeployRelayerRegistry.js create mode 100755 script/DeployRouter.js create mode 100755 script/DeployStaking.js create mode 100644 script/DeployUniswapFeeOracle.js mode change 100644 => 100755 script/Deploys.sol diff --git a/.env.example b/.env.example index ed23191..a3185d8 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,6 @@ # Network & other MAINNET_RPC_URL= +GOERLI_RPC_URL= ETHERSCAN_KEY= PRIVATE_KEY= diff --git a/config.js b/config.js new file mode 100644 index 0000000..7fa099d --- /dev/null +++ b/config.js @@ -0,0 +1,14 @@ +require("dotenv").config(); + +module.exports = { + governanceProxyAddress: "0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce", + tornTokenAddress: "0x77777FeDdddFfC19Ff86DB637967013e6C6A116C", + deployed: { + router: `${process.env.DEPLOYED_ROUTER_ADDRESS}`, + stakingImpl: `${process.env.DEPLOYED_STAKING_ADDRESS}`, + relayerRegistryImpl: `${process.env.DEPLOYED_RELAYERSR_ADDRESS}`, + instanceRegistryImpl: `${process.env.DEPLOYED_INSTANCESR_ADDRESS}`, + fomImpl: `${process.env.DEPLOYED_FOM_ADDRESS}`, + uniFeeOracle: `${process.env.DEPLOYED_UNIFEO_ADDRESS}`, + }, +}; diff --git a/hardhat.config.js b/hardhat.config.js new file mode 100644 index 0000000..ced6f03 --- /dev/null +++ b/hardhat.config.js @@ -0,0 +1,50 @@ +require('dotenv').config() + +require("@nomicfoundation/hardhat-ethers"); +require("@nomicfoundation/hardhat-foundry"); +require("@nomicfoundation/hardhat-verify"); + + +/** @type import('hardhat/config').HardhatUserConfig */ +module.exports = { + solidity: { + compilers: [ + { + version: '0.6.12', + settings: { + optimizer: { + enabled: true, + runs: 1_000_000, + }, + }, + }, + ], + overrides: { + 'src/proposals/*.sol': { + version: '0.6.12', + settings: { + optimizer: { + enabled: true, + runs: 1, + }, + }, + }, + }, + }, + networks: { + goerli: { + url: `${process.env.GOERLI_RPC_URL}`, + accounts: [`${process.env.PRIVATE_KEY}`], + timeout: 999999, + }, + mainnet: { + url: `${process.env.MAINNET_RPC_URL}`, + accounts: [`${process.env.PRIVATE_KEY}`], + timeout: 999999, + }, + }, + etherscan: { + apiKey: `${process.env.ETHERSCAN_KEY}`, + }, +}; + diff --git a/package.json b/package.json index 0481c50..67aa3b9 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,13 @@ "coverage": "genhtml -o coverage -s --legend lcov.info && rm lcov.info" }, "devDependencies": { - "prettier": "^2.5.1", + "@nomicfoundation/hardhat-ethers": "^3.0.3", + "@nomicfoundation/hardhat-foundry": "^1.0.2", + "@nomicfoundation/hardhat-verify": "^1.0.3", + "dotenv": "^16.3.1", + "ethers": "^6.6.2", + "hardhat": "^2.16.1", + "prettier": "^2.8.8", "prettier-plugin-solidity": "^1.0.0-beta.19", "solhint": "^3.3.6" } diff --git a/script/DeployFeeOracleManager.js b/script/DeployFeeOracleManager.js new file mode 100644 index 0000000..7cb746c --- /dev/null +++ b/script/DeployFeeOracleManager.js @@ -0,0 +1,35 @@ +require("dotenv").config(); + +const hre = require("hardhat"); +const config = require("../config"); + +function timeout(seconds) { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +} + +async function deploy() { + const factory = await hre.ethers.getContractFactory("FeeOracleManager"); + + const deployed = await factory.deploy( + config.governanceProxyAddress, + config.tornTokenAddress + ); + + const depaddr = await deployed.getAddress(); + + console.log("\nFeeOracleManager deployed @ " + depaddr + "\n"); + + console.log("\nWaiting 50 seconds.\n"); + + await timeout(50); + + await hre.run("verify:verify", { + address: depaddr, + constructorArguments: [ + config.governanceProxyAddress, + config.tornTokenAddress, + ], + }); +} + +deploy().then(() => console.log("\nScript finished.\n")); diff --git a/script/DeployInfrastructureUpgradeProposal.js b/script/DeployInfrastructureUpgradeProposal.js new file mode 100644 index 0000000..e42a588 --- /dev/null +++ b/script/DeployInfrastructureUpgradeProposal.js @@ -0,0 +1,45 @@ +require("dotenv").config(); + +const hre = require("hardhat"); +const config = require("../config"); + +function timeout(seconds) { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +} + +async function deploy() { + const factory = await hre.ethers.getContractFactory( + "src/proposals/InfrastructureUpgradeProposal.sol:InfrastructureUpgradeProposal" + ); + + const deployed = await factory.deploy( + config.deployed.router, + config.deployed.stakingImpl, + config.deployed.relayerRegistryImpl, + config.deployed.instanceRegistryImpl, + config.deployed.fomImpl, + config.deployed.uniFeeOracle + ); + + const depaddr = await deployed.getAddress(); + + console.log("\nInfastructureUpgradeProposal deployed @ " + depaddr + "\n"); + + console.log("\nWaiting 50 seconds.\n"); + + await timeout(50); + + await hre.run("verify:verify", { + address: depaddr, + constructorArguments: [ + config.deployed.router, + config.deployed.stakingImpl, + config.deployed.relayerRegistryImpl, + config.deployed.instanceRegistryImpl, + config.deployed.fomImpl, + config.deployed.uniFeeOracle, + ], + }); +} + +deploy().then(() => console.log("\nScript finished.\n")); diff --git a/script/DeployInstanceRegistry.js b/script/DeployInstanceRegistry.js new file mode 100755 index 0000000..9ec66d7 --- /dev/null +++ b/script/DeployInstanceRegistry.js @@ -0,0 +1,31 @@ +require("dotenv").config(); + +const hre = require("hardhat"); +const config = require("../config"); + +function timeout(seconds) { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +} + +async function deploy() { + const factory = await hre.ethers.getContractFactory( + "src/v2/InstanceRegistry.sol:InstanceRegistry" + ); + + const deployed = await factory.deploy(config.governanceProxyAddress); + + const depaddr = await deployed.getAddress(); + + console.log("InstanceRegistry deployed @ " + depaddr + "\n"); + + console.log("\nWaiting 50 seconds.\n"); + + await timeout(50); + + await hre.run("verify:verify", { + address: depaddr, + constructorArguments: [config.governanceProxyAddress], + }); +} + +deploy().then(() => console.log("\nScript finished.\n")); diff --git a/script/DeployRelayerRegistry.js b/script/DeployRelayerRegistry.js new file mode 100755 index 0000000..330f529 --- /dev/null +++ b/script/DeployRelayerRegistry.js @@ -0,0 +1,37 @@ +require("dotenv").config(); + +const hre = require("hardhat"); +const config = require("../config"); + +function timeout(seconds) { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +} + +async function deploy() { + const factory = await hre.ethers.getContractFactory( + "src/v2/RelayerRegistry.sol:RelayerRegistry" + ); + + const deployed = await factory.deploy( + config.governanceProxyAddress, + config.tornTokenAddress + ); + + const depaddr = await deployed.getAddress(); + + console.log("\nRelayerRegistry deployed @ " + depaddr + "\n"); + + console.log("\nWaiting 50 seconds.\n"); + + await timeout(50); + + await hre.run("verify:verify", { + address: depaddr, + constructorArguments: [ + config.governanceProxyAddress, + config.tornTokenAddress, + ], + }); +} + +deploy().then(() => console.log("\nScript finished.\n")); diff --git a/script/DeployRouter.js b/script/DeployRouter.js new file mode 100755 index 0000000..d81d11d --- /dev/null +++ b/script/DeployRouter.js @@ -0,0 +1,31 @@ +require("dotenv").config(); + +const hre = require("hardhat"); +const config = require("../config"); + +function timeout(seconds) { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +} + +async function deploy() { + const factory = await hre.ethers.getContractFactory( + "src/v2/TornadoRouter.sol:TornadoRouter" + ); + + const deployed = await factory.deploy(config.governanceProxyAddress); + + const depaddr = await deployed.getAddress(); + + console.log("\nRouter deployed @ " + depaddr + "\n"); + + console.log("\nWaiting 50 seconds.\n"); + + await timeout(50); + + await hre.run("verify:verify", { + address: depaddr, + constructorArguments: [config.governanceProxyAddress], + }); +} + +deploy().then(() => console.log("\nScript finished.\n")); diff --git a/script/DeployStaking.js b/script/DeployStaking.js new file mode 100755 index 0000000..648f229 --- /dev/null +++ b/script/DeployStaking.js @@ -0,0 +1,39 @@ +require("dotenv").config(); + +const hre = require("hardhat"); +const config = require("../config"); + +function timeout(seconds) { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +} + +async function deploy() { + const factory = await hre.ethers.getContractFactory( + "src/v2/TornadoStakingRewards.sol:TornadoStakingRewards" + ); + + const deployed = await factory.deploy( + config.governanceProxyAddress, + config.tornTokenAddress, + config.deployed.router + ); + + const depaddr = await deployed.getAddress(); + + console.log("\nStaking deployed @ " + depaddr + "\n"); + + console.log("\nWaiting 50 seconds.\n"); + + await timeout(50); + + await hre.run("verify:verify", { + address: depaddr, + constructorArguments: [ + config.governanceProxyAddress, + config.tornTokenAddress, + config.deployed.router, + ], + }); +} + +deploy().then(() => console.log("\nScript finished.\n")); diff --git a/script/DeployUniswapFeeOracle.js b/script/DeployUniswapFeeOracle.js new file mode 100644 index 0000000..9955238 --- /dev/null +++ b/script/DeployUniswapFeeOracle.js @@ -0,0 +1,37 @@ +require("dotenv").config(); + +const hre = require("hardhat"); +const config = require("../config"); + +function timeout(seconds) { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +} + +async function deploy() { + const factory = await hre.ethers.getContractFactory( + "src/v2/UniswapFeeOracle.sol:UniswapFeeOracle" + ); + + const deployed = await factory.deploy( + config.governanceProxyAddress, + config.deployed.fomImpl + ); + + const depaddr = await deployed.getAddress(); + + console.log("\nUniswapFeeOracle deployed @ " + depaddr + "\n"); + + console.log("\nWaiting 50 seconds.\n"); + + await timeout(50); + + await hre.run("verify:verify", { + address: depaddr, + constructorArguments: [ + config.governanceProxyAddress, + config.deployed.fomImpl, + ], + }); +} + +deploy().then(() => console.log("\nScript finished.\n")); diff --git a/script/Deploys.sol b/script/Deploys.sol old mode 100644 new mode 100755