ETH Price: $2,496.88 (-0.59%)

Contract

0x6fb946B55C50E6Dc64c59D3F3e6c7C64580d6B82
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
185683422023-11-14 6:26:35354 days ago1699943195  Contract Creation0 ETH
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x9645044C...5c3daBD22
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
RangeEthAdapterInitializable

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 10 runs

Other Settings:
default evmVersion
File 1 of 11 : RangeEthAdapterInitializable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "../interfaces/IAdapter.sol";
import "../interfaces/IRangeEthVault.sol";

contract RangeEthAdapterInitializable is IAdapter, Initializable, Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    string public constant PROTOCOL = "Range";
    uint8 public constant VERSION = 1;
    uint256 public constant PRECISION = 1e18;

    address public wrapper;
    address public vault;
    address public token0;
    address public token1;
    address public lpToken;

    event SetWrapper(address indexed oldWrapper, address indexed newWrapper);
    event SetVault(address indexed oldVault, address indexed newVault, address token0, address token1, address lpToken);
    event ApproveToken(IERC20 indexed _token, address indexed _spender, uint256 _amount);
    event TransferToken(IERC20 indexed _token, address indexed _recipient, uint256 _amount);

    modifier onlyWrapper() {
        require(wrapper == msg.sender, "onlyWrapper: caller is not the wrapper");
        _;
    }

    /// * INIT *
    constructor() {}

    function initialize(
        address _wrapper,
        address _vault,
        address _admin
    ) external initializer {
        require(_wrapper != address(0) && _vault != address(0) && _admin != address(0), "initialize: address cant be zero");
        wrapper = _wrapper;
        vault = _vault;
        token0 = IRangeEthVault(vault).token0();
        token1 = IRangeEthVault(vault).token1();
        lpToken = vault;
        transferOwnership(_admin);
    }

    receive() external payable {}
    fallback() external {}

    /// * GETTER *
    function totalSupply(
    ) public view returns(uint256) {
        return IRangeEthVault(vault).totalSupply();
    }

    function tokenPerShare(
    ) public view returns(uint256 _token0PerShare, uint256 _token1PerShare) {
        (_token0PerShare, _token1PerShare) = IRangeEthVault(vault).getUnderlyingBalancesByShare(PRECISION);
    }

    function pool(
    ) public view returns(address) {
        return IRangeEthVault(vault).pool();
    }

    function manager(
    ) public view returns(address) {
        return IRangeEthVault(vault).manager();
    }

    function managerFee(
    ) public view returns(uint256) {
        return IRangeEthVault(vault).managingFee() * PRECISION / 10_000;
    }

    /// * OWNER *
    function setWrapper(
        address _newWrapper
    ) external onlyOwner {
        require(_newWrapper != address(0), "setWrapper: address cant be zero");

        address oldWrapper = wrapper;

        wrapper = _newWrapper;

        emit SetWrapper(oldWrapper, wrapper);
    }

    function setVault(
        address _newVault
    ) external onlyOwner {
        require(_newVault != address(0), "setVault: address cant be zero");

        address oldVault = vault;

        vault = _newVault;

        token0 = IRangeEthVault(vault).token0();
        token1 = IRangeEthVault(vault).token1();
        lpToken = vault;

        emit SetVault(oldVault, vault, token0, token1, lpToken);
    }

    function approveToken(
        IERC20 _token, 
        address _spender, 
        uint256 _amount
    ) external onlyOwner {
        _token.approve(_spender, _amount);

        emit ApproveToken(_token, _spender, _amount);
    }

    function transferToken(
        IERC20 _token, 
        address _recipient, 
        uint256 _amount
    ) external onlyOwner {
        uint256 balance = _token.balanceOf(address(this));
        if (balance < _amount) {
            _amount = balance;
        }

        _token.safeTransfer(_recipient, _amount);

        emit TransferToken(_token, _recipient, _amount);
    }

    /// * VAULT *
    function deposit(
        uint256 _amount0,
        uint256 _amount1,
        address _user,
        bytes calldata
    ) external nonReentrant onlyWrapper returns(uint256 mintAmount) {
        (uint256 amount0Current, uint256 amount1Current) = IRangeEthVault(vault).getUnderlyingBalances();
        uint256 totalSupply_ = totalSupply();
        require(amount0Current > 0 || amount1Current > 0, "deposit: no current balance");
        if (amount0Current == 0 && amount1Current > 0) {
            mintAmount = _amount1 * totalSupply_ / amount1Current;
        } else if (amount1Current == 0 && amount0Current > 0) {
            mintAmount = _amount0 * totalSupply_ / amount0Current;
        } else {
            uint256 amount0Mint = _amount0 * totalSupply_ / amount0Current; 
            uint256 amount1Mint = _amount1 * totalSupply_ / amount1Current;
            mintAmount = amount0Mint <= amount1Mint ? amount0Mint : amount1Mint;
        }
 
        IERC20(token0).safeTransferFrom(wrapper, address(this), _amount0);
        IERC20(token1).safeTransferFrom(wrapper, address(this), _amount1);
        IERC20(token0).forceApprove(vault, _amount0);
        IERC20(token1).forceApprove(vault, _amount1);

        uint256[2] memory amounts;
        amounts[0] = _amount0;
        amounts[1] = _amount1;

        (uint256 amount0Used, uint256 amount1Used) = IRangeEthVault(vault).mint(mintAmount, false, amounts);

        require(_amount0 >= amount0Used && _amount1 >= amount1Used, "deposit: incorrect token amount");

        IERC20(lpToken).safeTransfer(wrapper, mintAmount);

        if (IERC20(token0).balanceOf(address(this)) > 0) IERC20(token0).safeTransfer(_user, IERC20(token0).balanceOf(address(this)));
        if (IERC20(token1).balanceOf(address(this)) > 0) IERC20(token1).safeTransfer(_user, IERC20(token1).balanceOf(address(this)));
    }

    function withdraw(
        uint256 _share,
        address _user,
        bytes calldata
    ) external nonReentrant onlyWrapper returns(uint256 _amount0, uint256 _amount1) {
        IERC20(lpToken).safeTransferFrom(wrapper, address(this), _share);
        IERC20(lpToken).forceApprove(vault, _share);

        uint256[2] memory amounts;

        (_amount0, _amount1) = IRangeEthVault(vault).burn(_share, false, amounts);

        IERC20(token0).safeTransfer(_user, _amount0);
        IERC20(token1).safeTransfer(_user, _amount1);

        if (IERC20(lpToken).balanceOf(address(this)) > 0) IERC20(lpToken).safeTransfer(_user, IERC20(lpToken).balanceOf(address(this)));
    }
}

