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
4 changes: 3 additions & 1 deletion src/L1/rollup/ScrollChain.sol
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ contract ScrollChain is OwnableUpgradeable, PausableUpgradeable, IScrollChain {

modifier OnlyTopLevelCall() {
// disallow contract accounts and delegated EOAs
if (msg.sender.code.length != 0) revert ErrorTopLevelCallRequired();
if (msg.sender != tx.origin || msg.sender.code.length != 0) {
revert ErrorTopLevelCallRequired();
}
_;
}

Expand Down
12 changes: 6 additions & 6 deletions src/test/ScrollChain.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ contract ScrollChainTest is DSTestPlus {

// revert when ErrorNotInEnforcedBatchMode
hevm.expectRevert(ScrollChain.ErrorNotInEnforcedBatchMode.selector);
hevm.startPrank(address(999));
hevm.startPrank(address(0x00a329c0648769A73afAc7F9381E08FB43dBEA72));
rollup.commitAndFinalizeBatch(
7,
bytes32(0),
Expand Down Expand Up @@ -372,7 +372,7 @@ contract ScrollChainTest is DSTestPlus {
// succeed to call commitAndFinalizeBatch 13
ScrollChainMockBlob(address(rollup)).setBlobVersionedHash(0, blobVersionedHash);
ScrollChainMockBlob(address(rollup)).setBlobVersionedHash(1, bytes32(0));
hevm.startPrank(address(999));
hevm.startPrank(address(0x00a329c0648769A73afAc7F9381E08FB43dBEA72));
rollup.commitAndFinalizeBatch(
7,
keccak256(headers[12]),
Expand Down Expand Up @@ -410,7 +410,7 @@ contract ScrollChainTest is DSTestPlus {
// succeed to call commitAndFinalizeBatch 14, no need to warp time
ScrollChainMockBlob(address(rollup)).setBlobVersionedHash(0, blobVersionedHash);
ScrollChainMockBlob(address(rollup)).setBlobVersionedHash(1, bytes32(0));
hevm.startPrank(address(999));
hevm.startPrank(address(0x00a329c0648769A73afAc7F9381E08FB43dBEA72));
rollup.commitAndFinalizeBatch(
7,
keccak256(headers[13]),
Expand Down Expand Up @@ -442,7 +442,7 @@ contract ScrollChainTest is DSTestPlus {

// not in enforced mode
hevm.expectRevert(ScrollChain.ErrorNotInEnforcedBatchMode.selector);
hevm.startPrank(address(999));
hevm.startPrank(address(0x00a329c0648769A73afAc7F9381E08FB43dBEA72));
rollup.commitAndFinalizeBatch(
7,
keccak256(headers[13]),
Expand Down Expand Up @@ -489,7 +489,7 @@ contract ScrollChainTest is DSTestPlus {

// revert when ErrorNotInEnforcedBatchMode
hevm.expectRevert(ScrollChain.ErrorNotInEnforcedBatchMode.selector);
hevm.startPrank(address(999));
hevm.startPrank(address(0x00a329c0648769A73afAc7F9381E08FB43dBEA72));
rollup.commitAndFinalizeBatch(
7,
bytes32(0),
Expand All @@ -514,7 +514,7 @@ contract ScrollChainTest is DSTestPlus {
// succeed to call commitAndFinalizeBatch 13
ScrollChainMockBlob(address(rollup)).setBlobVersionedHash(0, blobVersionedHash);
ScrollChainMockBlob(address(rollup)).setBlobVersionedHash(1, bytes32(0));
hevm.startPrank(address(999));
hevm.startPrank(address(0x00a329c0648769A73afAc7F9381E08FB43dBEA72));
rollup.commitAndFinalizeBatch(
7,
keccak256(headers[12]),
Expand Down
Loading