Skip to content
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
6 changes: 2 additions & 4 deletions scripts/foundry/InitializeL1ScrollOwner.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {ScrollChain} from "../../src/L1/rollup/ScrollChain.sol";
import {ScrollOwner} from "../../src/misc/ScrollOwner.sol";
import {Whitelist} from "../../src/L2/predeploys/Whitelist.sol";


// solhint-disable max-states-count
// solhint-disable state-visibility
// solhint-disable var-name-mixedcase
Expand Down Expand Up @@ -66,7 +65,6 @@ contract InitializeL1ScrollOwner is Script {

address SYSTEM_CONTRACT_ADDR = vm.envAddress("SYSTEM_CONTRACT_ADDR");


ScrollOwner owner;

function run() external {
Expand All @@ -85,8 +83,8 @@ contract InitializeL1ScrollOwner is Script {
configL1GatewayRouter();
configL1CustomERC20Gateway();
configL1ERC721Gateway();
configL1ERC1155Gateway();
configL1ERC1155Gateway();

configL1USDCGateway();
configEnforcedTxGateway();

Expand Down
16 changes: 8 additions & 8 deletions scripts/foundry/InitializeL1SystemConfig.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.8.24;

import { Script } from "forge-std/Script.sol";
import { SystemConfig } from "../../src/L1/system-contract/SystemConfig.sol";
import { ScrollOwner } from "../../src/misc/ScrollOwner.sol"; // Adjust this path as needed
import {Script} from "forge-std/Script.sol";
import {SystemConfig} from "../../src/L1/system-contract/SystemConfig.sol";
import {ScrollOwner} from "../../src/misc/ScrollOwner.sol"; // Adjust this path as needed

/**
* @title InitializeL1SystemConfig
Expand All @@ -18,7 +18,7 @@ contract InitializeL1SystemConfig is Script {
address systemConfigAddr = vm.envAddress("SYSTEM_CONTRACT_ADDR");
address securityCouncilAddr = vm.envAddress("L1_SECURITY_COUNCIL_ADDR");
address scrollOwnerAddr = vm.envAddress("L1_SCROLL_OWNER_ADDR");

// Compute the role hash for the Security Council with no delay.
bytes32 SECURITY_COUNCIL_NO_DELAY_ROLE = keccak256("SECURITY_COUNCIL_NO_DELAY_ROLE");

Expand All @@ -36,12 +36,12 @@ contract InitializeL1SystemConfig is Script {
// Grant the SECURITY_COUNCIL_NO_DELAY_ROLE permission on SystemConfig,
// so that the Security Council address can call updateSigner() with no delay.
owner.updateAccess(
systemConfigAddr, // Address of the SystemConfig contract.
selectors, // The function selectors (only updateSigner here).
systemConfigAddr, // Address of the SystemConfig contract.
selectors, // The function selectors (only updateSigner here).
SECURITY_COUNCIL_NO_DELAY_ROLE,
true // Grant access.
true // Grant access.
);

vm.stopBroadcast();
}
}
}
1 change: 0 additions & 1 deletion src/L1/L1ScrollMessenger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {IScrollMessenger} from "../libraries/IScrollMessenger.sol";
import {ScrollMessengerBase} from "../libraries/ScrollMessengerBase.sol";
import {WithdrawTrieVerifier} from "../libraries/verifier/WithdrawTrieVerifier.sol";


import {IMessageDropCallback} from "../libraries/callbacks/IMessageDropCallback.sol";

// solhint-disable avoid-low-level-calls
Expand Down
19 changes: 19 additions & 0 deletions src/L1/rollup/IScrollChain.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,23 @@ interface IScrollChain {
bytes32 withdrawRoot,
bytes calldata aggrProof
) external;

/// @param The struct for batch finalization.
/// @param batchHeader The header of current batch, see the encoding in comments of `commitBatch`.
/// @param lastProcessedQueueIndex The last processed message queue index.
/// @param postStateRoot The state root after current batch.
/// @param withdrawRoot The withdraw trie root after current batch.
/// @param zkProof The zk proof for current batch (single-batch bundle).
struct FinalizeStruct {
bytes batchHeader;
uint256 lastProcessedQueueIndex;
bytes32 postStateRoot;
bytes32 withdrawRoot;
bytes zkProof;
}

/// @notice Commit a batch of transactions on layer 1 and finalize it.
/// @param version The version of current batch.
/// @param finalizeStruct The data needed for finalize.
function commitAndFinalizeBatch(uint8 version, FinalizeStruct calldata finalizeStruct) external;
}
Loading
Loading