ETH Price: $2,278.17 (-5.49%)

Contract

0xa80c6715F2F2fE5622c11FF7Cc390B07a4DaE846

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Whitelist Module...3587565202025-07-17 20:04:29199 days ago1752782669IN
0xa80c6715...7a4DaE846
0 ETH0.000022890.061365

Latest 3 internal transactions

Parent Transaction Hash Block From To
3638633822025-08-01 14:14:31184 days ago1754057671
0xa80c6715...7a4DaE846
30 ETH
3638633822025-08-01 14:14:31184 days ago1754057671
0xa80c6715...7a4DaE846
30 ETH
3587565112025-07-17 20:04:27199 days ago1752782667  Contract Creation0 ETH

Cross-Chain Transactions
Loading...
Loading

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

Contract Name:
ArrakisMetaVaultPrivate

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 10000 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {IArrakisMetaVaultPrivate} from
    "./interfaces/IArrakisMetaVaultPrivate.sol";
import {IOwnable} from "./interfaces/IOwnable.sol";
import {ArrakisMetaVault} from "./abstracts/ArrakisMetaVault.sol";
import {IArrakisLPModulePrivate} from
    "./interfaces/IArrakisLPModulePrivate.sol";

import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {IERC721} from
    "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {EnumerableSet} from
    "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

