diff --git a/.gitignore b/.gitignore index 018f8ed..d120098 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ out/ node_modules/ # Ignores development broadcast logs -!/broadcast +/broadcast /broadcast/*/31337/ /broadcast/**/dry-run/ diff --git a/script/DeployScript.sol b/script/DeployScript.sol new file mode 100644 index 0000000..62f0eb0 --- /dev/null +++ b/script/DeployScript.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.6.12; + +import "@forge-std/Script.sol"; + +import { RelayerRegistry } from "@root/v4-patch/RelayerRegistry.sol"; +import { TornadoStakingRewards } from "@root/v4-patch/TornadoStakingRewards.sol"; +import { AdminUpgradeableProxy } from "@root/v4-patch/AdminUpgradeableProxy.sol"; +import { PatchProposal } from "@root/v4-patch/PatchProposal.sol"; +import { Parameters } from "@proprietary/Parameters.sol"; + +contract DeployScript is Script, Parameters { + function run() external { + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + + TornadoStakingRewards governanceStakingImplementation = + new TornadoStakingRewards(_governanceAddress, _tokenAddress, _relayerRegistryAddress); + + // We don't need initialization parameters to deploy Governance Staking Proxy contract + bytes memory empty; + AdminUpgradeableProxy governanceStakingProxy = + new AdminUpgradeableProxy(address(governanceStakingImplementation), _governanceAddress, empty); + + // Deploy new relayer registry implementation after staking, because we need refer to staking proxy in registry contract + RelayerRegistry relayerRegistryImplementation = + new RelayerRegistry(_tokenAddress, _governanceAddress, _ensAddress, address(governanceStakingProxy), _feeManagerAddress); + + PatchProposal patchProposal = + new PatchProposal(address(governanceStakingProxy), address(relayerRegistryImplementation)); + + vm.stopBroadcast(); + } +}