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

Fix deploy scripts after merging dev #1098

Merged
merged 2 commits into from
Nov 29, 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
11 changes: 2 additions & 9 deletions l1-contracts/deploy-scripts/DeployL1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,10 @@ contract DeployL1Script is Script {
}

function deployChainAdmin() internal {
bytes memory accessControlRestrictionBytecode = abi.encodePacked(
bytes memory bytecode = abi.encodePacked(
type(ChainAdmin).creationCode,
abi.encode(uint256(0), config.ownerAddress)
abi.encode(config.ownerAddress, address(0))
);

address accessControlRestriction = deployViaCreate2(accessControlRestrictionBytecode);
console.log("Access control restriction deployed at:", accessControlRestriction);
address[] memory restrictions = new address[](1);
restrictions[0] = accessControlRestriction;

bytes memory bytecode = abi.encodePacked(type(ChainAdmin).creationCode, abi.encode(restrictions));
address contractAddress = deployViaCreate2(bytecode);
console.log("ChainAdmin deployed at:", contractAddress);
addresses.chainAdmin = contractAddress;
Expand Down
1 change: 0 additions & 1 deletion l1-contracts/deploy-scripts/DeployL2Contracts.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ contract DeployL2Script is Script {
deploySharedBridge();
deploySharedBridgeProxy(legacyBridge);
initializeChain();
finalizeRegistration();

saveOutput();
}
Expand Down
18 changes: 17 additions & 1 deletion l1-contracts/deploy-scripts/RegisterHyperchain.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,23 @@ contract RegisterHyperchainScript is Script {
}

function loadChain() internal {
chainConfig = chainRegistrar.proposedChains[config.proposalAuthor][config.chainChainId];
(
uint256 chainId,
ChainRegistrar.BaseToken memory baseToken,
address blobOperator,
address operator,
address governor,
PubdataPricingMode pubdataPricingMode
) = chainRegistrar.proposedChains(config.proposalAuthor, config.chainChainId);

chainConfig = ChainRegistrar.ChainConfig({
chainId: chainId,
baseToken: baseToken,
operator: operator,
blobOperator: blobOperator,
governor: governor,
pubdataPricingMode: pubdataPricingMode
});
}

function checkTokenAddress() internal view {
Expand Down
2 changes: 1 addition & 1 deletion system-contracts/scripts/calculate-hashes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const readBytecode = (details: ContractDetails): string => {
try {
if (details.bytecodePath.endsWith(".json")) {
const jsonFile = fs.readFileSync(absolutePath, "utf8");
return ethers.utils.hexlify(JSON.parse(jsonFile).bytecode.object);
return "0x" + ethers.utils.hexlify(JSON.parse(jsonFile).bytecode.object);
} else {
return ethers.utils.hexlify(fs.readFileSync(absolutePath).toString(), { allowMissingPrefix: true });
}
Expand Down
2 changes: 1 addition & 1 deletion system-contracts/scripts/preprocess-bootloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function getSystemContextCodeHash() {
let bytecode;
try {
const artifact = JSON.parse(fs.readFileSync("zkout/SystemContext.sol/SystemContext.json", { encoding: "utf-8" }));
bytecode = artifact.bytecode.object;
bytecode = "0x" + artifact.bytecode.object;
} catch (e) {
bytecode = hre.artifacts.readArtifactSync("SystemContext").bytecode;
}
Expand Down
Loading