ETH Price: $3,289.40 (+0.06%)

Contract

0x7dA89F62340Ad976e4E32a30c7f688aFCcE8a51C
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Multicall197900552024-05-03 14:02:35254 days ago1714744955IN
0x7dA89F62...FCcE8a51C
0 ETH0.0038163215.89295778
Multicall197814282024-05-02 9:05:11255 days ago1714640711IN
0x7dA89F62...FCcE8a51C
0.0012 ETH0.0012834710.71561131
Multicall197814092024-05-02 9:01:23255 days ago1714640483IN
0x7dA89F62...FCcE8a51C
0.001 ETH0.000987598.24539114
Multicall197745322024-05-01 9:57:47256 days ago1714557467IN
0x7dA89F62...FCcE8a51C
0.02 ETH0.001028288.58507058
Multicall197664342024-04-30 6:47:59257 days ago1714459679IN
0x7dA89F62...FCcE8a51C
0.0005 ETH0.001109258.10410812
Multicall197455092024-04-27 8:34:11260 days ago1714206851IN
0x7dA89F62...FCcE8a51C
0 ETH0.001566496.91223097
Multicall197454902024-04-27 8:30:23260 days ago1714206623IN
0x7dA89F62...FCcE8a51C
0 ETH0.001560896.49695271
Multicall197337822024-04-25 17:10:23262 days ago1714065023IN
0x7dA89F62...FCcE8a51C
0 ETH0.0061138227.49839303
Multicall197336352024-04-25 16:40:47262 days ago1714063247IN
0x7dA89F62...FCcE8a51C
0 ETH0.0072760430.28796428
Multicall197336112024-04-25 16:35:59262 days ago1714062959IN
0x7dA89F62...FCcE8a51C
0 ETH0.0047703419.55044361
Multicall197334702024-04-25 16:07:35262 days ago1714061255IN
0x7dA89F62...FCcE8a51C
0.1 ETH0.0035892226.15578045
Multicall196598492024-04-15 8:53:47272 days ago1713171227IN
0x7dA89F62...FCcE8a51C
0 ETH0.0030166312.64575118
Multicall191999162024-02-10 19:56:11337 days ago1707594971IN
0x7dA89F62...FCcE8a51C
0.02 ETH0.0049464636.04637265
Multicall191548842024-02-04 12:14:59343 days ago1707048899IN
0x7dA89F62...FCcE8a51C
0.002 ETH0.0029423821.49669262
Multicall191544772024-02-04 10:52:59343 days ago1707043979IN
0x7dA89F62...FCcE8a51C
0 ETH0.0036268113.62393246

Latest 7 internal transactions

Advanced mode:
Parent Transaction Hash Block
From
To
197814282024-05-02 9:05:11255 days ago1714640711
0x7dA89F62...FCcE8a51C
0.0012 ETH
197814092024-05-02 9:01:23255 days ago1714640483
0x7dA89F62...FCcE8a51C
0.001 ETH
197745322024-05-01 9:57:47256 days ago1714557467
0x7dA89F62...FCcE8a51C
0.02 ETH
197664342024-04-30 6:47:59257 days ago1714459679
0x7dA89F62...FCcE8a51C
0.0005 ETH
197334702024-04-25 16:07:35262 days ago1714061255
0x7dA89F62...FCcE8a51C
0.1 ETH
191999162024-02-10 19:56:11337 days ago1707594971
0x7dA89F62...FCcE8a51C
0.02 ETH
191548842024-02-04 12:14:59343 days ago1707048899
0x7dA89F62...FCcE8a51C
0.002 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Invest

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 1000 runs

Other Settings:
istanbul EvmVersion
File 1 of 18 : Invest.sol
// SPDX-License-Identifier: MIT
/*
                                           +##*:                                          
                                         .######-                                         
                                        .########-                                        
                                        *#########.                                       
                                       :##########+                                       
                                       *###########.                                      
                                      :############=                                      
                   *###################################################.                  
                   :##################################################=                   
                    .################################################-                    
                     .*#############################################-                     
                       =##########################################*.                      
                        :########################################=                        
                          -####################################=                          
                            -################################+.                           
               =##########################################################*               
               .##########################################################-               
                .*#######################################################:                
                  =####################################################*.                 
                   .*#################################################-                   
                     -##############################################=                     
                       -##########################################=.                      
                         :+####################################*-                         
           *###################################################################:          
           =##################################################################*           
            :################################################################=            
              =############################################################*.             
               .*#########################################################-               
                 :*#####################################################-                 
                   .=################################################+:                   
                      -+##########################################*-.                     
     .+*****************###########################################################*:     
      +############################################################################*.     
       :##########################################################################=       
         -######################################################################+.        
           -##################################################################+.          
             -*#############################################################=             
               :=########################################################+:               
                  :=##################################################+-                  
                     .-+##########################################*=:                     
                         .:=*################################*+-.                         
                              .:-=+*##################*+=-:.                              
                                     .:=*#########+-.                                     
                                         .+####*:                                         
                                           .*#:    */
pragma solidity 0.8.18;

import {BaseProtocolProxy} from "../base/BaseProtocolProxy.sol";
import {IInvest} from "../interfaces/Invest/IInvest.sol";
import {ISDai} from "../interfaces/Invest/ISDai.sol";
import {ILido} from "../interfaces/Invest/ILido.sol";
import {IWETH9} from "../interfaces/IWETH9.sol";
import {IWstETH} from "../interfaces/Invest/IWstETH.sol";

/**
 * @title Invest proxy contract
 * @author Pino development team
 * @notice Interacts with Lido and SavingsDai
 */
