mirror of
https://github.com/vacp2p/foundry-template.git
synced 2026-01-09 23:28:01 -05:00
refactor: move deployer assignment to the top
This ensures `deployer` is set then deployment configs are created.
This commit is contained in:
@@ -17,13 +17,13 @@ contract DeploymentConfig is Script {
|
|||||||
address private deployer;
|
address private deployer;
|
||||||
|
|
||||||
constructor(address _broadcaster) {
|
constructor(address _broadcaster) {
|
||||||
|
if (_broadcaster == address(0)) revert DeploymentConfig_InvalidDeployerAddress();
|
||||||
|
deployer = _broadcaster;
|
||||||
if (block.chainid == 31_337) {
|
if (block.chainid == 31_337) {
|
||||||
activeNetworkConfig = getOrCreateAnvilEthConfig();
|
activeNetworkConfig = getOrCreateAnvilEthConfig();
|
||||||
} else {
|
} else {
|
||||||
revert DeploymentConfig_NoConfigForChain(block.chainid);
|
revert DeploymentConfig_NoConfigForChain(block.chainid);
|
||||||
}
|
}
|
||||||
if (_broadcaster == address(0)) revert DeploymentConfig_InvalidDeployerAddress();
|
|
||||||
deployer = _broadcaster;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOrCreateAnvilEthConfig() public view returns (NetworkConfig memory) {
|
function getOrCreateAnvilEthConfig() public view returns (NetworkConfig memory) {
|
||||||
|
|||||||
Reference in New Issue
Block a user