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:
openhands 2026-03-19 00:03:59 +00:00
parent 331fe65384
commit 9632693b8a
3 changed files with 23 additions and 6 deletions

View file

@ -5,8 +5,11 @@ import "forge-std/Script.sol";
contract BaseDeploy is Script {
function run() public view {
// Base data
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);
}
address sender = vm.addr(privateKey);
console.log(sender);
}