Skip to content

Commit

Permalink
refactor: make chain id variable
Browse files Browse the repository at this point in the history
  • Loading branch information
renlulu committed Apr 2, 2024
1 parent 1d1d645 commit b47896b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion contracts/script/MachServiceManagerDeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ contract MachServiceManagerDeployer is Script {
address churner;
address ejector;
address confirmer;
uint256 chainId;
// from eigenlayer contracts
address avsDirectory;
address delegationManager;
Expand Down Expand Up @@ -103,6 +104,7 @@ contract MachServiceManagerDeployer is Script {
addressConfig.churner = msg.sender;
addressConfig.ejector = msg.sender;
addressConfig.confirmer = msg.sender;
addressConfig.chainId = 1;
addressConfig.avsDirectory = address(eigenLayerContracts.avsDirectory);
addressConfig.delegationManager = address(eigenLayerContracts.delegationManager);

Expand Down Expand Up @@ -217,7 +219,8 @@ contract MachServiceManagerDeployer is Script {
IPauserRegistry(pauserRegistry),
0,
addressConfig.machAVSCommunityMultisig,
addressConfig.machAVSCommunityMultisig
addressConfig.machAVSCommunityMultisig,
addressConfig.chainId
)
);
vm.stopBroadcast();
Expand Down
4 changes: 3 additions & 1 deletion contracts/src/core/MachServiceManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ contract MachServiceManager is
IPauserRegistry _pauserRegistry,
uint256 _initialPausedStatus,
address _initialOwner,
address _alertConfirmer
address _alertConfirmer,
uint256 _chainId
) public initializer {
_initializePauser(_pauserRegistry, _initialPausedStatus);
_transferOwnership(_initialOwner);
_setAlertConfirmer(_alertConfirmer);
allowlistEnabled = true;
quorumThresholdPercentage = 66;
chainId = _chainId;
}

//////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 4 additions & 3 deletions contracts/src/core/MachServiceManagerStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ abstract contract MachServiceManagerStorage {
// CONSTANTS
uint256 public constant THRESHOLD_DENOMINATOR = 100;

uint256 public immutable chainId = block.chainid;

EnumerableSet.Bytes32Set internal _messageHashes;

/// @notice Ethereum addresses of currently register operators
Expand All @@ -33,7 +31,10 @@ abstract contract MachServiceManagerStorage {
/// @notice Minimul quorum threshold percentage
uint8 public quorumThresholdPercentage;

/// @notice Chain id
uint256 public chainId;

// storage gap for upgradeability
// slither-disable-next-line shadowing-state
uint256[46] private __GAP;
uint256[45] private __GAP;
}

0 comments on commit b47896b

Please sign in to comment.