Create deploy script

This commit is contained in:
Theo 2023-05-28 11:15:07 +03:00
parent 2031afdbe8
commit 7f0433bd33
2 changed files with 35 additions and 1 deletions

2
.gitignore vendored
View File

@ -4,7 +4,7 @@ out/
node_modules/
# Ignores development broadcast logs
!/broadcast
/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/

34
script/DeployScript.sol Normal file
View File

@ -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();
}
}