Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
063e52ac
Commit
063e52ac
authored
Jul 20, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Upgrade `MIPS.sol` solc version
parent
6020e6b7
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
720 additions
and
713 deletions
+720
-713
mips.go
op-bindings/bindings/mips.go
+1
-1
mips_more.go
op-bindings/bindings/mips_more.go
+1
-1
MIPS.sol
packages/contracts-bedrock/src/cannon/MIPS.sol
+683
-663
PreimageKeyLib.sol
packages/contracts-bedrock/src/cannon/PreimageKeyLib.sol
+1
-1
PreimageOracle.sol
packages/contracts-bedrock/src/cannon/PreimageOracle.sol
+6
-29
IPreimageOracle.sol
...ntracts-bedrock/src/cannon/interfaces/IPreimageOracle.sol
+24
-5
IBigStepper.sol
.../contracts-bedrock/src/dispute/interfaces/IBigStepper.sol
+2
-11
AssetReceiver.sol
packages/contracts-bedrock/src/periphery/AssetReceiver.sol
+1
-0
PreimageOracle.t.sol
packages/contracts-bedrock/test/PreimageOracle.t.sol
+1
-2
No files found.
op-bindings/bindings/mips.go
View file @
063e52ac
This diff is collapsed.
Click to expand it.
op-bindings/bindings/mips_more.go
View file @
063e52ac
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/src/cannon/MIPS.sol
View file @
063e52ac
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/src/cannon/PreimageKeyLib.sol
View file @
063e52ac
// SPDX-License-Identifier: MIT
pragma solidity
^0.7.6
;
pragma solidity
0.8.15
;
/// @title PreimageKeyLib
/// @notice Shared utilities for localizing local keys in the preimage oracle.
...
...
packages/contracts-bedrock/src/cannon/PreimageOracle.sol
View file @
063e52ac
// SPDX-License-Identifier: MIT
pragma solidity 0.
7.6
;
pragma solidity 0.
8.15
;
import { IPreimageOracle } from "./interfaces/IPreimageOracle.sol";
import { PreimageKeyLib } from "./PreimageKeyLib.sol";
/// @title PreimageOracle
/// @notice A contract for storing permissioned pre-images.
contract PreimageOracle {
contract PreimageOracle
is IPreimageOracle
{
/// @notice Mapping of pre-image keys to pre-image lengths.
mapping(bytes32 => uint256) public preimageLengths;
/// @notice Mapping of pre-image keys to pre-image parts.
...
...
@@ -13,11 +14,7 @@ contract PreimageOracle {
/// @notice Mapping of pre-image keys to pre-image part offsets.
mapping(bytes32 => mapping(uint256 => bool)) public preimagePartOk;
/// @notice Reads a pre-image from the oracle.
/// @param _key The key of the pre-image to read.
/// @param _offset The offset of the pre-image to read.
/// @return dat_ The pre-image data.
/// @return datLen_ The length of the pre-image data.
/// @inheritdoc IPreimageOracle
function readPreimage(bytes32 _key, uint256 _offset)
external
view
...
...
@@ -53,24 +50,7 @@ contract PreimageOracle {
preimageLengths[key] = size;
}
/// @notice Loads a word of local data into the preimage oracle in two separate parts.
/// @param _ident The identifier of the local data.
/// @param _word The local data word.
/// @param _size The number of bytes in `_word` to load.
/// @dev The local data parts are loaded into the preimage oracle under the context
/// of the caller - no other account can write to the caller's context
/// specific data.
///
/// There are 5 local data identifiers:
/// ┌────────────┬────────────────────────┐
/// │ Identifier │ Data │
/// ├────────────┼────────────────────────┤
/// │ 1 │ L1 Head Hash (bytes32) │
/// │ 2 │ Output Root (bytes32) │
/// │ 3 │ Root Claim (bytes32) │
/// │ 4 │ L2 Block Number (u64) │
/// │ 5 │ Chain ID (u64) │
/// └────────────┴────────────────────────┘
/// @inheritdoc IPreimageOracle
function loadLocalData(
uint256 _ident,
bytes32 _word,
...
...
@@ -106,10 +86,7 @@ contract PreimageOracle {
preimageLengths[key_] = _size;
}
/// @notice Prepares a pre-image to be read by keccak256 key, starting at
/// the given offset and up to 32 bytes (clipped at pre-image length, if out of data).
/// @param _partOffset The offset of the pre-image to read.
/// @param _preimage The preimage data.
/// @inheritdoc IPreimageOracle
function loadKeccak256PreimagePart(uint256 _partOffset, bytes calldata _preimage) external {
uint256 size;
bytes32 key;
...
...
packages/contracts-bedrock/src/cannon/interfaces/IPreimageOracle.sol
View file @
063e52ac
// SPDX-License-Identifier: MIT
pragma solidity 0.
7.6
;
pragma solidity 0.
8.15
;
/// @title IPreimageOracle
/// @notice Interface for a preimage oracle.
...
...
@@ -14,10 +14,29 @@ interface IPreimageOracle {
view
returns (bytes32 dat_, uint256 datLen_);
/// @notice Computes and returns the key for a pre-image.
/// @param _preimage The pre-image.
/// @return key_ The pre-image key.
function computePreimageKey(bytes calldata _preimage) external pure returns (bytes32 key_);
/// @notice Loads a word of local data into the preimage oracle in two separate parts.
/// @param _ident The identifier of the local data.
/// @param _word The local data word.
/// @param _size The number of bytes in `_word` to load.
/// @dev The local data parts are loaded into the preimage oracle under the context
/// of the caller - no other account can write to the caller's context
/// specific data.
///
/// There are 5 local data identifiers:
/// ┌────────────┬────────────────────────┐
/// │ Identifier │ Data │
/// ├────────────┼────────────────────────┤
/// │ 1 │ L1 Head Hash (bytes32) │
/// │ 2 │ Output Root (bytes32) │
/// │ 3 │ Root Claim (bytes32) │
/// │ 4 │ L2 Block Number (u64) │
/// │ 5 │ Chain ID (u64) │
/// └────────────┴────────────────────────┘
function loadLocalData(
uint256 _ident,
bytes32 _word,
uint8 _size
) external returns (bytes32 key_);
/// @notice Prepares a preimage to be read by keccak256 key, starting at
/// the given offset and up to 32 bytes (clipped at preimage length, if out of data).
...
...
packages/contracts-bedrock/src/dispute/interfaces/IBigStepper.sol
View file @
063e52ac
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
import { IPreimageOracle } from "../../cannon/interfaces/IPreimageOracle.sol";
/// @title IBigStepper
/// @notice An interface for a contract with a state transition function that
/// will accept a pre state and return a post state.
...
...
@@ -35,14 +37,3 @@ interface IBigStepper {
/// @notice Returns the preimage oracle used by the stepper.
function oracle() external view returns (IPreimageOracle oracle_);
}
/// @notice Temporary interface for the `IPreimageOracle`. Remove once we've upgraded
/// the cannon contracts to a newer version of solc.
interface IPreimageOracle {
function loadLocalData(
uint256 _ident,
bytes32 _word,
uint256 _size,
uint256 _partOffset
) external returns (bytes32 key_);
}
packages/contracts-bedrock/src/periphery/AssetReceiver.sol
View file @
063e52ac
...
...
@@ -64,6 +64,7 @@ contract AssetReceiver is Transactor {
function withdrawETH(address payable _to, uint256 _amount) public onlyOwner {
// slither-disable-next-line reentrancy-unlimited-gas
(bool success, ) = _to.call{ value: _amount }("");
success; // Suppress warning; We ignore the low-level call result.
emit WithdrewETH(msg.sender, _to, _amount);
}
...
...
packages/contracts-bedrock/test/PreimageOracle.t.sol
View file @
063e52ac
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
pragma solidity 0.8.15;
import { Test } from "forge-std/Test.sol";
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment