Commit 01da4952 authored by Maurelian's avatar Maurelian

contracts-bedrock: Move modifiers up in Deploy.s.sol

parent 2e35a8f6
...@@ -54,6 +54,33 @@ import { Types } from "scripts/Types.sol"; ...@@ -54,6 +54,33 @@ import { Types } from "scripts/Types.sol";
contract Deploy is Deployer { contract Deploy is Deployer {
DeployConfig cfg; DeployConfig cfg;
/// @notice Modifier that wraps a function in broadcasting.
modifier broadcast() {
vm.startBroadcast();
_;
vm.stopBroadcast();
}
/// @notice Modifier that will only allow a function to be called on devnet.
modifier onlyDevnet() {
uint256 chainid = block.chainid;
if (chainid == Chains.LocalDevnet || chainid == Chains.GethDevnet) {
_;
}
}
/// @notice Modifier that will only allow a function to be called on a public
/// testnet or devnet.
modifier onlyTestnetOrDevnet() {
uint256 chainid = block.chainid;
if (
chainid == Chains.Goerli || chainid == Chains.Sepolia || chainid == Chains.LocalDevnet
|| chainid == Chains.GethDevnet
) {
_;
}
}
/// @inheritdoc Deployer /// @inheritdoc Deployer
function name() public pure override returns (string memory name_) { function name() public pure override returns (string memory name_) {
name_ = "Deploy"; name_ = "Deploy";
...@@ -102,33 +129,6 @@ contract Deploy is Deployer { ...@@ -102,33 +129,6 @@ contract Deploy is Deployer {
return keccak256(bytes(vm.envOr("IMPL_SALT", string("ethers phoenix")))); return keccak256(bytes(vm.envOr("IMPL_SALT", string("ethers phoenix"))));
} }
/// @notice Modifier that wraps a function in broadcasting.
modifier broadcast() {
vm.startBroadcast();
_;
vm.stopBroadcast();
}
/// @notice Modifier that will only allow a function to be called on devnet.
modifier onlyDevnet() {
uint256 chainid = block.chainid;
if (chainid == Chains.LocalDevnet || chainid == Chains.GethDevnet) {
_;
}
}
/// @notice Modifier that will only allow a function to be called on a public
/// testnet or devnet.
modifier onlyTestnetOrDevnet() {
uint256 chainid = block.chainid;
if (
chainid == Chains.Goerli || chainid == Chains.Sepolia || chainid == Chains.LocalDevnet
|| chainid == Chains.GethDevnet
) {
_;
}
}
/// @notice Deploy all of the proxies /// @notice Deploy all of the proxies
function deployProxies() public { function deployProxies() public {
deployAddressManager(); deployAddressManager();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment