Skip to content

Commit

Permalink
refactor: move deployer assignment to the top
Browse files Browse the repository at this point in the history
This ensures `deployer` is set then deployment configs are created.
  • Loading branch information
0x-r4bbit committed Sep 26, 2023
1 parent cbd03c7 commit 6b423b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script/DeploymentConfig.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ contract DeploymentConfig is Script {
address private deployer;

constructor(address _broadcaster) {
if (_broadcaster == address(0)) revert DeploymentConfig_InvalidDeployerAddress();
deployer = _broadcaster;
if (block.chainid == 31_337) {
activeNetworkConfig = getOrCreateAnvilEthConfig();
} else {
revert DeploymentConfig_NoConfigForChain(block.chainid);
}
if (_broadcaster == address(0)) revert DeploymentConfig_InvalidDeployerAddress();
deployer = _broadcaster;
}

function getOrCreateAnvilEthConfig() public view returns (NetworkConfig memory) {
Expand Down

0 comments on commit 6b423b7

Please sign in to comment.