Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pol): implement unique deterministic salts for contract deployment #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions script/pol/POLSalts.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

uint256 constant WBERA_SALT = 1;
uint256 constant BGT_SALT = 1;
uint256 constant BERA_CHEF_SALT = 1;
uint256 constant BLOCK_REWARD_CONTROLLER_SALT = 1;
uint256 constant DISTRIBUTOR_SALT = 1;
uint256 constant REWARDS_FACTORY_SALT = 1;
uint256 constant BGT_STAKER_SALT = 1;
uint256 constant FEE_COLLECTOR_SALT = 1;
// Each salt is unique and derived from the keccak256 hash of the contract name
// This ensures no collisions while maintaining deterministic addresses
uint256 constant WBERA_SALT = uint256(keccak256("WBERA_V1"));
uint256 constant BGT_SALT = uint256(keccak256("BGT_V1"));
uint256 constant BERA_CHEF_SALT = uint256(keccak256("BERA_CHEF_V1"));
uint256 constant BLOCK_REWARD_CONTROLLER_SALT = uint256(keccak256("BLOCK_REWARD_CONTROLLER_V1"));
uint256 constant DISTRIBUTOR_SALT = uint256(keccak256("DISTRIBUTOR_V1"));
uint256 constant REWARDS_FACTORY_SALT = uint256(keccak256("REWARDS_FACTORY_V1"));
uint256 constant BGT_STAKER_SALT = uint256(keccak256("BGT_STAKER_V1"));
uint256 constant FEE_COLLECTOR_SALT = uint256(keccak256("FEE_COLLECTOR_V1"));