Skip to content

Commit

Permalink
feat: broadcast inside script
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtekgrinder committed Aug 6, 2024
1 parent 007b784 commit c50cfdb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/foundry/UpgradeRouter.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ contract UpgradeRouterScript is Script, CommonUtils {
function run() public {
uint256 chainId = vm.envUint("CHAIN_ID");

uint256 deployerPrivateKey = vm.deriveKey(vm.envString("MNEMONIC_MAINNET"), 0);
address deployer = vm.addr(deployerPrivateKey);
console.log("Address: %s", deployer);
vm.startBroadcast(deployerPrivateKey);

address routerImpl;
if (chainId == CHAIN_ETHEREUM) {
routerImpl = address(new AngleRouterMainnet());
Expand All @@ -39,5 +44,7 @@ contract UpgradeRouterScript is Script, CommonUtils {
}

console.log("Deployed router implementation at address: %s", routerImpl);

vm.stopBroadcast();
}
}

0 comments on commit c50cfdb

Please sign in to comment.