contract Invest is IInvest, BaseProtocolProxy {
    address public immutable dai;
    ISDai public immutable sdai;
    ILido public immutable steth;
    IWstETH public immutable wsteth;

    /**
     * @notice Lido proxy contract
     * @param _permit2 Permit2 contract address
     * @param _weth WETH9 contract address
     * @param _stETH StETH contract address
     * @param _wstETH WstETH contract address
     * @param _sDai Savings Dai contract address
     */
    constructor(address _permit2, address _weth, ILido _stETH, IWstETH _wstETH, ISDai _sDai)
        payable
        BaseProtocolProxy(_permit2, _weth)
    {
        sdai = _sDai;
        steth = _stETH;
        wsteth = _wstETH;
        dai = _sDai.dai();
    }

    /**
     * @notice Sends ETH to the Lido protocol and transfers ST_ETH to the recipient
     * @param _proxyFeeInWei Fee of the proxy contract
     * @param _recipient The destination address that will receive ST_ETH
     * @return stethAmount Amount of ST_ETH token that is being transferred to the recipient
     */
    function ethToStETH(address _recipient, uint256 _proxyFeeInWei)
        external
        payable
        nonETHReuse
        returns (uint256 stethAmount)
    {
        address _steth = address(steth);

        // Get StETH by paying ETH
        stethAmount = ILido(_steth).submit{value: msg.value - _proxyFeeInWei}(msg.sender);

        // Recipient receives StETH shares
        sweepStETH(_recipient);

        emit Deposit(msg.sender, _recipient, ETH, _steth, msg.value - _proxyFeeInWei);
    }

    /**
     * @notice Converts ETH to WST_ETH and transfers WST_ETH to the recipient
     * @param _proxyFeeInWei Fee of the proxy contract
     * @param _recipient The destination address that will receive WST_ETH
     */
    function ethToWstETH(address _recipient, uint256 _proxyFeeInWei) external payable nonETHReuse {
        address _wsteth = address(wsteth);

        // Get WstETH by paying ETH
        _sendETH(_wsteth, msg.value - _proxyFeeInWei);

        // Recipient receives WstETH shares
        sweepToken(IWstETH(_wsteth), _recipient);

        emit Deposit(msg.sender, _recipient, ETH, _wsteth, msg.value - _proxyFeeInWei);
    }

    /**
     * @notice Submits WETH to Lido protocol and transfers ST_ETH to the recipient
     * @param _amount Amount of WETH to submit to ST_ETH contract
     * @param _recipient The destination address that will receive ST_ETH
     * @dev For security reasons, it is not possible to run functions
     * inside of this function separately through a multicall
     * @return stethAmount Amount of ST_ETH token that is being transferred to msg.sender
     */
    function wethToStETH(uint256 _amount, address _recipient)
        external
        payable
        nonETHReuse
        returns (uint256 stethAmount)
    {
        address _weth = address(weth);
        address _steth = address(steth);

        // StETH works with ETH, so WETH needs to be unwrapped
        IWETH9(_weth).withdraw(_amount);

        // Get StETH by paying ETH
        stethAmount = ILido(_steth).submit{value: _amount}(msg.sender);

        // Recipient receives StETH shares
        sweepStETH(_recipient);

        emit Deposit(msg.sender, _recipient, _weth, _steth, _amount);
    }

    /**
     * @notice Submits WETH to Lido protocol and transfers WST_ETH to msg.sender
     * @param _amount Amount of WETH to submit to get WST_ETH
     * @param _recipient The destination address that will receive WST_ETH
     */
    function wethToWstETH(uint256 _amount, address _recipient) external payable nonETHReuse {
        address _weth = address(weth);
        address _wsteth = address(wsteth);

        // WstETH works with ETH, so WETH needs to be unwrapped
        IWETH9(_weth).withdraw(_amount);

        // Get WstETH by paying ETH
        _sendETH(_wsteth, _amount);

        // Recipient receives WstETH
        sweepToken(IWstETH(_wsteth), _recipient);

        emit Deposit(msg.sender, _recipient, _weth, _wsteth, _amount);
    }

    /**
     * @notice Wraps ST_ETH to WST_ETH and transfers it to msg.sender
     * @param _amount Amount to convert to WST_ETH
     * @param _recipient The destination address that will receive WST_ETH
     * @return wrapped The amount of wrapped WstETH token
     */
    function stETHToWstETH(uint256 _amount, address _recipient) external payable returns (uint256 wrapped) {
        address _wsteth = address(wsteth);

        // Uses StETH shares of the proxy to get WstETH
        wrapped = IWstETH(_wsteth).wrap(_amount);

        // Recipient receives WstETH
        sweepToken(IWstETH(wsteth), _recipient);

        emit Deposit(msg.sender, _recipient, address(steth), _wsteth, _amount);
    }

    /**
     * @notice Unwraps WST_ETH to ST_ETH and transfers it to the recipient
     * @param _amount Amount of WstETH to unwrap
     * @param _recipient The destination address that will receive StETH
     * @return unwrapped The amount of StETH unwrapped
     */
    function wstETHToStETH(uint256 _amount, address _recipient) external payable returns (uint256 unwrapped) {
        address _wsteth = address(wsteth);

        // Uses WstETH in the proxy contract to get StETH
        unwrapped = IWstETH(_wsteth).unwrap(_amount);

        // Recipient receives StETH
        sweepStETH(_recipient);

        emit Deposit(msg.sender, _recipient, _wsteth, address(steth), _amount);
    }

    /**
     * @notice Transfers DAI to SavingsDai and transfers SDai to the recipient
     * @param _amount Amount of DAI to deposit
     * @param _recipient The destination address that will receive SDAI
     * @return deposited Returns the amount of shares that recipient received after deposit
     */
    function daiToSDai(uint256 _amount, address _recipient) external payable returns (uint256 deposited) {
        address _sdai = address(sdai);

        // Uses the DAI inside the proxy contract to get SDAI
        deposited = ISDai(_sdai).deposit(_amount, _recipient);

        emit Deposit(msg.sender, _recipient, address(dai), _sdai, _amount);
    }

    /**
     * @notice Transfers SDAI to SavingsDai and transfers Dai to the recipient
     * @param _amount Amount of SDAI to withdraw
     * @param _recipient The destination address that will receive DAI
     * @return withdrew Returns the amount of shares that were burned
     */
    function sDaiToDai(uint256 _amount, address _recipient) external payable returns (uint256 withdrew) {
        address _sdai = address(sdai);

        // Uses SDAI token inside the proxy contract to get DAI
        withdrew = ISDai(_sdai).withdraw(_amount, _recipient, address(this));

        emit Deposit(msg.sender, _recipient, _sdai, address(dai), _amount);
    }

    /**
     * @notice Sweeps all ST_ETH tokens of the contract based on shares to msg.sender
     * @dev This function uses sharesOf instead of balanceOf to transfer 100% of tokens
     */
    function sweepStETH(address _recipient) internal {
        // Recipient receives StETH shares
        steth.transferShares(_recipient, steth.sharesOf(address(this)));
    }
}

File 2 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 18 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

import "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Returns the address of the pending owner.
     */
    function pendingOwner() public view virtual returns (address) {
        return _pendingOwner;
    }

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }
}

