Skip to content

Commit

Permalink
feat: update deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Feb 12, 2025
1 parent b431f1d commit 7c61008
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
34 changes: 25 additions & 9 deletions packages/protocol/script/layer1/based/DeployProtocolOnL1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -450,24 +450,19 @@ contract DeployProtocolOnL1 is DeployCapability {
registerTo: resolver
});

router = deployProxy({
name: "preconf_router",
impl: address(new PreconfRouter(taikoWrapper, whitelist)),
data: abi.encodeCall(PreconfRouter.init, (owner)),
registerTo: resolver
});

// Initializable a forced inclusion store with a fake address for TaikoWrapper at first,
// to be used for deploying TaikoWrapper, then upgrade it to the real TaikoWrapper address.
store = deployProxy({
name: "forced_inclusion_store",
impl: address(
new ForcedInclusionStore(
uint8(vm.envUint("INCLUSION_WINDOW")),
uint64(vm.envUint("INCLUSION_FEE_IN_GWEI")),
taikoInbox,
taikoWrapper
address(1)
)
),
data: abi.encodeCall(ForcedInclusionStore.init, (owner)),
data: abi.encodeCall(ForcedInclusionStore.init, (address(0))),
registerTo: resolver
});

Expand All @@ -478,6 +473,27 @@ contract DeployProtocolOnL1 is DeployCapability {
registerTo: resolver
});

UUPSUpgradeable(store).upgradeTo(
address(
new ForcedInclusionStore(
uint8(vm.envUint("INCLUSION_WINDOW")),
uint64(vm.envUint("INCLUSION_FEE_IN_GWEI")),
taikoInbox,
taikoWrapper
)
)
);

Ownable2StepUpgradeable(store).transferOwnership(owner);
console2.log("** forced_inclusion_store ownership transferred to:", owner);

router = deployProxy({
name: "preconf_router",
impl: address(new PreconfRouter(taikoWrapper, whitelist)),
data: abi.encodeCall(PreconfRouter.init, (owner)),
registerTo: resolver
});

return (whitelist, router, store, taikoWrapper);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ FOUNDRY_PROFILE="layer1" \
DEPLOY_PRECONF_CONTRACTS=true \
INCLUSION_WINDOW=24 \
INCLUSION_FEE_IN_GWEI=100 \
DEPLOY_PRECONF_CONTRACTS=false \
forge script ./script/layer1/based/DeployProtocolOnL1.s.sol:DeployProtocolOnL1 \
--fork-url http://localhost:8545 \
--broadcast \
Expand Down

0 comments on commit 7c61008

Please sign in to comment.