Skip to content

Commit

Permalink
fix: bsc governor init params issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cosinlink committed Dec 11, 2023
1 parent 0b17484 commit 46811a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
15 changes: 1 addition & 14 deletions contracts/BC_fusion/BSCGovernor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,8 @@ contract BSCGovernor is
__GovernorVotesQuorumFraction_init(INIT_QUORUM_NUMERATOR);
__GovernorPreventLateQuorum_init(INIT_MIN_PERIOD_AFTER_QUORUM);

whitelistTargets[VALIDATOR_CONTRACT_ADDR] = true;
whitelistTargets[SLASH_CONTRACT_ADDR] = true;
whitelistTargets[SYSTEM_REWARD_ADDR] = true;
whitelistTargets[LIGHT_CLIENT_ADDR] = true;
whitelistTargets[TOKEN_HUB_ADDR] = true;
whitelistTargets[INCENTIVIZE_ADDR] = true;
whitelistTargets[RELAYERHUB_CONTRACT_ADDR] = true;
// BSCGovernor => Timelock => GovHub => system contracts
whitelistTargets[GOV_HUB_ADDR] = true;
whitelistTargets[TOKEN_MANAGER_ADDR] = true;
whitelistTargets[CROSS_CHAIN_CONTRACT_ADDR] = true;
whitelistTargets[STAKING_CONTRACT_ADDR] = true;
whitelistTargets[STAKE_HUB_ADDR] = true;
whitelistTargets[GOVERNOR_ADDR] = true;
whitelistTargets[GOV_TOKEN_ADDR] = true;
whitelistTargets[TIMELOCK_ADDR] = true;

governorProtector = address(0x000000000000000000000000000000000000dEaD); // TODO
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/GovHub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract GovHub is System, IApplication{
require(false, "receive unexpected fail ack package");
}

function updateParam(string calldata key, bytes calldata value, address target) external onlyGovernor {
function updateParam(string calldata key, bytes calldata value, address target) external onlyGovernorTimelock {
ParamChangePackage memory proposal = ParamChangePackage(key, value, target);
notifyUpdates(proposal);
}
Expand Down
8 changes: 6 additions & 2 deletions contracts/System.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity 0.6.4;
import "./interface/ISystemReward.sol";
import "./interface/IRelayerHub.sol";
import "./interface/ILightClient.sol";
import "forge-std/console.sol";

contract System {

Expand Down Expand Up @@ -32,7 +33,10 @@ contract System {
address public constant CROSS_CHAIN_CONTRACT_ADDR = 0x0000000000000000000000000000000000002000;
address public constant STAKING_CONTRACT_ADDR = 0x0000000000000000000000000000000000002001;
address public constant STAKE_HUB_ADDR = 0x0000000000000000000000000000000000002002;
address public constant STAKE_CREDIT_ADDR = 0x0000000000000000000000000000000000002003;
address public constant GOVERNOR_ADDR = 0x0000000000000000000000000000000000002004;
address public constant GOV_TOKEN_ADDR = 0x0000000000000000000000000000000000002005;
address public constant TIMELOCK_ADDR = 0x0000000000000000000000000000000000002006;
address public constant TOKEN_RECOVER_PORTAL_ADDR = 0x0000000000000000000000000000000000003000;

modifier onlyCoinbase() {
Expand Down Expand Up @@ -100,8 +104,8 @@ contract System {
_;
}

modifier onlyGovernor() {
require(msg.sender == GOVERNOR_ADDR, "the msg sender must be governor contract");
modifier onlyGovernorTimelock() {
require(msg.sender == TIMELOCK_ADDR, "the msg sender must be governor timelock contract");
_;
}

Expand Down

0 comments on commit 46811a6

Please sign in to comment.