File 4 of 18 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 5 of 18 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` 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 amount) external returns (bool);
}

File 6 of 18 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 7 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 8 of 18 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 9 of 18 : BaseProtocolProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import {IWETH9} from "../interfaces/IWETH9.sol";
import {Multicall} from "./Multicall.sol";
import {Permit} from "./Permit.sol";

/**
 * @title Handles payment and approve functions
 * @author Pino development team
 */
contract BaseProtocolProxy is Permit, Multicall, Ownable2Step {
    using SafeERC20 for IERC20;

    IWETH9 public immutable weth;
    address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    /**
     * @notice Thrown when the ETH transfer call is failed
     * @param _caller Address of the caller of the transaction
     * @param _recipient Address of the recipient receiving ETH
     */
    error FailedToSendEther(address _caller, address _recipient);

    /**
     * @notice Thrown when the amount of ETH to transfer is 0
     */
    error InvalidAmountToTransfer();

    /**
     * @notice Proxy contract constructor, sets permit2 and weth addresses
     * @param _permit2 Permit2 contract address
     * @param _weth WETH9 contract address
     */
    constructor(address _permit2, address _weth) payable Permit(_permit2) {
        weth = IWETH9(_weth);
    }

    receive() external payable {}

    /**
     * @notice Withdraws ETH and transfers to the recipient
     * @param _recipient Address of the destination receiving the fees
     */
    function withdrawAdmin(address _recipient) external onlyOwner {
        _sendETH(_recipient, address(this).balance);
    }

    /**
     * @notice Approves an ERC20 token to multiple spenders
     * @param _token ERC20 token address
     * @param _spenders The spender which spends the tokens (usually DeFi protocols)
     */
    function approveToken(IERC20 _token, address[] calldata _spenders) external payable {
        for (uint256 i = 0; i < _spenders.length;) {
            _token.forceApprove(_spenders[i], type(uint256).max);

            unchecked {
                ++i;
            }
        }
    }

    /**
     * @notice Wraps ETH to WETH
     * @param _proxyFeeInWei Fee of the proxy contract
     */
    function wrapETH(uint256 _proxyFeeInWei) external payable nonETHReuse {
        weth.deposit{value: msg.value - _proxyFeeInWei}();
    }

    /**
     * @notice Unwraps total amount of WETH9 to ETH and transfers the amount to the recipient
     * @param _recipient The destination address
     */
    function unwrapWETH9(address _recipient) external payable {
        uint256 balanceWETH = weth.balanceOf(address(this));

        if (balanceWETH > 0) {
            weth.withdraw(balanceWETH);

            _sendETH(_recipient, balanceWETH);
        }
    }

    /**
     * @notice Sweeps the total amount of tokens to inside the contract to the recipient
     * @param _token ERC20 token address
     * @param _recipient The destination address
     * @return amount Transferred amount of the token
     */
    function sweepToken(IERC20 _token, address _recipient) public payable returns (uint256 amount) {
        amount = _token.balanceOf(address(this));

        if (amount > 0) {
            _token.safeTransfer(_recipient, amount);
        }
    }

    /**
     * @notice Transfer ETH to the destination
     * @param _recipient The destination address
     * @param _amount Ether amount
     */
    function _sendETH(address _recipient, uint256 _amount) internal {
        if (_amount == 0) {
            revert InvalidAmountToTransfer();
        }

        (bool success,) = _recipient.call{value: _amount}("");

        if (!success) {
            revert FailedToSendEther(msg.sender, _recipient);
        }
    }
}

File 10 of 18 : Multicall.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

/**
 * @title Handles multicall function
 * @author Pino development team
 */
contract Multicall {
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;
    uint256 private _status;

    /**
     * @notice Thrown when the nonETHReuse modifier is called twice in the multicall
     */
    error EtherReuseGuardCall();

    /**
     * @dev Prevents a caller from calling multiple functions that work with ETH in a transaction
     */
    modifier nonETHReuse() {
        _nonReuseBefore();
        _;
    }

    /**
     * @notice Sets status to NOT_ENTERED
     */
    constructor() payable {
        _status = NOT_ENTERED;
    }

    /**
     * @notice Multiple calls on proxy functions
     * @param _calldata An array of calldata that is called one by one
     * @dev The other param is for the referral program of the Pino server
     */
    function multicall(bytes[] calldata _calldata, uint256) external payable {
        // Unlock ether locker just in case if it was locked before
        unlockETHReuse();

        // Loop through each calldata and execute them
        for (uint256 i = 0; i < _calldata.length;) {
            (bool success, bytes memory result) = address(this).delegatecall(_calldata[i]);

            // Check if the call was successful or not
            if (!success) {
                // Next 7 lines from https://ethereum.stackexchange.com/a/83577
                if (result.length < 68) revert();

                assembly {
                    result := add(result, 0x04)
                }

                revert(abi.decode(result, (string)));
            }

            // Increment variable i more efficiently
            unchecked {
                ++i;
            }
        }

        /*
         * To ensure proper execution, unlock reusability for future use.
         * In some cases, the caller might invoke a function with the 'nonETHReuse'
         * modifier directly, bypassing the 'unlockETHReuse' step at the beginning of the
         * multicall. This would render the function unusable if not unlocked here.
         */
        unlockETHReuse();
    }

    /**
     * @notice Unlocks the reentrancy
     * @dev Should be used before and after all the calls
     */
    function unlockETHReuse() internal {
        _status = NOT_ENTERED;
    }

    function _nonReuseBefore() private {
        // On the first call to nonETHReuse, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert EtherReuseGuardCall();
        }

        // Any calls to nonETHReuse after this point will fail
        _status = ENTERED;
    }
}

File 11 of 18 : Permit.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import {IPermit2} from "../interfaces/IPermit2.sol";

/**
 * @title Permit2 SignatureTransfer functions
 * @author Pino development team
 */
contract Permit {
    IPermit2 public immutable permit2;

    /**
     * @notice Sets permit2 contract address
     * @param _permit2 Permit2 contract address
     */
    constructor(address _permit2) payable {
        permit2 = IPermit2(_permit2);
    }

    /**
     * @notice Transfers 1 token from user to the contract using Permit2
     * @param _permit PermitTransferFrom data struct
     * @param _signature EIP712 Signature of the Permit2 data structure
     */
    function permitTransferFrom(IPermit2.PermitTransferFrom calldata _permit, bytes calldata _signature)
        public
        payable
    {
        permit2.permitTransferFrom(
            _permit,
            IPermit2.SignatureTransferDetails({to: address(this), requestedAmount: _permit.permitted.amount}),
            msg.sender,
            _signature
        );
    }

    /**
     * @notice Transfers multiple tokens from user to the contract using Permit2
     * @param _permit permitBatchTransferFrom data struct
     * @param _signature EIP712 Signature of the Permit2 data structure
     */
    function permitBatchTransferFrom(IPermit2.PermitBatchTransferFrom calldata _permit, bytes calldata _signature)
        external
        payable
    {
        uint256 tokensLen = _permit.permitted.length;

        IPermit2.SignatureTransferDetails[] memory details = new IPermit2.SignatureTransferDetails[](tokensLen);

        for (uint256 i = 0; i < tokensLen;) {
            details[i].to = address(this);
            details[i].requestedAmount = _permit.permitted[i].amount;

            unchecked {
                ++i;
            }
        }

        permit2.permitTransferFrom(_permit, details, msg.sender, _signature);
    }
}

File 12 of 18 : IInvest.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

/**
 * @title Invest proxy contract
 * @author Pino development team
 * @notice Interacts with Lido and SavingsDai
 */
interface IInvest {
    /**
     * @notice Emitted when a token is deposited
     * @param _caller Address of the caller of the transaction
     * @param _recipient The recipient that received the tokens
     * @param _fromToken Address of the token that was sent
     * @param _toToken Address of the token that was received
     * @param _amount Amount of the sent token
     */
    event Deposit(address _caller, address _recipient, address _fromToken, address _toToken, uint256 _amount);

    /**
     * @notice Sends ETH to the Lido protocol and transfers ST_ETH to the recipient
     * @param _proxyFeeInWei Fee of the proxy contract
     * @param _recipient The destination address that will receive ST_ETH
     * @return steth Amount of ST_ETH token that is being transferred to the recipient
     */
    function ethToStETH(address _recipient, uint256 _proxyFeeInWei) external payable returns (uint256 steth);

    /**
     * @notice Converts ETH to WST_ETH and transfers WST_ETH to the recipient
     * @param _proxyFeeInWei Fee of the proxy contract
     * @param _recipient The destination address that will receive WST_ETH
     */
    function ethToWstETH(address _recipient, uint256 _proxyFeeInWei) external payable;

    /**
     * @notice Submits WETH to Lido protocol and transfers ST_ETH to the recipient
     * @param _amount Amount of WETH to submit to ST_ETH contract
     * @param _recipient The destination address that will receive ST_ETH
     * @dev For security reasons, it is not possible to run functions
     * inside of this function separately through a multicall
     * @return stethAmount Amount of ST_ETH token that is being transferred to msg.sender
     */
    function wethToStETH(uint256 _amount, address _recipient) external payable returns (uint256 stethAmount);

    /**
     * @notice Submits WETH to Lido protocol and transfers WST_ETH to msg.sender
     * @param _amount Amount of WETH to submit to get WST_ETH
     * @param _recipient The destination address that will receive WST_ETH
     */
    function wethToWstETH(uint256 _amount, address _recipient) external payable;

    /**
     * @notice Wraps ST_ETH to WST_ETH and transfers it to msg.sender
     * @param _amount Amount to convert to WST_ETH
     * @param _recipient The destination address that will receive WST_ETH
     * @return wrapped The amount of wrapped WstETH token
     */
    function stETHToWstETH(uint256 _amount, address _recipient) external payable returns (uint256 wrapped);

    /**
     * @notice Unwraps WST_ETH to ST_ETH and transfers it to the recipient
     * @param _amount Amount of WstETH to unwrap
     * @param _recipient The destination address that will receive StETH
     * @return unwrapped The amount of StETH unwrapped
     */
    function wstETHToStETH(uint256 _amount, address _recipient) external payable returns (uint256 unwrapped);

    /**
     * @notice Transfers DAI to SavingsDai and transfers SDai to the recipient
     * @param _amount Amount of DAI to invest
     * @param _recipient The destination address that will receive StETH
     * @return deposited Returns the amount of shares that recipient received after deposit
     */
    function daiToSDai(uint256 _amount, address _recipient) external payable returns (uint256 deposited);

    /**
     * @notice Transfers SDAI to SavingsDai and transfers Dai to the recipient
     * @param _amount Amount of SDAI to withdraw
     * @param _recipient The destination address that will receive DAI
     * @return withdrew Returns the amount of shares that were burned
     */
    function sDaiToDai(uint256 _amount, address _recipient) external payable returns (uint256 withdrew);
}

File 13 of 18 : ILido.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.18;

import {ISTETH} from "./ISTETH.sol";

/**
 * @title Liquid staking pool
 *
 * For the high-level description of the pool operation please refer to the paper.
 * Pool manages withdrawal keys and fees. It receives ether submitted by users on the ETH 1 side
 * and stakes it via the deposit_contract.sol contract. It doesn't hold ether on it's balance,
 * only a small portion (buffer) of it.
 * It also mints new tokens for rewards generated at the ETH 2.0 side.
 *
 * At the moment withdrawals are not possible in the beacon chain and there's no workaround.
 * Pool will be upgraded to an actual implementation when withdrawals are enabled
 * (Phase 1.5 or 2 of Eth2 launch, likely late 2022 or 2023).
 */
interface ILido is ISTETH {
    function totalSupply() external view returns (uint256);
    function getTotalShares() external view returns (uint256);

    /**
     * @notice Adds eth to the pool
     * @return StETH Amount of StETH generated
     */
    function submit(address _referral) external payable returns (uint256 StETH);
}

File 14 of 18 : ISDai.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.18;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * @notice Savings Dai Interface
 */
interface ISDai is IERC20 {
    function dai() external view returns (address);
    function deposit(uint256, address, uint16) external returns (uint256);
    function mint(uint256, address) external returns (uint256);
    function mint(uint256, address, uint16) external returns (uint256);
    function redeem(uint256, address, address) external returns (uint256);
    function deposit(uint256 amount, address receiver) external returns (uint256);
    function withdraw(uint256 amount, address receiver, address owner) external returns (uint256);
}

File 15 of 18 : ISTETH.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.18;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ISTETH is IERC20 {
    function sharesOf(address _account) external view returns (uint256);
    function transferShares(address _recipient, uint256 _sharesAmount) external;
}

File 16 of 18 : IWstETH.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IWstETH is IERC20 {
    function wrap(uint256 _stETHAmount) external returns (uint256);
    function unwrap(uint256 _wstETHAmount) external returns (uint256);
}

File 17 of 18 : IPermit2.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

/**
 * @title SignatureTransfer
 * @notice Handles ERC20 token transfers through signature based actions
 * @dev Requires user's token approval on the Permit2 contract
 */
interface IPermit2 {
    /**
     * @notice The token and amount details for a transfer signed in the permit transfer signature
     */
    struct TokenPermissions {
        // ERC20 token address
        address token;
        // the maximum amount that can be spent
        uint256 amount;
    }

    /**
     * @notice The signed permit message for a single token transfer
     */
    struct PermitTransferFrom {
        TokenPermissions permitted;
        // a unique value for every token owner's signature to prevent signature replays
        uint256 nonce;
        // deadline on the permit signature
        uint256 deadline;
    }

    /**
     * @notice Specifies the recipient address and amount for batched transfers.
     * @dev Recipients and amounts correspond to the index of the signed token permissions array.
     * @dev Reverts if the requested amount is greater than the permitted signed amount.
     */
    struct SignatureTransferDetails {
        // recipient address
        address to;
        // spender requested amount
        uint256 requestedAmount;
    }

    /**
     * @notice Used to reconstruct the signed permit message for multiple token transfers
     * @dev Do not need to pass in spender address as it is required that it is msg.sender
     * @dev Note that a user still signs over a spender address
     */
    struct PermitBatchTransferFrom {
        // the tokens and corresponding amounts permitted for a transfer
        TokenPermissions[] permitted;
        // a unique value for every token owner's signature to prevent signature replays
        uint256 nonce;
        // deadline on the permit signature
        uint256 deadline;
    }

    /**
     * @notice Transfers a token using a signed permit message
     * @dev Reverts if the requested amount is greater than the permitted signed amount
     * @param permit The permit data signed over by the owner
     * @param owner The owner of the tokens to transfer
     * @param transferDetails The spender's requested transfer details for the permitted token
     * @param signature The signature to verify
     */
    function permitTransferFrom(
        PermitTransferFrom calldata permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external;

    /**
     * @notice Transfers multiple tokens using a signed permit message
     * @param permit The permit data signed over by the owner
     * @param owner The owner of the tokens to transfer
     * @param transferDetails Specifies the recipient and requested amount for the token transfer
     * @param signature The signature to verify
     */
    function permitTransferFrom(
        PermitBatchTransferFrom calldata permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external;
}

File 18 of 18 : IWETH9.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * @notice IWETH9 WETH interface
 */
interface IWETH9 is IERC20 {
    function deposit() external payable;
    function withdraw(uint256 wad) external;
}

Settings
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "metadata": {
    "bytecodeHash": "none"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_permit2","type":"address"},{"internalType":"address","name":"_weth","type":"address"},{"internalType":"contract ILido","name":"_stETH","type":"address"},{"internalType":"contract IWstETH","name":"_wstETH","type":"address"},{"internalType":"contract ISDai","name":"_sDai","type":"address"}],"stateMutability":"payable","type":"constructor"},{"inputs":[],"name":"EtherReuseGuardCall","type":"error"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"FailedToSendEther","type":"error"},{"inputs":[],"name":"InvalidAmountToTransfer","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_caller","type":"address"},{"indexed":false,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"address","name":"_fromToken","type":"address"},{"indexed":false,"internalType":"address","name":"_toToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address[]","name":"_spenders","type":"address[]"}],"name":"approveToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"dai","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"daiToSDai","outputs":[{"internalType":"uint256","name":"deposited","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_proxyFeeInWei","type":"uint256"}],"name":"ethToStETH","outputs":[{"internalType":"uint256","name":"stethAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_proxyFeeInWei","type":"uint256"}],"name":"ethToWstETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"_calldata","type":"bytes[]"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"multicall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"permit2","outputs":[{"internalType":"contract IPermit2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IPermit2.TokenPermissions[]","name":"permitted","type":"tuple[]"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct IPermit2.PermitBatchTransferFrom","name":"_permit","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"permitBatchTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IPermit2.TokenPermissions","name":"permitted","type":"tuple"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct IPermit2.PermitTransferFrom","name":"_permit","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"permitTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"sDaiToDai","outputs":[{"internalType":"uint256","name":"withdrew","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"sdai","outputs":[{"internalType":"contract ISDai","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"stETHToWstETH","outputs":[{"internalType":"uint256","name":"wrapped","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"steth","outputs":[{"internalType":"contract ILido","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"sweepToken","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"unwrapWETH9","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH9","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"wethToStETH","outputs":[{"internalType":"uint256","name":"stethAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"wethToWstETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"withdrawAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_proxyFeeInWei","type":"uint256"}],"name":"wrapETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"wstETHToStETH","outputs":[{"internalType":"uint256","name":"unwrapped","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"wsteth","outputs":[{"internalType":"contract IWstETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6101406040526040516200272d3803806200272d833981016040819052620000279162000178565b6001600160a01b038516608052600160005584846200004633620000e6565b6001600160a01b0390811660a05282811660e081905285821661010052908416610120526040805163f4b9fa7560e01b8152905191925063f4b9fa759160048083019260209291908290030181865afa158015620000a8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ce9190620001f8565b6001600160a01b031660c052506200021f9350505050565b600280546001600160a01b03191690556200010d8162000110602090811b6200159517901c565b50565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03811681146200010d57600080fd5b600080600080600060a086880312156200019157600080fd5b85516200019e8162000162565b6020870151909550620001b18162000162565b6040870151909450620001c48162000162565b6060870151909350620001d78162000162565b6080870151909250620001ea8162000162565b809150509295509295909350565b6000602082840312156200020b57600080fd5b8151620002188162000162565b9392505050565b60805160a05160c05160e051610100516101205161242b620003026000396000818161045001528181610a2001528181610b7501528181610d7a01528181610df801526113630152600081816103d001528181610630015281816107ab01528181610e3701528181611408015261166501526000818161030e0152818161052c0152610f8e0152600081816104c2015281816105be01526110160152600081816102b4015281816107890152818161091301528181610b5301528181611092015261112301526000818161021a015281816112bb01526114a5015261242b6000f3fe6080604052600436106101b05760003560e01c8063715018a6116100ec578063a4d3fb0b1161008a578063d1d8bce711610064578063d1d8bce71461043e578063e30c397814610472578063f2fde38b14610490578063f4b9fa75146104b057600080fd5b8063a4d3fb0b14610405578063cc3ee73714610418578063cd93f1971461042b57600080fd5b80638da5cb5b116100c65780638da5cb5b1461038d57806393597abd146103ab578063953d7ee2146103be578063a1b75446146103f257600080fd5b8063715018a61461034357806373fd28071461035857806379ba50971461037857600080fd5b80632fbaf8bf116101595780634321fa50116101335780634321fa50146102d657806357aca4f1146102e95780635b2eeca4146102fc5780636efb3c6b1461033057600080fd5b80632fbaf8bf1461027c578063354711011461028f5780633fc8cef3146102a257600080fd5b806312261ee71161018a57806312261ee7146102085780631c58db4f14610254578063258836fe1461026957600080fd5b806308457291146101bc578063089cd344146101e25780630e3925bc146101f557600080fd5b366101b757005b600080fd5b6101cf6101ca366004611d4b565b6104e4565b6040519081526020015b60405180910390f35b6101cf6101f0366004611d7b565b610624565b6101cf610203366004611d4b565b610769565b34801561021457600080fd5b5061023c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d9565b610267610262366004611da7565b610901565b005b6101cf610277366004611dc0565b610989565b61026761028a366004611d7b565b610a16565b61026761029d366004611e3a565b610adf565b3480156102ae57600080fd5b5061023c7f000000000000000000000000000000000000000000000000000000000000000081565b6102676102e4366004611d4b565b610b35565b6102676102f7366004611e8f565b610c4e565b34801561030857600080fd5b5061023c7f000000000000000000000000000000000000000000000000000000000000000081565b6101cf61033e366004611d4b565b610d48565b34801561034f57600080fd5b50610267610e98565b34801561036457600080fd5b50610267610373366004611edb565b610eac565b34801561038457600080fd5b50610267610ec1565b34801561039957600080fd5b506001546001600160a01b031661023c565b6101cf6103b9366004611d4b565b610f4c565b3480156103ca57600080fd5b5061023c7f000000000000000000000000000000000000000000000000000000000000000081565b610267610400366004611edb565b61107a565b610267610413366004611f41565b611195565b6101cf610426366004611d4b565b611331565b610267610439366004611fa5565b611460565b34801561044a57600080fd5b5061023c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561047e57600080fd5b506002546001600160a01b031661023c565b34801561049c57600080fd5b506102676104ab366004611edb565b611517565b3480156104bc57600080fd5b5061023c7f000000000000000000000000000000000000000000000000000000000000000081565b6040517fb460af94000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0382811660248301523060448301526000917f00000000000000000000000000000000000000000000000000000000000000009182169063b460af94906064016020604051808303816000875af1158015610577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059b9190611ff3565b604080513381526001600160a01b038681166020830152848116928201929092527f00000000000000000000000000000000000000000000000000000000000000009091166060820152608081018690529092507fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109060a0015b60405180910390a15092915050565b600061062e6115f4565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811663a1903eab610668853461200c565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815233600482015260240160206040518083038185885af11580156106bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e09190611ff3565b91506106eb84611637565b7fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c2810338573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8461072e883461200c565b604080516001600160a01b0396871681529486166020860152928516928401929092529092166060820152608081019190915260a001610615565b60006107736115f4565b604051632e1a7d4d60e01b8152600481018490527f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156107f957600080fd5b505af115801561080d573d6000803e3d6000fd5b50506040517fa1903eab0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b038416925063a1903eab9150879060240160206040518083038185885af1158015610871573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108969190611ff3565b92506108a184611637565b604080513381526001600160a01b03868116602083015284811682840152831660608201526080810187905290517fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109181900360a00190a1505092915050565b6109096115f4565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663d0e30db0610942833461200c565b6040518263ffffffff1660e01b81526004016000604051808303818588803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b505050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156109d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f49190611ff3565b90508015610a1057610a106001600160a01b038416838361175b565b92915050565b610a1e6115f4565b7f0000000000000000000000000000000000000000000000000000000000000000610a5281610a4d843461200c565b611804565b610a5c8184610989565b507fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c2810338473eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84610aa0873461200c565b604080516001600160a01b03968716815294861660208601529285168484015293166060830152608082019290925290519081900360a00190a1505050565b60005b81811015610b2f57610b27838383818110610aff57610aff61202d565b9050602002016020810190610b149190611edb565b6001600160a01b038616906000196118dc565b600101610ae2565b50505050565b610b3d6115f4565b604051632e1a7d4d60e01b8152600481018390527f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b158015610bc357600080fd5b505af1158015610bd7573d6000803e3d6000fd5b50505050610be58185611804565b610bef8184610989565b50604080513381526001600160a01b03858116602083015284811682840152831660608201526080810186905290517fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109181900360a00190a150505050565b610c586001600055565b60005b82811015610d385760008030868685818110610c7957610c7961202d565b9050602002810190610c8b9190612043565b604051610c9992919061208a565b600060405180830381855af49150503d8060008114610cd4576040519150601f19603f3d011682016040523d82523d6000602084013e610cd9565b606091505b509150915081610d2e57604481511015610cf257600080fd5b60048101905080806020019051810190610d0c91906120d4565b60405162461bcd60e51b8152600401610d259190612176565b60405180910390fd5b5050600101610c5b565b50610d436001600055565b505050565b6040517fea598cb0000000000000000000000000000000000000000000000000000000008152600481018390526000907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b0382169063ea598cb0906024016020604051808303816000875af1158015610dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df19190611ff3565b9150610e1d7f000000000000000000000000000000000000000000000000000000000000000084610989565b50604080513381526001600160a01b0380861660208301527f00000000000000000000000000000000000000000000000000000000000000008116928201929092529082166060820152608081018590527fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109060a001610615565b610ea0611980565b610eaa60006119da565b565b610eb4611980565b610ebe8147611804565b50565b60025433906001600160a01b03168114610f435760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610d25565b610ebe816119da565b6040517f6e553f65000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0382811660248301526000917f000000000000000000000000000000000000000000000000000000000000000091821690636e553f65906044016020604051808303816000875af1158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190611ff3565b604080513381526001600160a01b0380871660208301527f00000000000000000000000000000000000000000000000000000000000000008116928201929092529083166060820152608081018690529092507fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109060a001610615565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156110e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111059190611ff3565b9050801561119157604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561116f57600080fd5b505af1158015611183573d6000803e3d6000fd5b505050506111918282611804565b5050565b60006111a184806121a9565b9050905060008167ffffffffffffffff8111156111c0576111c061209a565b60405190808252806020026020018201604052801561120557816020015b60408051808201909152600080825260208201528152602001906001900390816111de5790505b50905060005b8281101561128a57308282815181106112265761122661202d565b60209081029190910101516001600160a01b03909116905261124886806121a9565b828181106112585761125861202d565b905060400201602001358282815181106112745761127461202d565b602090810291909101810151015260010161120b565b506040517fedd9444b0000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063edd9444b906112f8908890859033908a908a90600401612295565b600060405180830381600087803b15801561131257600080fd5b505af1158015611326573d6000803e3d6000fd5b505050505050505050565b6040517fde0e9a3e000000000000000000000000000000000000000000000000000000008152600481018390526000907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b0382169063de0e9a3e906024016020604051808303816000875af11580156113b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113da9190611ff3565b91506113e583611637565b604080513381526001600160a01b038581166020830152838116928201929092527f00000000000000000000000000000000000000000000000000000000000000009091166060820152608081018590527fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109060a001610615565b6040805180820182523081526020808601359082015290517f30f28b7a0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916330f28b7a916114e091879133908890889060040161237b565b600060405180830381600087803b1580156114fa57600080fd5b505af115801561150e573d6000803e3d6000fd5b50505050505050565b61151f611980565b600280546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915561155d6001546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600260005403611630576040517f7bb2e40600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b6040517ff5eb42dc0000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690638fcb4e5b908390839063f5eb42dc90602401602060405180830381865afa1580156116be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e29190611ff3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561174057600080fd5b505af1158015611754573d6000803e3d6000fd5b5050505050565b6040516001600160a01b038316602482015260448101829052610d439084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611a00565b8060000361183e576040517fb512576100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461188b576040519150601f19603f3d011682016040523d82523d6000602084013e611890565b606091505b5050905080610d43576040517fb0b0ec350000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0384166024820152604401610d25565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b1790526119428482611ae8565b610b2f576040516001600160a01b03841660248201526000604482015261197690859063095ea7b360e01b906064016117a0565b610b2f8482611a00565b6001546001600160a01b03163314610eaa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d25565b6002805473ffffffffffffffffffffffffffffffffffffffff19169055610ebe81611595565b6000611a55826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611b8f9092919063ffffffff16565b9050805160001480611a76575080806020019051810190611a7691906123e0565b610d435760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d25565b6000806000846001600160a01b031684604051611b059190612402565b6000604051808303816000865af19150503d8060008114611b42576040519150601f19603f3d011682016040523d82523d6000602084013e611b47565b606091505b5091509150818015611b71575080511580611b71575080806020019051810190611b7191906123e0565b8015611b8657506001600160a01b0385163b15155b95945050505050565b6060611b9e8484600085611ba6565b949350505050565b606082471015611c1e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d25565b600080866001600160a01b03168587604051611c3a9190612402565b60006040518083038185875af1925050503d8060008114611c77576040519150601f19603f3d011682016040523d82523d6000602084013e611c7c565b606091505b5091509150611c8d87838387611c98565b979650505050505050565b60608315611d07578251600003611d00576001600160a01b0385163b611d005760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d25565b5081611b9e565b611b9e8383815115611d1c5781518083602001fd5b8060405162461bcd60e51b8152600401610d259190612176565b6001600160a01b0381168114610ebe57600080fd5b60008060408385031215611d5e57600080fd5b823591506020830135611d7081611d36565b809150509250929050565b60008060408385031215611d8e57600080fd5b8235611d9981611d36565b946020939093013593505050565b600060208284031215611db957600080fd5b5035919050565b60008060408385031215611dd357600080fd5b8235611dde81611d36565b91506020830135611d7081611d36565b60008083601f840112611e0057600080fd5b50813567ffffffffffffffff811115611e1857600080fd5b6020830191508360208260051b8501011115611e3357600080fd5b9250929050565b600080600060408486031215611e4f57600080fd5b8335611e5a81611d36565b9250602084013567ffffffffffffffff811115611e7657600080fd5b611e8286828701611dee565b9497909650939450505050565b600080600060408486031215611ea457600080fd5b833567ffffffffffffffff811115611ebb57600080fd5b611ec786828701611dee565b909790965060209590950135949350505050565b600060208284031215611eed57600080fd5b8135611ef881611d36565b9392505050565b60008083601f840112611f1157600080fd5b50813567ffffffffffffffff811115611f2957600080fd5b602083019150836020828501011115611e3357600080fd5b600080600060408486031215611f5657600080fd5b833567ffffffffffffffff80821115611f6e57600080fd5b9085019060608288031215611f8257600080fd5b90935060208501359080821115611f9857600080fd5b50611e8286828701611eff565b600080600083850360a0811215611fbb57600080fd5b6080811215611fc957600080fd5b50839250608084013567ffffffffffffffff811115611fe757600080fd5b611e8286828701611eff565b60006020828403121561200557600080fd5b5051919050565b81810381811115610a1057634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261205a57600080fd5b83018035915067ffffffffffffffff82111561207557600080fd5b602001915036819003821315611e3357600080fd5b8183823760009101908152919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156120cb5781810151838201526020016120b3565b50506000910152565b6000602082840312156120e657600080fd5b815167ffffffffffffffff808211156120fe57600080fd5b818401915084601f83011261211257600080fd5b8151818111156121245761212461209a565b604051601f8201601f19908116603f0116810190838211818310171561214c5761214c61209a565b8160405282815287602084870101111561216557600080fd5b611c8d8360208301602088016120b0565b60208152600082518060208401526121958160408501602087016120b0565b601f01601f19169190910160400192915050565b6000808335601e198436030181126121c057600080fd5b83018035915067ffffffffffffffff8211156121db57600080fd5b6020019150600681901b3603821315611e3357600080fd5b80356121fe81611d36565b6001600160a01b03168252602090810135910152565b600081518084526020808501945080840160005b838110156122615761224e87835180516001600160a01b03168252602090810151910152565b6040969096019590820190600101612228565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60808152600060e082018735601e198936030181126122b357600080fd5b880160208101903567ffffffffffffffff8111156122d057600080fd5b8060061b36038213156122e257600080fd5b60606080860152918290529060009061010085015b8183101561231c5761230981856121f3565b60409384019360019390930192016122f7565b60208b013560a087015260408b013560c08701528581036020870152612342818b612214565b935050505061235c60408401876001600160a01b03169052565b828103606084015261236f81858761226c565b98975050505050505050565b600061010061238a83896121f3565b60408801356040840152606088013560608401526123be608084018880516001600160a01b03168252602090810151910152565b6001600160a01b03861660c08401528060e084015261236f818401858761226c565b6000602082840312156123f257600080fd5b81518015158114611ef857600080fd5b600082516124148184602087016120b0565b919091019291505056fea164736f6c6343000812000a000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe840000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca000000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea

Deployed Bytecode

0x6080604052600436106101b05760003560e01c8063715018a6116100ec578063a4d3fb0b1161008a578063d1d8bce711610064578063d1d8bce71461043e578063e30c397814610472578063f2fde38b14610490578063f4b9fa75146104b057600080fd5b8063a4d3fb0b14610405578063cc3ee73714610418578063cd93f1971461042b57600080fd5b80638da5cb5b116100c65780638da5cb5b1461038d57806393597abd146103ab578063953d7ee2146103be578063a1b75446146103f257600080fd5b8063715018a61461034357806373fd28071461035857806379ba50971461037857600080fd5b80632fbaf8bf116101595780634321fa50116101335780634321fa50146102d657806357aca4f1146102e95780635b2eeca4146102fc5780636efb3c6b1461033057600080fd5b80632fbaf8bf1461027c578063354711011461028f5780633fc8cef3146102a257600080fd5b806312261ee71161018a57806312261ee7146102085780631c58db4f14610254578063258836fe1461026957600080fd5b806308457291146101bc578063089cd344146101e25780630e3925bc146101f557600080fd5b366101b757005b600080fd5b6101cf6101ca366004611d4b565b6104e4565b6040519081526020015b60405180910390f35b6101cf6101f0366004611d7b565b610624565b6101cf610203366004611d4b565b610769565b34801561021457600080fd5b5061023c7f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba381565b6040516001600160a01b0390911681526020016101d9565b610267610262366004611da7565b610901565b005b6101cf610277366004611dc0565b610989565b61026761028a366004611d7b565b610a16565b61026761029d366004611e3a565b610adf565b3480156102ae57600080fd5b5061023c7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6102676102e4366004611d4b565b610b35565b6102676102f7366004611e8f565b610c4e565b34801561030857600080fd5b5061023c7f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea81565b6101cf61033e366004611d4b565b610d48565b34801561034f57600080fd5b50610267610e98565b34801561036457600080fd5b50610267610373366004611edb565b610eac565b34801561038457600080fd5b50610267610ec1565b34801561039957600080fd5b506001546001600160a01b031661023c565b6101cf6103b9366004611d4b565b610f4c565b3480156103ca57600080fd5b5061023c7f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe8481565b610267610400366004611edb565b61107a565b610267610413366004611f41565b611195565b6101cf610426366004611d4b565b611331565b610267610439366004611fa5565b611460565b34801561044a57600080fd5b5061023c7f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca081565b34801561047e57600080fd5b506002546001600160a01b031661023c565b34801561049c57600080fd5b506102676104ab366004611edb565b611517565b3480156104bc57600080fd5b5061023c7f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81565b6040517fb460af94000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0382811660248301523060448301526000917f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea9182169063b460af94906064016020604051808303816000875af1158015610577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059b9190611ff3565b604080513381526001600160a01b038681166020830152848116928201929092527f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f9091166060820152608081018690529092507fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109060a0015b60405180910390a15092915050565b600061062e6115f4565b7f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b03811663a1903eab610668853461200c565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815233600482015260240160206040518083038185885af11580156106bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e09190611ff3565b91506106eb84611637565b7fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c2810338573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8461072e883461200c565b604080516001600160a01b0396871681529486166020860152928516928401929092529092166060820152608081019190915260a001610615565b60006107736115f4565b604051632e1a7d4d60e01b8152600481018490527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2907f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84906001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b1580156107f957600080fd5b505af115801561080d573d6000803e3d6000fd5b50506040517fa1903eab0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b038416925063a1903eab9150879060240160206040518083038185885af1158015610871573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108969190611ff3565b92506108a184611637565b604080513381526001600160a01b03868116602083015284811682840152831660608201526080810187905290517fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109181900360a00190a1505092915050565b6109096115f4565b6001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21663d0e30db0610942833461200c565b6040518263ffffffff1660e01b81526004016000604051808303818588803b15801561096d57600080fd5b505af1158015610981573d6000803e3d6000fd5b505050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156109d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f49190611ff3565b90508015610a1057610a106001600160a01b038416838361175b565b92915050565b610a1e6115f4565b7f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0610a5281610a4d843461200c565b611804565b610a5c8184610989565b507fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c2810338473eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84610aa0873461200c565b604080516001600160a01b03968716815294861660208601529285168484015293166060830152608082019290925290519081900360a00190a1505050565b60005b81811015610b2f57610b27838383818110610aff57610aff61202d565b9050602002016020810190610b149190611edb565b6001600160a01b038616906000196118dc565b600101610ae2565b50505050565b610b3d6115f4565b604051632e1a7d4d60e01b8152600481018390527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2907f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0906001600160a01b03831690632e1a7d4d90602401600060405180830381600087803b158015610bc357600080fd5b505af1158015610bd7573d6000803e3d6000fd5b50505050610be58185611804565b610bef8184610989565b50604080513381526001600160a01b03858116602083015284811682840152831660608201526080810186905290517fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109181900360a00190a150505050565b610c586001600055565b60005b82811015610d385760008030868685818110610c7957610c7961202d565b9050602002810190610c8b9190612043565b604051610c9992919061208a565b600060405180830381855af49150503d8060008114610cd4576040519150601f19603f3d011682016040523d82523d6000602084013e610cd9565b606091505b509150915081610d2e57604481511015610cf257600080fd5b60048101905080806020019051810190610d0c91906120d4565b60405162461bcd60e51b8152600401610d259190612176565b60405180910390fd5b5050600101610c5b565b50610d436001600055565b505050565b6040517fea598cb0000000000000000000000000000000000000000000000000000000008152600481018390526000907f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0906001600160a01b0382169063ea598cb0906024016020604051808303816000875af1158015610dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df19190611ff3565b9150610e1d7f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca084610989565b50604080513381526001600160a01b0380861660208301527f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe848116928201929092529082166060820152608081018590527fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109060a001610615565b610ea0611980565b610eaa60006119da565b565b610eb4611980565b610ebe8147611804565b50565b60025433906001600160a01b03168114610f435760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610d25565b610ebe816119da565b6040517f6e553f65000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0382811660248301526000917f00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea91821690636e553f65906044016020604051808303816000875af1158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190611ff3565b604080513381526001600160a01b0380871660208301527f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f8116928201929092529083166060820152608081018690529092507fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109060a001610615565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316906370a0823190602401602060405180830381865afa1580156110e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111059190611ff3565b9050801561119157604051632e1a7d4d60e01b8152600481018290527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561116f57600080fd5b505af1158015611183573d6000803e3d6000fd5b505050506111918282611804565b5050565b60006111a184806121a9565b9050905060008167ffffffffffffffff8111156111c0576111c061209a565b60405190808252806020026020018201604052801561120557816020015b60408051808201909152600080825260208201528152602001906001900390816111de5790505b50905060005b8281101561128a57308282815181106112265761122661202d565b60209081029190910101516001600160a01b03909116905261124886806121a9565b828181106112585761125861202d565b905060400201602001358282815181106112745761127461202d565b602090810291909101810151015260010161120b565b506040517fedd9444b0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3169063edd9444b906112f8908890859033908a908a90600401612295565b600060405180830381600087803b15801561131257600080fd5b505af1158015611326573d6000803e3d6000fd5b505050505050505050565b6040517fde0e9a3e000000000000000000000000000000000000000000000000000000008152600481018390526000907f0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0906001600160a01b0382169063de0e9a3e906024016020604051808303816000875af11580156113b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113da9190611ff3565b91506113e583611637565b604080513381526001600160a01b038581166020830152838116928201929092527f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe849091166060820152608081018590527fa856e8f098813135735b4d4f52d96083d1dbb35fd5603ff424661413f59c28109060a001610615565b6040805180820182523081526020808601359082015290517f30f28b7a0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba316916330f28b7a916114e091879133908890889060040161237b565b600060405180830381600087803b1580156114fa57600080fd5b505af115801561150e573d6000803e3d6000fd5b50505050505050565b61151f611980565b600280546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915561155d6001546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600180546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600260005403611630576040517f7bb2e40600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b6040517ff5eb42dc0000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe846001600160a01b031690638fcb4e5b908390839063f5eb42dc90602401602060405180830381865afa1580156116be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e29190611ff3565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561174057600080fd5b505af1158015611754573d6000803e3d6000fd5b5050505050565b6040516001600160a01b038316602482015260448101829052610d439084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611a00565b8060000361183e576040517fb512576100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461188b576040519150601f19603f3d011682016040523d82523d6000602084013e611890565b606091505b5050905080610d43576040517fb0b0ec350000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0384166024820152604401610d25565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b1790526119428482611ae8565b610b2f576040516001600160a01b03841660248201526000604482015261197690859063095ea7b360e01b906064016117a0565b610b2f8482611a00565b6001546001600160a01b03163314610eaa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d25565b6002805473ffffffffffffffffffffffffffffffffffffffff19169055610ebe81611595565b6000611a55826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611b8f9092919063ffffffff16565b9050805160001480611a76575080806020019051810190611a7691906123e0565b610d435760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d25565b6000806000846001600160a01b031684604051611b059190612402565b6000604051808303816000865af19150503d8060008114611b42576040519150601f19603f3d011682016040523d82523d6000602084013e611b47565b606091505b5091509150818015611b71575080511580611b71575080806020019051810190611b7191906123e0565b8015611b8657506001600160a01b0385163b15155b95945050505050565b6060611b9e8484600085611ba6565b949350505050565b606082471015611c1e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d25565b600080866001600160a01b03168587604051611c3a9190612402565b60006040518083038185875af1925050503d8060008114611c77576040519150601f19603f3d011682016040523d82523d6000602084013e611c7c565b606091505b5091509150611c8d87838387611c98565b979650505050505050565b60608315611d07578251600003611d00576001600160a01b0385163b611d005760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d25565b5081611b9e565b611b9e8383815115611d1c5781518083602001fd5b8060405162461bcd60e51b8152600401610d259190612176565b6001600160a01b0381168114610ebe57600080fd5b60008060408385031215611d5e57600080fd5b823591506020830135611d7081611d36565b809150509250929050565b60008060408385031215611d8e57600080fd5b8235611d9981611d36565b946020939093013593505050565b600060208284031215611db957600080fd5b5035919050565b60008060408385031215611dd357600080fd5b8235611dde81611d36565b91506020830135611d7081611d36565b60008083601f840112611e0057600080fd5b50813567ffffffffffffffff811115611e1857600080fd5b6020830191508360208260051b8501011115611e3357600080fd5b9250929050565b600080600060408486031215611e4f57600080fd5b8335611e5a81611d36565b9250602084013567ffffffffffffffff811115611e7657600080fd5b611e8286828701611dee565b9497909650939450505050565b600080600060408486031215611ea457600080fd5b833567ffffffffffffffff811115611ebb57600080fd5b611ec786828701611dee565b909790965060209590950135949350505050565b600060208284031215611eed57600080fd5b8135611ef881611d36565b9392505050565b60008083601f840112611f1157600080fd5b50813567ffffffffffffffff811115611f2957600080fd5b602083019150836020828501011115611e3357600080fd5b600080600060408486031215611f5657600080fd5b833567ffffffffffffffff80821115611f6e57600080fd5b9085019060608288031215611f8257600080fd5b90935060208501359080821115611f9857600080fd5b50611e8286828701611eff565b600080600083850360a0811215611fbb57600080fd5b6080811215611fc957600080fd5b50839250608084013567ffffffffffffffff811115611fe757600080fd5b611e8286828701611eff565b60006020828403121561200557600080fd5b5051919050565b81810381811115610a1057634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261205a57600080fd5b83018035915067ffffffffffffffff82111561207557600080fd5b602001915036819003821315611e3357600080fd5b8183823760009101908152919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156120cb5781810151838201526020016120b3565b50506000910152565b6000602082840312156120e657600080fd5b815167ffffffffffffffff808211156120fe57600080fd5b818401915084601f83011261211257600080fd5b8151818111156121245761212461209a565b604051601f8201601f19908116603f0116810190838211818310171561214c5761214c61209a565b8160405282815287602084870101111561216557600080fd5b611c8d8360208301602088016120b0565b60208152600082518060208401526121958160408501602087016120b0565b601f01601f19169190910160400192915050565b6000808335601e198436030181126121c057600080fd5b83018035915067ffffffffffffffff8211156121db57600080fd5b6020019150600681901b3603821315611e3357600080fd5b80356121fe81611d36565b6001600160a01b03168252602090810135910152565b600081518084526020808501945080840160005b838110156122615761224e87835180516001600160a01b03168252602090810151910152565b6040969096019590820190600101612228565b509495945050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60808152600060e082018735601e198936030181126122b357600080fd5b880160208101903567ffffffffffffffff8111156122d057600080fd5b8060061b36038213156122e257600080fd5b60606080860152918290529060009061010085015b8183101561231c5761230981856121f3565b60409384019360019390930192016122f7565b60208b013560a087015260408b013560c08701528581036020870152612342818b612214565b935050505061235c60408401876001600160a01b03169052565b828103606084015261236f81858761226c565b98975050505050505050565b600061010061238a83896121f3565b60408801356040840152606088013560608401526123be608084018880516001600160a01b03168252602090810151910152565b6001600160a01b03861660c08401528060e084015261236f818401858761226c565b6000602082840312156123f257600080fd5b81518015158114611ef857600080fd5b600082516124148184602087016120b0565b919091019291505056fea164736f6c6343000812000a

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

000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe840000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca000000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea

-----Decoded View---------------
Arg [0] : _permit2 (address): 0x000000000022D473030F116dDEE9F6B43aC78BA3
Arg [1] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : _stETH (address): 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84
Arg [3] : _wstETH (address): 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0
Arg [4] : _sDai (address): 0x83F20F44975D03b1b09e64809B757c47f942BEeA

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 000000000000000000000000ae7ab96520de3a18e5e111b5eaab095312d7fe84
Arg [3] : 0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca0
Arg [4] : 00000000000000000000000083f20f44975d03b1b09e64809b757c47f942beea


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.