Skip to content

Commit

Permalink
add deployment salt
Browse files Browse the repository at this point in the history
  • Loading branch information
anajuliabit committed Sep 26, 2024
1 parent 98122f3 commit 678e69a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions script/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ uint256 constant MIN_STAKE = 50_000e18;
uint256 constant REWARD_RATE = 0.1333333333e18;
uint256 constant LOCK_PERIOD = 182 days;
uint256 constant INITIAL_MINT = 10_000e18;

bytes32 constant DEPLOYMENT_SALT = keccak256("SHUTTER_STAKING");
9 changes: 5 additions & 4 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@ contract Deploy is Script {

vm.startBroadcast();

rewardsDistributor = new RewardsDistributor(
rewardsDistributor = new RewardsDistributor{salt: DEPLOYMENT_SALT}(
CONTRACT_OWNER,
address(STAKING_TOKEN)
);
vm.label(address(rewardsDistributor), "RewardsDistributor");

Staking stake = new Staking();
vm.label(address(stake), "Staking");

stakingProxy = Staking(
address(
new TransparentUpgradeableProxy(
new TransparentUpgradeableProxy{salt: DEPLOYMENT_SALT}(
address(stake),
address(CONTRACT_OWNER),
""
Expand All @@ -58,11 +59,11 @@ contract Deploy is Script {
MIN_STAKE
);

DelegateStaking delegate = new DelegateStaking();
DelegateStaking delegate = new DelegateStaking{salt: DEPLOYMENT_SALT}();
vm.label(address(delegate), "DelegateStaking");
delegateProxy = DelegateStaking(
address(
new TransparentUpgradeableProxy(
new TransparentUpgradeableProxy{salt: DEPLOYMENT_SALT}(
address(delegate),
address(CONTRACT_OWNER),
""
Expand Down

0 comments on commit 678e69a

Please sign in to comment.