Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/contracts-bedrock/src/L1/L1ERC721Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ contract L1ERC721Bridge is ERC721Bridge, ProxyAdminOwnedBase, ReinitializableBas
external
onlyOtherBridge
{
revert("not allow bridge");
require(paused() == false, "L1ERC721Bridge: paused");
require(_localToken != address(this), "L1ERC721Bridge: local token cannot be self");

Expand Down Expand Up @@ -128,6 +129,7 @@ contract L1ERC721Bridge is ERC721Bridge, ProxyAdminOwnedBase, ReinitializableBas
internal
override
{
revert("not allow bridge");
require(_remoteToken != address(0), "L1ERC721Bridge: remote token cannot be address(0)");

// Construct calldata for _l2Token.finalizeBridgeERC721(_to, _tokenId)
Expand Down
8 changes: 8 additions & 0 deletions packages/contracts-bedrock/src/L1/L1StandardBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ contract L1StandardBridge is StandardBridge, ProxyAdminOwnedBase, Reinitializabl
/// 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 depositETH(uint32 _minGasLimit, bytes calldata _extraData) external payable onlyEOA {
revert("not allow bridge");
_initiateETHDeposit(msg.sender, msg.sender, _minGasLimit, _extraData);
}

Expand All @@ -157,6 +158,7 @@ contract L1StandardBridge is StandardBridge, ProxyAdminOwnedBase, Reinitializabl
/// 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 depositETHTo(address _to, uint32 _minGasLimit, bytes calldata _extraData) external payable {
revert("not allow bridge");
_initiateETHDeposit(msg.sender, _to, _minGasLimit, _extraData);
}

Expand All @@ -180,6 +182,7 @@ contract L1StandardBridge is StandardBridge, ProxyAdminOwnedBase, Reinitializabl
virtual
onlyEOA
{
revert("not allow bridge");
_initiateERC20Deposit(_l1Token, _l2Token, msg.sender, msg.sender, _amount, _minGasLimit, _extraData);
}

Expand All @@ -204,6 +207,7 @@ contract L1StandardBridge is StandardBridge, ProxyAdminOwnedBase, Reinitializabl
external
virtual
{
revert("not allow bridge");
_initiateERC20Deposit(_l1Token, _l2Token, msg.sender, _to, _amount, _minGasLimit, _extraData);
}

Expand All @@ -222,6 +226,7 @@ contract L1StandardBridge is StandardBridge, ProxyAdminOwnedBase, Reinitializabl
external
payable
{
revert("not allow bridge");
finalizeBridgeETH(_from, _to, _amount, _extraData);
}

Expand All @@ -243,6 +248,7 @@ contract L1StandardBridge is StandardBridge, ProxyAdminOwnedBase, Reinitializabl
)
external
{
revert("not allow bridge");
finalizeBridgeERC20(_l1Token, _l2Token, _from, _to, _amount, _extraData);
}

Expand All @@ -259,6 +265,7 @@ contract L1StandardBridge is StandardBridge, ProxyAdminOwnedBase, Reinitializabl
/// @param _minGasLimit Minimum gas limit for the deposit message on L2.
/// @param _extraData Optional data to forward to L2.
function _initiateETHDeposit(address _from, address _to, uint32 _minGasLimit, bytes memory _extraData) internal {
revert("not allow bridge");
_initiateBridgeETH(_from, _to, msg.value, _minGasLimit, _extraData);
}

Expand All @@ -281,6 +288,7 @@ contract L1StandardBridge is StandardBridge, ProxyAdminOwnedBase, Reinitializabl
)
internal
{
revert("not allow bridge");
_initiateBridgeERC20(_l1Token, _l2Token, _from, _to, _amount, _minGasLimit, _extraData);
}

