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
056a9dfe
Unverified
Commit
056a9dfe
authored
Dec 05, 2022
by
Kelvin Fichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maint(ctb): minor comment cleanup
Cleans up a few minor issues with comments.
parent
902985f2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
47 deletions
+40
-47
L1StandardBridge.sol
packages/contracts-bedrock/contracts/L1/L1StandardBridge.sol
+6
-6
L2OutputOracle.sol
packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
+12
-15
SystemConfig.sol
packages/contracts-bedrock/contracts/L1/SystemConfig.sol
+3
-3
BaseFeeVault.sol
packages/contracts-bedrock/contracts/L2/BaseFeeVault.sol
+1
-2
CrossDomainOwnable.sol
...ges/contracts-bedrock/contracts/L2/CrossDomainOwnable.sol
+5
-7
CrossDomainOwnable2.sol
...es/contracts-bedrock/contracts/L2/CrossDomainOwnable2.sol
+7
-9
L2StandardBridge.sol
packages/contracts-bedrock/contracts/L2/L2StandardBridge.sol
+3
-4
StandardBridge.sol
.../contracts-bedrock/contracts/universal/StandardBridge.sol
+3
-1
No files found.
packages/contracts-bedrock/contracts/L1/L1StandardBridge.sol
View file @
056a9dfe
...
...
@@ -10,12 +10,12 @@ import { Semver } from "../universal/Semver.sol";
* @title L1StandardBridge
* @notice The L1StandardBridge is responsible for transfering ETH and ERC20 tokens between L1 and
* L2. In the case that an ERC20 token is native to L1, it will be escrowed within this
* contract. If the ERC20 token is native to L2, it will be burnt.
*
ETH is transferred to and escrowed within the OptimismPortal contract.
*
Note that this contract is not intended to support all variations of ERC20 tokens
.
*
Examples of some token types that may not be properly supported by this contract include,
*
but are not limited to: tokens with transfer fees, rebasing tokens, and
* tokens with blocklists.
* contract. If the ERC20 token is native to L2, it will be burnt.
Before Bedrock, ETH was
*
stored within this contract. After Bedrock, ETH is instead stored inside the
*
OptimismPortal contract
.
*
NOTE: this contract is not intended to support all variations of ERC20 tokens. Examples
*
of some token types that may not be properly supported by this contract include, but are
*
not limited to: tokens with transfer fees, rebasing tokens, and
tokens with blocklists.
*/
contract L1StandardBridge is StandardBridge, Semver {
/**
...
...
packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
View file @
056a9dfe
...
...
@@ -8,11 +8,10 @@ import { Types } from "../libraries/Types.sol";
/**
* @custom:proxied
* @title L2OutputOracle
* @notice The L2
state is committed to in this contract
*
The payable keyword is used on proposeL2Output to save gas on the msg.value check.
*
This contract should be deployed behind an upgradable proxy
* @notice The L2
OutputOracle contains an array of L2 state outputs, where each output is a
*
commitment to the state of the L2 chain. Other contracts like the OptimismPortal use
*
these outputs to verify information about the state of L2.
*/
// slither-disable-next-line locked-ether
contract L2OutputOracle is Initializable, Semver {
/**
* @notice The interval in L2 blocks at which checkpoints must be submitted. Although this is
...
...
@@ -76,12 +75,12 @@ contract L2OutputOracle is Initializable, Semver {
/**
* @custom:semver 0.0.1
*
* @param _submissionInterval
Interval in blocks at which checkpoints must be submitted.
* @param _l2BlockTime
The time per L2 block, in seconds.
* @param _startingBlockNumber
The number of the first L2 block.
* @param _startingTimestamp
The timestamp of the first L2 block.
* @param _proposer
The address of the proposer.
* @param _challenger
The address of the challenger.
* @param _submissionInterval Interval in blocks at which checkpoints must be submitted.
* @param _l2BlockTime The time per L2 block, in seconds.
* @param _startingBlockNumber The number of the first L2 block.
* @param _startingTimestamp The timestamp of the first L2 block.
* @param _proposer The address of the proposer.
* @param _challenger The address of the challenger.
*/
constructor(
uint256 _submissionInterval,
...
...
@@ -149,9 +148,9 @@ contract L2OutputOracle is Initializable, Semver {
}
/**
* @notice Accepts an outputRoot and the timestamp of the corresponding L2 block. The
*
timestamp must be equal to the current value returned by `nextTimestamp()` in order
*
to be
accepted. This function may only be called by the Proposer.
* @notice Accepts an outputRoot and the timestamp of the corresponding L2 block. The
timestamp
*
must be equal to the current value returned by `nextTimestamp()` in order to be
* accepted. This function may only be called by the Proposer.
*
* @param _outputRoot The L2 output of the checkpoint block.
* @param _l2BlockNumber The L2 block number that resulted in _outputRoot.
...
...
@@ -321,8 +320,6 @@ contract L2OutputOracle is Initializable, Semver {
/**
* @notice Returns the L2 timestamp corresponding to a given L2 block number.
* If the L2 block number provided is between checkpoints, this function will return the
* timestamp of the previous checkpoint.
*
* @param _l2BlockNumber The L2 block number of the target block.
*
...
...
packages/contracts-bedrock/contracts/L1/SystemConfig.sol
View file @
056a9dfe
...
...
@@ -32,9 +32,9 @@ contract SystemConfig is OwnableUpgradeable, Semver {
uint256 public constant VERSION = 0;
/**
* @notice Minimum gas limit. This should not be lower than the maximum deposit
*
gas resource limit in the ResourceMetering contract used by OptimismPortal,
*
to ensure the L2
block always has sufficient gas to process deposits.
* @notice Minimum gas limit. This should not be lower than the maximum deposit
gas resource
*
limit in the ResourceMetering contract used by OptimismPortal, to ensure the L2
* block always has sufficient gas to process deposits.
*/
uint64 public constant MINIMUM_GAS_LIMIT = 8_000_000;
...
...
packages/contracts-bedrock/contracts/L2/BaseFeeVault.sol
View file @
056a9dfe
...
...
@@ -10,8 +10,7 @@ import { FeeVault } from "../universal/FeeVault.sol";
* @custom:proxied
* @custom:predeploy 0x4200000000000000000000000000000000000019
* @title BaseFeeVault
* @notice The BaseFeeVault accumulates the base fee that is paid by
* transactions.
* @notice The BaseFeeVault accumulates the base fee that is paid by transactions.
*/
contract BaseFeeVault is FeeVault, Semver {
/**
...
...
packages/contracts-bedrock/contracts/L2/CrossDomainOwnable.sol
View file @
056a9dfe
...
...
@@ -6,17 +6,15 @@ import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
/**
* @title CrossDomainOwnable
* @notice This contract extends the OpenZeppelin `Ownable` contract
* for L2 contracts to be owned by contracts on L1. Note that
* this contract is only safe to be used if the CrossDomainMessenger
* system is bypassed and the caller on L1 is calling the
* @notice This contract extends the OpenZeppelin `Ownable` contract for L2 contracts to be owned
* by contracts on L1. Note that this contract is only safe to be used if the
* CrossDomainMessenger system is bypassed and the caller on L1 is calling the
* OptimismPortal directly.
*/
abstract contract CrossDomainOwnable is Ownable {
/**
* @notice Overrides the implementation of the `onlyOwner` modifier
* to check that the unaliased `msg.sender` is the owner
* of the contract.
* @notice Overrides the implementation of the `onlyOwner` modifier to check that the unaliased
* `msg.sender` is the owner of the contract.
*/
function _checkOwner() internal view override {
require(
...
...
packages/contracts-bedrock/contracts/L2/CrossDomainOwnable2.sol
View file @
056a9dfe
...
...
@@ -7,18 +7,16 @@ import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title CrossDomainOwnable2
* @notice This contract extends the OpenZeppelin `Ownable` contract
* for L2 contracts to be owned by contracts on L1. Note that
* this contract is meant to be used with systems that use the
* CrossDomainMessenger system. It will not work if the OptimismPortal
* is used directly.
* @notice This contract extends the OpenZeppelin `Ownable` contract for L2 contracts to be owned
* by contracts on L1. Note that this contract is meant to be used with systems that use
* the CrossDomainMessenger system. It will not work if the OptimismPortal is used
* directly.
*/
abstract contract CrossDomainOwnable2 is Ownable {
/**
* @notice Overrides the implementation of the `onlyOwner` modifier
* to check that the unaliased `xDomainMessageSender`
* is the owner of the contract. This value is set
* to the caller of the L1CrossDomainMessenger.
* @notice Overrides the implementation of the `onlyOwner` modifier to check that the unaliased
* `xDomainMessageSender` is the owner of the contract. This value is set to the caller
* of the L1CrossDomainMessenger.
*/
function _checkOwner() internal view override {
L2CrossDomainMessenger messenger = L2CrossDomainMessenger(
...
...
packages/contracts-bedrock/contracts/L2/L2StandardBridge.sol
View file @
056a9dfe
...
...
@@ -13,10 +13,9 @@ import { OptimismMintableERC20 } from "../universal/OptimismMintableERC20.sol";
* @notice The L2StandardBridge is responsible for transfering ETH and ERC20 tokens between L1 and
* L2. In the case that an ERC20 token is native to L2, it will be escrowed within this
* contract. If the ERC20 token is native to L1, it will be burnt.
* Note that this contract is not intended to support all variations of ERC20 tokens.
* Examples of some token types that may not be properly supported by this contract include,
* but are not limited to: tokens with transfer fees, rebasing tokens, and
* tokens with blocklists.
* NOTE: this contract is not intended to support all variations of ERC20 tokens. Examples
* of some token types that may not be properly supported by this contract include, but are
* not limited to: tokens with transfer fees, rebasing tokens, and tokens with blocklists.
*/
contract L2StandardBridge is StandardBridge, Semver {
/**
...
...
packages/contracts-bedrock/contracts/universal/StandardBridge.sol
View file @
056a9dfe
...
...
@@ -13,7 +13,9 @@ import { OptimismMintableERC20 } from "./OptimismMintableERC20.sol";
/**
* @custom:upgradeable
* @title StandardBridge
* @notice StandardBridge is a base contract for the L1 and L2 standard ERC20 bridges.
* @notice StandardBridge is a base contract for the L1 and L2 standard ERC20 bridges. It handles
* the core bridging logic, including escrowing tokens that are native to the local chain
* and minting/burning tokens that are native to the remote chain.
*/
abstract contract StandardBridge {
using SafeERC20 for IERC20;
...
...
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