infrastructure-upgrade/script/Deploys.sol
AlienTornadosaurusHex c47c492c3c Code quality and other
Signed-off-by: AlienTornadosaurusHex <>
2023-06-23 23:23:17 +00:00

108 lines
3.5 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
// STD imports
import { Script } from "forge-std/Script.sol";
import { console2 } from "forge-std/console2.sol";
// Local imports
import { TornadoAddresses } from "../src/common/TornadoAddresses.sol";
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BASE CONTRACTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
abstract contract SimpleDeployer is TornadoAddresses, Script {
function _createContract() internal virtual;
function run() external {
uint256 key = vm.envUint("PRIVATE_KEY");
vm.startBroadcast(key);
_createContract();
vm.stopBroadcast();
}
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEPLOY ROUTER ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
import { TornadoRouter } from "../src/v2/TornadoRouter.sol";
contract RouterDeployer is SimpleDeployer {
function _createContract() internal virtual override {
new TornadoRouter(getGovernanceProxyAddress());
}
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEPLOY STAKING ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
import { TornadoStakingRewards } from "../src/v2/TornadoStakingRewards.sol";
contract StakingDeployer is SimpleDeployer {
function _createContract() internal virtual override {
new TornadoStakingRewards(getGovernanceProxyAddress(), getTornTokenAddress(), vm.envAddress("DEPLOYED_ROUTER_ADDRESS"));
}
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEPLOY RELAYER REGISTRY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
import { RelayerRegistry } from "../src/v2/RelayerRegistry.sol";
contract RelayerRegistryDeployer is SimpleDeployer {
function _createContract() internal virtual override {
new RelayerRegistry(getGovernanceProxyAddress(), getTornTokenAddress());
}
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEPLOY INSTANCE REGISTRY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
import { InstanceRegistry } from "../src/v2/InstanceRegistry.sol";
contract InstanceRegistryDeployer is SimpleDeployer {
function _createContract() internal virtual override {
new InstanceRegistry(getGovernanceProxyAddress());
}
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEPLOY FEE ORACLE MANAGER ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
import { FeeOracleManager } from "../src/v2/FeeOracleManager.sol";
contract FeeOracleManagerDeployer is SimpleDeployer {
function _createContract() internal virtual override {
new FeeOracleManager(getGovernanceProxyAddress(), getTornTokenAddress());
}
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEPLOY UNISWAP FEE ORACLE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
import { UniswapFeeOracle } from "../src/v2/UniswapFeeOracle.sol";
contract UniswapFeeOracleDeployer is SimpleDeployer {
function _createContract() internal virtual override {
new UniswapFeeOracle(getGovernanceProxyAddress(), vm.envAddress("DEPLOYED_FOM_ADDRESS"));
}
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEPLOY INFRASTRUCTURE UPGRADE PROPOSAL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
import { InfrastructureUpgradeProposal } from "../src/proposals/InfrastructureUpgradeProposal.sol";
contract InfrastructureUpgradeProposalDeployer is SimpleDeployer {
function _createContract() internal virtual override {
new InfrastructureUpgradeProposal(
vm.envAddress("DEPLOYED_ROUTER_ADDRESS"),
vm.envAddress("DEPLOYED_STAKING_ADDRESS"),
vm.envAddress("DEPLOYED_RELAYERSR_ADDRESS"),
vm.envAddress("DEPLOYED_INSTANCESR_ADDRESS"),
vm.envAddress("DEPLOYED_FOM_ADDRESS"),
vm.envAddress("DEPLOYED_UNIFEO_ADDRESS")
);
}
}