Skip to content

Commit

Permalink
feat(contracts): optionally use different key for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
emilianobonassi committed Jan 12, 2025
1 parent 2cb66f1 commit 0dea8cb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions contracts/script/OPSuccinctUpgrader.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import {console} from "forge-std/console.sol";

contract OPSuccinctUpgrader is Script, Utils {
function run() public {
vm.startBroadcast();

Config memory cfg = readJson("opsuccinctl2ooconfig.json");

address l2OutputOracleProxy = vm.envAddress("L2OO_ADDRESS");
Expand All @@ -20,11 +18,21 @@ contract OPSuccinctUpgrader is Script, Utils {

address proxyAdmin = vm.envOr("PROXY_ADMIN", address(0));

uint256 adminPk = vm.envUint("ADMIN_PK");
// optionally use a different key for deployment
uint256 deployPk = vm.envOr("DEPLOY_PK", adminPk);

if (OPSuccinctL2OutputOracleImpl == address(0)) {
vm.startBroadcast(deployPk);

console.log("Deploying new logic");
OPSuccinctL2OutputOracleImpl = address(new OPSuccinctL2OutputOracle());

vm.stopBroadcast();
}

vm.startBroadcast(adminPk);

upgradeAndInitialize(OPSuccinctL2OutputOracleImpl, cfg, l2OutputOracleProxy, executeUpgradeCall, proxyAdmin);

vm.stopBroadcast();
Expand Down

0 comments on commit 0dea8cb

Please sign in to comment.