contract ArrakisMetaVaultPrivate is
    ArrakisMetaVault,
    IArrakisMetaVaultPrivate,
    IOwnable
{
    using Address for address payable;
    using EnumerableSet for EnumerableSet.AddressSet;

    // #region immutable properties.

    address public immutable nft;

    // #endregion immutable properties.

    // #region internal properties.

    EnumerableSet.AddressSet internal _depositors;

    // #endregion internal properties.

    constructor(
        address moduleRegistry_,
        address manager_,
        address token0_,
        address token1_,
        address nft_
    ) ArrakisMetaVault(moduleRegistry_, manager_, token0_, token1_) {
        if (nft_ == address(0)) revert AddressZero("NFT");
        nft = nft_;
    }

    /// @notice function used to deposit tokens or expand position inside the
    /// inherent strategy.
    /// @param amount0_ amount of token0 need to increase the position by proportion_;
    /// @param amount1_ amount of token1 need to increase the position by proportion_;
    function deposit(
        uint256 amount0_,
        uint256 amount1_
    ) external payable {
        if (!_depositors.contains(msg.sender)) revert OnlyDepositor();
        _deposit(amount0_, amount1_);

        emit LogDeposit(amount0_, amount1_);
    }

    /// @notice function used to withdraw tokens or position contraction of the
    /// underpin strategy.
    /// @param proportion_ the proportion of position contraction.
    /// @param receiver_ the address that will receive withdrawn tokens.
    /// @return amount0 amount of token0 returned.
    /// @return amount1 amount of token1 returned.
    function withdraw(
        uint256 proportion_,
        address receiver_
    )
        external
        onlyOwnerCustom
        returns (uint256 amount0, uint256 amount1)
    {
        (amount0, amount1) = _withdraw(receiver_, proportion_);

        emit LogWithdraw(proportion_, amount0, amount1);
    }

    /// @notice function used to whitelist depositors.
    /// @param depositors_  list of address that will be granted to depositor role.
    function whitelistDepositors(address[] calldata depositors_)
        external
        onlyOwnerCustom
    {
        uint256 length = depositors_.length;
        for (uint256 i; i < length; i++) {
            address depositor = depositors_[i];

            if (depositor == address(0)) {
                revert AddressZero("Depositor");
            }
            if (_depositors.contains(depositor)) {
                revert DepositorAlreadyWhitelisted();
            }

            _depositors.add(depositor);
        }

        emit LogWhitelistDepositors(depositors_);
    }

    /// @notice function used to blacklist depositors.
    /// @param depositors_ list of address who depositor role will be revoked.
    function blacklistDepositors(address[] calldata depositors_)
        external
        onlyOwnerCustom
    {
        uint256 length = depositors_.length;
        for (uint256 i; i < length; i++) {
            address depositor = depositors_[i];

            if (!_depositors.contains(depositor)) {
                revert NotAlreadyWhitelistedDepositor();
            }

            _depositors.remove(depositor);
        }

        emit LogBlacklistDepositors(depositors_);
    }

    // #region external view/pure functions.

    /// @notice function used to get the owner of this contract.
    function owner() external view returns (address) {
        return IERC721(nft).ownerOf(uint256(uint160(address(this))));
    }

    /// @notice function used to get the list of depositors.
    /// @return depositors list of address granted to depositor role.
    function depositors() external view returns (address[] memory) {
        return _depositors.values();
    }

    // #endregion  external view/pure functions.

    // #region internal functions.

    function _deposit(
        uint256 amount0_,
        uint256 amount1_
    ) internal nonReentrant {
        /// @dev msg.sender should be the tokens provider

        bytes memory data = abi.encodeWithSelector(
            IArrakisLPModulePrivate.fund.selector,
            msg.sender,
            amount0_,
            amount1_
        );

        payable(address(module)).functionCallWithValue(
            data, msg.value
        );
    }

    function _onlyOwnerCheck() internal view override {
        if (
            msg.sender
                != IERC721(nft).ownerOf(uint256(uint160(address(this))))
        ) {
            revert OnlyOwner();
        }
    }

    // #endregion internal functions.
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IArrakisMetaVaultPrivate {
    // #region errors.

    error MintZero();
    error BurnZero();
    error BurnOverflow();
    error DepositorAlreadyWhitelisted();
    error NotAlreadyWhitelistedDepositor();
    error OnlyDepositor();

    // #endregion errors.

    // #region events.

    /// @notice Event describing a deposit done by an user inside this vault.
    /// @param amount0 amount of token0 needed to increase the portfolio of "proportion" percent.
    /// @param amount1 amount of token1 needed to increase the portfolio of "proportion" percent.
    event LogDeposit(uint256 amount0, uint256 amount1);

    /// @notice Event describing a withdrawal of participation by an user inside this vault.
    /// @param proportion percentage of the current position that user want to withdraw.
    /// @param amount0 amount of token0 withdrawn due to withdraw action.
    /// @param amount1 amount of token1 withdrawn due to withdraw action.
    event LogWithdraw(
        uint256 proportion, uint256 amount0, uint256 amount1
    );

    /// @notice Event describing the whitelist of fund depositor.
    /// @param depositors list of address that are granted to depositor role.
    event LogWhitelistDepositors(address[] depositors);

    /// @notice Event describing the blacklist of fund depositor.
    /// @param depositors list of address who depositor role is revoked.
    event LogBlacklistDepositors(address[] depositors);

    // #endregion events.

    /// @notice function used to deposit tokens or expand position inside the
    /// inherent strategy.
    /// @param amount0_ amount of token0 need to increase the position by proportion_;
    /// @param amount1_ amount of token1 need to increase the position by proportion_;
    function deposit(
        uint256 amount0_,
        uint256 amount1_
    ) external payable;

    /// @notice function used to withdraw tokens or position contraction of the
    /// underpin strategy.
    /// @param proportion_ the proportion of position contraction.
    /// @param receiver_ the address that will receive withdrawn tokens.
    /// @return amount0 amount of token0 returned.
    /// @return amount1 amount of token1 returned.
    function withdraw(
        uint256 proportion_,
        address receiver_
    ) external returns (uint256 amount0, uint256 amount1);

    /// @notice function used to whitelist depositors.
    /// @param depositors_ list of address that will be granted to depositor role.
    function whitelistDepositors(address[] calldata depositors_)
        external;

    /// @notice function used to blacklist depositors.
    /// @param depositors_ list of address who depositor role will be revoked.
    function blacklistDepositors(address[] calldata depositors_)
        external;

    /// @notice function used to get the list of depositors.
    /// @return depositors list of address granted to depositor role.
    function depositors() external view returns (address[] memory);
}

File 3 of 19 : IOwnable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IOwnable {
    /// @notice function used to get the owner of this contract.
    function owner() external view returns (address);
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {IArrakisMetaVault} from "../interfaces/IArrakisMetaVault.sol";
import {IArrakisLPModule} from "../interfaces/IArrakisLPModule.sol";
import {IModuleRegistry} from "../interfaces/IModuleRegistry.sol";
import {BASE} from "../constants/CArrakis.sol";

import {ReentrancyGuard} from
    "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {EnumerableSet} from
    "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

import {Initializable} from
    "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

abstract contract ArrakisMetaVault is
    IArrakisMetaVault,
    ReentrancyGuard,
    Initializable
{
    using EnumerableSet for EnumerableSet.AddressSet;

    // #region immutable properties.

    address public immutable moduleRegistry;
    address public immutable token0;
    address public immutable token1;
    address public immutable manager;

    // #endregion immutable properties.

    // #region public properties.

    IArrakisLPModule public module;

    // #endregion public properties.

    EnumerableSet.AddressSet internal _whitelistedModules;

    // #region modifier.

    modifier onlyOwnerCustom() {
        _onlyOwnerCheck();
        _;
    }

    modifier onlyManager() {
        if (msg.sender != manager) {
            revert OnlyManager(msg.sender, manager);
        }
        _;
    }

    // #endregion modifier.

    constructor(
        address moduleRegistry_,
        address manager_,
        address token0_,
        address token1_
    ) {
        // #region checks.

        if (moduleRegistry_ == address(0)) {
            revert AddressZero("Module Registry");
        }
        if (manager_ == address(0)) revert AddressZero("Manager");
        if (token0_ == address(0)) revert AddressZero("Token 0");
        if (token1_ == address(0)) revert AddressZero("Token 1");
        if (token0_ > token1_) revert Token0GtToken1();
        if (token0_ == token1_) revert Token0EqToken1();

        // #endregion checks.

        moduleRegistry = moduleRegistry_;
        manager = manager_;
        token0 = token0_;
        token1 = token1_;

        emit LogSetManager(manager_);
    }

    function initialize(address module_) external initializer {
        if (module_ == address(0)) revert AddressZero("Module");

        _whitelistedModules.add(module_);
        module = IArrakisLPModule(module_);

        emit LogSetFirstModule(module_);
        emit LogWhitelistedModule(module_);
    }

    /// @notice function used to set module
    /// @param module_ address of the new module
    /// @param payloads_ datas to initialize/rebalance on the new module
    function setModule(
        address module_,
        bytes[] calldata payloads_
    ) external onlyManager nonReentrant {
        // store in memory to save gas.
        IArrakisLPModule _module = module;

        if (address(_module) == module_) revert SameModule();
        if (!_whitelistedModules.contains(module_)) {
            revert NotWhitelistedModule(module_);
        }

        module = IArrakisLPModule(module_);

        // #region withdraw manager fees balances.

        _withdrawManagerBalance(_module);

        // #endregion withdraw manager fees balances.

        // #region move tokens to the new module.

        /// @dev we transfer here all tokens to the new module.
        _module.withdraw(module_, BASE);

        // #endregion move tokens to the new module.

        // #region check if the module is empty.

        // #endregion check if the module is empty.

        uint256 len = payloads_.length;

        // #region first call.

        if (len == 0) {
            revert PositionNotInitialized();
        }

        bytes4 selector = bytes4(payloads_[0][:4]);

        if (selector != IArrakisLPModule.initializePosition.selector)
        {
            revert NotPositionInitializationCall();
        }

        _call(module_, payloads_[0]);

        // #endregion first call.

        for (uint256 i = 1; i < len; i++) {
            selector = bytes4(payloads_[i][:4]);

            if (IArrakisLPModule.withdraw.selector == selector) {
                revert WithdrawNotAllowed();
            }

            _call(module_, payloads_[i]);
        }
        emit LogSetModule(module_, payloads_);
    }

    /// @notice function used to whitelist modules that can used by manager.
    /// @param beacons_ array of beacons addresses to use for modules creation.
    /// @param data_ array of payload to use for modules creation.
    function whitelistModules(
        address[] calldata beacons_,
        bytes[] calldata data_
    ) external onlyOwnerCustom {
        uint256 len = beacons_.length;
        if (len != data_.length) revert ArrayNotSameLength();

        address[] memory modules = new address[](len);
        for (uint256 i; i < len; i++) {
            address _module = IModuleRegistry(moduleRegistry)
                .createModule(address(this), beacons_[i], data_[i]);

            modules[i] = _module;

            _whitelistedModules.add(_module);
        }

        emit LogWhiteListedModules(modules);
    }

    /// @notice function used to blacklist modules that can used by manager.
    /// @param modules_ array of module addresses to be blacklisted.
    function blacklistModules(address[] calldata modules_)
        external
        onlyOwnerCustom
    {
        uint256 len = modules_.length;
        for (uint256 i; i < len; i++) {
            address _module = modules_[i];
            if (!_whitelistedModules.contains(_module)) {
                revert NotWhitelistedModule(_module);
            }
            if (address(module) == _module) revert ActiveModule();
            _whitelistedModules.remove(_module);
        }

        emit LogBlackListedModules(modules_);
    }

    /// @notice function used to get the list of modules whitelisted.
    /// @return modules whitelisted modules addresses.
    function whitelistedModules()
        external
        view
        returns (address[] memory modules)
    {
        return _whitelistedModules.values();
    }

    // #region view functions.

    /// @notice function used to get the initial amounts needed to open a position.
    /// @return init0 the amount of token0 needed to open a position.
    /// @return init1 the amount of token1 needed to open a position.
    function getInits()
        external
        view
        returns (uint256 init0, uint256 init1)
    {
        return module.getInits();
    }

    /// @notice function used to get the amount of token0 and token1 sitting
    /// on the position.
    /// @return amount0 the amount of token0 sitting on the position.
    /// @return amount1 the amount of token1 sitting on the position.
    function totalUnderlying()
        public
        view
        returns (uint256 amount0, uint256 amount1)
    {
        return module.totalUnderlying();
    }

    /// @notice function used to get the amounts of token0 and token1 sitting
    /// on the position for a specific price.
    /// @param priceX96_ price at which we want to simulate our tokens composition
    /// @return amount0 the amount of token0 sitting on the position for priceX96.
    /// @return amount1 the amount of token1 sitting on the position for priceX96.
    function totalUnderlyingAtPrice(uint160 priceX96_)
        external
        view
        returns (uint256 amount0, uint256 amount1)
    {
        return module.totalUnderlyingAtPrice(priceX96_);
    }

    // #endregion view functions.

    // #region internal functions.

    function _withdraw(
        address receiver_,
        uint256 proportion_
    ) internal returns (uint256 amount0, uint256 amount1) {
        (amount0, amount1) = module.withdraw(receiver_, proportion_);
    }

    function _withdrawManagerBalance(IArrakisLPModule module_)
        internal
        returns (uint256 amount0, uint256 amount1)
    {
        (amount0, amount1) = module_.withdrawManagerBalance();

        emit LogWithdrawManagerBalance(amount0, amount1);
    }

    function _call(address module_, bytes memory data_) internal {
        (bool success,) = module_.call(data_);
        if (!success) revert CallFailed();
    }

    function _onlyOwnerCheck() internal view virtual;

    // #endregion internal functions.
}

File 5 of 19 : IArrakisLPModulePrivate.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/// @notice expose a deposit function for that can
/// deposit any share of token0 and token1.
/// @dev this deposit feature will be used by
/// private actor.
interface IArrakisLPModulePrivate {
    // #region errors.

    error DepositZero();

    // #endregion errors.

    // #region events.

    /// @notice event emitted when owner of private fund the private vault.
    /// @param depositor address that are sending the tokens, the owner.
    /// @param amount0 amount of token0 sent by depositor.
    /// @param amount1 amount of token1 sent by depositor.
    event LogFund(
        address depositor, uint256 amount0, uint256 amount1
    );

    // #endregion events.

    /// @notice deposit function for private vault.
    /// @param depositor_ address that will provide the tokens.
    /// @param amount0_ amount of token0 that depositor want to send to module.
    /// @param amount1_ amount of token1 that depositor want to send to module.
    function fund(
        address depositor_,
        uint256 amount0_,
        uint256 amount1_
    ) external payable;
}

// 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);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

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

/// @title IArrakisMetaVault
/// @notice IArrakisMetaVault is a vault that is able to invest dynamically deposited
/// tokens into protocols through his module.
interface IArrakisMetaVault {
    // #region errors.

    /// @dev triggered when an address that should not
    /// be zero is equal to address zero.
    error AddressZero(string property);

    /// @dev triggered when the caller is different than
    /// the manager.
    error OnlyManager(address caller, address manager);

    /// @dev triggered when a low level call failed during
    /// execution.
    error CallFailed();

    /// @dev triggered when manager try to set the active
    /// module as active.
    error SameModule();

    /// @dev triggered when owner of the vault try to set the
    /// manager with the current manager.
    error SameManager();

    /// @dev triggered when all tokens withdrawal has been done
    /// during a switch of module.
    error ModuleNotEmpty(uint256 amount0, uint256 amount1);

    /// @dev triggered when owner try to whitelist a module
    /// that has been already whitelisted.
    error AlreadyWhitelisted(address module);

    /// @dev triggered when owner try to blacklist a module
    /// that has not been whitelisted.
    error NotWhitelistedModule(address module);

    /// @dev triggered when owner try to blacklist the active module.
    error ActiveModule();

    /// @dev triggered during vault creation if token0 address is greater than
    /// token1 address.
    error Token0GtToken1();

    /// @dev triggered during vault creation if token0 address is equal to
    /// token1 address.
    error Token0EqToken1();

    /// @dev triggered when whitelisting action is occuring and module's beacon
    /// is not whitelisted on module registry.
    error NotWhitelistedBeacon();

    /// @dev triggered when guardian of the whitelisting module is different than
    /// the guardian of the registry.
    error NotSameGuardian();

    /// @dev triggered when a function logic is not implemented.
    error NotImplemented();

    /// @dev triggered when two arrays suppposed to have the same length, have different length.
    error ArrayNotSameLength();

    /// @dev triggered when function is called by someone else than the owner.
    error OnlyOwner();

    /// @dev triggered when setModule action try to remove funds.
    error WithdrawNotAllowed();

    /// @dev triggered when setModule function end without
    /// initiliazePosition call.
    error PositionNotInitialized();

    /// @dev triggered when the first external call of setModule function
    /// isn't InitializePosition function.
    error NotPositionInitializationCall();

    // #endregion errors.

    // #region events.

    /// @notice Event describing a manager fee withdrawal.
    /// @param amount0 amount of token0 that manager has earned and will be transfered.
    /// @param amount1 amount of token1 that manager has earned and will be transfered.
    event LogWithdrawManagerBalance(uint256 amount0, uint256 amount1);

    /// @notice Event describing owner setting the manager.
    /// @param manager address of manager that will manage the portfolio.
    event LogSetManager(address manager);

    /// @notice Event describing manager setting the module.
    /// @param module address of the new active module.
    /// @param payloads data payloads for initializing positions on the new module.
    event LogSetModule(address module, bytes[] payloads);

    /// @notice Event describing default module that the vault will be initialized with.
    /// @param module address of the default module.
    event LogSetFirstModule(address module);

    /// @notice Event describing list of modules that has been whitelisted by owner.
    /// @param modules list of addresses corresponding to new modules now available
    /// to be activated by manager.
    event LogWhiteListedModules(address[] modules);

    /// @notice Event describing whitelisted of the first module during vault creation.
    /// @param module default activation.
    event LogWhitelistedModule(address module);

    /// @notice Event describing blacklisting action of modules by owner.
    /// @param modules list of addresses corresponding to old modules that has been
    /// blacklisted.
    event LogBlackListedModules(address[] modules);

    // #endregion events.

    /// @notice function used to initialize default module.
    /// @param module_ address of the default module.
    function initialize(address module_) external;

    /// @notice function used to set module
    /// @param module_ address of the new module
    /// @param payloads_ datas to initialize/rebalance on the new module
    function setModule(
        address module_,
        bytes[] calldata payloads_
    ) external;

    /// @notice function used to whitelist modules that can used by manager.
    /// @param beacons_ array of beacons addresses to use for modules creation.
    /// @param data_ array of payload to use for modules creation.
    function whitelistModules(
        address[] calldata beacons_,
        bytes[] calldata data_
    ) external;

    /// @notice function used to blacklist modules that can used by manager.
    /// @param modules_ array of module addresses to be blacklisted.
    function blacklistModules(address[] calldata modules_) external;

    // #region view functions.

    /// @notice function used to get the list of modules whitelisted.
    /// @return modules whitelisted modules addresses.
    function whitelistedModules()
        external
        view
        returns (address[] memory modules);

    /// @notice function used to get the amount of token0 and token1 sitting
    /// on the position.
    /// @return amount0 the amount of token0 sitting on the position.
    /// @return amount1 the amount of token1 sitting on the position.
    function totalUnderlying()
        external
        view
        returns (uint256 amount0, uint256 amount1);

    /// @notice function used to get the amounts of token0 and token1 sitting
    /// on the position for a specific price.
    /// @param priceX96 price at which we want to simulate our tokens composition
    /// @return amount0 the amount of token0 sitting on the position for priceX96.
    /// @return amount1 the amount of token1 sitting on the position for priceX96.
    function totalUnderlyingAtPrice(uint160 priceX96)
        external
        view
        returns (uint256 amount0, uint256 amount1);

    /// @notice function used to get the initial amounts needed to open a position.
    /// @return init0 the amount of token0 needed to open a position.
    /// @return init1 the amount of token1 needed to open a position.
    function getInits()
        external
        view
        returns (uint256 init0, uint256 init1);

    /// @notice function used to get the address of token0.
    function token0() external view returns (address);

    /// @notice function used to get the address of token1.
    function token1() external view returns (address);

    /// @notice function used to get manager address.
    function manager() external view returns (address);

    /// @notice function used to get module used to
    /// open/close/manager a position.
    function module() external view returns (IArrakisLPModule);

    /// @notice function used to get module registry.
    /// @return registry address of module registry.
    function moduleRegistry()
        external
        view
        returns (address registry);

    // #endregion view functions.
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import {IERC20Metadata} from
    "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {IArrakisMetaVault} from "./IArrakisMetaVault.sol";
import {IOracleWrapper} from "./IOracleWrapper.sol";

/// @title Liquidity providing module interface.
/// @author Arrakis Finance
/// @notice Module interfaces, modules are implementing differents strategies that an
/// arrakis module can use.
interface IArrakisLPModule {
    // #region errors.

    /// @dev triggered when an address that should not
    /// be zero is equal to address zero.
    error AddressZero();

    /// @dev triggered when the caller is different than
    /// the metaVault that own this module.
    error OnlyMetaVault(address caller, address metaVault);

    /// @dev triggered when the caller is different than
    /// the manager defined by the metaVault.
    error OnlyManager(address caller, address manager);

    /// @dev triggered if proportion of minting or burning is
    /// zero.
    error ProportionZero();

    /// @dev triggered if during withdraw more than 100% of the
    /// position.
    error ProportionGtBASE();

    /// @dev triggered when manager want to set his more
    /// earned by the position than 100% of fees earned.
    error NewFeesGtPIPS(uint256 newFees);

    /// @dev triggered when manager is setting the same fees
    /// that already active.
    error SameManagerFee();

    /// @dev triggered when inits values are zeros.
    error InitsAreZeros();

    /// @dev triggered when pause/unpaused function is
    /// called by someone else than guardian.
    error OnlyGuardian();

    // #endregion errors.

    // #region events.

    /// @notice Event describing a withdrawal of participation by an user inside this module.
    /// @dev withdraw action can be indexed by receiver.
    /// @param receiver address that will receive the tokens withdrawn.
    /// @param proportion percentage of the current position that user want to withdraw.
    /// @param amount0 amount of token0 send to "receiver" due to withdraw action.
    /// @param amount1 amount of token1 send to "receiver" due to withdraw action.
    event LogWithdraw(
        address indexed receiver,
        uint256 proportion,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Event describing a manager fee withdrawal.
    /// @param manager address of the manager that will fees earned due to his fund management.
    /// @param amount0 amount of token0 that manager has earned and will be transfered.
    /// @param amount1 amount of token1 that manager has earned and will be transfered.
    event LogWithdrawManagerBalance(
        address manager, uint256 amount0, uint256 amount1
    );

    /// @notice Event describing manager set his fees.
    /// @param oldFee fees share that have been taken by manager.
    /// @param newFee fees share that have been taken by manager.
    event LogSetManagerFeePIPS(uint256 oldFee, uint256 newFee);

    // #endregion events.

    /// @notice function used to pause the module.
    /// @dev only callable by guardian
    function pause() external;

    /// @notice function used to unpause the module.
    /// @dev only callable by guardian
    function unpause() external;

    /// @notice function used to initialize the module
    /// when a module switch happen
    /// @param data_ bytes that contain information to initialize
    /// the position.
    function initializePosition(bytes calldata data_) external;

    /// @notice function used by metaVault to withdraw tokens from the strategy.
    /// @param receiver_ address that will receive tokens.
    /// @param proportion_ the proportion of the total position that need to be withdrawn.
    /// @return amount0 amount of token0 withdrawn.
    /// @return amount1 amount of token1 withdrawn.
    function withdraw(
        address receiver_,
        uint256 proportion_
    ) external returns (uint256 amount0, uint256 amount1);

    /// @notice function used by metaVault or manager to get manager fees.
    /// @return amount0 amount of token0 sent to manager.
    /// @return amount1 amount of token1 sent to manager.
    function withdrawManagerBalance()
        external
        returns (uint256 amount0, uint256 amount1);

    /// @notice function used to set manager fees.
    /// @param newFeePIPS_ new fee that will be applied.
    function setManagerFeePIPS(uint256 newFeePIPS_) external;

    // #region view functions.

    /// @notice function used to get metaVault as IArrakisMetaVault.
    /// @return metaVault that implement IArrakisMetaVault.
    function metaVault() external view returns (IArrakisMetaVault);

    /// @notice function used to get the address that can pause the module.
    /// @return guardian address of the pauser.
    function guardian() external view returns (address);

    /// @notice function used to get manager token0 balance.
    /// @dev amount of fees in token0 that manager have not taken yet.
    /// @return managerBalance0 amount of token0 that manager earned.
    function managerBalance0() external view returns (uint256);

    /// @notice function used to get manager token1 balance.
    /// @dev amount of fees in token1 that manager have not taken yet.
    /// @return managerBalance1 amount of token1 that manager earned.
    function managerBalance1() external view returns (uint256);

    /// @notice function used to get manager fees.
    /// @return managerFeePIPS amount of token1 that manager earned.
    function managerFeePIPS() external view returns (uint256);

    /// @notice function used to get token0 as IERC20Metadata.
    /// @return token0 as IERC20Metadata.
    function token0() external view returns (IERC20Metadata);

    /// @notice function used to get token1 as IERC20Metadata.
    /// @return token1 as IERC20Metadata.
    function token1() external view returns (IERC20Metadata);

    /// @notice function used to get the initial amounts needed to open a position.
    /// @return init0 the amount of token0 needed to open a position.
    /// @return init1 the amount of token1 needed to open a position.
    function getInits()
        external
        view
        returns (uint256 init0, uint256 init1);

    /// @notice function used to get the amount of token0 and token1 sitting
    /// on the position.
    /// @return amount0 the amount of token0 sitting on the position.
    /// @return amount1 the amount of token1 sitting on the position.
    function totalUnderlying()
        external
        view
        returns (uint256 amount0, uint256 amount1);

    /// @notice function used to get the amounts of token0 and token1 sitting
    /// on the position for a specific price.
    /// @param priceX96_ price at which we want to simulate our tokens composition
    /// @return amount0 the amount of token0 sitting on the position for priceX96.
    /// @return amount1 the amount of token1 sitting on the position for priceX96.
    function totalUnderlyingAtPrice(uint160 priceX96_)
        external
        view
        returns (uint256 amount0, uint256 amount1);

    /// @notice function used to validate if module state is not manipulated
    /// before rebalance.
    /// @param oracle_ oracle that will used to check internal state.
    /// @param maxDeviation_ maximum deviation allowed.
    function validateRebalance(
        IOracleWrapper oracle_,
        uint24 maxDeviation_
    ) external view;

    // #endregion view function.
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

/// @title IModuleRegistry
/// @author Arrakis Team.
/// @notice interface of module registry that contains all whitelisted modules.
interface IModuleRegistry {
    // #region errors.

    error AddressZero();
    error AlreadyWhitelistedBeacon(address beacon);
    error NotAlreadyWhitelistedBeacon(address beacon);
    error NotWhitelistedBeacon();
    error NotBeacon();
    error ModuleNotLinkedToMetaVault();
    error NotSameGuardian();
    error NotSameAdmin();

    // #endregion errors.

    // #region events.

    /// @notice Log whitelist action of beacons.
    /// @param beacons list of beacons whitelisted.
    event LogWhitelistBeacons(address[] beacons);
    /// @notice Log blacklist action of beacons.
    /// @param beacons list of beacons blacklisted.
    event LogBlacklistBeacons(address[] beacons);

    // #endregion events.

    // #region view functions.

    /// @notice function to get the whitelisted list of IBeacon
    /// that have module as implementation.
    /// @return beacons list of upgradeable beacon.
    function beacons()
        external
        view
        returns (address[] memory beacons);

    /// @notice function to know if the beacons enumerableSet contain
    /// beacon_
    /// @param beacon_ beacon address to check
    /// @param isContained is true if beacon_ is whitelisted.
    function beaconsContains(address beacon_)
        external
        view
        returns (bool isContained);

    /// @notice function used to get the guardian address of arrakis protocol.
    /// @return guardian address of the pauser.
    function guardian() external view returns (address);

    /// @notice function used to get the admin address that can
    /// upgrade beacon implementation.
    /// @dev admin address should be a timelock contract.
    /// @return admin address that can upgrade beacon implementation.
    function admin() external view returns (address);

    // #endregion view functions.

    // #region state modifying functions.

    /// @dev function used to initialize module registry.
    /// @param factory_ address of ArrakisMetaVaultFactory,
    ///  who is the only one who can call the init management function.
    function initialize(address factory_) external;

    /// @notice function used to whitelist IBeacon  that contain
    /// implementation of valid module.
    /// @param beacons_ list of beacon to whitelist.
    function whitelistBeacons(address[] calldata beacons_) external;

    /// @notice function used to blacklist IBeacon that contain
    /// implementation of unvalid (from now) module.
    /// @param beacons_ list of beacon to blacklist.
    function blacklistBeacons(address[] calldata beacons_) external;

    /// @notice function used to create module instance that can be
    /// whitelisted as module inside a vault.
    /// @param beacon_ which whitelisted beacon's implementation we want to
    /// create an instance of.
    /// @param payload_ payload to create the module.
    function createModule(
        address vault_,
        address beacon_,
        bytes calldata payload_
    ) external returns (address module);

    // #endregion state modifying functions.
}

File 12 of 19 : CArrakis.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

uint256 constant MINIMUM_LIQUIDITY = 10 ** 3;
uint256 constant BASE = 1e18;
uint24 constant PIPS = 1_000_000;
uint24 constant TEN_PERCENT = 100_000;
uint256 constant WEEK = 604_800;
address constant NATIVE_COIN =
    0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
uint8 constant NATIVE_COIN_DECIMALS = 18;

// 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;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.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) || (!AddressUpgradeable.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;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

interface IOracleWrapper {
    // #region errors.

    error AddressZero();
    error DecimalsToken0Zero();
    error DecimalsToken1Zero();

    // #endregion errors.

    /// @notice function used to get price0.
    /// @return price0 price of token0/token1.
    function getPrice0() external view returns (uint256 price0);

    /// @notice function used to get price1.
    /// @return price1 price of token1/token0.
    function getPrice1() external view returns (uint256 price1);
}

// 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 AddressUpgradeable {
    /**
     * @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);
        }
    }
}

// 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);
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@solady/contracts/=lib/solady/src/",
    "@create3/contracts/=lib/create3/contracts/",
    "@v3-lib-0.8/contracts/=lib/v3-lib-0.8/contracts/",
    "forge-std/=lib/forge-std/src/",
    "@valantis-hot/contracts/=lib/valantis-hot/src/",
    "@valantis-core/contracts/=lib/valantis-hot/lib/valantis-core/src/",
    "@valantis-hot/contracts-test/=lib/valantis-hot/test/",
    "@uniswap/v4-core/=lib/v4-periphery/lib/v4-core/",
    "@uniswap/v4-periphery/=lib/v4-periphery/",
    "@ensdomains/=lib/v4-periphery/lib/v4-core/node_modules/@ensdomains/",
    "@uniswap/v3-core/=lib/valantis-hot/lib/v3-core/",
    "@uniswap/v3-periphery/=lib/valantis-hot/lib/v3-periphery/",
    "create3/=lib/create3/contracts/",
    "doppler-hook/=lib/doppler-hook/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-gas-snapshot/=lib/v4-periphery/lib/forge-gas-snapshot/src/",
    "halmos-cheatcodes/=lib/infinity-core/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "hardhat/=lib/v4-periphery/lib/v4-core/node_modules/hardhat/",
    "infinity-core/=lib/infinity-core/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "pancake-create3-factory/=lib/infinity-core/lib/pancake-create3-factory/",
    "permit2/=lib/v4-periphery/lib/permit2/",
    "solady/=lib/solady/",
    "solmate/=lib/infinity-core/lib/solmate/",
    "v3-core/=lib/valantis-hot/lib/v3-core/contracts/",
    "v3-lib-0.8/=lib/v3-lib-0.8/contracts/",
    "v3-periphery/=lib/valantis-hot/lib/v3-periphery/contracts/",
    "v4-core/=lib/v4-periphery/lib/v4-core/src/",
    "v4-periphery/=lib/v4-periphery/",
    "valantis-core/=lib/valantis-hot/lib/valantis-core/",
    "valantis-hot/=lib/valantis-hot/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 10000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"moduleRegistry_","type":"address"},{"internalType":"address","name":"manager_","type":"address"},{"internalType":"address","name":"token0_","type":"address"},{"internalType":"address","name":"token1_","type":"address"},{"internalType":"address","name":"nft_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ActiveModule","type":"error"},{"inputs":[{"internalType":"string","name":"property","type":"string"}],"name":"AddressZero","type":"error"},{"inputs":[{"internalType":"address","name":"module","type":"address"}],"name":"AlreadyWhitelisted","type":"error"},{"inputs":[],"name":"ArrayNotSameLength","type":"error"},{"inputs":[],"name":"BurnOverflow","type":"error"},{"inputs":[],"name":"BurnZero","type":"error"},{"inputs":[],"name":"CallFailed","type":"error"},{"inputs":[],"name":"DepositorAlreadyWhitelisted","type":"error"},{"inputs":[],"name":"MintZero","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"ModuleNotEmpty","type":"error"},{"inputs":[],"name":"NotAlreadyWhitelistedDepositor","type":"error"},{"inputs":[],"name":"NotImplemented","type":"error"},{"inputs":[],"name":"NotPositionInitializationCall","type":"error"},{"inputs":[],"name":"NotSameGuardian","type":"error"},{"inputs":[],"name":"NotWhitelistedBeacon","type":"error"},{"inputs":[{"internalType":"address","name":"module","type":"address"}],"name":"NotWhitelistedModule","type":"error"},{"inputs":[],"name":"OnlyDepositor","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"manager","type":"address"}],"name":"OnlyManager","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[],"name":"PositionNotInitialized","type":"error"},{"inputs":[],"name":"SameManager","type":"error"},{"inputs":[],"name":"SameModule","type":"error"},{"inputs":[],"name":"Token0EqToken1","type":"error"},{"inputs":[],"name":"Token0GtToken1","type":"error"},{"inputs":[],"name":"WithdrawNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"modules","type":"address[]"}],"name":"LogBlackListedModules","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"depositors","type":"address[]"}],"name":"LogBlacklistDepositors","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"LogDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"module","type":"address"}],"name":"LogSetFirstModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"manager","type":"address"}],"name":"LogSetManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"module","type":"address"},{"indexed":false,"internalType":"bytes[]","name":"payloads","type":"bytes[]"}],"name":"LogSetModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"modules","type":"address[]"}],"name":"LogWhiteListedModules","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"depositors","type":"address[]"}],"name":"LogWhitelistDepositors","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"module","type":"address"}],"name":"LogWhitelistedModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"proportion","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"LogWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"LogWithdrawManagerBalance","type":"event"},{"inputs":[{"internalType":"address[]","name":"depositors_","type":"address[]"}],"name":"blacklistDepositors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"modules_","type":"address[]"}],"name":"blacklistModules","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0_","type":"uint256"},{"internalType":"uint256","name":"amount1_","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"depositors","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInits","outputs":[{"internalType":"uint256","name":"init0","type":"uint256"},{"internalType":"uint256","name":"init1","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"module_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"module","outputs":[{"internalType":"contract IArrakisLPModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"moduleRegistry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nft","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"module_","type":"address"},{"internalType":"bytes[]","name":"payloads_","type":"bytes[]"}],"name":"setModule","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":"totalUnderlying","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint160","name":"priceX96_","type":"uint160"}],"name":"totalUnderlyingAtPrice","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"depositors_","type":"address[]"}],"name":"whitelistDepositors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"beacons_","type":"address[]"},{"internalType":"bytes[]","name":"data_","type":"bytes[]"}],"name":"whitelistModules","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"whitelistedModules","outputs":[{"internalType":"address[]","name":"modules","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"proportion_","type":"uint256"},{"internalType":"address","name":"receiver_","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

0x6101206040523480156200001257600080fd5b50604051620028463803806200284683398101604081905262000035916200028b565b6001600055848484846001600160a01b0384166200008d5760405163c5dbe6e760e01b815260206004820152600f60248201526e4d6f64756c6520526567697374727960881b60448201526064015b60405180910390fd5b6001600160a01b038316620000d05760405163c5dbe6e760e01b815260206004820152600760248201526626b0b730b3b2b960c91b604482015260640162000084565b6001600160a01b038216620001135760405163c5dbe6e760e01b81526020600482015260076024820152660546f6b656e20360cc1b604482015260640162000084565b6001600160a01b038116620001565760405163c5dbe6e760e01b8152602060048201526007602482015266546f6b656e203160c81b604482015260640162000084565b806001600160a01b0316826001600160a01b031611156200018a576040516331fdd40160e11b815260040160405180910390fd5b806001600160a01b0316826001600160a01b031603620001bd576040516307ad028d60e31b815260040160405180910390fd5b6001600160a01b0384811660805283811660e081905283821660a05290821660c0526040519081527f9b6ffaf4cbfd923495440b7f17ced9394289f001b3ead53ab67e2c3f3e39b0f59060200160405180910390a15050506001600160a01b0382169050620002565760405163c5dbe6e760e01b815260206004820152600360248201526213919560ea1b604482015260640162000084565b6001600160a01b03166101005250620002fb92505050565b80516001600160a01b03811681146200028657600080fd5b919050565b600080600080600060a08688031215620002a457600080fd5b620002af866200026e565b9450620002bf602087016200026e565b9350620002cf604087016200026e565b9250620002df606087016200026e565b9150620002ef608087016200026e565b90509295509295909350565b60805160a05160c05160e051610100516124e3620003636000396000818161024a01528181610d75015261154e01526000818161027e0152818161064001526106a80152600061040f015260006101af0152600081816103910152610bc201526124e36000f3fe60806040526004361061015e5760003560e01c8063aaa46688116100c0578063c6b2934711610074578063d21220a711610059578063d21220a7146103fd578063dc57b9ad14610431578063e2bbb1581461045157600080fd5b8063c6b29347146103d3578063c70920bc146103e857600080fd5b8063b86d5298116100a5578063b86d52981461034c578063b95459e41461037f578063c4d66de8146103b357600080fd5b8063aaa4668814610317578063acecf6f51461032c57600080fd5b8063481c6a75116101175780638d62cce2116100fc5780638d62cce2146102c25780638da5cb5b146102e2578063951f1f09146102f757600080fd5b8063481c6a751461026c57806355b80e47146102a057600080fd5b806325353c441161014857806325353c44146101f65780632b1ba4f11461021857806347ccca021461023857600080fd5b8062f714ce146101635780630dfe16811461019d575b600080fd5b34801561016f57600080fd5b5061018361017e366004611ddb565b610464565b604080519283526020830191909152015b60405180910390f35b3480156101a957600080fd5b506101d17f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610194565b34801561020257600080fd5b50610216610211366004611e57565b6104c6565b005b34801561022457600080fd5b50610216610233366004611e99565b610628565b34801561024457600080fd5b506101d17f000000000000000000000000000000000000000000000000000000000000000081565b34801561027857600080fd5b506101d17f000000000000000000000000000000000000000000000000000000000000000081565b3480156102ac57600080fd5b506102b5610b19565b6040516101949190611eee565b3480156102ce57600080fd5b506102166102dd366004611f48565b610b2a565b3480156102ee57600080fd5b506101d1610d44565b34801561030357600080fd5b50610216610312366004611e57565b610df5565b34801561032357600080fd5b506102b5610f39565b34801561033857600080fd5b50610183610347366004611fb4565b610f45565b34801561035857600080fd5b506001546101d19062010000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561038b57600080fd5b506101d17f000000000000000000000000000000000000000000000000000000000000000081565b3480156103bf57600080fd5b506102166103ce366004611fb4565b610fed565b3480156103df57600080fd5b506101836112c3565b3480156103f457600080fd5b5061018361135e565b34801561040957600080fd5b506101d17f000000000000000000000000000000000000000000000000000000000000000081565b34801561043d57600080fd5b5061021661044c366004611e57565b6113cd565b61021661045f366004611fd1565b61149f565b60008061046f611520565b6104798385611634565b604080518781526020810184905290810182905291935091507f3228bf4a0d547ed34051296b931fce02a1927888b6bc3dfbb85395d0cca1e9e09060600160405180910390a19250929050565b6104ce611520565b8060005b818110156105e95760008484838181106104ee576104ee611ff3565b90506020020160208101906105039190611fb4565b905073ffffffffffffffffffffffffffffffffffffffff8116610587576040517fc5dbe6e700000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4465706f7369746f72000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6105926004826116e7565b156105c9576040517f7671d4e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105d460048261171b565b505080806105e190612051565b9150506104d2565b507f5c9265672925c5544e4d535af6d0684ea57e4cd95c7e707253c189c37de03c59838360405161061b929190612089565b60405180910390a1505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146106d5576040517f59c8c6cc00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016602482015260440161057e565b6106dd61173d565b60015473ffffffffffffffffffffffffffffffffffffffff6201000090910481169084168103610739576040517fde832e2d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107446002856116e7565b610792576040517f7b76a60e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240161057e565b600180547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8716021790556107e0816117b0565b50506040517ff3fef3a300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152670de0b6b3a7640000602483015282169063f3fef3a39060440160408051808303816000875af115801561085d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088191906120e4565b5082905060008190036108c0576040517fe45b643c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848460008181106108d5576108d5611ff3565b90506020028101906108e79190612108565b6108f69160049160009161216d565b6108ff91612197565b90507fffffffff0000000000000000000000000000000000000000000000000000000081167fc40394d3000000000000000000000000000000000000000000000000000000001461097c576040517f77ee77a400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109df868686600081811061099357610993611ff3565b90506020028101906109a59190612108565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061186792505050565b60015b82811015610acb578585828181106109fc576109fc611ff3565b9050602002810190610a0e9190612108565b610a1d9160049160009161216d565b610a2691612197565b91507fffffffff0000000000000000000000000000000000000000000000000000000082167ff3fef3a30000000000000000000000000000000000000000000000000000000003610aa3576040517f15e34e0500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ab98787878481811061099357610993611ff3565b80610ac381612051565b9150506109e2565b507f098a4cb3597f0b783d955415cf1025a9452365cac4dcddca246a394e73cca90a868686604051610aff93929190612228565b60405180910390a1505050610b146001600055565b505050565b6060610b25600261190b565b905090565b610b32611520565b82818114610b6c576040517f261f2a5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff811115610b8757610b87612321565b604051908082528060200260200182016040528015610bb0578160200160208202803683370190505b50905060005b82811015610d045760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663455f4bb1308a8a86818110610c0f57610c0f611ff3565b9050602002016020810190610c249190611fb4565b898987818110610c3657610c36611ff3565b9050602002810190610c489190612108565b6040518563ffffffff1660e01b8152600401610c679493929190612350565b6020604051808303816000875af1158015610c86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610caa9190612394565b905080838381518110610cbf57610cbf611ff3565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152610cef60028261171b565b50508080610cfc90612051565b915050610bb6565b507f0936fa8fc79e7acdb2f5db0618a6355fdda409b0e5b17e3be004be15bcf4c88481604051610d349190611eee565b60405180910390a1505050505050565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015610dd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b259190612394565b610dfd611520565b8060005b81811015610f07576000848483818110610e1d57610e1d611ff3565b9050602002016020810190610e329190611fb4565b9050610e3f6002826116e7565b610e8d576040517f7b76a60e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161057e565b60015473ffffffffffffffffffffffffffffffffffffffff808316620100009092041603610ee7576040517ffafd81f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ef260028261191f565b50508080610eff90612051565b915050610e01565b507fbb08f8051cd2fa9d17f2636a7cf104cf87e85218c2a9061b0ade4fc5d013f328838360405161061b929190612089565b6060610b25600461190b565b6001546040517facecf6f500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526000928392620100009091049091169063acecf6f5906024016040805180830381865afa158015610fc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe491906120e4565b91509150915091565b600154610100900460ff161580801561100a57506001805460ff16105b806110235750303b15801561102357506001805460ff16145b6110af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161057e565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001681179055801561110c57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff8216611189576040517fc5dbe6e700000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4d6f64756c650000000000000000000000000000000000000000000000000000604482015260640161057e565b61119460028361171b565b50600180547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8516908102919091179091556040519081527fc36d7d831827b79e3044eab60b0e78bcbddb1e832fdd0e848aa633471f7a2dce9060200160405180910390a160405173ffffffffffffffffffffffffffffffffffffffff831681527ff2b7116a60dcb1f53337287d3735fc1ac1b053cc3fd07d605588cc1a879c0df09060200160405180910390a180156112bf57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b5050565b600080600160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c6b293476040518163ffffffff1660e01b81526004016040805180830381865afa158015611332573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135691906120e4565b915091509091565b600080600160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c70920bc6040518163ffffffff1660e01b81526004016040805180830381865afa158015611332573d6000803e3d6000fd5b6113d5611520565b8060005b8181101561146d5760008484838181106113f5576113f5611ff3565b905060200201602081019061140a9190611fb4565b90506114176004826116e7565b61144d576040517fb256e8f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61145860048261191f565b5050808061146590612051565b9150506113d9565b507fb0cb71a9d9fcb2642936172f746fc80597811e946a534ba1b0e218963a2f2f02838360405161061b929190612089565b6114aa6004336116e7565b6114e0576040517fce8c104800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114ea8282611941565b60408051838152602081018390527f1f38c0b96f5f251e5fb679ab3fb88695fb7ed9698d9d13fa8599de3bf0fd647991016112b6565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa1580156115aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ce9190612394565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611632576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6001546040517ff3fef3a300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526000928392620100009091049091169063f3fef3a39060440160408051808303816000875af11580156116b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116dc91906120e4565b909590945092505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b90505b92915050565b60006117128373ffffffffffffffffffffffffffffffffffffffff84166119f2565b6002600054036117a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161057e565b6002600055565b6000808273ffffffffffffffffffffffffffffffffffffffff16637ecd67176040518163ffffffff1660e01b815260040160408051808303816000875af11580156117ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182391906120e4565b60408051838152602081018390529294509092507fa292e28c648da34e20b372054caab5f0359198b3b4d5f0ef9945d4616e15dc97910160405180910390a1915091565b60008273ffffffffffffffffffffffffffffffffffffffff168260405161188e91906123d5565b6000604051808303816000865af19150503d80600081146118cb576040519150601f19603f3d011682016040523d82523d6000602084013e6118d0565b606091505b5050905080610b14576040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060600061191883611a41565b9392505050565b60006117128373ffffffffffffffffffffffffffffffffffffffff8416611a9d565b61194961173d565b604080513360248201526044810184905260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0af6ce85000000000000000000000000000000000000000000000000000000001790526001546119e69062010000900473ffffffffffffffffffffffffffffffffffffffff168234611b90565b50506112bf6001600055565b6000818152600183016020526040812054611a3957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611715565b506000611715565b606081600001805480602002602001604051908101604052809291908181526020018280548015611a9157602002820191906000526020600020905b815481526020019060010190808311611a7d575b50505050509050919050565b60008181526001830160205260408120548015611b86576000611ac16001836123f1565b8554909150600090611ad5906001906123f1565b9050818114611b3a576000866000018281548110611af557611af5611ff3565b9060005260206000200154905080876000018481548110611b1857611b18611ff3565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611b4b57611b4b612404565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611715565b6000915050611715565b6060611bb684848460405180606001604052806029815260200161248560299139611bbe565b949350505050565b606082471015611c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161057e565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611c7991906123d5565b60006040518083038185875af1925050503d8060008114611cb6576040519150601f19603f3d011682016040523d82523d6000602084013e611cbb565b606091505b5091509150611ccc87838387611cd7565b979650505050505050565b60608315611d6d578251600003611d665773ffffffffffffffffffffffffffffffffffffffff85163b611d66576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161057e565b5081611bb6565b611bb68383815115611d825781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057e9190612433565b73ffffffffffffffffffffffffffffffffffffffff81168114611dd857600080fd5b50565b60008060408385031215611dee57600080fd5b823591506020830135611e0081611db6565b809150509250929050565b60008083601f840112611e1d57600080fd5b50813567ffffffffffffffff811115611e3557600080fd5b6020830191508360208260051b8501011115611e5057600080fd5b9250929050565b60008060208385031215611e6a57600080fd5b823567ffffffffffffffff811115611e8157600080fd5b611e8d85828601611e0b565b90969095509350505050565b600080600060408486031215611eae57600080fd5b8335611eb981611db6565b9250602084013567ffffffffffffffff811115611ed557600080fd5b611ee186828701611e0b565b9497909650939450505050565b6020808252825182820181905260009190848201906040850190845b81811015611f3c57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611f0a565b50909695505050505050565b60008060008060408587031215611f5e57600080fd5b843567ffffffffffffffff80821115611f7657600080fd5b611f8288838901611e0b565b90965094506020870135915080821115611f9b57600080fd5b50611fa887828801611e0b565b95989497509550505050565b600060208284031215611fc657600080fd5b813561191881611db6565b60008060408385031215611fe457600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361208257612082612022565b5060010190565b60208082528181018390526000908460408401835b868110156120d95782356120b181611db6565b73ffffffffffffffffffffffffffffffffffffffff168252918301919083019060010161209e565b509695505050505050565b600080604083850312156120f757600080fd5b505080516020909101519092909150565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261213d57600080fd5b83018035915067ffffffffffffffff82111561215857600080fd5b602001915036819003821315611e5057600080fd5b6000808585111561217d57600080fd5b8386111561218a57600080fd5b5050820193919092039150565b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156121d75780818660040360031b1b83161692505b505092915050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60006040820173ffffffffffffffffffffffffffffffffffffffff8616835260206040818501528185835260608501905060608660051b86010192508660005b87811015612313577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa087860301835281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18a36030181126122c957600080fd5b8901848101903567ffffffffffffffff8111156122e557600080fd5b8036038213156122f457600080fd5b6122ff8782846121df565b965050509183019190830190600101612268565b509298975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600073ffffffffffffffffffffffffffffffffffffffff80871683528086166020840152506060604083015261238a6060830184866121df565b9695505050505050565b6000602082840312156123a657600080fd5b815161191881611db6565b60005b838110156123cc5781810151838201526020016123b4565b50506000910152565b600082516123e78184602087016123b1565b9190910192915050565b8181038181111561171557611715612022565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60208152600082518060208401526124528160408501602087016123b1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a2646970667358221220479952d7e3df527150cdf9fb29dfc3d8f12a48267c3ded6835fdff422761367964736f6c63430008130033000000000000000000000000e278c1944ba3321c1079abf94961e9ff1127a2650000000000000000000000002e6e879648293e939aa68ba4c6c129a1be733bda0000000000000000000000006ba19ee69d5dde3ab70185c801fa404f66fedb58000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000044a801e7e2e073bd8bce4bccf653239fa156b762

Deployed Bytecode

0x60806040526004361061015e5760003560e01c8063aaa46688116100c0578063c6b2934711610074578063d21220a711610059578063d21220a7146103fd578063dc57b9ad14610431578063e2bbb1581461045157600080fd5b8063c6b29347146103d3578063c70920bc146103e857600080fd5b8063b86d5298116100a5578063b86d52981461034c578063b95459e41461037f578063c4d66de8146103b357600080fd5b8063aaa4668814610317578063acecf6f51461032c57600080fd5b8063481c6a75116101175780638d62cce2116100fc5780638d62cce2146102c25780638da5cb5b146102e2578063951f1f09146102f757600080fd5b8063481c6a751461026c57806355b80e47146102a057600080fd5b806325353c441161014857806325353c44146101f65780632b1ba4f11461021857806347ccca021461023857600080fd5b8062f714ce146101635780630dfe16811461019d575b600080fd5b34801561016f57600080fd5b5061018361017e366004611ddb565b610464565b604080519283526020830191909152015b60405180910390f35b3480156101a957600080fd5b506101d17f0000000000000000000000006ba19ee69d5dde3ab70185c801fa404f66fedb5881565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610194565b34801561020257600080fd5b50610216610211366004611e57565b6104c6565b005b34801561022457600080fd5b50610216610233366004611e99565b610628565b34801561024457600080fd5b506101d17f00000000000000000000000044a801e7e2e073bd8bce4bccf653239fa156b76281565b34801561027857600080fd5b506101d17f0000000000000000000000002e6e879648293e939aa68ba4c6c129a1be733bda81565b3480156102ac57600080fd5b506102b5610b19565b6040516101949190611eee565b3480156102ce57600080fd5b506102166102dd366004611f48565b610b2a565b3480156102ee57600080fd5b506101d1610d44565b34801561030357600080fd5b50610216610312366004611e57565b610df5565b34801561032357600080fd5b506102b5610f39565b34801561033857600080fd5b50610183610347366004611fb4565b610f45565b34801561035857600080fd5b506001546101d19062010000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561038b57600080fd5b506101d17f000000000000000000000000e278c1944ba3321c1079abf94961e9ff1127a26581565b3480156103bf57600080fd5b506102166103ce366004611fb4565b610fed565b3480156103df57600080fd5b506101836112c3565b3480156103f457600080fd5b5061018361135e565b34801561040957600080fd5b506101d17f000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561043d57600080fd5b5061021661044c366004611e57565b6113cd565b61021661045f366004611fd1565b61149f565b60008061046f611520565b6104798385611634565b604080518781526020810184905290810182905291935091507f3228bf4a0d547ed34051296b931fce02a1927888b6bc3dfbb85395d0cca1e9e09060600160405180910390a19250929050565b6104ce611520565b8060005b818110156105e95760008484838181106104ee576104ee611ff3565b90506020020160208101906105039190611fb4565b905073ffffffffffffffffffffffffffffffffffffffff8116610587576040517fc5dbe6e700000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4465706f7369746f72000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6105926004826116e7565b156105c9576040517f7671d4e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105d460048261171b565b505080806105e190612051565b9150506104d2565b507f5c9265672925c5544e4d535af6d0684ea57e4cd95c7e707253c189c37de03c59838360405161061b929190612089565b60405180910390a1505050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000002e6e879648293e939aa68ba4c6c129a1be733bda16146106d5576040517f59c8c6cc00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000002e6e879648293e939aa68ba4c6c129a1be733bda16602482015260440161057e565b6106dd61173d565b60015473ffffffffffffffffffffffffffffffffffffffff6201000090910481169084168103610739576040517fde832e2d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107446002856116e7565b610792576040517f7b76a60e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240161057e565b600180547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8716021790556107e0816117b0565b50506040517ff3fef3a300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152670de0b6b3a7640000602483015282169063f3fef3a39060440160408051808303816000875af115801561085d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088191906120e4565b5082905060008190036108c0576040517fe45b643c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848460008181106108d5576108d5611ff3565b90506020028101906108e79190612108565b6108f69160049160009161216d565b6108ff91612197565b90507fffffffff0000000000000000000000000000000000000000000000000000000081167fc40394d3000000000000000000000000000000000000000000000000000000001461097c576040517f77ee77a400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109df868686600081811061099357610993611ff3565b90506020028101906109a59190612108565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061186792505050565b60015b82811015610acb578585828181106109fc576109fc611ff3565b9050602002810190610a0e9190612108565b610a1d9160049160009161216d565b610a2691612197565b91507fffffffff0000000000000000000000000000000000000000000000000000000082167ff3fef3a30000000000000000000000000000000000000000000000000000000003610aa3576040517f15e34e0500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ab98787878481811061099357610993611ff3565b80610ac381612051565b9150506109e2565b507f098a4cb3597f0b783d955415cf1025a9452365cac4dcddca246a394e73cca90a868686604051610aff93929190612228565b60405180910390a1505050610b146001600055565b505050565b6060610b25600261190b565b905090565b610b32611520565b82818114610b6c576040517f261f2a5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff811115610b8757610b87612321565b604051908082528060200260200182016040528015610bb0578160200160208202803683370190505b50905060005b82811015610d045760007f000000000000000000000000e278c1944ba3321c1079abf94961e9ff1127a26573ffffffffffffffffffffffffffffffffffffffff1663455f4bb1308a8a86818110610c0f57610c0f611ff3565b9050602002016020810190610c249190611fb4565b898987818110610c3657610c36611ff3565b9050602002810190610c489190612108565b6040518563ffffffff1660e01b8152600401610c679493929190612350565b6020604051808303816000875af1158015610c86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610caa9190612394565b905080838381518110610cbf57610cbf611ff3565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152610cef60028261171b565b50508080610cfc90612051565b915050610bb6565b507f0936fa8fc79e7acdb2f5db0618a6355fdda409b0e5b17e3be004be15bcf4c88481604051610d349190611eee565b60405180910390a1505050505050565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000044a801e7e2e073bd8bce4bccf653239fa156b76273ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015610dd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b259190612394565b610dfd611520565b8060005b81811015610f07576000848483818110610e1d57610e1d611ff3565b9050602002016020810190610e329190611fb4565b9050610e3f6002826116e7565b610e8d576040517f7b76a60e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240161057e565b60015473ffffffffffffffffffffffffffffffffffffffff808316620100009092041603610ee7576040517ffafd81f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ef260028261191f565b50508080610eff90612051565b915050610e01565b507fbb08f8051cd2fa9d17f2636a7cf104cf87e85218c2a9061b0ade4fc5d013f328838360405161061b929190612089565b6060610b25600461190b565b6001546040517facecf6f500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526000928392620100009091049091169063acecf6f5906024016040805180830381865afa158015610fc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe491906120e4565b91509150915091565b600154610100900460ff161580801561100a57506001805460ff16105b806110235750303b15801561102357506001805460ff16145b6110af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161057e565b600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001681179055801561110c57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b73ffffffffffffffffffffffffffffffffffffffff8216611189576040517fc5dbe6e700000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f4d6f64756c650000000000000000000000000000000000000000000000000000604482015260640161057e565b61119460028361171b565b50600180547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8516908102919091179091556040519081527fc36d7d831827b79e3044eab60b0e78bcbddb1e832fdd0e848aa633471f7a2dce9060200160405180910390a160405173ffffffffffffffffffffffffffffffffffffffff831681527ff2b7116a60dcb1f53337287d3735fc1ac1b053cc3fd07d605588cc1a879c0df09060200160405180910390a180156112bf57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b5050565b600080600160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c6b293476040518163ffffffff1660e01b81526004016040805180830381865afa158015611332573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135691906120e4565b915091509091565b600080600160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c70920bc6040518163ffffffff1660e01b81526004016040805180830381865afa158015611332573d6000803e3d6000fd5b6113d5611520565b8060005b8181101561146d5760008484838181106113f5576113f5611ff3565b905060200201602081019061140a9190611fb4565b90506114176004826116e7565b61144d576040517fb256e8f900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61145860048261191f565b5050808061146590612051565b9150506113d9565b507fb0cb71a9d9fcb2642936172f746fc80597811e946a534ba1b0e218963a2f2f02838360405161061b929190612089565b6114aa6004336116e7565b6114e0576040517fce8c104800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114ea8282611941565b60408051838152602081018390527f1f38c0b96f5f251e5fb679ab3fb88695fb7ed9698d9d13fa8599de3bf0fd647991016112b6565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000044a801e7e2e073bd8bce4bccf653239fa156b76273ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa1580156115aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ce9190612394565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611632576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6001546040517ff3fef3a300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490526000928392620100009091049091169063f3fef3a39060440160408051808303816000875af11580156116b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116dc91906120e4565b909590945092505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260018301602052604081205415155b90505b92915050565b60006117128373ffffffffffffffffffffffffffffffffffffffff84166119f2565b6002600054036117a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161057e565b6002600055565b6000808273ffffffffffffffffffffffffffffffffffffffff16637ecd67176040518163ffffffff1660e01b815260040160408051808303816000875af11580156117ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182391906120e4565b60408051838152602081018390529294509092507fa292e28c648da34e20b372054caab5f0359198b3b4d5f0ef9945d4616e15dc97910160405180910390a1915091565b60008273ffffffffffffffffffffffffffffffffffffffff168260405161188e91906123d5565b6000604051808303816000865af19150503d80600081146118cb576040519150601f19603f3d011682016040523d82523d6000602084013e6118d0565b606091505b5050905080610b14576040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060600061191883611a41565b9392505050565b60006117128373ffffffffffffffffffffffffffffffffffffffff8416611a9d565b61194961173d565b604080513360248201526044810184905260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0af6ce85000000000000000000000000000000000000000000000000000000001790526001546119e69062010000900473ffffffffffffffffffffffffffffffffffffffff168234611b90565b50506112bf6001600055565b6000818152600183016020526040812054611a3957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611715565b506000611715565b606081600001805480602002602001604051908101604052809291908181526020018280548015611a9157602002820191906000526020600020905b815481526020019060010190808311611a7d575b50505050509050919050565b60008181526001830160205260408120548015611b86576000611ac16001836123f1565b8554909150600090611ad5906001906123f1565b9050818114611b3a576000866000018281548110611af557611af5611ff3565b9060005260206000200154905080876000018481548110611b1857611b18611ff3565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611b4b57611b4b612404565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611715565b6000915050611715565b6060611bb684848460405180606001604052806029815260200161248560299139611bbe565b949350505050565b606082471015611c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161057e565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611c7991906123d5565b60006040518083038185875af1925050503d8060008114611cb6576040519150601f19603f3d011682016040523d82523d6000602084013e611cbb565b606091505b5091509150611ccc87838387611cd7565b979650505050505050565b60608315611d6d578251600003611d665773ffffffffffffffffffffffffffffffffffffffff85163b611d66576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161057e565b5081611bb6565b611bb68383815115611d825781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057e9190612433565b73ffffffffffffffffffffffffffffffffffffffff81168114611dd857600080fd5b50565b60008060408385031215611dee57600080fd5b823591506020830135611e0081611db6565b809150509250929050565b60008083601f840112611e1d57600080fd5b50813567ffffffffffffffff811115611e3557600080fd5b6020830191508360208260051b8501011115611e5057600080fd5b9250929050565b60008060208385031215611e6a57600080fd5b823567ffffffffffffffff811115611e8157600080fd5b611e8d85828601611e0b565b90969095509350505050565b600080600060408486031215611eae57600080fd5b8335611eb981611db6565b9250602084013567ffffffffffffffff811115611ed557600080fd5b611ee186828701611e0b565b9497909650939450505050565b6020808252825182820181905260009190848201906040850190845b81811015611f3c57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611f0a565b50909695505050505050565b60008060008060408587031215611f5e57600080fd5b843567ffffffffffffffff80821115611f7657600080fd5b611f8288838901611e0b565b90965094506020870135915080821115611f9b57600080fd5b50611fa887828801611e0b565b95989497509550505050565b600060208284031215611fc657600080fd5b813561191881611db6565b60008060408385031215611fe457600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361208257612082612022565b5060010190565b60208082528181018390526000908460408401835b868110156120d95782356120b181611db6565b73ffffffffffffffffffffffffffffffffffffffff168252918301919083019060010161209e565b509695505050505050565b600080604083850312156120f757600080fd5b505080516020909101519092909150565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261213d57600080fd5b83018035915067ffffffffffffffff82111561215857600080fd5b602001915036819003821315611e5057600080fd5b6000808585111561217d57600080fd5b8386111561218a57600080fd5b5050820193919092039150565b7fffffffff0000000000000000000000000000000000000000000000000000000081358181169160048510156121d75780818660040360031b1b83161692505b505092915050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60006040820173ffffffffffffffffffffffffffffffffffffffff8616835260206040818501528185835260608501905060608660051b86010192508660005b87811015612313577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa087860301835281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18a36030181126122c957600080fd5b8901848101903567ffffffffffffffff8111156122e557600080fd5b8036038213156122f457600080fd5b6122ff8782846121df565b965050509183019190830190600101612268565b509298975050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600073ffffffffffffffffffffffffffffffffffffffff80871683528086166020840152506060604083015261238a6060830184866121df565b9695505050505050565b6000602082840312156123a657600080fd5b815161191881611db6565b60005b838110156123cc5781810151838201526020016123b4565b50506000910152565b600082516123e78184602087016123b1565b9190910192915050565b8181038181111561171557611715612022565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60208152600082518060208401526124528160408501602087016123b1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a2646970667358221220479952d7e3df527150cdf9fb29dfc3d8f12a48267c3ded6835fdff422761367964736f6c63430008130033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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.