FTM Price: $0.67 (-2.83%)
Gas: 13 GWei

Contract

0xFCf83648b8cDeF62e5d03319a6f1FCE16e4D6A59
 

Overview

FTM Balance

Fantom LogoFantom LogoFantom Logo0 FTM

FTM Value

$0.00

Token Holdings

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x60806040329168982022-03-09 0:08:33771 days ago1646784513IN
 Create: WethGate
0 FTM0.07048532315.2239

Latest 7 internal transactions

Parent Txn Hash Block From To Value
781112172024-03-24 21:22:4624 days ago1711315366
0xFCf83648...16e4D6A59
5.988006 FTM
781112172024-03-24 21:22:4624 days ago1711315366
0xFCf83648...16e4D6A59
5.988006 FTM
590715002023-04-04 16:43:51379 days ago1680626631
0xFCf83648...16e4D6A59
0.97665 FTM
590715002023-04-04 16:43:51379 days ago1680626631
0xFCf83648...16e4D6A59
0.97665 FTM
405174062022-06-14 18:04:11673 days ago1655229851
0xFCf83648...16e4D6A59
1.951625 FTM
405174062022-06-14 18:04:11673 days ago1655229851
0xFCf83648...16e4D6A59
1.951625 FTM
329168982022-03-09 0:08:33771 days ago1646784513  Contract Creation0 FTM
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WethGate

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 3 : WethGate.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.7;

import "../interfaces/IWETH.sol";
import "../interfaces/IWethGate.sol";

/// @dev Upgradable contracts cannot receive ether via `transfer` because of increased SLOAD gas cost.
/// We use this non-upgradeable contract as the recipient and then immediately transfer to an upgradable contract.
/// More details about this issue can be found
/// [here](https://forum.openzeppelin.com/t/openzeppelin-upgradeable-contracts-affected-by-istanbul-hardfork/1616).
contract WethGate is IWethGate
{
    /// @dev Wrapped native token contract
    IWETH public weth;

    /* ========== ERRORS ========== */

    error EthTransferFailed();

    /* ========== EVENTS ========== */
    /// @dev Emitted when any amount is withdrawn.
    event Withdrawal(address indexed receiver, uint wad);

    /* ========== CONSTRUCTOR  ========== */

    constructor(IWETH _weth) {
        weth = _weth;
    }

    /// @inheritdoc IWethGate
    function withdraw(address _receiver, uint _wad) external override {
        weth.withdraw(_wad);
        _safeTransferETH(_receiver, _wad);
        emit Withdrawal(_receiver, _wad);
    }

    function _safeTransferETH(address _to, uint256 _value) internal {
        (bool success, ) = _to.call{value: _value}(new bytes(0));
        if (!success) revert EthTransferFailed();
    }

    // we need to accept ETH sends to unwrap WETH
    receive() external payable {
    }

    // ============ Version Control ============
    /// @dev Get this contract's version
    function version() external pure returns (uint256) {
        return 101; // 1.0.1
    }
}

File 2 of 3 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256 wad) external;

    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function transfer(address recipient, uint256 amount) external returns (bool);

    function allowance(address owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);
}

File 2 of 3 : IWethGate.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.7;

interface IWethGate {
    /// @dev Transfer assets to a receiver.
    /// @param receiver This address will receive a transfer.
    /// @param wad Amount in wei
    function withdraw(address receiver, uint wad) external;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IWETH","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EthTransferFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"wad","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_wad","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b5060405161033d38038061033d83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b6102aa806100936000396000f3fe6080604052600436106100385760003560e01c80633fc8cef31461004457806354fd4d5014610081578063f3fef3a31461009d57600080fd5b3661003f57005b600080fd5b34801561005057600080fd5b50600054610064906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561008d57600080fd5b5060405160658152602001610078565b3480156100a957600080fd5b506100bd6100b8366004610201565b6100bf565b005b600054604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b50505050610127828261016e565b816001600160a01b03167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b658260405161016291815260200190565b60405180910390a25050565b604080516000808252602082019092526001600160a01b0384169083906040516101989190610239565b60006040518083038185875af1925050503d80600081146101d5576040519150601f19603f3d011682016040523d82523d6000602084013e6101da565b606091505b50509050806101fc57604051630db2c7f160e31b815260040160405180910390fd5b505050565b6000806040838503121561021457600080fd5b82356001600160a01b038116811461022b57600080fd5b946020939093013593505050565b6000825160005b8181101561025a5760208186018101518583015201610240565b81811115610269576000828501525b50919091019291505056fea264697066735822122072e937b694514d9587be41383ab5be750c976763a2d3cd04314269b91790000364736f6c6343000807003300000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83

Deployed Bytecode

0x6080604052600436106100385760003560e01c80633fc8cef31461004457806354fd4d5014610081578063f3fef3a31461009d57600080fd5b3661003f57005b600080fd5b34801561005057600080fd5b50600054610064906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561008d57600080fd5b5060405160658152602001610078565b3480156100a957600080fd5b506100bd6100b8366004610201565b6100bf565b005b600054604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b50505050610127828261016e565b816001600160a01b03167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b658260405161016291815260200190565b60405180910390a25050565b604080516000808252602082019092526001600160a01b0384169083906040516101989190610239565b60006040518083038185875af1925050503d80600081146101d5576040519150601f19603f3d011682016040523d82523d6000602084013e6101da565b606091505b50509050806101fc57604051630db2c7f160e31b815260040160405180910390fd5b505050565b6000806040838503121561021457600080fd5b82356001600160a01b038116811461022b57600080fd5b946020939093013593505050565b6000825160005b8181101561025a5760208186018101518583015201610240565b81811115610269576000828501525b50919091019291505056fea264697066735822122072e937b694514d9587be41383ab5be750c976763a2d3cd04314269b91790000364736f6c63430008070033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83

-----Decoded View---------------
Arg [0] : _weth (address): 0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.