Skip to content

Commit

Permalink
Merge pull request #6096 from ethereum-optimism/refcell/first/stylestack
Browse files Browse the repository at this point in the history
fix(ctb): Triple Slash Natspec Port
  • Loading branch information
OptimismBot authored Jun 22, 2023
2 parents 07b0dc2 + 92b5bae commit 5d38cf2
Show file tree
Hide file tree
Showing 22 changed files with 914 additions and 1,094 deletions.
2 changes: 1 addition & 1 deletion op-bindings/bindings/l1crossdomainmessenger.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion op-bindings/bindings/l1erc721bridge.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion op-bindings/bindings/l1standardbridge.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion op-bindings/bindings/l2outputoracle.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion op-bindings/bindings/optimismportal.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion op-bindings/bindings/systemconfig.go

Large diffs are not rendered by default.

182 changes: 91 additions & 91 deletions packages/contracts-bedrock/.gas-snapshot

Large diffs are not rendered by default.

42 changes: 14 additions & 28 deletions packages/contracts-bedrock/contracts/L1/L1CrossDomainMessenger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,32 @@ import { OptimismPortal } from "./OptimismPortal.sol";
import { CrossDomainMessenger } from "../universal/CrossDomainMessenger.sol";
import { Semver } from "../universal/Semver.sol";

/**
* @custom:proxied
* @title L1CrossDomainMessenger
* @notice The L1CrossDomainMessenger is a message passing interface between L1 and L2 responsible
* for sending and receiving data on the L1 side. Users are encouraged to use this
* interface instead of interacting with lower-level contracts directly.
*/
/// @custom:proxied
/// @title L1CrossDomainMessenger
/// @notice The L1CrossDomainMessenger is a message passing interface between L1 and L2 responsible
/// for sending and receiving data on the L1 side. Users are encouraged to use this
/// interface instead of interacting with lower-level contracts directly.
contract L1CrossDomainMessenger is CrossDomainMessenger, Semver {
/**
* @notice Address of the OptimismPortal.
*/
/// @notice Address of the OptimismPortal.
OptimismPortal public immutable PORTAL;

/**
* @custom:semver 1.4.0
*
* @param _portal Address of the OptimismPortal contract on this network.
*/
/// @custom:semver 1.4.1
/// @notice Constructs the L1CrossDomainMessenger contract.
/// @param _portal Address of the OptimismPortal contract on this network.
constructor(OptimismPortal _portal)
Semver(1, 4, 0)
Semver(1, 4, 1)
CrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER)
{
PORTAL = _portal;
initialize();
}

/**
* @notice Initializer.
*/
/// @notice Initializes the contract.
function initialize() public initializer {
__CrossDomainMessenger_init();
}

/**
* @inheritdoc CrossDomainMessenger
*/
/// @inheritdoc CrossDomainMessenger
function _sendMessage(
address _to,
uint64 _gasLimit,
Expand All @@ -51,16 +41,12 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, Semver {
PORTAL.depositTransaction{ value: _value }(_to, _value, _gasLimit, false, _data);
}

/**
* @inheritdoc CrossDomainMessenger
*/
/// @inheritdoc CrossDomainMessenger
function _isOtherMessenger() internal view override returns (bool) {
return msg.sender == address(PORTAL) && PORTAL.l2Sender() == OTHER_MESSENGER;
}

/**
* @inheritdoc CrossDomainMessenger
*/
/// @inheritdoc CrossDomainMessenger
function _isUnsafeTarget(address _target) internal view override returns (bool) {
return _target == address(this) || _target == address(PORTAL);
}
Expand Down
55 changes: 22 additions & 33 deletions packages/contracts-bedrock/contracts/L1/L1ERC721Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,34 @@ import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import { L2ERC721Bridge } from "../L2/L2ERC721Bridge.sol";
import { Semver } from "../universal/Semver.sol";

/**
* @title L1ERC721Bridge
* @notice The L1 ERC721 bridge is a contract which works together with the L2 ERC721 bridge to
* make it possible to transfer ERC721 tokens from Ethereum to Optimism. This contract
* acts as an escrow for ERC721 tokens deposited into L2.
*/
/// @title L1ERC721Bridge
/// @notice The L1 ERC721 bridge is a contract which works together with the L2 ERC721 bridge to
/// make it possible to transfer ERC721 tokens from Ethereum to Optimism. This contract
/// acts as an escrow for ERC721 tokens deposited into L2.
contract L1ERC721Bridge is ERC721Bridge, Semver {
/**
* @notice Mapping of L1 token to L2 token to ID to boolean, indicating if the given L1 token
* by ID was deposited for a given L2 token.
*/
/// @notice Mapping of L1 token to L2 token to ID to boolean, indicating if the given L1 token
/// by ID was deposited for a given L2 token.
mapping(address => mapping(address => mapping(uint256 => bool))) public deposits;

/**
* @custom:semver 1.1.1
*
* @param _messenger Address of the CrossDomainMessenger on this network.
* @param _otherBridge Address of the ERC721 bridge on the other network.
*/
/// @custom:semver 1.1.2
/// @notice Constructs the L1ERC721Bridge contract.
/// @param _messenger Address of the CrossDomainMessenger on this network.
/// @param _otherBridge Address of the ERC721 bridge on the other network.
constructor(address _messenger, address _otherBridge)
Semver(1, 1, 1)
Semver(1, 1, 2)
ERC721Bridge(_messenger, _otherBridge)
{}

/**
* @notice Completes an ERC721 bridge from the other domain and sends the ERC721 token to the
* recipient on this domain.
*
* @param _localToken Address of the ERC721 token on this domain.
* @param _remoteToken Address of the ERC721 token on the other domain.
* @param _from Address that triggered the bridge on the other domain.
* @param _to Address to receive the token on this domain.
* @param _tokenId ID of the token being deposited.
* @param _extraData Optional data to forward to L2. Data supplied here will not be used to
* execute any code on L2 and is only emitted as extra data for the
* convenience of off-chain tooling.
*/
/// @notice Completes an ERC721 bridge from the other domain and sends the ERC721 token to the
/// recipient on this domain.
/// @param _localToken Address of the ERC721 token on this domain.
/// @param _remoteToken Address of the ERC721 token on the other domain.
/// @param _from Address that triggered the bridge on the other domain.
/// @param _to Address to receive the token on this domain.
/// @param _tokenId ID of the token being deposited.
/// @param _extraData Optional data to forward to L2.
/// Data supplied here will not be used to execute any code on L2 and is
/// only emitted as extra data for the convenience of off-chain tooling.
function finalizeBridgeERC721(
address _localToken,
address _remoteToken,
Expand Down Expand Up @@ -71,9 +62,7 @@ contract L1ERC721Bridge is ERC721Bridge, Semver {
emit ERC721BridgeFinalized(_localToken, _remoteToken, _from, _to, _tokenId, _extraData);
}

/**
* @inheritdoc ERC721Bridge
*/
/// @inheritdoc ERC721Bridge
function _initiateBridgeERC721(
address _localToken,
address _remoteToken,
Expand Down
Loading

0 comments on commit 5d38cf2

Please sign in to comment.