Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SystemConfig to deployBridge #48

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions scripts/hardhat/deploy/deployBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ const main = async () => {
[l1CrossDomainMessengerAddr],
);

const portalReceipt = await l1Provider.getTransactionReceipt(
lightLinkPortal.deployTx!.hash,
);

// Deploy SystemConfig contract
log("Deploying SystemConfig to L1...");
const systemConfig = await proxyDeployAndInitialize(
l1Deployer,
await ethers.getContractFactory("SystemConfig"),
[portalReceipt?.blockNumber, lightLinkPortal.address],
);

log("Deployment complete!");

// Log deployment addresses
Expand All @@ -62,6 +74,11 @@ const main = async () => {
`"${L1StandardBridgeDeployment.address}"`,
`"(impl ${L1StandardBridgeDeployment.implementationAddress})"`,
);
log(
" SystemConfig:",
`"${systemConfig.address}"`,
`"(impl ${systemConfig.implementationAddress})"`,
);
};

main()
Expand Down
3 changes: 3 additions & 0 deletions scripts/hardhat/lib/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const proxyDeployAndInitialize = async (
.deploy(signer.address)) as any;
await proxy.waitForDeployment();

const deployTx = await proxy.deploymentTransaction();

await proxy.upgradeToAndCall(
implementationAddress,
implementation.interface.encodeFunctionData("initialize", args),
Expand All @@ -34,6 +36,7 @@ export const proxyDeployAndInitialize = async (
address: proxyAddress,
implementation,
implementationAddress,
deployTx,
};
};

Expand Down