S Price: $0.068191 (+2.07%)

Contract

0xfF97A100c4D731A533B0683AD1f957f55fd1a8e3

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Fuse Collector582052892025-12-17 23:18:0540 days ago1766013485IN
0xfF97A100...55fd1a8e3
0 S0.0245085550
Fuse Collector582019502025-12-17 22:17:5740 days ago1766009877IN
0xfF97A100...55fd1a8e3
0 S0.025319150
Fuse Collector581982752025-12-17 21:17:4840 days ago1766006268IN
0xfF97A100...55fd1a8e3
0 S0.024246750
Fuse Collector581942722025-12-17 20:17:3940 days ago1766002659IN
0xfF97A100...55fd1a8e3
0 S0.0331484968.1
Burn Fuse581938642025-12-17 20:12:2940 days ago1766002349IN
0xfF97A100...55fd1a8e3
0 S0.0162937550
Fuse Collector581903782025-12-17 19:17:3440 days ago1765999054IN
0xfF97A100...55fd1a8e3
0 S0.0301943562.03333333
Fuse Collector581858302025-12-17 18:17:2940 days ago1765995449IN
0xfF97A100...55fd1a8e3
0 S0.024464350
Fuse Collector581813292025-12-17 17:17:2240 days ago1765991842IN
0xfF97A100...55fd1a8e3
0 S0.0267481854.66666666
Fuse Collector581754532025-12-17 16:17:1040 days ago1765988230IN
0xfF97A100...55fd1a8e3
0 S0.024466450
Fuse Collector581693952025-12-17 15:17:0440 days ago1765984624IN
0xfF97A100...55fd1a8e3
0 S0.020969550
Fuse Collector581634922025-12-17 14:16:5740 days ago1765981017IN
0xfF97A100...55fd1a8e3
0 S0.0480216498.647995
Fuse Collector581634652025-12-17 14:16:4340 days ago1765981003IN
0xfF97A100...55fd1a8e3
0 S0.0251546550
Burn Fuse581632302025-12-17 14:12:2440 days ago1765980744IN
0xfF97A100...55fd1a8e3
0 S0.0223764368.33333333
Fuse Collector581594012025-12-17 13:16:3440 days ago1765977394IN
0xfF97A100...55fd1a8e3
0 S0.0245110550
Fuse Collector581560932025-12-17 12:16:3040 days ago1765973790IN
0xfF97A100...55fd1a8e3
0 S0.0243818550
Fuse Collector581523732025-12-17 11:16:2440 days ago1765970184IN
0xfF97A100...55fd1a8e3
0 S0.024335850
Fuse Collector581488752025-12-17 10:16:1640 days ago1765966576IN
0xfF97A100...55fd1a8e3
0 S0.0243832550
Fuse Collector581456612025-12-17 9:16:0940 days ago1765962969IN
0xfF97A100...55fd1a8e3
0 S0.0245119550
Fuse Collector581427632025-12-17 8:16:0640 days ago1765959366IN
0xfF97A100...55fd1a8e3
0 S0.024461850
Burn Fuse581425862025-12-17 8:12:1840 days ago1765959138IN
0xfF97A100...55fd1a8e3
0 S0.0164160550
Fuse Collector581397482025-12-17 7:15:5340 days ago1765955753IN
0xfF97A100...55fd1a8e3
0 S0.0245110550
Fuse Collector581367792025-12-17 6:15:4740 days ago1765952147IN
0xfF97A100...55fd1a8e3
0 S0.0243859550
Fuse Collector581334232025-12-17 5:15:4140 days ago1765948541IN
0xfF97A100...55fd1a8e3
0 S0.0243843550
Fuse Collector581298402025-12-17 4:15:3640 days ago1765944936IN
0xfF97A100...55fd1a8e3
0 S0.0245103550
Fuse Collector581270942025-12-17 3:15:2941 days ago1765941329IN
0xfF97A100...55fd1a8e3
0 S0.0245112550
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
479113692025-09-23 14:03:30125 days ago1758636210  Contract Creation0 S
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FusionCore

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

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

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

import {ILoopToken} from "./interfaces/ILoopToken.sol";
import {INonfungiblePositionManager} from "./interfaces/INonfungiblePositionManager.sol";
import {IRamsesV3PoolDeployer} from "./interfaces/IRamsesV3PoolDeployer.sol";
import {IRamsesV3Factory} from "./interfaces/IRamsesV3Factory.sol";
import {IRamsesV3Pool} from "./interfaces/IRamsesV3Pool.sol";
import {IRamsesV2Pair} from "./interfaces/IRamsesV2Pair.sol";

import {TickMath} from "./libraries/TickMath.sol";

