forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update isuperchainweth (#71)
--------- Co-authored-by: agusduha <[email protected]>
- Loading branch information
1 parent
7a69a7e
commit 07c9c77
Showing
8 changed files
with
51 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
packages/contracts-bedrock/src/L2/interfaces/ISuperchainERC20.sol
This file was deleted.
Oops, something went wrong.
59 changes: 35 additions & 24 deletions
59
packages/contracts-bedrock/src/L2/interfaces/ISuperchainWETH.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,44 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import { IWETH } from "src/universal/interfaces/IWETH.sol"; | ||
|
||
interface ISuperchainWETH { | ||
/// @notice Thrown when attempting a deposit or withdrawal and the chain uses a custom gas token. | ||
error NotCustomGasToken(); | ||
error Unauthorized(); | ||
|
||
event Approval(address indexed src, address indexed guy, uint256 wad); | ||
event Deposit(address indexed dst, uint256 wad); | ||
/// @notice Thrown when attempting to relay a message and the function caller (msg.sender) is not | ||
/// L2ToL2CrossDomainMessenger. | ||
error CallerNotL2ToL2CrossDomainMessenger(); | ||
|
||
/// @notice Thrown when attempting to relay a message and the cross domain message sender is not `address(this)` | ||
error InvalidCrossDomainSender(); | ||
|
||
/// @notice Emitted whenever tokens are successfully relayed on this chain. | ||
/// @param from Address of the msg.sender of sendERC20 on the source chain. | ||
/// @param to Address of the recipient. | ||
/// @param amount Amount of tokens relayed. | ||
/// @param source Chain ID of the source chain. | ||
event RelayERC20(address indexed from, address indexed to, uint256 amount, uint256 source); | ||
|
||
/// @notice Emitted when tokens are sent from one chain to another. | ||
/// @param from Address of the sender. | ||
/// @param to Address of the recipient. | ||
/// @param amount Number of tokens sent. | ||
/// @param destination Chain ID of the destination chain. | ||
event SendERC20(address indexed from, address indexed to, uint256 amount, uint256 destination); | ||
event Transfer(address indexed src, address indexed dst, uint256 wad); | ||
event Withdrawal(address indexed src, uint256 wad); | ||
|
||
fallback() external payable; | ||
|
||
receive() external payable; | ||
|
||
function allowance(address, address) external view returns (uint256); | ||
function approve(address guy, uint256 wad) external returns (bool); | ||
function balanceOf(address) external view returns (uint256); | ||
function decimals() external view returns (uint8); | ||
function deposit() external payable; | ||
function name() external view returns (string memory); | ||
function relayERC20(address from, address dst, uint256 wad) external; | ||
function sendERC20(address dst, uint256 wad, uint256 chainId) external; | ||
function symbol() external view returns (string memory); | ||
function totalSupply() external view returns (uint256); | ||
function transfer(address dst, uint256 wad) external returns (bool); | ||
function transferFrom(address src, address dst, uint256 wad) external returns (bool); | ||
function version() external view returns (string memory); | ||
function withdraw(uint256 wad) external; | ||
|
||
/// @notice Sends tokens to some target address on another chain. | ||
/// @param _dst Address to send tokens to. | ||
/// @param _wad Amount of tokens to send. | ||
/// @param _chainId Chain ID of the destination chain. | ||
function sendERC20(address _dst, uint256 _wad, uint256 _chainId) external; | ||
|
||
/// @notice Relays tokens received from another chain. | ||
/// @param _from Address of the msg.sender of sendERC20 on the source chain. | ||
/// @param _dst Address to relay tokens to. | ||
/// @param _wad Amount of tokens to relay. | ||
function relayERC20(address _from, address _dst, uint256 _wad) external; | ||
} | ||
|
||
interface ISuperchainWETHERC20 is IWETH, ISuperchainWETH { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters