refactor: move deployer assignment to the top (#9)

This ensures `deployer` is set then deployment configs are created.
This commit is contained in:
r4bbit 2023-09-26 16:35:42 +02:00 committed by GitHub
parent cbd03c711c
commit 22704ebe1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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) {