contract FusionCore is Ownable, ReentrancyGuard {
    struct SwapCallbackData {
        address srcToken;
    }

    /// @dev The contract where POL is locked.
    LiquidityLock public immutable LIQUIDITY_LOCK;

    /// @dev LBP is always token0 in the pool.
    ILoopToken public immutable LFD;

    /// @dev MCLB is always token1 in the pool, derived from the LIQUIDITY_LOCK.
    IERC20 public immutable MCLB;

    /// @dev Derived from the LBP_POOL.
    ILoopToken public immutable LBP;

    /// @dev Wrapped Sonic, derived from the LBP_POOL.
    IERC20 public immutable WS;

    /// @dev LFD-MCLB pool. The pool where POL is hosted.
    IRamsesV3Pool public immutable LFD_POOL;

    /// @dev LBP-WS pool.
    IRamsesV3Pool public immutable LBP_POOL;

    /// @dev MCLB-WS pair.
    IRamsesV2Pair public immutable MCLB_PAIR;

    uint256 public constant BASE_BURN_INTERVAL = 4 hours;

    uint256 public nextBurnTime;
    uint256 public nextCollectTime;

    event Collected(uint256 total, uint256 forLfd, uint256 forLbp, uint256 toDao);

    /// @dev percentage, 0 decimal precision, [0: LFD, 1: LBP, 2: DAO].
    uint256[3] public strategy = [45, 5, 50];

    constructor(address liquidityLock, address mclbPair, address lbpPool) Ownable(msg.sender) {
        LIQUIDITY_LOCK = LiquidityLock(liquidityLock);
        INonfungiblePositionManager positionManager = LIQUIDITY_LOCK.POSITION_MANAGER();
        uint256 nftId = LIQUIDITY_LOCK.nftId();
        (address token0, address token1, int24 tickSpacing, , , , , , , ) = positionManager.positions(nftId);
        IRamsesV3PoolDeployer deployer = positionManager.deployer();
        IRamsesV3Factory factory = deployer.RamsesV3Factory();

        LFD_POOL = factory.getPool(token0, token1, tickSpacing);
        MCLB_PAIR = IRamsesV2Pair(mclbPair);
        LBP_POOL = IRamsesV3Pool(lbpPool);

        LFD = ILoopToken(token0);
        MCLB = IERC20(token1);
        LBP = ILoopToken(LBP_POOL.token0());
        WS = IERC20(LBP_POOL.token1());
    }

    /// @dev For every 5% of total supply burned, the removal interval increases by +2 hours.
    function burnInterval() public view returns (uint256) {
        uint256 initialSupply = LFD.MAX_TOTAL_SUPPLY();
        uint256 burnedPercent = ((initialSupply - LFD.totalSupply()) * 100) / initialSupply;
        return BASE_BURN_INTERVAL + (2 hours * (burnedPercent / 5));
    }

    function burnFuse() external nonReentrant {
        // Adaptive cooldown between each cycle execution
        require(block.timestamp >= nextBurnTime, "not ready");
        nextBurnTime = block.timestamp + burnInterval();

        // Withdraw 0.5% of POL
        LIQUIDITY_LOCK.decreaseLiquidity(5);
        LIQUIDITY_LOCK.collect();

        // 50% to DAO, 50% used to buy LFD
        uint256 amount = MCLB.balanceOf(address(this)) / 2;
        if (amount > 0) {
            MCLB.transfer(owner(), amount);
            swapV3(LFD_POOL, address(MCLB), address(LFD), amount);
        }

        // Burn all LFD
        amount = LFD.balanceOf(address(this));
        if (amount > 0) LFD.burn(amount);
    }

    function fuseCollector() external nonReentrant {
        // 1 hour cooldown between each cycle execution
        require(block.timestamp >= nextCollectTime, "not ready");
        nextCollectTime = block.timestamp + 1 hours;

        // Claim trading fees
        LIQUIDITY_LOCK.collect();

        uint256[3] memory _strategy = strategy;
        uint256 mclbBalance = MCLB.balanceOf(address(this));

        // Send to DAO
        uint256 toDao = (_strategy[2] * mclbBalance) / 100;
        if (toDao > 0) MCLB.transfer(owner(), toDao);

        // Buy LBP
        uint256 forLbp = (_strategy[1] * mclbBalance) / 100;
        if (forLbp > 0) {
            swapV2(MCLB_PAIR, address(MCLB), address(WS), forLbp);
            uint256 amount = WS.balanceOf(address(this));
            if (amount > 0) swapV3(LBP_POOL, address(WS), address(LBP), amount);
        }

        // Buy back LFD
        uint256 forLfd = (_strategy[0] * mclbBalance) / 100;
        if (forLfd > 0) swapV3(LFD_POOL, address(MCLB), address(LFD), forLfd);

        emit Collected(mclbBalance, forLfd, forLbp, toDao);

        // Burn all LBP and LFD
        uint256 balance = LBP.balanceOf(address(this));
        if (balance > 0) LBP.burn(balance);
        balance = LFD.balanceOf(address(this));
        if (balance > 0) LFD.burn(balance);
    }

    function changeRatesStrategy(uint256 lfd, uint256 lbp, uint256 dao) external onlyOwner {
        strategy[0] = lfd;
        strategy[1] = lbp;
        strategy[2] = dao;
    }

    function uniswapV3SwapCallback(int256 amount0, int256 amount1, bytes calldata data) external {
        require(msg.sender == address(LFD_POOL) || msg.sender == address(LBP_POOL), "unauthorized");
        uint256 amount = uint256(amount0 > 0 ? amount0 : amount1);
        if (amount > 0) {
            SwapCallbackData memory _data = abi.decode(data, (SwapCallbackData));
            IERC20(_data.srcToken).transfer(msg.sender, amount);
        }
    }

    function swapV3(IRamsesV3Pool pool, address tokenIn, address tokenOut, uint256 amount) private {
        bool zeroForOne = tokenIn < tokenOut;
        uint160 limit = zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1;
        bytes memory data = abi.encode(SwapCallbackData(tokenIn));
        // solhint-disable-next-line no-empty-blocks
        try pool.swap(address(this), zeroForOne, int256(amount), limit, data) {} catch {}
    }

    function swapV2(IRamsesV2Pair pair, address tokenIn, address tokenOut, uint256 amount) private {
        IERC20(tokenIn).transfer(address(pair), amount);
        uint256 amountOutput;
        {
            (uint256 reserve0, uint256 reserve1, ) = pair.getReserves();
            uint256 reserveInput = tokenIn < tokenOut ? reserve0 : reserve1;
            uint256 amountInput = IERC20(tokenIn).balanceOf(address(pair)) - reserveInput;
            amountOutput = pair.getAmountOut(amountInput, tokenIn);
        }
        if (tokenIn < tokenOut) pair.swap(0, amountOutput, address(this), new bytes(0));
        else pair.swap(amountOutput, 0, address(this), new bytes(0));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

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

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity >=0.6.2;

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

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

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

pragma solidity >=0.6.2;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC-721 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 ERC-721 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 ERC-721
     * 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 address zero.
     *
     * 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 v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * 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[ERC 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 (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @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 EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * 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;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    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
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // 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
pragma solidity ^0.8.20;

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

/// @title Interface for WETH9
interface ILoopToken is IERC20 {
    // solhint-disable-next-line func-name-mixedcase
    function MAX_TOTAL_SUPPLY() external view returns (uint256);

    function burn(uint256 value) external;
}

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

import {IPoolInitializer} from "./IPoolInitializer.sol";
import {IPeripheryImmutableState} from "./IPeripheryImmutableState.sol";
import {IERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

interface INonfungiblePositionManager is IPoolInitializer, IPeripheryImmutableState, IERC721Enumerable {
    /// @notice Returns the position information associated with a given token ID.
    /// @dev Throws if the token ID is not valid.
    /// @param tokenId The ID of the token that represents the position
    /// @return token0 The address of the token0 for a specific pool
    /// @return token1 The address of the token1 for a specific pool
    /// @return tickSpacing The tickSpacing the pool
    /// @return tickLower The lower end of the tick range for the position
    /// @return tickUpper The higher end of the tick range for the position
    /// @return liquidity The liquidity of the position
    /// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position
    /// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position
    /// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation
    /// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation
    function positions(
        uint256 tokenId
    )
        external
        view
        returns (
            address token0,
            address token1,
            int24 tickSpacing,
            int24 tickLower,
            int24 tickUpper,
            uint128 liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    struct MintParams {
        address token0;
        address token1;
        int24 tickSpacing;
        int24 tickLower;
        int24 tickUpper;
        uint256 amount0Desired;
        uint256 amount1Desired;
        uint256 amount0Min;
        uint256 amount1Min;
        address recipient;
        uint256 deadline;
    }

    /// @notice Creates a new position wrapped in a NFT
    /// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized
    /// a method does not exist, i.e. the pool is assumed to be initialized.
    /// @param params The params necessary to mint a position, encoded as `MintParams` in calldata
    /// @return tokenId The ID of the token that represents the minted position
    /// @return liquidity The amount of liquidity for this position
    /// @return amount0 The amount of token0
    /// @return amount1 The amount of token1
    function mint(
        MintParams calldata params
    ) external payable returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);

    struct DecreaseLiquidityParams {
        uint256 tokenId;
        uint128 liquidity;
        uint256 amount0Min;
        uint256 amount1Min;
        uint256 deadline;
    }

    /// @notice Decreases the amount of liquidity in a position and accounts it to the position
    /// @param params tokenId The ID of the token for which liquidity is being decreased,
    /// amount The amount by which liquidity will be decreased,
    /// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity,
    /// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity,
    /// deadline The time by which the transaction must be included to effect the change
    /// @return amount0 The amount of token0 accounted to the position's tokens owed
    /// @return amount1 The amount of token1 accounted to the position's tokens owed
    function decreaseLiquidity(
        DecreaseLiquidityParams calldata params
    ) external payable returns (uint256 amount0, uint256 amount1);

    struct CollectParams {
        uint256 tokenId;
        address recipient;
        uint128 amount0Max;
        uint128 amount1Max;
    }

    /// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient
    /// @param params tokenId The ID of the NFT for which tokens are being collected,
    /// recipient The account that should receive the tokens,
    /// amount0Max The maximum amount of token0 to collect,
    /// amount1Max The maximum amount of token1 to collect
    /// @return amount0 The amount of fees collected in token0
    /// @return amount1 The amount of fees collected in token1
    function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1);
}

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

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

/// @title Immutable state
/// @notice Functions that return immutable state of the router
interface IPeripheryImmutableState {
    /// @return Returns the address of the Uniswap V3 deployer
    function deployer() external view returns (IRamsesV3PoolDeployer);

    /// @return Returns the address of WETH9
    function WETH9() external view returns (address);
}

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

/// @title Creates and initializes V3 Pools
/// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that
/// require the pool to exist.
interface IPoolInitializer {
    /// @notice Creates a new pool if it does not exist, then initializes if not initialized
    /// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool
    /// @param token0 The contract address of token0 of the pool
    /// @param token1 The contract address of token1 of the pool
    /// @param tickSpacing The tickSpacing of the v3 pool for the specified token pair
    /// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value
    /// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary
    function createAndInitializePoolIfNecessary(
        address token0,
        address token1,
        int24 tickSpacing,
        uint160 sqrtPriceX96
    ) external payable returns (address pool);
}

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

// solhint-disable-next-line no-empty-blocks
interface IRamsesV2Pair {
    /// @notice calculate the current reserves of the pool and their last 'seen' timestamp
    /// @return _reserve0 amount of token0 in reserves
    /// @return _reserve1 amount of token1 in reserves
    /// @return _blockTimestampLast the timestamp when the pool was last updated
    function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);

    /// @notice calculates the amount of tokens to receive post swap
    /// @param amountIn the token amount
    /// @param tokenIn the address of the token
    function getAmountOut(uint256 amountIn, address tokenIn) external view returns (uint256 amountOut);

    /// @notice direct swap through the pool
    function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external;
}

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

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

// solhint-disable-next-line no-empty-blocks
interface IRamsesV3Factory {
    /// @notice Returns the pool address for a given pair of tokens and a tickSpacing, or address 0 if it does not exist
    /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
    /// @dev unlike UniswapV3, we map via the tickSpacing rather than the fee tier
    /// @param tokenA The contract address of either token0 or token1
    /// @param tokenB The contract address of the other token
    /// @param tickSpacing The tickSpacing of the pool
    /// @return pool The pool address
    function getPool(address tokenA, address tokenB, int24 tickSpacing) external view returns (IRamsesV3Pool pool);
}

File 15 of 20 : IRamsesV3Pool.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {IRamsesV3PoolActions} from "./pool/IRamsesV3PoolActions.sol";
import {IRamsesV3PoolImmutables} from "./pool/IRamsesV3PoolImmutables.sol";

// solhint-disable-next-line no-empty-blocks
interface IRamsesV3Pool is IRamsesV3PoolImmutables, IRamsesV3PoolActions {

}

File 16 of 20 : IRamsesV3PoolDeployer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

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

interface IRamsesV3PoolDeployer {
    // solhint-disable-next-line func-name-mixedcase
    function RamsesV3Factory() external view returns (IRamsesV3Factory factory);
}

File 17 of 20 : IRamsesV3PoolActions.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IRamsesV3PoolActions {
    /// @notice Swap token0 for token1, or token1 for token0
    /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
    /// @param recipient The address to receive the output of the swap
    /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
    /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
    /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
    /// value after the swap. If one for zero, the price cannot be greater than this value after the swap
    /// @param data Any data to be passed through to the callback
    /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
    /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
    function swap(
        address recipient,
        bool zeroForOne,
        int256 amountSpecified,
        uint160 sqrtPriceLimitX96,
        bytes calldata data
    ) external returns (int256 amount0, int256 amount1);
}

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

/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
interface IRamsesV3PoolImmutables {
    /// @notice The contract that deployed the pool, which must adhere to the IRamsesV3Factory interface
    /// @return The contract address
    function factory() external view returns (address);

    /// @notice The first of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token0() external view returns (address);

    /// @notice The second of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token1() external view returns (address);

    /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
    /// @return The fee
    function fee() external view returns (uint24);

    /// @notice The pool tick spacing
    /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
    /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
    /// This value is an int24 to avoid casting even though it is always positive.
    /// @return The tick spacing
    function tickSpacing() external view returns (int24);

    /// @notice The maximum amount of position liquidity that can use any tick in the range
    /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
    /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
    /// @return The max amount of liquidity per tick
    function maxLiquidityPerTick() external view returns (uint128);
}

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

/// @title Math library for computing sqrt prices from ticks and vice versa
/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128
library TickMath {
    error T();
    error R();

    /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
    int24 internal constant MIN_TICK = -887272;
    /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
    int24 internal constant MAX_TICK = -MIN_TICK;

    /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)
    uint160 internal constant MIN_SQRT_RATIO = 4295128739;
    /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)
    uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;

    /// @notice Calculates sqrt(1.0001^tick) * 2^96
    /// @dev Throws if |tick| > max tick
    /// @param tick The input tick for the above formula
    /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
    /// at the given tick
    function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
        unchecked {
            uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
            if (absTick > uint256(int256(MAX_TICK))) revert T();

            uint256 ratio = absTick & 0x1 != 0
                ? 0xfffcb933bd6fad37aa2d162d1a594001
                : 0x100000000000000000000000000000000;
            if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
            if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
            if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
            if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
            if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
            if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
            if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
            if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
            if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
            if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
            if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
            if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
            if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
            if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
            if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
            if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
            if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
            if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
            if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;

            if (tick > 0) ratio = type(uint256).max / ratio;

            /// @dev this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
            /// @dev we then downcast because we know the result always fits within 160 bits due to our tick input constraint
            /// @dev we round up in the division so getTickAtSqrtRatio of the output price is always consistent
            sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));
        }
    }

    /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
    /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
    /// ever return.
    /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96
    /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio
    function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {
        unchecked {
            /// @dev second inequality must be < because the price can never reach the price at the max tick
            if (!(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO)) revert R();
            uint256 ratio = uint256(sqrtPriceX96) << 32;

            uint256 r = ratio;
            uint256 msb = 0;

            assembly {
                let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(5, gt(r, 0xFFFFFFFF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(4, gt(r, 0xFFFF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(3, gt(r, 0xFF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(2, gt(r, 0xF))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := shl(1, gt(r, 0x3))
                msb := or(msb, f)
                r := shr(f, r)
            }
            assembly {
                let f := gt(r, 0x1)
                msb := or(msb, f)
            }

            if (msb >= 128) r = ratio >> (msb - 127);
            else r = ratio << (127 - msb);

            int256 log_2 = (int256(msb) - 128) << 64;

            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(63, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(62, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(61, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(60, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(59, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(58, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(57, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(56, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(55, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(54, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(53, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(52, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(51, f))
                r := shr(f, r)
            }
            assembly {
                r := shr(127, mul(r, r))
                let f := shr(128, r)
                log_2 := or(log_2, shl(50, f))
            }

            int256 log_sqrt10001 = log_2 * 255738958999603826347141; /// @dev 128.128 number

            int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);
            int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);

            tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;
        }
    }
}

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

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {INonfungiblePositionManager} from "./interfaces/INonfungiblePositionManager.sol";

contract LiquidityLock is Ownable {
    INonfungiblePositionManager public immutable POSITION_MANAGER;
    uint256 public nftId;

    constructor(address _positionManager) Ownable(msg.sender) {
        POSITION_MANAGER = INonfungiblePositionManager(_positionManager);
    }

    /// @dev Once locked, the NFT can never be unlocked
    function lockNFT(uint256 _nftId) external {
        require(nftId == 0, "nft is already locked");
        nftId = _nftId;
        POSITION_MANAGER.transferFrom(msg.sender, address(this), _nftId);
    }

    function collect() external onlyOwner {
        POSITION_MANAGER.collect(
            INonfungiblePositionManager.CollectParams({
                tokenId: nftId,
                recipient: owner(),
                amount0Max: type(uint128).max,
                amount1Max: type(uint128).max
            })
        );
    }

    /// @dev Decreases liquidity by a percentage of the current position.
    /// The `percent` parameter uses 4 decimal precision: 10000 = 100%, 5 = 0.5%, etc.
    function decreaseLiquidity(uint256 percent) external onlyOwner {
        (, , , , , uint128 liquidity, , , , ) = POSITION_MANAGER.positions(nftId);
        POSITION_MANAGER.decreaseLiquidity(
            INonfungiblePositionManager.DecreaseLiquidityParams({
                tokenId: nftId,
                liquidity: uint128((uint256(liquidity) * percent) / 10000),
                amount0Min: 0,
                amount1Min: 0,
                deadline: block.timestamp
            })
        );
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"liquidityLock","type":"address"},{"internalType":"address","name":"mclbPair","type":"address"},{"internalType":"address","name":"lbpPool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"forLfd","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"forLbp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toDao","type":"uint256"}],"name":"Collected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"BASE_BURN_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LBP","outputs":[{"internalType":"contract ILoopToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LBP_POOL","outputs":[{"internalType":"contract IRamsesV3Pool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LFD","outputs":[{"internalType":"contract ILoopToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LFD_POOL","outputs":[{"internalType":"contract IRamsesV3Pool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIQUIDITY_LOCK","outputs":[{"internalType":"contract LiquidityLock","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MCLB","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MCLB_PAIR","outputs":[{"internalType":"contract IRamsesV2Pair","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WS","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burnFuse","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lfd","type":"uint256"},{"internalType":"uint256","name":"lbp","type":"uint256"},{"internalType":"uint256","name":"dao","type":"uint256"}],"name":"changeRatesStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fuseCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nextBurnTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextCollectTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"strategy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0","type":"int256"},{"internalType":"int256","name":"amount1","type":"int256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101e0604052602d61018090815260056101a05260326101c05262000029906004906003620004c7565b503480156200003757600080fd5b506040516200220b3803806200220b8339810160408190526200005a916200053f565b33806200008157604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200008c8162000477565b50600180556001600160a01b038316608081905260408051630df541ff60e11b8152905160009291631bea83fe9160048083019260209291908290030181865afa158015620000df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000105919062000593565b905060006080516001600160a01b031663c6bc51826040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200014a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001709190620005ba565b90506000806000846001600160a01b03166399fbab88856040518263ffffffff1660e01b8152600401620001a691815260200190565b61014060405180830381865afa158015620001c5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001eb919062000604565b505050505050509250925092506000856001600160a01b031663d5f394886040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000239573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025f919062000593565b90506000816001600160a01b0316639f38f7406040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002a2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002c8919062000593565b6040516328af8d0b60e01b81526001600160a01b0387811660048301528681166024830152600286900b6044830152919250908216906328af8d0b90606401602060405180830381865afa15801562000325573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200034b919062000593565b6001600160a01b03908116610120528981166101605288811661014081905286821660a05290851660c05260408051630dfe168160e01b81529051630dfe1681916004808201926020929091908290030181865afa158015620003b2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003d8919062000593565b6001600160a01b031660e0816001600160a01b031681525050610140516001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000433573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000459919062000593565b6001600160a01b03166101005250620006c698505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8260038101928215620004fd579160200282015b82811115620004fd578251829060ff16905591602001919060010190620004db565b506200050b9291506200050f565b5090565b5b808211156200050b576000815560010162000510565b6001600160a01b03811681146200053c57600080fd5b50565b6000806000606084860312156200055557600080fd5b8351620005628162000526565b6020850151909350620005758162000526565b6040850151909250620005888162000526565b809150509250925092565b600060208284031215620005a657600080fd5b8151620005b38162000526565b9392505050565b600060208284031215620005cd57600080fd5b5051919050565b8051600281900b8114620005e757600080fd5b919050565b80516001600160801b0381168114620005e757600080fd5b6000806000806000806000806000806101408b8d0312156200062557600080fd5b8a51620006328162000526565b60208c0151909a50620006458162000526565b98506200065560408c01620005d4565b97506200066560608c01620005d4565b96506200067560808c01620005d4565b95506200068560a08c01620005ec565b945060c08b0151935060e08b01519250620006a46101008c01620005ec565b9150620006b56101208c01620005ec565b90509295989b9194979a5092959850565b60805160a05160c05160e05161010051610120516101405161016051611a0d620007fe600039600081816102bf01526105cb015260008181610260015281816106ca01526110630152600081816102e60152818161075d01528181610cfe015261103101526000818161016f0152818161060d0152818161064a01526106eb0152600081816101ff0152818161070c0152818161082401526108b50152600081816102900152818161044f015281816104eb015281816105ec0152818161077e01528181610bc901528181610c480152610d1f0152600081816101b60152818161079f0152818161092f015281816109c001528181610d4001528181610d7a01528181610e0b01528181610e960152610f1d0152600081816102260152818161038d01528181610acf0152610b350152611a0d6000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c8063b969cdbb116100ad578063e55a68b311610071578063e55a68b3146102b2578063e86aa820146102ba578063ea12930d146102e1578063f2fde38b14610308578063fa461e331461031b57600080fd5b8063b969cdbb14610221578063bc88d7e414610248578063d3f87e321461025b578063d604af1514610282578063e3d286561461028b57600080fd5b8063795dbf34116100f4578063795dbf34146101b1578063893dbf61146101d85780638da5cb5b146101e157806393f878eb146101f257806395f9e7c7146101fa57600080fd5b80630cc37df31461013157806327be1f291461013b5780633ed04aa0146101575780635d4093591461016a578063715018a6146101a9575b600080fd5b61013961032e565b005b61014460035481565b6040519081526020015b60405180910390f35b610139610165366004611631565b610a36565b6101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161014e565b610139610a4c565b6101917f000000000000000000000000000000000000000000000000000000000000000081565b61014460025481565b6000546001600160a01b0316610191565b610139610a5e565b6101917f000000000000000000000000000000000000000000000000000000000000000081565b6101917f000000000000000000000000000000000000000000000000000000000000000081565b61014461025636600461165d565b610e7a565b6101917f000000000000000000000000000000000000000000000000000000000000000081565b61014461384081565b6101917f000000000000000000000000000000000000000000000000000000000000000081565b610144610e91565b6101917f000000000000000000000000000000000000000000000000000000000000000081565b6101917f000000000000000000000000000000000000000000000000000000000000000081565b610139610316366004611692565b610fe8565b6101396103293660046116b4565b611026565b610336611166565b6003544210156103795760405162461bcd60e51b81526020600482015260096024820152686e6f7420726561647960b81b60448201526064015b60405180910390fd5b61038542610e1061174a565b6003819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e52253816040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156103e657600080fd5b505af11580156103fa573d6000803e3d6000fd5b505060408051606081019182905260009350915060049060039082845b8154815260200190600101908083116104175750506040516370a0823160e01b81523060048201529394506000936001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693506370a0823192506024019050602060405180830381865afa15801561049a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104be9190611763565b9050600060648284600260200201516104d7919061177c565b6104e19190611793565b9050801561059d577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb61052a6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059b91906117b5565b505b600060648385600160200201516105b4919061177c565b6105be9190611793565b90508015610733576106327f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000084611190565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610699573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bd9190611763565b90508015610731576107317f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000846114a4565b505b835160009060649061074690869061177c565b6107509190611793565b905080156107c4576107c47f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000846114a4565b6040805185815260208101839052908101839052606081018490527f744f4ef6f94924367792adb659366b55752ab0b4bc850e068e26174cb77e60fb9060800160405180910390a16040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610873573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108979190611763565b9050801561091a57604051630852cd8d60e31b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906342966c6890602401600060405180830381600087803b15801561090157600080fd5b505af1158015610915573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561097e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a29190611763565b90508015610a2557604051630852cd8d60e31b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906342966c6890602401600060405180830381600087803b158015610a0c57600080fd5b505af1158015610a20573d6000803e3d6000fd5b505050505b505050505050610a3460018055565b565b610a3e6115b4565b600492909255600555600655565b610a546115b4565b610a3460006115e1565b610a66611166565b600254421015610aa45760405162461bcd60e51b81526020600482015260096024820152686e6f7420726561647960b81b6044820152606401610370565b610aac610e91565b610ab6904261174a565b60025560405163439c0e2560e01b8152600560048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063439c0e2590602401600060405180830381600087803b158015610b1b57600080fd5b505af1158015610b2f573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e52253816040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b8e57600080fd5b505af1158015610ba2573d6000803e3d6000fd5b50506040516370a0823160e01b815230600482015260009250600291506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610c10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c349190611763565b610c3e9190611793565b90508015610d65577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb610c876000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610cd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf891906117b5565b50610d657f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000846114a4565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ded9190611763565b90508015610e7057604051630852cd8d60e31b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906342966c6890602401600060405180830381600087803b158015610e5757600080fd5b505af1158015610e6b573d6000803e3d6000fd5b505050505b50610a3460018055565b60048160038110610e8a57600080fd5b0154905081565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166333039d3d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f169190611763565b90506000817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9d9190611763565b610fa790846117d7565b610fb290606461177c565b610fbc9190611793565b9050610fc9600582611793565b610fd590611c2061177c565b610fe19061384061174a565b9250505090565b610ff06115b4565b6001600160a01b03811661101a57604051631e4fbdf760e01b815260006004820152602401610370565b611023816115e1565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806110855750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b6110c05760405162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b6044820152606401610370565b60008085136110cf57836110d1565b845b9050801561115f5760006110e7838501856117ea565b805160405163a9059cbb60e01b8152336004820152602481018590529192506001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015611138573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115c91906117b5565b50505b5050505050565b60026001540361118957604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b60405163a9059cbb60e01b81526001600160a01b0385811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156111df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120391906117b5565b506000806000866001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611247573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126b9190611859565b506001600160701b031691506001600160701b031691506000856001600160a01b0316876001600160a01b0316106112a357816112a5565b825b6040516370a0823160e01b81526001600160a01b038a811660048301529192506000918391908a16906370a0823190602401602060405180830381865afa1580156112f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113189190611763565b61132291906117d7565b6040516378a051ad60e11b8152600481018290526001600160a01b038a81166024830152919250908a169063f140a35a90604401602060405180830381865afa158015611373573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113979190611763565b945050505050826001600160a01b0316846001600160a01b0316101561142d57604080516000808252602082019283905263022c0d9f60e01b9092526001600160a01b0387169163022c0d9f916113f6919085903090602481016118ef565b600060405180830381600087803b15801561141057600080fd5b505af1158015611424573d6000803e3d6000fd5b5050505061115f565b604080516000808252602082019283905263022c0d9f60e01b9092526001600160a01b0387169163022c0d9f9161146b9185913090602481016118ef565b600060405180830381600087803b15801561148557600080fd5b505af1158015611499573d6000803e3d6000fd5b505050505050505050565b6001600160a01b03808316908416106000816114de576114d9600173fffd8963efd1fc6a506488495d951d5263988d26611926565b6114ee565b6114ee6401000276a3600161194d565b905060006040518060200160405280876001600160a01b031681525060405160200161152691516001600160a01b0316815260200190565b60408051601f1981840301815290829052630251596160e31b825291506001600160a01b0388169063128acb089061156a903090879089908890889060040161196d565b60408051808303816000875af19250505080156115a4575060408051601f3d908101601f191682019092526115a1918101906119b3565b60015b1561115c57505050505050505050565b6000546001600160a01b03163314610a345760405163118cdaa760e01b8152336004820152602401610370565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060006060848603121561164657600080fd5b505081359360208301359350604090920135919050565b60006020828403121561166f57600080fd5b5035919050565b80356001600160a01b038116811461168d57600080fd5b919050565b6000602082840312156116a457600080fd5b6116ad82611676565b9392505050565b600080600080606085870312156116ca57600080fd5b8435935060208501359250604085013567ffffffffffffffff808211156116f057600080fd5b818701915087601f83011261170457600080fd5b81358181111561171357600080fd5b88602082850101111561172557600080fd5b95989497505060200194505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561175d5761175d611734565b92915050565b60006020828403121561177557600080fd5b5051919050565b808202811582820484141761175d5761175d611734565b6000826117b057634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156117c757600080fd5b815180151581146116ad57600080fd5b8181038181111561175d5761175d611734565b6000602082840312156117fc57600080fd5b6040516020810181811067ffffffffffffffff8211171561182d57634e487b7160e01b600052604160045260246000fd5b60405261183983611676565b81529392505050565b80516001600160701b038116811461168d57600080fd5b60008060006060848603121561186e57600080fd5b61187784611842565b925061188560208501611842565b9150604084015163ffffffff8116811461189e57600080fd5b809150509250925092565b6000815180845260005b818110156118cf576020818501810151868301820152016118b3565b506000602082860101526020601f19601f83011685010191505092915050565b84815283602082015260018060a01b038316604082015260806060820152600061191c60808301846118a9565b9695505050505050565b6001600160a01b0382811682821603908082111561194657611946611734565b5092915050565b6001600160a01b0381811683821601908082111561194657611946611734565b6001600160a01b0386811682528515156020830152604082018590528316606082015260a0608082018190526000906119a8908301846118a9565b979650505050505050565b600080604083850312156119c657600080fd5b50508051602090910151909290915056fea2646970667358221220e6f565adf5acfd6790361d3b5cec4292701962dfce710b22bd1eccae556aef5d64736f6c6343000814003300000000000000000000000010aad399c59df12b1ae09735fe9efd8bd9f62fd6000000000000000000000000de87419f0774eef80b0ebd134ff54ece0d4927c90000000000000000000000007b585a38519b307746e6a9c9734a34f7fb1b6d0d

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061012c5760003560e01c8063b969cdbb116100ad578063e55a68b311610071578063e55a68b3146102b2578063e86aa820146102ba578063ea12930d146102e1578063f2fde38b14610308578063fa461e331461031b57600080fd5b8063b969cdbb14610221578063bc88d7e414610248578063d3f87e321461025b578063d604af1514610282578063e3d286561461028b57600080fd5b8063795dbf34116100f4578063795dbf34146101b1578063893dbf61146101d85780638da5cb5b146101e157806393f878eb146101f257806395f9e7c7146101fa57600080fd5b80630cc37df31461013157806327be1f291461013b5780633ed04aa0146101575780635d4093591461016a578063715018a6146101a9575b600080fd5b61013961032e565b005b61014460035481565b6040519081526020015b60405180910390f35b610139610165366004611631565b610a36565b6101917f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad3881565b6040516001600160a01b03909116815260200161014e565b610139610a4c565b6101917f00000000000000000000000001fd763618e555a7118f1d1144c88113a5c34e6481565b61014460025481565b6000546001600160a01b0316610191565b610139610a5e565b6101917f000000000000000000000000001bff4b6da770f445a740227224d3c8b48e6fb281565b6101917f00000000000000000000000010aad399c59df12b1ae09735fe9efd8bd9f62fd681565b61014461025636600461165d565b610e7a565b6101917f0000000000000000000000007b585a38519b307746e6a9c9734a34f7fb1b6d0d81565b61014461384081565b6101917f00000000000000000000000044e23b1f3f4511b3a7e81077fd9f2858df1b757981565b610144610e91565b6101917f000000000000000000000000de87419f0774eef80b0ebd134ff54ece0d4927c981565b6101917f0000000000000000000000007dac17a1d054668449bcf6a4d80af657f4b1bc3b81565b610139610316366004611692565b610fe8565b6101396103293660046116b4565b611026565b610336611166565b6003544210156103795760405162461bcd60e51b81526020600482015260096024820152686e6f7420726561647960b81b60448201526064015b60405180910390fd5b61038542610e1061174a565b6003819055507f00000000000000000000000010aad399c59df12b1ae09735fe9efd8bd9f62fd66001600160a01b031663e52253816040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156103e657600080fd5b505af11580156103fa573d6000803e3d6000fd5b505060408051606081019182905260009350915060049060039082845b8154815260200190600101908083116104175750506040516370a0823160e01b81523060048201529394506000936001600160a01b037f00000000000000000000000044e23b1f3f4511b3a7e81077fd9f2858df1b75791693506370a0823192506024019050602060405180830381865afa15801561049a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104be9190611763565b9050600060648284600260200201516104d7919061177c565b6104e19190611793565b9050801561059d577f00000000000000000000000044e23b1f3f4511b3a7e81077fd9f2858df1b75796001600160a01b031663a9059cbb61052a6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059b91906117b5565b505b600060648385600160200201516105b4919061177c565b6105be9190611793565b90508015610733576106327f000000000000000000000000de87419f0774eef80b0ebd134ff54ece0d4927c97f00000000000000000000000044e23b1f3f4511b3a7e81077fd9f2858df1b75797f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad3884611190565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad386001600160a01b0316906370a0823190602401602060405180830381865afa158015610699573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bd9190611763565b90508015610731576107317f0000000000000000000000007b585a38519b307746e6a9c9734a34f7fb1b6d0d7f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad387f000000000000000000000000001bff4b6da770f445a740227224d3c8b48e6fb2846114a4565b505b835160009060649061074690869061177c565b6107509190611793565b905080156107c4576107c47f0000000000000000000000007dac17a1d054668449bcf6a4d80af657f4b1bc3b7f00000000000000000000000044e23b1f3f4511b3a7e81077fd9f2858df1b75797f00000000000000000000000001fd763618e555a7118f1d1144c88113a5c34e64846114a4565b6040805185815260208101839052908101839052606081018490527f744f4ef6f94924367792adb659366b55752ab0b4bc850e068e26174cb77e60fb9060800160405180910390a16040516370a0823160e01b81523060048201526000907f000000000000000000000000001bff4b6da770f445a740227224d3c8b48e6fb26001600160a01b0316906370a0823190602401602060405180830381865afa158015610873573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108979190611763565b9050801561091a57604051630852cd8d60e31b8152600481018290527f000000000000000000000000001bff4b6da770f445a740227224d3c8b48e6fb26001600160a01b0316906342966c6890602401600060405180830381600087803b15801561090157600080fd5b505af1158015610915573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201527f00000000000000000000000001fd763618e555a7118f1d1144c88113a5c34e646001600160a01b0316906370a0823190602401602060405180830381865afa15801561097e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a29190611763565b90508015610a2557604051630852cd8d60e31b8152600481018290527f00000000000000000000000001fd763618e555a7118f1d1144c88113a5c34e646001600160a01b0316906342966c6890602401600060405180830381600087803b158015610a0c57600080fd5b505af1158015610a20573d6000803e3d6000fd5b505050505b505050505050610a3460018055565b565b610a3e6115b4565b600492909255600555600655565b610a546115b4565b610a3460006115e1565b610a66611166565b600254421015610aa45760405162461bcd60e51b81526020600482015260096024820152686e6f7420726561647960b81b6044820152606401610370565b610aac610e91565b610ab6904261174a565b60025560405163439c0e2560e01b8152600560048201527f00000000000000000000000010aad399c59df12b1ae09735fe9efd8bd9f62fd66001600160a01b03169063439c0e2590602401600060405180830381600087803b158015610b1b57600080fd5b505af1158015610b2f573d6000803e3d6000fd5b505050507f00000000000000000000000010aad399c59df12b1ae09735fe9efd8bd9f62fd66001600160a01b031663e52253816040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b8e57600080fd5b505af1158015610ba2573d6000803e3d6000fd5b50506040516370a0823160e01b815230600482015260009250600291506001600160a01b037f00000000000000000000000044e23b1f3f4511b3a7e81077fd9f2858df1b757916906370a0823190602401602060405180830381865afa158015610c10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c349190611763565b610c3e9190611793565b90508015610d65577f00000000000000000000000044e23b1f3f4511b3a7e81077fd9f2858df1b75796001600160a01b031663a9059cbb610c876000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610cd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf891906117b5565b50610d657f0000000000000000000000007dac17a1d054668449bcf6a4d80af657f4b1bc3b7f00000000000000000000000044e23b1f3f4511b3a7e81077fd9f2858df1b75797f00000000000000000000000001fd763618e555a7118f1d1144c88113a5c34e64846114a4565b6040516370a0823160e01b81523060048201527f00000000000000000000000001fd763618e555a7118f1d1144c88113a5c34e646001600160a01b0316906370a0823190602401602060405180830381865afa158015610dc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ded9190611763565b90508015610e7057604051630852cd8d60e31b8152600481018290527f00000000000000000000000001fd763618e555a7118f1d1144c88113a5c34e646001600160a01b0316906342966c6890602401600060405180830381600087803b158015610e5757600080fd5b505af1158015610e6b573d6000803e3d6000fd5b505050505b50610a3460018055565b60048160038110610e8a57600080fd5b0154905081565b6000807f00000000000000000000000001fd763618e555a7118f1d1144c88113a5c34e646001600160a01b03166333039d3d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f169190611763565b90506000817f00000000000000000000000001fd763618e555a7118f1d1144c88113a5c34e646001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9d9190611763565b610fa790846117d7565b610fb290606461177c565b610fbc9190611793565b9050610fc9600582611793565b610fd590611c2061177c565b610fe19061384061174a565b9250505090565b610ff06115b4565b6001600160a01b03811661101a57604051631e4fbdf760e01b815260006004820152602401610370565b611023816115e1565b50565b336001600160a01b037f0000000000000000000000007dac17a1d054668449bcf6a4d80af657f4b1bc3b1614806110855750336001600160a01b037f0000000000000000000000007b585a38519b307746e6a9c9734a34f7fb1b6d0d16145b6110c05760405162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b6044820152606401610370565b60008085136110cf57836110d1565b845b9050801561115f5760006110e7838501856117ea565b805160405163a9059cbb60e01b8152336004820152602481018590529192506001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015611138573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115c91906117b5565b50505b5050505050565b60026001540361118957604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b60405163a9059cbb60e01b81526001600160a01b0385811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156111df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120391906117b5565b506000806000866001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611247573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126b9190611859565b506001600160701b031691506001600160701b031691506000856001600160a01b0316876001600160a01b0316106112a357816112a5565b825b6040516370a0823160e01b81526001600160a01b038a811660048301529192506000918391908a16906370a0823190602401602060405180830381865afa1580156112f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113189190611763565b61132291906117d7565b6040516378a051ad60e11b8152600481018290526001600160a01b038a81166024830152919250908a169063f140a35a90604401602060405180830381865afa158015611373573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113979190611763565b945050505050826001600160a01b0316846001600160a01b0316101561142d57604080516000808252602082019283905263022c0d9f60e01b9092526001600160a01b0387169163022c0d9f916113f6919085903090602481016118ef565b600060405180830381600087803b15801561141057600080fd5b505af1158015611424573d6000803e3d6000fd5b5050505061115f565b604080516000808252602082019283905263022c0d9f60e01b9092526001600160a01b0387169163022c0d9f9161146b9185913090602481016118ef565b600060405180830381600087803b15801561148557600080fd5b505af1158015611499573d6000803e3d6000fd5b505050505050505050565b6001600160a01b03808316908416106000816114de576114d9600173fffd8963efd1fc6a506488495d951d5263988d26611926565b6114ee565b6114ee6401000276a3600161194d565b905060006040518060200160405280876001600160a01b031681525060405160200161152691516001600160a01b0316815260200190565b60408051601f1981840301815290829052630251596160e31b825291506001600160a01b0388169063128acb089061156a903090879089908890889060040161196d565b60408051808303816000875af19250505080156115a4575060408051601f3d908101601f191682019092526115a1918101906119b3565b60015b1561115c57505050505050505050565b6000546001600160a01b03163314610a345760405163118cdaa760e01b8152336004820152602401610370565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060006060848603121561164657600080fd5b505081359360208301359350604090920135919050565b60006020828403121561166f57600080fd5b5035919050565b80356001600160a01b038116811461168d57600080fd5b919050565b6000602082840312156116a457600080fd5b6116ad82611676565b9392505050565b600080600080606085870312156116ca57600080fd5b8435935060208501359250604085013567ffffffffffffffff808211156116f057600080fd5b818701915087601f83011261170457600080fd5b81358181111561171357600080fd5b88602082850101111561172557600080fd5b95989497505060200194505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561175d5761175d611734565b92915050565b60006020828403121561177557600080fd5b5051919050565b808202811582820484141761175d5761175d611734565b6000826117b057634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156117c757600080fd5b815180151581146116ad57600080fd5b8181038181111561175d5761175d611734565b6000602082840312156117fc57600080fd5b6040516020810181811067ffffffffffffffff8211171561182d57634e487b7160e01b600052604160045260246000fd5b60405261183983611676565b81529392505050565b80516001600160701b038116811461168d57600080fd5b60008060006060848603121561186e57600080fd5b61187784611842565b925061188560208501611842565b9150604084015163ffffffff8116811461189e57600080fd5b809150509250925092565b6000815180845260005b818110156118cf576020818501810151868301820152016118b3565b506000602082860101526020601f19601f83011685010191505092915050565b84815283602082015260018060a01b038316604082015260806060820152600061191c60808301846118a9565b9695505050505050565b6001600160a01b0382811682821603908082111561194657611946611734565b5092915050565b6001600160a01b0381811683821601908082111561194657611946611734565b6001600160a01b0386811682528515156020830152604082018590528316606082015260a0608082018190526000906119a8908301846118a9565b979650505050505050565b600080604083850312156119c657600080fd5b50508051602090910151909290915056fea2646970667358221220e6f565adf5acfd6790361d3b5cec4292701962dfce710b22bd1eccae556aef5d64736f6c63430008140033

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

00000000000000000000000010aad399c59df12b1ae09735fe9efd8bd9f62fd6000000000000000000000000de87419f0774eef80b0ebd134ff54ece0d4927c90000000000000000000000007b585a38519b307746e6a9c9734a34f7fb1b6d0d

-----Decoded View---------------
Arg [0] : liquidityLock (address): 0x10aAd399c59df12b1aE09735FE9EFD8BD9F62Fd6
Arg [1] : mclbPair (address): 0xDE87419F0774eef80b0EbD134Ff54ece0d4927C9
Arg [2] : lbpPool (address): 0x7B585A38519B307746E6a9c9734a34f7Fb1B6D0D

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000010aad399c59df12b1ae09735fe9efd8bd9f62fd6
Arg [1] : 000000000000000000000000de87419f0774eef80b0ebd134ff54ece0d4927c9
Arg [2] : 0000000000000000000000007b585a38519b307746e6a9c9734a34f7fb1b6d0d


Block Transaction 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.