Skip to content

Commit

Permalink
fix: rm usage of default priv key
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaSethi committed Oct 17, 2023
1 parent 6337cc5 commit 558a629
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
11 changes: 1 addition & 10 deletions scripts/1.0.0/Deploy.goerli.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,8 @@ import {PolygonMigration} from "../../src/PolygonMigration.sol";
contract Deploy is Script {
using stdJson for string;

string internal constant TEST_MNEMONIC = "test test test test test test test test test test test junk";
uint256 public deployerPrivateKey;

constructor() {
deployerPrivateKey = vm.envOr({name: "PRIVATE_KEY", defaultValue: uint256(0)});
if (deployerPrivateKey == 0) {
(, deployerPrivateKey) = deriveRememberKey({mnemonic: TEST_MNEMONIC, index: 0});
}
}

function run() public {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
string memory input = vm.readFile("scripts/1.0.0/input.json");
string memory chainIdSlug = string(abi.encodePacked('["', vm.toString(block.chainid), '"]'));
address matic = input.readAddress(string.concat(chainIdSlug, ".matic"));
Expand Down
11 changes: 1 addition & 10 deletions scripts/1.1.0/UpgradeEmissionManager.goerli.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,8 @@ import {DefaultEmissionManager} from "../../src/DefaultEmissionManager.sol";
contract Deploy is Script {
using stdJson for string;

string internal constant TEST_MNEMONIC = "test test test test test test test test test test test junk";
uint256 public deployerPrivateKey;

constructor() {
deployerPrivateKey = vm.envOr({name: "PRIVATE_KEY", defaultValue: uint256(0)});
if (deployerPrivateKey == 0) {
(, deployerPrivateKey) = deriveRememberKey({mnemonic: TEST_MNEMONIC, index: 0});
}
}

function run() public {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
string memory input = vm.readFile("scripts/1.1.0/input.json");
string memory chainIdSlug = string(abi.encodePacked('["', vm.toString(block.chainid), '"]'));
address migrationProxy = input.readAddress(string.concat(chainIdSlug, ".migrationProxy"));
Expand Down

0 comments on commit 558a629

Please sign in to comment.