generated from PaulRBerg/hardhat-template
-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use "constructor" instead of "setUp" in "BaseScript"
chore: prettier ignore ".github/workflows" ci: polish deploy workflow refactor: remove nested dirs in "script"
- Loading branch information
Showing
5 changed files
with
37 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# directories | ||
.github/workflows | ||
broadcast | ||
cache | ||
lib | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.