fix: BootstrapVWAPPhase2.s.sol hardcodes .secret file dependency (#769)
Check PRIVATE_KEY env var first in BootstrapVWAPPhase2.s.sol, DeployBase.sol, and BaseDeploy.sol; fall back to .secret seed-phrase file when unset. This allows CI/CD environments to inject keys via environment variables while preserving the existing local .secret workflow unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
331fe65384
commit
9632693b8a
3 changed files with 23 additions and 6 deletions
|
|
@ -37,8 +37,11 @@ contract DeployBase is Script {
|
|||
IUniswapV3Pool public pool;
|
||||
|
||||
function run() public {
|
||||
string memory seedPhrase = vm.readFile(".secret");
|
||||
uint256 privateKey = vm.deriveKey(seedPhrase, 0);
|
||||
uint256 privateKey = vm.envOr("PRIVATE_KEY", uint256(0));
|
||||
if (privateKey == 0) {
|
||||
string memory seedPhrase = vm.readFile(".secret");
|
||||
privateKey = vm.deriveKey(seedPhrase, 0);
|
||||
}
|
||||
vm.startBroadcast(privateKey);
|
||||
address sender = vm.addr(privateKey);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue