Skip to content

Commit

Permalink
legacy: 9a1b541
Browse files Browse the repository at this point in the history
  • Loading branch information
gzeoneth committed Aug 29, 2023
1 parent 1d60251 commit 1ce497b
Show file tree
Hide file tree
Showing 109 changed files with 2,066 additions and 4,299 deletions.
7 changes: 1 addition & 6 deletions contracts/src/bridge/Bridge.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.4;
Expand Down Expand Up @@ -63,11 +63,6 @@ contract Bridge is Initializable, DelegateCallAware, IBridge {
rollup = rollup_;
}

/// @notice Allows the proxy owner to set the rollup address
function updateRollupAddress(IOwnable _rollup) external onlyDelegated onlyProxyOwner {
rollup = _rollup;
}

modifier onlyRollupOrOwner() {
if (msg.sender != address(rollup)) {
address rollupOwner = rollup.owner();
Expand Down
4 changes: 1 addition & 3 deletions contracts/src/bridge/IBridge.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

// solhint-disable-next-line compiler-version
Expand Down Expand Up @@ -112,6 +112,4 @@ interface IBridge {
// ---------- initializer ----------

function initialize(IOwnable rollup_) external;

function updateRollupAddress(IOwnable _rollup) external;
}
2 changes: 1 addition & 1 deletion contracts/src/bridge/IDelayedMessageProvider.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

// solhint-disable-next-line compiler-version
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/bridge/IInbox.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

// solhint-disable-next-line compiler-version
Expand Down
4 changes: 1 addition & 3 deletions contracts/src/bridge/IOutbox.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

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

function updateSendRoot(bytes32 sendRoot, bytes32 l2BlockHash) external;

function updateRollupAddress() external;

/// @notice When l2ToL1Sender returns a nonzero address, the message was originated by an L2 account
/// When the return value is zero, that means this is a system message
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/bridge/IOwnable.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

// solhint-disable-next-line compiler-version
Expand Down
4 changes: 1 addition & 3 deletions contracts/src/bridge/ISequencerInbox.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

// solhint-disable-next-line compiler-version
Expand Down Expand Up @@ -175,6 +175,4 @@ interface ISequencerInbox is IDelayedMessageProvider {
// ---------- initializer ----------

function initialize(IBridge bridge_, MaxTimeVariation calldata maxTimeVariation_) external;

function updateRollupAddress() external;
}
3 changes: 1 addition & 2 deletions contracts/src/bridge/Inbox.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.4;
Expand Down Expand Up @@ -527,7 +527,6 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
);
}


function _deliverMessage(
uint8 _kind,
address _sender,
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/bridge/Messages.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;
Expand Down
7 changes: 1 addition & 6 deletions contracts/src/bridge/Outbox.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.4;
Expand Down Expand Up @@ -68,11 +68,6 @@ contract Outbox is DelegateCallAware, IOutbox {
rollup = address(_bridge.rollup());
}

/// @notice Allows the proxy owner to set the rollup address
function updateRollupAddress() external onlyDelegated onlyProxyOwner {
rollup = address(bridge.rollup());
}

function updateSendRoot(bytes32 root, bytes32 l2BlockHash) external {
if (msg.sender != rollup) revert NotRollup(msg.sender, rollup);
roots[root] = l2BlockHash;
Expand Down
7 changes: 1 addition & 6 deletions contracts/src/bridge/SequencerInbox.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;
Expand Down Expand Up @@ -87,11 +87,6 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
maxTimeVariation = maxTimeVariation_;
}

/// @notice Allows the proxy owner to set the rollup address
function updateRollupAddress() external onlyDelegated onlyProxyOwner {
rollup = bridge.rollup();
}

function getTimeBounds() internal view virtual returns (TimeBounds memory) {
TimeBounds memory bounds;
if (block.timestamp > maxTimeVariation.delaySeconds) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

import "../state/Machine.sol";
import "../state/GlobalState.sol";

library OldChallengeLib {
library ChallengeLib {
using MachineLib for Machine;
using OldChallengeLib for Challenge;
using ChallengeLib for Challenge;

/// @dev It's assumed that that uninitialzed challenges have mode NONE
enum ChallengeMode {
Expand Down Expand Up @@ -86,6 +86,8 @@ library OldChallengeLib {
return keccak256(abi.encodePacked("Machine finished:", globalStateHash));
} else if (status == MachineStatus.ERRORED) {
return keccak256(abi.encodePacked("Machine errored:"));
} else if (status == MachineStatus.TOO_FAR) {
return keccak256(abi.encodePacked("Machine too far:"));
} else {
revert("BAD_BLOCK_STATUS");
}
Expand Down Expand Up @@ -122,6 +124,8 @@ library OldChallengeLib {
return keccak256(abi.encodePacked("Block state:", globalStateHash));
} else if (status == MachineStatus.ERRORED) {
return keccak256(abi.encodePacked("Block state, errored:", globalStateHash));
} else if (status == MachineStatus.TOO_FAR) {
return keccak256(abi.encodePacked("Block state, too far:"));
} else {
revert("BAD_BLOCK_STATUS");
}
Expand Down
Loading

0 comments on commit 1ce497b

Please sign in to comment.