Skip to content

Commit

Permalink
fix(contracts): OZ-L10 maxReplayTimes is Not Initialized in `L1Scro…
Browse files Browse the repository at this point in the history
…llMessenger` (#852)

Co-authored-by: zimpha <zimpha@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <HAOYUatHZ@users.noreply.github.com>
  • Loading branch information
4 people committed Aug 25, 2023
1 parent 24a0fd0 commit 6139ca0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
)

var tag = "v4.1.106"
var tag = "v4.1.107"

var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
Expand Down
3 changes: 3 additions & 0 deletions contracts/src/L1/L1ScrollMessenger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ contract L1ScrollMessenger is ScrollMessengerBase, IL1ScrollMessenger {

rollup = _rollup;
messageQueue = _messageQueue;

maxReplayTimes = 3;
emit UpdateMaxReplayTimes(0, 3);
}

/*****************************
Expand Down
6 changes: 4 additions & 2 deletions contracts/src/test/L1ScrollMessengerTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ contract L1ScrollMessengerTest is L1GatewayTestBase {

exceedValue = bound(exceedValue, 1, address(this).balance / 2);

l1Messenger.updateMaxReplayTimes(0);

// append a message
l1Messenger.sendMessage{value: 100}(address(0), 100, new bytes(0), 0, refundAddress);

Expand Down Expand Up @@ -179,9 +181,9 @@ contract L1ScrollMessengerTest is L1GatewayTestBase {
hevm.stopPrank();

hevm.expectEmit(false, false, false, true);
emit UpdateMaxReplayTimes(0, _maxReplayTimes);
emit UpdateMaxReplayTimes(3, _maxReplayTimes);

assertEq(l1Messenger.maxReplayTimes(), 0);
assertEq(l1Messenger.maxReplayTimes(), 3);
l1Messenger.updateMaxReplayTimes(_maxReplayTimes);
assertEq(l1Messenger.maxReplayTimes(), _maxReplayTimes);
}
Expand Down

0 comments on commit 6139ca0

Please sign in to comment.