Address Contract Verified
Address
0xBD9fc4FdB07e46a69349101E862e82aa002aDe0d
Balance
0 ETH
Nonce
1
Code Size
1930 bytes
Creator
0x174Ae6eB...1A08 at tx 0x021195f0...ea9c82
Indexed Transactions
0
Contract Bytecode
1930 bytes
0x608060405260043610610084575f3560e01c8063c72bf7a511610057578063c72bf7a514610170578063c7411491146101a3578063d4f2bf44146101ad578063ee99205c146101cc578063f0d2aee0146101ff575f80fd5b80630de371e2146100885780633fc8cef3146100d75780634aa07e641461010a578063c1fe3e481461013d575b5f80fd5b348015610093575f80fd5b506100bb7f00000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac281565b6040516001600160a01b03909116815260200160405180910390f35b3480156100e2575f80fd5b506100bb7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b348015610115575f80fd5b506100bb7f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca081565b348015610148575f80fd5b506100bb7f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8481565b34801561017b575f80fd5b506100bb7f000000000000000000000000cd5fe23c85820f7b72d0926fc9b05b43e359b7ee81565b6101ab61021e565b005b3480156101b8575f80fd5b506101ab6101c7366004610700565b610353565b3480156101d7575f80fd5b506100bb7f00000000000000000000000038d43a6cb8da0e855a42fb6b0733a0498531d77481565b34801561020a575f80fd5b506101ab610219366004610700565b6105a7565b345f0361023e576040516312073f6d60e21b815260040160405180910390fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b158015610297575f80fd5b505af11580156102a9573d5f803e3d5ffd5b5050604051633d14d1b760e21b81526001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2811660048301523460248301523360448301527f00000000000000000000000038d43a6cb8da0e855a42fb6b0733a0498531d77416935063f45346dc925060640190505f604051808303815f87803b15801561033b575f80fd5b505af115801561034d573d5f803e3d5ffd5b50505050565b805f03610373576040516312073f6d60e21b815260040160405180910390fd5b6040516323b872dd60e01b8152336004820152306024820152604481018290527f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b0316906323b872dd906064016020604051808303815f875af11580156103e3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104079190610717565b506040516370a0823160e01b81523060048201526001600160a01b037f00000000000000000000000038d43a6cb8da0e855a42fb6b0733a0498531d77481169163f45346dc917f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0918282169163ea598cb0917f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84909116906370a08231906024015b602060405180830381865afa1580156104c3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104e7919061073d565b6040518263ffffffff1660e01b815260040161050591815260200190565b6020604051808303815f875af1158015610521573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610545919061073d565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201523360448201526064015f604051808303815f87803b15801561058e575f80fd5b505af11580156105a0573d5f803e3d5ffd5b5050505050565b805f036105c7576040516312073f6d60e21b815260040160405180910390fd5b6040516323b872dd60e01b8152336004820152306024820152604481018290527f00000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac26001600160a01b0316906323b872dd906064016020604051808303815f875af1158015610637573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061065b9190610717565b506040516370a0823160e01b81523060048201526001600160a01b037f00000000000000000000000038d43a6cb8da0e855a42fb6b0733a0498531d77481169163f45346dc917f000000000000000000000000cd5fe23c85820f7b72d0926fc9b05b43e359b7ee918282169163ea598cb0917f00000000000000000000000035fa164735182de50811e8e2e824cfb9b6118ac2909116906370a08231906024016104a8565b5f60208284031215610710575f80fd5b5035919050565b5f60208284031215610727575f80fd5b81518015158114610736575f80fd5b9392505050565b5f6020828403121561074d575f80fd5b505191905056fea26469706673582212200d8f2c7ea9d5c6132fe99d9ea11add91eef37a931238066be9ecf55e8a6e3cef64736f6c63430008170033
Verified Source Code Full Match
Compiler: v0.8.23+commit.f704f362
EVM: shanghai
Optimization: Yes (200 runs)
Zap.sol 60 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IWETH} from "./interfaces/IWETH.sol";
import {IWeETH} from "./interfaces/IWeETH.sol";
import {IWstETH} from "./interfaces/IWstETH.sol";
import {ISimpleStakingERC20} from "./interfaces/ISimpleStakingERC20.sol";
contract Zap {
IWETH public immutable weth;
IERC20 public immutable eETH;
IERC20 public immutable stETH;
IWeETH public immutable weETH;
IWstETH public immutable wstETH;
ISimpleStakingERC20 public immutable stakingContract;
constructor(address payable _weth, address _wstETH, address _weETH, address _stakingContract) {
weth = IWETH(_weth);
weETH = IWeETH(_weETH);
wstETH = IWstETH(_wstETH);
eETH = IERC20(weETH.eETH());
stETH = IERC20(wstETH.stETH());
stakingContract = ISimpleStakingERC20(_stakingContract);
eETH.approve(address(weETH), type(uint256).max);
weth.approve(_stakingContract, type(uint256).max);
stETH.approve(address(wstETH), type(uint256).max);
weETH.approve(address(stakingContract), type(uint256).max);
wstETH.approve(address(stakingContract), type(uint256).max);
}
function ethZapIn() external payable {
if (msg.value == 0) revert ISimpleStakingERC20.AMOUNT_NULL();
// Wrap ETH to wETH
weth.deposit{value: msg.value}();
// Deposit wETH to staking contract
stakingContract.deposit(IERC20(address(weth)), msg.value, msg.sender);
}
function stETHZapIn(uint256 _amount) external {
if (_amount == 0) revert ISimpleStakingERC20.AMOUNT_NULL();
// Transfer stETH from msg.sender to this contract, sometimes 1 or 2 wei can be missing.
stETH.transferFrom(msg.sender, address(this), _amount);
// Deposit wstETH to staking contract
stakingContract.deposit(IERC20(address(wstETH)), wstETH.wrap(stETH.balanceOf(address(this))), msg.sender);
}
function eETHZapIn(uint256 _amount) external {
if (_amount == 0) revert ISimpleStakingERC20.AMOUNT_NULL();
// Transfer eETH from msg.sender to this contract, sometimes 1 or 2 wei can be missing.
eETH.transferFrom(msg.sender, address(this), _amount);
// Deposit eETH to staking contract
stakingContract.deposit(IERC20(address(weETH)), weETH.wrap(eETH.balanceOf(address(this))), msg.sender);
}
}
IWETH.sol 16 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
interface IWETH {
function deposit() external payable;
function withdraw(uint256) external;
function approve(address, uint256) external returns (bool);
function transfer(address, uint256) external returns (bool);
function transferFrom(address, address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
}
IWeETH.sol 9 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
interface IWeETH {
function approve(address _spender, uint256 _amount) external returns (bool);
function eETH() external view returns (address);
function liquidityPool() external view returns (address);
function wrap(uint256 _stETHAmount) external returns (uint256);
}
IWstETH.sol 9 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
interface IWstETH {
function approve(address _spender, uint256 _amount) external returns (bool);
function getWstETHByStETH(uint256 _stETHAmount) external view returns (uint256);
function stETH() external view returns (address);
function wrap(uint256 _stETHAmount) external returns (uint256);
}
ISimpleStakingERC20.sol 68 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface ISimpleStakingERC20 {
/// @notice Struct to hold the supported booleans
/// @param deposit true if deposit is supported
/// @param withdraw true if withdraw is supported
struct Supported {
bool deposit;
bool withdraw;
}
/// @notice Error emitted when the amount is null
error AMOUNT_NULL();
/// @notice Error emitted when the address is null
error ADDRESS_NULL();
/// @notice Error emitted when the balance is insufficient
error INSUFFICIENT_BALANCE();
/// @notice Error emitted when the token is not allowed
error TOKEN_NOT_ALLOWED(IERC20 token);
/// @notice Event emitted when a token is added or removed
/// @param token address of the token
/// @param supported struct with deposit and withdraw booleans
event SupportedToken(IERC20 indexed token, Supported supported);
/// @notice Event emitted when a deposit is made
/// @param token address of the token
/// @param staker address of the staker
/// @param amount amount of the deposit
event Deposit(IERC20 indexed token, address indexed staker, uint256 amount);
/// @notice Event emitted when a withdrawal is made
/// @param token address of the token
/// @param staker address of the staker
/// @param amount amount of the withdrawal
event Withdraw(IERC20 indexed token, address indexed staker, uint256 amount);
/// @notice Method to deposit tokens
/// @dev token are transferred from the sender, and the receiver is credited
/// @param _token address of the token
/// @param _amount amount to deposit
/// @param _receiver address of the receiver
function deposit(IERC20 _token, uint256 _amount, address _receiver) external;
/// @notice Method to rescue tokens, only callable by the owner
/// @dev difference between balance and internal balance is transferred to the owner
/// @param _token address of the token
function rescueERC20(IERC20 _token) external;
/// @notice Method to add or remove a token
/// @dev only callable by the owner
/// @param _token address of the token
/// @param _supported struct with deposit and withdraw booleans
function supportToken(IERC20 _token, Supported calldata _supported) external;
/// @notice Method to rescue tokens, only callable by the owner
/// @dev token are transferred to the receiver and sender is credited
/// @param _token address of the token
/// @param _amount amount to withdraw
/// @param _receiver address of the receiver
function withdraw(IERC20 _token, uint256 _amount, address _receiver) external;
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
Read Contract
eETH 0x0de371e2 → address
stETH 0xc1fe3e48 → address
stakingContract 0xee99205c → address
weETH 0xc72bf7a5 → address
weth 0x3fc8cef3 → address
wstETH 0x4aa07e64 → address
Write Contract 3 functions
These functions modify contract state and require a wallet transaction to execute.
eETHZapIn 0xf0d2aee0
uint256 _amount
ethZapIn 0xc7411491
No parameters
stETHZapIn 0xd4f2bf44
uint256 _amount
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address