Skip to content

Commit 1ce497b

Browse files
committed
legacy: 9a1b541
1 parent 1d60251 commit 1ce497b

File tree

109 files changed

+2066
-4299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2066
-4299
lines changed

contracts/src/bridge/Bridge.sol

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
pragma solidity ^0.8.4;
@@ -63,11 +63,6 @@ contract Bridge is Initializable, DelegateCallAware, IBridge {
6363
rollup = rollup_;
6464
}
6565

66-
/// @notice Allows the proxy owner to set the rollup address
67-
function updateRollupAddress(IOwnable _rollup) external onlyDelegated onlyProxyOwner {
68-
rollup = _rollup;
69-
}
70-
7166
modifier onlyRollupOrOwner() {
7267
if (msg.sender != address(rollup)) {
7368
address rollupOwner = rollup.owner();

contracts/src/bridge/IBridge.sol

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
// solhint-disable-next-line compiler-version
@@ -112,6 +112,4 @@ interface IBridge {
112112
// ---------- initializer ----------
113113

114114
function initialize(IOwnable rollup_) external;
115-
116-
function updateRollupAddress(IOwnable _rollup) external;
117115
}

contracts/src/bridge/IDelayedMessageProvider.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
// solhint-disable-next-line compiler-version

contracts/src/bridge/IInbox.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
// solhint-disable-next-line compiler-version

contracts/src/bridge/IOutbox.sol

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
// solhint-disable-next-line compiler-version
@@ -28,8 +28,6 @@ interface IOutbox {
2828
function OUTBOX_VERSION() external view returns (uint128); // the outbox version
2929

3030
function updateSendRoot(bytes32 sendRoot, bytes32 l2BlockHash) external;
31-
32-
function updateRollupAddress() external;
3331

3432
/// @notice When l2ToL1Sender returns a nonzero address, the message was originated by an L2 account
3533
/// When the return value is zero, that means this is a system message

contracts/src/bridge/IOwnable.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
// solhint-disable-next-line compiler-version

contracts/src/bridge/ISequencerInbox.sol

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
// solhint-disable-next-line compiler-version
@@ -175,6 +175,4 @@ interface ISequencerInbox is IDelayedMessageProvider {
175175
// ---------- initializer ----------
176176

177177
function initialize(IBridge bridge_, MaxTimeVariation calldata maxTimeVariation_) external;
178-
179-
function updateRollupAddress() external;
180178
}

contracts/src/bridge/Inbox.sol

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
pragma solidity ^0.8.4;
@@ -527,7 +527,6 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
527527
);
528528
}
529529

530-
531530
function _deliverMessage(
532531
uint8 _kind,
533532
address _sender,

contracts/src/bridge/Messages.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
pragma solidity ^0.8.0;

contracts/src/bridge/Outbox.sol

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
pragma solidity ^0.8.4;
@@ -68,11 +68,6 @@ contract Outbox is DelegateCallAware, IOutbox {
6868
rollup = address(_bridge.rollup());
6969
}
7070

71-
/// @notice Allows the proxy owner to set the rollup address
72-
function updateRollupAddress() external onlyDelegated onlyProxyOwner {
73-
rollup = address(bridge.rollup());
74-
}
75-
7671
function updateSendRoot(bytes32 root, bytes32 l2BlockHash) external {
7772
if (msg.sender != rollup) revert NotRollup(msg.sender, rollup);
7873
roots[root] = l2BlockHash;

contracts/src/bridge/SequencerInbox.sol

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
pragma solidity ^0.8.0;
@@ -87,11 +87,6 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
8787
maxTimeVariation = maxTimeVariation_;
8888
}
8989

90-
/// @notice Allows the proxy owner to set the rollup address
91-
function updateRollupAddress() external onlyDelegated onlyProxyOwner {
92-
rollup = bridge.rollup();
93-
}
94-
9590
function getTimeBounds() internal view virtual returns (TimeBounds memory) {
9691
TimeBounds memory bounds;
9792
if (block.timestamp > maxTimeVariation.delaySeconds) {

contracts/src/challenge/OldChallengeLib.sol renamed to contracts/src/challenge/ChallengeLib.sol

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// Copyright 2021-2022, Offchain Labs, Inc.
2-
// For license information, see https://github.com/nitro/blob/master/LICENSE
2+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
33
// SPDX-License-Identifier: BUSL-1.1
44

55
pragma solidity ^0.8.0;
66

77
import "../state/Machine.sol";
88
import "../state/GlobalState.sol";
99

10-
library OldChallengeLib {
10+
library ChallengeLib {
1111
using MachineLib for Machine;
12-
using OldChallengeLib for Challenge;
12+
using ChallengeLib for Challenge;
1313

1414
/// @dev It's assumed that that uninitialzed challenges have mode NONE
1515
enum ChallengeMode {
@@ -86,6 +86,8 @@ library OldChallengeLib {
8686
return keccak256(abi.encodePacked("Machine finished:", globalStateHash));
8787
} else if (status == MachineStatus.ERRORED) {
8888
return keccak256(abi.encodePacked("Machine errored:"));
89+
} else if (status == MachineStatus.TOO_FAR) {
90+
return keccak256(abi.encodePacked("Machine too far:"));
8991
} else {
9092
revert("BAD_BLOCK_STATUS");
9193
}
@@ -122,6 +124,8 @@ library OldChallengeLib {
122124
return keccak256(abi.encodePacked("Block state:", globalStateHash));
123125
} else if (status == MachineStatus.ERRORED) {
124126
return keccak256(abi.encodePacked("Block state, errored:", globalStateHash));
127+
} else if (status == MachineStatus.TOO_FAR) {
128+
return keccak256(abi.encodePacked("Block state, too far:"));
125129
} else {
126130
revert("BAD_BLOCK_STATUS");
127131
}

0 commit comments

Comments
 (0)