github.com/ethereum-optimism/optimism@v1.7.2/packages/contracts-bedrock/src/dispute/interfaces/IWETH.sol (about)

     1  // SPDX-License-Identifier: MIT
     2  pragma solidity ^0.8.0;
     3  
     4  /// @title IWETH
     5  /// @notice Interface for WETH9.
     6  interface IWETH {
     7      /// @notice Emitted when an approval is made.
     8      /// @param src The address that approved the transfer.
     9      /// @param guy The address that was approved to transfer.
    10      /// @param wad The amount that was approved to transfer.
    11      event Approval(address indexed src, address indexed guy, uint256 wad);
    12  
    13      /// @notice Emitted when a transfer is made.
    14      /// @param src The address that transferred the WETH.
    15      /// @param dst The address that received the WETH.
    16      /// @param wad The amount of WETH that was transferred.
    17      event Transfer(address indexed src, address indexed dst, uint256 wad);
    18  
    19      /// @notice Emitted when a deposit is made.
    20      /// @param dst The address that deposited the WETH.
    21      /// @param wad The amount of WETH that was deposited.
    22      event Deposit(address indexed dst, uint256 wad);
    23  
    24      /// @notice Emitted when a withdrawal is made.
    25      /// @param src The address that withdrew the WETH.
    26      /// @param wad The amount of WETH that was withdrawn.
    27      event Withdrawal(address indexed src, uint256 wad);
    28  
    29      /// @notice Returns the name of the token.
    30      /// @return The name of the token.
    31      function name() external pure returns (string memory);
    32  
    33      /// @notice Returns the symbol of the token.
    34      /// @return The symbol of the token.
    35      function symbol() external pure returns (string memory);
    36  
    37      /// @notice Returns the number of decimals the token uses.
    38      /// @return The number of decimals the token uses.
    39      function decimals() external pure returns (uint8);
    40  
    41      /// @notice Returns the balance of the given address.
    42      /// @param owner The address to query the balance of.
    43      /// @return The balance of the given address.
    44      function balanceOf(address owner) external view returns (uint256);
    45  
    46      /// @notice Returns the amount of WETH that the spender can transfer on behalf of the owner.
    47      /// @param owner The address that owns the WETH.
    48      /// @param spender The address that is approved to transfer the WETH.
    49      /// @return The amount of WETH that the spender can transfer on behalf of the owner.
    50      function allowance(address owner, address spender) external view returns (uint256);
    51  
    52      /// @notice Allows WETH to be deposited by sending ether to the contract.
    53      function deposit() external payable;
    54  
    55      /// @notice Withdraws an amount of ETH.
    56      /// @param wad The amount of ETH to withdraw.
    57      function withdraw(uint256 wad) external;
    58  
    59      /// @notice Returns the total supply of WETH.
    60      /// @return The total supply of WETH.
    61      function totalSupply() external view returns (uint256);
    62  
    63      /// @notice Approves the given address to transfer the WETH on behalf of the caller.
    64      /// @param guy The address that is approved to transfer the WETH.
    65      /// @param wad The amount that is approved to transfer.
    66      /// @return True if the approval was successful.
    67      function approve(address guy, uint256 wad) external returns (bool);
    68  
    69      /// @notice Transfers the given amount of WETH to the given address.
    70      /// @param dst The address to transfer the WETH to.
    71      /// @param wad The amount of WETH to transfer.
    72      /// @return True if the transfer was successful.
    73      function transfer(address dst, uint256 wad) external returns (bool);
    74  
    75      /// @notice Transfers the given amount of WETH from the given address to the given address.
    76      /// @param src The address to transfer the WETH from.
    77      /// @param dst The address to transfer the WETH to.
    78      /// @param wad The amount of WETH to transfer.
    79      /// @return True if the transfer was successful.
    80      function transferFrom(address src, address dst, uint256 wad) external returns (bool);
    81  }