-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathBase.s.sol
29 lines (22 loc) · 911 Bytes
/
Base.s.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19 <0.9.0;
import { Script } from "forge-std/Script.sol";
abstract contract BaseScript is Script {
/// @dev Included to enable compilation of the script without a $MNEMONIC environment variable.
string internal constant TEST_MNEMONIC = "test test test test test test test test test test test junk";
/// @dev Needed for the deterministic deployments.
bytes32 internal constant ZERO_SALT = bytes32(0);
/// @dev The address of the contract deployer.
address internal deployer;
/// @dev Used to derive the deployer's address.
string internal mnemonic;
constructor() {
mnemonic = vm.envOr("MNEMONIC", TEST_MNEMONIC);
(deployer,) = deriveRememberKey({ mnemonic: mnemonic, index: 0 });
}
modifier broadcaster() {
vm.startBroadcast(deployer);
_;
vm.stopBroadcast();
}
}