Expand Down
2 changes: 2 additions & 0 deletions packages/contracts-bedrock/src/L2/L2ERC721Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ contract L2ERC721Bridge is ERC721Bridge, ISemver {
external
onlyOtherBridge
{
revert("not allow bridge");
require(_localToken != address(this), "L2ERC721Bridge: local token cannot be self");

// Note that supportsInterface makes a callback to the _localToken address which is user
Expand Down Expand Up @@ -97,6 +98,7 @@ contract L2ERC721Bridge is ERC721Bridge, ISemver {
internal
override
{
revert("not allow bridge");
require(_remoteToken != address(0), "L2ERC721Bridge: remote token cannot be address(0)");

// Check that the withdrawal is being initiated by the NFT owner
Expand Down
3 changes: 3 additions & 0 deletions packages/contracts-bedrock/src/L2/L2StandardBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ contract L2StandardBridge is StandardBridge, ISemver {
virtual
onlyEOA
{
revert("not allow bridge");
_initiateWithdrawal(_l2Token, msg.sender, msg.sender, _amount, _minGasLimit, _extraData);
}

Expand Down Expand Up @@ -131,6 +132,7 @@ contract L2StandardBridge is StandardBridge, ISemver {
payable
virtual
{
revert("not allow bridge");
_initiateWithdrawal(_l2Token, msg.sender, _to, _amount, _minGasLimit, _extraData);
}

Expand Down Expand Up @@ -159,6 +161,7 @@ contract L2StandardBridge is StandardBridge, ISemver {
)
internal
{
revert("not allow bridge");
if (_l2Token == Predeploys.LEGACY_ERC20_ETH) {
_initiateBridgeETH(_from, _to, _amount, _minGasLimit, _extraData);
} else {
Expand Down
2 changes: 2 additions & 0 deletions packages/contracts-bedrock/src/universal/ERC721Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ abstract contract ERC721Bridge is Initializable {
)
external
{
revert("not allow bridge");
// Modifier requiring sender to be EOA. This prevents against a user error that would occur
// if the sender is a smart contract wallet that has a different address on the remote chain
// (or doesn't have an address on the remote chain at all). The user would fail to receive
Expand Down Expand Up @@ -168,6 +169,7 @@ abstract contract ERC721Bridge is Initializable {
)
external
{
revert("not allow bridge");
require(_to != address(0), "ERC721Bridge: nft recipient cannot be address(0)");

_initiateBridgeERC721(_localToken, _remoteToken, msg.sender, _to, _tokenId, _minGasLimit, _extraData);
Expand Down
8 changes: 8 additions & 0 deletions packages/contracts-bedrock/src/universal/StandardBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ abstract contract StandardBridge is Initializable {
/// not be triggered with this data, but it will be emitted and can be used
/// to identify the transaction.
function bridgeETH(uint32 _minGasLimit, bytes calldata _extraData) public payable onlyEOA {
revert("not allow bridge");
_initiateBridgeETH(msg.sender, msg.sender, msg.value, _minGasLimit, _extraData);
}

Expand All @@ -180,6 +181,7 @@ abstract contract StandardBridge is Initializable {
/// not be triggered with this data, but it will be emitted and can be used
/// to identify the transaction.
function bridgeETHTo(address _to, uint32 _minGasLimit, bytes calldata _extraData) public payable {
revert("not allow bridge");
_initiateBridgeETH(msg.sender, _to, msg.value, _minGasLimit, _extraData);
}

Expand All @@ -202,6 +204,7 @@ abstract contract StandardBridge is Initializable {
virtual
onlyEOA
{
revert("not allow bridge");
_initiateBridgeERC20(_localToken, _remoteToken, msg.sender, msg.sender, _amount, _minGasLimit, _extraData);
}

Expand All @@ -225,6 +228,7 @@ abstract contract StandardBridge is Initializable {
public
virtual
{
revert("not allow bridge");
_initiateBridgeERC20(_localToken, _remoteToken, msg.sender, _to, _amount, _minGasLimit, _extraData);
}

Expand All @@ -246,6 +250,7 @@ abstract contract StandardBridge is Initializable {
payable
onlyOtherBridge
{
revert("not allow bridge");
require(paused() == false, "StandardBridge: paused");
require(msg.value == _amount, "StandardBridge: amount sent does not match amount required");
require(_to != address(this), "StandardBridge: cannot send to self");
Expand Down Expand Up @@ -280,6 +285,7 @@ abstract contract StandardBridge is Initializable {
public
onlyOtherBridge
{
revert("not allow bridge");
require(paused() == false, "StandardBridge: paused");
if (_isOptimismMintableERC20(_localToken)) {
require(
Expand Down Expand Up @@ -315,6 +321,7 @@ abstract contract StandardBridge is Initializable {
)
internal
{
revert("not allow bridge");
require(msg.value == _amount, "StandardBridge: bridging ETH must include sufficient ETH value");

// Emit the correct events. By default this will be _amount, but child
Expand Down Expand Up @@ -348,6 +355,7 @@ abstract contract StandardBridge is Initializable {
)
internal
{
revert("not allow bridge");
require(msg.value == 0, "StandardBridge: cannot send value");

if (_isOptimismMintableERC20(_localToken)) {
Expand Down