File 2 of 11 : 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 11 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/Address.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 4 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 5 of 11 : 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 6 of 11 : 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 7 of 11 : 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 8 of 11 : 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 9 of 11 : 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 10 of 11 : IAdapter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IAdapter {
    function initialize(
        address _wrapper,
        address _vault,
        address _admin
    ) external;

    function wrapper() external returns(address);

    function vault() external returns(address);

    function token0() external returns(address);

    function token1() external returns(address);

    function lpToken() external returns(address);

    function PROTOCOL() external returns(string memory);

    function VERSION() external returns(uint8);

    function PRECISION() external returns(uint256);

    function totalSupply() external view returns(uint256);

    function tokenPerShare() external view returns(uint256 _token0PerShare, uint256 _token1PerShare);

    function pool() external view returns(address);

    function deposit(
        uint256 _amount0,
        uint256 _amount1,
        address _user,
        bytes calldata _data
    ) external returns(uint256 _share);

    function withdraw(
        uint256 _share,
        address _user,
        bytes calldata _data
    ) external returns(uint256 _amount0, uint256 _amount1);
}

File 11 of 11 : IRangeEthVault.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IRangeEthVault{
    function lowerTick() external returns(int24);
    function upperTick() external returns(int24);
    function inThePosition() external returns(bool);
    function mintStarted() external returns(bool);
    function tickSpacing() external returns(int24);

    function pool() external view returns(address);
    function token0() external view returns(address);
    function token1() external view returns(address);
    function totalSupply() external view returns (uint256);

    function factory() external returns(address);
    function manager() external view returns (address);
    function managingFee() external view returns(uint16);
    function performanceFee() external view returns(uint16);
    function managerBalance0() external view returns(uint256);
    function managerBalance1() external view returns(uint256);

    struct UserVault {
        bool exists;
        uint256 token0;
        uint256 token1;
    }
    function userVaults(address) external returns(UserVault memory);
    function users(uint256) external returns(address);

    function MAX_PERFORMANCE_FEE_BPS() external returns(uint16);
    function MAX_MANAGING_FEE_BPS() external returns(uint16);

    /**
     * @notice mint mints range vault shares, fractional shares of a Pancake V3 position/strategy
     * to compute the amount of tokens necessary to mint `mintAmount` see getMintAmounts
     * @param mintAmount The number of shares to mint
     * @param maxAmounts max amounts to add in token0 and token1.
     * @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`
     * @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`
     */
    function mint(
        uint256 mintAmount,
        bool depositNative,
        uint256[2] calldata maxAmounts
    )
        external
        payable
        returns (uint256 amount0, uint256 amount1);

    /**
     * @notice burn burns range vault shares (shares of a Pancake V3 position) and receive underlying
     * @param burnAmount The number of shares to burn
     * @return amount0 amount of token0 transferred to msg.sender for burning {burnAmount}
     * @return amount1 amount of token1 transferred to msg.sender for burning {burnAmount}
     */
    function burn(
        uint256 burnAmount,
        bool withdrawNative,
        uint256[2] calldata minAmounts
    ) external returns (uint256 amount0, uint256 amount1);

    /**
     * @notice compute maximum shares that can be minted from `amount0Max` and `amount1Max`
     * @param amount0Max The maximum amount of token0 to forward on mint
     * @param amount1Max The maximum amount of token1 to forward on mint
     * @return amount0 actual amount of token0 to forward when minting `mintAmount`
     * @return amount1 actual amount of token1 to forward when minting `mintAmount`
     * @return mintAmount maximum number of shares mintable
     */
    function getMintAmounts(
        uint256 amount0Max,
        uint256 amount1Max
    ) external view returns (uint256 amount0, uint256 amount1, uint256 mintAmount);

    /**
     * @notice compute total underlying token0 and token1 token supply at provided price
     * includes current liquidity invested in pancake position, current fees earned
     * and any uninvested leftover (but does not include manager fees accrued)
     * @param sqrtRatioX96 price to computer underlying balances at
     * @return amount0Current current total underlying balance of token0
     * @return amount1Current current total underlying balance of token1
     */
    function getUnderlyingBalancesAtPrice(
        uint160 sqrtRatioX96
    ) external view returns (uint256 amount0Current, uint256 amount1Current);

    /**
     * @notice getCurrentFees returns the current uncollected fees
     * @return fee0 uncollected fee in token0
     * @return fee1 uncollected fee in token1
     */
    function getCurrentFees() external view returns (uint256 fee0, uint256 fee1);

    struct UserVaultInfo {
        address user;
        uint256 token0;
        uint256 token1;
    }
    /**
     * @notice returns array of current user vaults. This function is only intended to be called off-chain.
     * @param fromIdx start index to fetch the user vaults info from.
     * @param toIdx end index to fetch the user vault to.
     */
    function getUserVaults(
        uint256 fromIdx,
        uint256 toIdx
    ) external view returns (UserVaultInfo[] memory);

    /**
     * @dev returns the length of users array.
     */
    function userCount() external view returns(uint256);

    /**
     * @notice getPositionID returns the position id of the vault in pancake pool
     * @return positionID position id of the vault in pancake pool
     */
    function getPositionID() external view returns (bytes32 positionID);

    /**
     * @notice compute total underlying token0 and token1 token supply at current price
     * includes current liquidity invested in pancake position, current fees earned
     * and any uninvested leftover (but does not include manager fees accrued)
     * @return amount0Current current total underlying balance of token0
     * @return amount1Current current total underlying balance of token1
     */
    function getUnderlyingBalances() external view returns (uint256 amount0Current, uint256 amount1Current);

    function getUnderlyingBalancesByShare(
        uint256 shares
    ) external view returns (uint256 amount0, uint256 amount1);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"_token","type":"address"},{"indexed":true,"internalType":"address","name":"_spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ApproveToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldVault","type":"address"},{"indexed":true,"internalType":"address","name":"newVault","type":"address"},{"indexed":false,"internalType":"address","name":"token0","type":"address"},{"indexed":false,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"address","name":"lpToken","type":"address"}],"name":"SetVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldWrapper","type":"address"},{"indexed":true,"internalType":"address","name":"newWrapper","type":"address"}],"name":"SetWrapper","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"_token","type":"address"},{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"TransferToken","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[],"name":"PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROTOCOL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"approveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount0","type":"uint256"},{"internalType":"uint256","name":"_amount1","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wrapper","type":"address"},{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_admin","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lpToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managerFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newVault","type":"address"}],"name":"setVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newWrapper","type":"address"}],"name":"setWrapper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenPerShare","outputs":[{"internalType":"uint256","name":"_token0PerShare","type":"uint256"},{"internalType":"uint256","name":"_token1PerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_share","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"_amount0","type":"uint256"},{"internalType":"uint256","name":"_amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wrapper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

Deployed Bytecode

0x6080604052600436106101145760003560e01c80630dfe16811461012957806316f0115b1461015f57806318160ddd14610174578063481c6a75146101975780635fcbd285146101ac57806362b2b5f0146101cc5780636817031b14610201578063715018a6146102215780638da5cb5b1461023657806391b9b8271461024b5780639c7632fc14610289578063aaf5eb681461029e578063ac210cc7146102ba578063c0c53b8b146102da578063c2167d93146102fa578063c7f734481461031a578063cb65d2211461032f578063d21220a71461034f578063da3e33971461036f578063f2fde38b1461038f578063f5537ede146103af578063fbfa77cf146103cf578063ffa1ad74146103ef5761011b565b3661011b57005b34801561012757600080fd5b005b34801561013557600080fd5b50600454610149906001600160a01b031681565b6040516101569190611b0f565b60405180910390f35b34801561016b57600080fd5b50610149610416565b34801561018057600080fd5b50610189610489565b604051908152602001610156565b3480156101a357600080fd5b506101496104f7565b3480156101b857600080fd5b50600654610149906001600160a01b031681565b3480156101d857600080fd5b506101ec6101e7366004611b80565b610541565b60408051928352602083019190915201610156565b34801561020d57600080fd5b5061012761021c366004611bdb565b610781565b34801561022d57600080fd5b50610127610965565b34801561024257600080fd5b50610149610979565b34801561025757600080fd5b5061027c6040518060400160405280600581526020016452616e676560d81b81525081565b6040516101569190611c23565b34801561029557600080fd5b5061018961098e565b3480156102aa57600080fd5b50610189670de0b6b3a764000081565b3480156102c657600080fd5b50600254610149906001600160a01b031681565b3480156102e657600080fd5b506101276102f5366004611c56565b610a2b565b34801561030657600080fd5b50610127610315366004611bdb565b610d04565b34801561032657600080fd5b506101ec610db4565b34801561033b57600080fd5b5061018961034a366004611ca1565b610e35565b34801561035b57600080fd5b50600554610149906001600160a01b031681565b34801561037b57600080fd5b5061012761038a366004611d0a565b61136e565b34801561039b57600080fd5b506101276103aa366004611bdb565b61143a565b3480156103bb57600080fd5b506101276103ca366004611d0a565b6114b3565b3480156103db57600080fd5b50600354610149906001600160a01b031681565b3480156103fb57600080fd5b50610404600181565b60405160ff9091168152602001610156565b600354604080516316f0115b60e01b815290516000926001600160a01b0316916316f0115b9160048083019260209291908290030181865afa158015610460573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104849190611d4b565b905090565b600354604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa1580156104d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104849190611d68565b6003546040805163481c6a7560e01b815290516000926001600160a01b03169163481c6a759160048083019260209291908290030181865afa158015610460573d6000803e3d6000fd5b60008061054c6115a0565b6002546001600160a01b0316331461057f5760405162461bcd60e51b815260040161057690611d81565b60405180910390fd5b60025460065461059d916001600160a01b03918216911630896115f9565b6003546006546105ba916001600160a01b03918216911688611664565b6105c2611af1565b60035460405163072e85a160e11b81526001600160a01b0390911690630e5d0b42906105f7908a906000908690600401611dc7565b60408051808303816000875af1158015610615573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106399190611e0c565b6004549194509250610655906001600160a01b031687856116fd565b60055461066c906001600160a01b031687846116fd565b6006546040516370a0823160e01b81526000916001600160a01b0316906370a082319061069d903090600401611b0f565b602060405180830381865afa1580156106ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106de9190611d68565b111561076e576006546040516370a0823160e01b815261076e9188916001600160a01b03909116906370a082319061071a903090600401611b0f565b602060405180830381865afa158015610737573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075b9190611d68565b6006546001600160a01b031691906116fd565b5061077860018055565b94509492505050565b610789611721565b6001600160a01b0381166107df5760405162461bcd60e51b815260206004820152601e60248201527f7365745661756c743a20616464726573732063616e74206265207a65726f00006044820152606401610576565b600380546001600160a01b038381166001600160a01b03198316811790935560408051630dfe168160e01b81529051919092169291630dfe16819160048083019260209291908290030181865afa15801561083e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108629190611d4b565b600480546001600160a01b0319166001600160a01b039283161781556003546040805163d21220a760e01b81529051919093169263d21220a792818101926020929091908290030181865afa1580156108bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e39190611d4b565b600580546001600160a01b039283166001600160a01b03199182168117909255600354600680549092169084169081179091556004546040805191851682526020820193909352918201819052918316907f5a35b6f9b480197376dbcb9b91088b73268a881d0b79986d55b1876ed61fe6269060600160405180910390a35050565b61096d611721565b6109776000611780565b565b6000546201000090046001600160a01b031690565b6000612710670de0b6b3a7640000600360009054906101000a90046001600160a01b03166001600160a01b031663601b48a46040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a139190611e30565b61ffff16610a219190611e54565b6104849190611e79565b600054610100900460ff1615808015610a4b5750600054600160ff909116105b80610a6c5750610a5a306117db565b158015610a6c575060005460ff166001145b610acf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610576565b6000805460ff191660011790558015610af2576000805461ff0019166101001790555b6001600160a01b03841615801590610b1257506001600160a01b03831615155b8015610b2657506001600160a01b03821615155b610b725760405162461bcd60e51b815260206004820181905260248201527f696e697469616c697a653a20616464726573732063616e74206265207a65726f6044820152606401610576565b600280546001600160a01b038087166001600160a01b03199283161790925560038054928616929091168217905560408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015610bdb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bff9190611d4b565b600480546001600160a01b0319166001600160a01b039283161781556003546040805163d21220a760e01b81529051919093169263d21220a792818101926020929091908290030181865afa158015610c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c809190611d4b565b600580546001600160a01b03199081166001600160a01b039384161790915560035460068054919093169116179055610cb88261143a565b8015610cfe576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b610d0c611721565b6001600160a01b038116610d625760405162461bcd60e51b815260206004820181905260248201527f736574577261707065723a20616464726573732063616e74206265207a65726f6044820152606401610576565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f4d842e26ec5c25253a29527530aadb317e89187df0fed58800fb2c736c3f612e90600090a35050565b60035460405163f173c7f560e01b8152670de0b6b3a7640000600482015260009182916001600160a01b039091169063f173c7f5906024016040805180830381865afa158015610e08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2c9190611e0c565b90939092509050565b6000610e3f6115a0565b6002546001600160a01b03163314610e695760405162461bcd60e51b815260040161057690611d81565b600354604080516304c8b65560e21b8152815160009384936001600160a01b0390911692631322d95492600480830193928290030181865afa158015610eb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed79190611e0c565b915091506000610ee5610489565b90506000831180610ef65750600082115b610f405760405162461bcd60e51b815260206004820152601b60248201527a6465706f7369743a206e6f2063757272656e742062616c616e636560281b6044820152606401610576565b82158015610f4e5750600082115b15610f6f5781610f5e828a611e54565b610f689190611e79565b9350610fd4565b81158015610f7d5750600083115b15610f8d5782610f5e828b611e54565b600083610f9a838c611e54565b610fa49190611e79565b9050600083610fb3848c611e54565b610fbd9190611e79565b905080821115610fcd5780610fcf565b815b955050505b600254600454610ff2916001600160a01b039182169116308c6115f9565b600254600554611010916001600160a01b039182169116308b6115f9565b60035460045461102d916001600160a01b0391821691168b611664565b60035460055461104a916001600160a01b0391821691168a611664565b611052611af1565b898152602081018990526003546040516389f604af60e01b815260009182916001600160a01b03909116906389f604af90611095908a9085908890600401611dc7565b60408051808303816000875af11580156110b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d79190611e0c565b91509150818c101580156110eb5750808b10155b6111375760405162461bcd60e51b815260206004820152601f60248201527f6465706f7369743a20696e636f727265637420746f6b656e20616d6f756e74006044820152606401610576565b600254600654611154916001600160a01b039182169116896116fd565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a082319161118691309101611b0f565b602060405180830381865afa1580156111a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c79190611d68565b111561125457600480546040516370a0823160e01b8152611254928d926001600160a01b0316916370a082319161120091309101611b0f565b602060405180830381865afa15801561121d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112419190611d68565b6004546001600160a01b031691906116fd565b6005546040516370a0823160e01b81526000916001600160a01b0316906370a0823190611285903090600401611b0f565b602060405180830381865afa1580156112a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c69190611d68565b1115611356576005546040516370a0823160e01b8152611356918c916001600160a01b03909116906370a0823190611302903090600401611b0f565b602060405180830381865afa15801561131f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113439190611d68565b6005546001600160a01b031691906116fd565b50505050505061136560018055565b95945050505050565b611376611721565b60405163095ea7b360e01b81526001600160a01b0384169063095ea7b3906113a49085908590600401611e9b565b6020604051808303816000875af11580156113c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e79190611eb4565b50816001600160a01b0316836001600160a01b03167feded619173dbb378903f97d44ecec898a1c4876f445ae551e063113aef58b4718360405161142d91815260200190565b60405180910390a3505050565b611442611721565b6001600160a01b0381166114a75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610576565b6114b081611780565b50565b6114bb611721565b6040516370a0823160e01b81526000906001600160a01b038516906370a08231906114ea903090600401611b0f565b602060405180830381865afa158015611507573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152b9190611d68565b905081811015611539578091505b61154d6001600160a01b03851684846116fd565b826001600160a01b0316846001600160a01b03167f3844b7075ed6e7d4b61342769cb2b1b325cba410a62932affaa90aee247dadf58460405161159291815260200190565b60405180910390a350505050565b6002600154036115f25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610576565b6002600155565b6040516001600160a01b0380851660248301528316604482015260648101829052610cfe9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526117ea565b600063095ea7b360e01b8383604051602401611681929190611e9b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915290506116bf84826118bf565b610cfe576040516001600160a01b0384166024820152600060448201526116f390859063095ea7b360e01b9060640161162d565b610cfe84826117ea565b61171c8363a9059cbb60e01b848460405160240161162d929190611e9b565b505050565b3361172a610979565b6001600160a01b0316146109775760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610576565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03163b151590565b600061183f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166119639092919063ffffffff16565b90508051600014806118605750808060200190518101906118609190611eb4565b61171c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610576565b6000806000846001600160a01b0316846040516118dc9190611ed6565b6000604051808303816000865af19150503d8060008114611919576040519150601f19603f3d011682016040523d82523d6000602084013e61191e565b606091505b50915091508180156119485750805115806119485750808060200190518101906119489190611eb4565b80156119585750611958856117db565b925050505b92915050565b6060611972848460008561197a565b949350505050565b6060824710156119db5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610576565b600080866001600160a01b031685876040516119f79190611ed6565b60006040518083038185875af1925050503d8060008114611a34576040519150601f19603f3d011682016040523d82523d6000602084013e611a39565b606091505b5091509150611a4a87838387611a55565b979650505050505050565b60608315611ac2578251600003611abb57611a6f856117db565b611abb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610576565b5081611972565b6119728383815115611ad75781518083602001fd5b8060405162461bcd60e51b81526004016105769190611c23565b60405180604001604052806002906020820280368337509192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146114b057600080fd5b60008083601f840112611b4a57600080fd5b5081356001600160401b03811115611b6157600080fd5b602083019150836020828501011115611b7957600080fd5b9250929050565b60008060008060608587031215611b9657600080fd5b843593506020850135611ba881611b23565b925060408501356001600160401b03811115611bc357600080fd5b611bcf87828801611b38565b95989497509550505050565b600060208284031215611bed57600080fd5b8135611bf881611b23565b9392505050565b60005b83811015611c1a578181015183820152602001611c02565b50506000910152565b6020815260008251806020840152611c42816040850160208701611bff565b601f01601f19169190910160400192915050565b600080600060608486031215611c6b57600080fd5b8335611c7681611b23565b92506020840135611c8681611b23565b91506040840135611c9681611b23565b809150509250925092565b600080600080600060808688031215611cb957600080fd5b85359450602086013593506040860135611cd281611b23565b925060608601356001600160401b03811115611ced57600080fd5b611cf988828901611b38565b969995985093965092949392505050565b600080600060608486031215611d1f57600080fd5b8335611d2a81611b23565b92506020840135611d3a81611b23565b929592945050506040919091013590565b600060208284031215611d5d57600080fd5b8151611bf881611b23565b600060208284031215611d7a57600080fd5b5051919050565b60208082526026908201527f6f6e6c79577261707065723a2063616c6c6572206973206e6f742074686520776040820152653930b83832b960d11b606082015260800190565b6000608082019050848252602084151581840152604083018460005b6002811015611e0057815183529183019190830190600101611de3565b50505050949350505050565b60008060408385031215611e1f57600080fd5b505080516020909101519092909150565b600060208284031215611e4257600080fd5b815161ffff81168114611bf857600080fd5b808202811582820484141761195d57634e487b7160e01b600052601160045260246000fd5b600082611e9657634e487b7160e01b600052601260045260246000fd5b500490565b6001600160a01b03929092168252602082015260400190565b600060208284031215611ec657600080fd5b81518015158114611bf857600080fd5b60008251611ee8818460208701611bff565b919091019291505056fea2646970667358221220566a4942f4a4e9689f403a5e9290d0dbb016fd9e3bf7f2e71a8309c13ec78c9264736f6c63430008130033

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  ]

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.