ETH Price: $3,150.66 (+0.21%)
Gas: 0.06 GWei

Contract

0x8f1b13497326857011B0b9A2b066054E1849F14D

Overview

ETH Balance

Linea Mainnet LogoLinea Mainnet LogoLinea Mainnet Logo0 ETH

ETH Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Grant Role24566592024-02-23 10:35:54141 days ago1708684554IN
Mendi Finance: LGE Depositor
0 ETH0.00006641.3
Harvest3610052023-09-06 14:38:29311 days ago1694011109IN
Mendi Finance: LGE Depositor
0 ETH0.000347312.3
Grant Role3610022023-09-06 14:37:53311 days ago1694011073IN
Mendi Finance: LGE Depositor
0 ETH0.000118362.3
Harvest3549672023-09-05 18:30:53311 days ago1693938653IN
Mendi Finance: LGE Depositor
0 ETH0.000342042.3
Harvest2750092023-08-25 14:29:41323 days ago1692973781IN
Mendi Finance: LGE Depositor
0 ETH0.000447913
Grant Role2170492023-08-17 13:08:17331 days ago1692277697IN
Mendi Finance: LGE Depositor
0 ETH0.000097781.9
Deposit2170312023-08-17 13:04:41331 days ago1692277481IN
Mendi Finance: LGE Depositor
0 ETH0.000682621.7
0x6101e0601665572023-08-10 12:36:34338 days ago1691670994IN
 Create: LGEDepositor
0 ETH0.004347722.31718777

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Value
29818812024-03-18 18:11:37116 days ago1710785497
Mendi Finance: LGE Depositor
0 ETH
29818812024-03-18 18:11:37116 days ago1710785497
Mendi Finance: LGE Depositor
0 ETH
29818812024-03-18 18:11:37116 days ago1710785497
Mendi Finance: LGE Depositor
0 ETH
29818812024-03-18 18:11:37116 days ago1710785497
Mendi Finance: LGE Depositor
0 ETH
29818812024-03-18 18:11:37116 days ago1710785497
Mendi Finance: LGE Depositor
0 ETH
29818572024-03-18 18:10:01116 days ago1710785401
Mendi Finance: LGE Depositor
0 ETH
29818572024-03-18 18:10:01116 days ago1710785401
Mendi Finance: LGE Depositor
0 ETH
29818572024-03-18 18:10:01116 days ago1710785401
Mendi Finance: LGE Depositor
0 ETH
29818572024-03-18 18:10:01116 days ago1710785401
Mendi Finance: LGE Depositor
0 ETH
29188302024-03-15 20:07:22119 days ago1710533242
Mendi Finance: LGE Depositor
0 ETH
29188302024-03-15 20:07:22119 days ago1710533242
Mendi Finance: LGE Depositor
0 ETH
29188302024-03-15 20:07:22119 days ago1710533242
Mendi Finance: LGE Depositor
0 ETH
29188302024-03-15 20:07:22119 days ago1710533242
Mendi Finance: LGE Depositor
0 ETH
27591092024-03-08 10:39:18127 days ago1709894358
Mendi Finance: LGE Depositor
0 ETH
27591092024-03-08 10:39:18127 days ago1709894358
Mendi Finance: LGE Depositor
0 ETH
27591092024-03-08 10:39:18127 days ago1709894358
Mendi Finance: LGE Depositor
0 ETH
27591092024-03-08 10:39:18127 days ago1709894358
Mendi Finance: LGE Depositor
0 ETH
25845502024-02-29 8:42:01135 days ago1709196121
Mendi Finance: LGE Depositor
0 ETH
25845502024-02-29 8:42:01135 days ago1709196121
Mendi Finance: LGE Depositor
0 ETH
25845502024-02-29 8:42:01135 days ago1709196121
Mendi Finance: LGE Depositor
0 ETH
25845502024-02-29 8:42:01135 days ago1709196121
Mendi Finance: LGE Depositor
0 ETH
24564722024-02-23 10:23:26141 days ago1708683806
Mendi Finance: LGE Depositor
0 ETH
24564722024-02-23 10:23:26141 days ago1708683806
Mendi Finance: LGE Depositor
0 ETH
24564722024-02-23 10:23:26141 days ago1708683806
Mendi Finance: LGE Depositor
0 ETH
24564722024-02-23 10:23:26141 days ago1708683806
Mendi Finance: LGE Depositor
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LGEDepositor

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Unlicense license
File 1 of 13 : LGEDepositor.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;

import "@openzeppelin/contracts/access/AccessControl.sol";

import "./interfaces/IERC20.sol";
import "./interfaces/IOwnedDistributor.sol";
import "./interfaces/VelocoreInterfaces.sol";
import "./libraries/SafeMath.sol";
import "./libraries/SafeToken.sol";

contract LGEDepositor is AccessControl {
    using TokenLib for Token;
    using SafeToken for address;

    address public immutable liquidityGenerator;
    IVault public immutable vault;
    IFactory public immutable factory;
    address public immutable mendi;
    address public immutable usdc;
    address public immutable vc;

    Token public immutable mendiToken;
    Token public immutable usdcToken;
    Token public immutable vcToken;
    IPool public immutable mendiUSDCPool;
    Token public immutable mendiUSDCPoolToken;

    uint256 finalizeAt;
    bool deposited;

    uint8 constant SWAP = 0;
    uint8 constant GAUGE = 1;

    uint8 constant EXACTLY = 0;
    uint8 constant AT_MOST = 1;
    uint8 constant ALL = 2;

    bytes32 public HARVESTER_ROLE = keccak256("HARVESTER_ROLE");

    modifier onlyLG() {
        require(msg.sender == liquidityGenerator, "LGEDepositor: ONLY_LG");
        _;
    }

    constructor(
        address liquidityGenerator_,
        IVault vault_,
        IFactory factory_,
        address mendi_,
        address usdc_,
        address vc_
    ) {
        _grantRole(DEFAULT_ADMIN_ROLE, _msgSender());

        liquidityGenerator = liquidityGenerator_;
        vault = vault_;
        factory = factory_;
        mendi = mendi_;
        usdc = usdc_;
        vc = vc_;

        mendiToken = toToken(IERC20(mendi));
        usdcToken = toToken(IERC20(usdc));
        vcToken = toToken(IERC20(vc));

        mendiUSDCPool = factory.pools(mendiToken, usdcToken);
        mendiUSDCPoolToken = toToken(IERC20(address(mendiUSDCPool)));
    }

    function finalize() external onlyLG {
        finalizeAt = getBlockTimestamp();
    }

    function deposit() external {
        require(finalizeAt > 0, "LGEDepositor: NOT_FINALIZED");
        require(
            mendi.balanceOf(address(this)) >= 2_500_000e18,
            "LGEDepositor: NOT_ENOUGH_MENDI"
        );

        addLPInternal();
        stakeLPInternal();

        deposited = true;
    }

    function harvest(address to) external onlyRole(HARVESTER_ROLE) {
        require(deposited, "LGEDepositor: NOT_DEPOSITED");

        harvestVCInternal();

        sendAllInternal(vcToken, to);
    }

    function withdraw(address to) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(
            getBlockTimestamp() > finalizeAt + 180 days,
            "LGEDepositor: LP_LOCKED"
        );

        unstakeLPInternal();

        sendAllInternal(mendiUSDCPoolToken, to);
    }

    /* Internal Liquidity Functions */

    function addLPInternal() internal {
        approveAllInternal(mendiToken, address(vault));
        approveAllInternal(usdcToken, address(vault));

        run3Internal(
            0,
            mendiUSDCPool,
            SWAP,
            mendiToken,
            EXACTLY,
            int128(int256(mendiToken.addr().balanceOf(address(this)))),
            usdcToken,
            EXACTLY,
            int128(int256(usdcToken.addr().balanceOf(address(this)))),
            mendiUSDCPoolToken,
            AT_MOST,
            0
        );

        removeApproveInternal(mendiToken, address(vault));
        removeApproveInternal(usdcToken, address(vault));
    }

    function stakeLPInternal() internal {
        approveAllInternal(mendiUSDCPoolToken, address(vault));

        run2Internal(
            0,
            mendiUSDCPool,
            GAUGE,
            mendiUSDCPoolToken,
            EXACTLY,
            int128(int256(mendiUSDCPoolToken.addr().balanceOf(address(this)))),
            vcToken,
            AT_MOST,
            0
        );

        removeApproveInternal(mendiUSDCPoolToken, address(vault));
    }

    function harvestVCInternal() internal {
        run1Internal(0, mendiUSDCPool, GAUGE, vcToken, AT_MOST, 0);
    }

    function unstakeLPInternal() internal {
        uint256 stakedAmount = IGauge(address(mendiUSDCPool)).stakedTokens(
            address(this)
        )[0];

        run2Internal(
            0,
            mendiUSDCPool,
            GAUGE,
            mendiUSDCPoolToken,
            EXACTLY,
            -(int128(uint128(stakedAmount))),
            vcToken,
            AT_MOST,
            0
        );
    }

    function removeLPInternal() internal {
        approveAllInternal(mendiUSDCPoolToken, address(vault));

        run3Internal(
            0,
            mendiUSDCPool,
            SWAP,
            mendiToken,
            AT_MOST,
            0,
            usdcToken,
            AT_MOST,
            0,
            mendiUSDCPoolToken,
            EXACTLY,
            int128(int256(mendiUSDCPoolToken.addr().balanceOf(address(this))))
        );

        removeApproveInternal(mendiUSDCPoolToken, address(vault));
    }

    function run1Internal(
        uint256 value,
        IPool pool,
        uint8 method,
        Token t1,
        uint8 m1,
        int128 a1
    ) internal {
        Token[] memory tokens = new Token[](1);

        VelocoreOperation[] memory ops = new VelocoreOperation[](1);

        tokens[0] = (t1);

        ops[0].poolId =
            bytes32(bytes1(method)) |
            bytes32(uint256(uint160(address(pool))));
        ops[0].tokenInformations = new bytes32[](1);
        ops[0].data = "";

        ops[0].tokenInformations[0] =
            bytes32(bytes1(0x00)) |
            bytes32(bytes2(uint16(m1))) |
            bytes32(uint256(uint128(uint256(int256(a1)))));
        vault.execute{value: value}(tokens, new int128[](1), ops);
    }

    function run2Internal(
        uint256 value,
        IPool pool,
        uint8 method,
        Token t1,
        uint8 m1,
        int128 a1,
        Token t2,
        uint8 m2,
        int128 a2
    ) internal {
        Token[] memory tokens = new Token[](2);

        VelocoreOperation[] memory ops = new VelocoreOperation[](1);

        tokens[0] = (t1);
        tokens[1] = (t2);

        ops[0].poolId =
            bytes32(bytes1(method)) |
            bytes32(uint256(uint160(address(pool))));
        ops[0].tokenInformations = new bytes32[](2);
        ops[0].data = "";

        ops[0].tokenInformations[0] =
            bytes32(bytes1(0x00)) |
            bytes32(bytes2(uint16(m1))) |
            bytes32(uint256(uint128(uint256(int256(a1)))));
        ops[0].tokenInformations[1] =
            bytes32(bytes1(0x01)) |
            bytes32(bytes2(uint16(m2))) |
            bytes32(uint256(uint128(uint256(int256(a2)))));
        vault.execute{value: value}(tokens, new int128[](2), ops);
    }

    function run3Internal(
        uint256 value,
        IPool pool,
        uint8 method,
        Token t1,
        uint8 m1,
        int128 a1,
        Token t2,
        uint8 m2,
        int128 a2,
        Token t3,
        uint8 m3,
        int128 a3
    ) internal {
        Token[] memory tokens = new Token[](3);

        VelocoreOperation[] memory ops = new VelocoreOperation[](1);

        tokens[0] = (t1);
        tokens[1] = (t2);
        tokens[2] = (t3);

        ops[0].poolId =
            bytes32(bytes1(method)) |
            bytes32(uint256(uint160(address(pool))));
        ops[0].tokenInformations = new bytes32[](3);
        ops[0].data = "";

        ops[0].tokenInformations[0] =
            bytes32(bytes1(0x00)) |
            bytes32(bytes2(uint16(m1))) |
            bytes32(uint256(uint128(uint256(int256(a1)))));
        ops[0].tokenInformations[1] =
            bytes32(bytes1(0x01)) |
            bytes32(bytes2(uint16(m2))) |
            bytes32(uint256(uint128(uint256(int256(a2)))));
        ops[0].tokenInformations[2] =
            bytes32(bytes1(0x02)) |
            bytes32(bytes2(uint16(m3))) |
            bytes32(uint256(uint128(uint256(int256(a3)))));
        vault.execute{value: value}(tokens, new int128[](3), ops);
    }

    /* Internal Helper Functions */

    function sendAllInternal(Token token, address to) internal {
        token.addr().safeTransfer(to, token.addr().balanceOf(address(this)));
    }

    function approveAllInternal(Token token, address spender) internal {
        token.addr().safeApprove(
            spender,
            token.addr().balanceOf(address(this))
        );
    }

    function removeApproveInternal(Token token, address spender) internal {
        token.addr().safeApprove(spender, 0);
    }

    /* Admin Functions */

    function _recover(address token) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(
            finalizeAt == 0 || getBlockTimestamp() > finalizeAt + 7 days,
            "LGEDepositor: NOT_RECOVER_TIME"
        );
        uint256 amount = token.balanceOf(address(this));
        token.safeTransfer(msg.sender, amount);
    }

    /* Misc Functions */

    function getBlockTimestamp() public view virtual returns (uint256) {
        return block.timestamp;
    }
}

File 2 of 13 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 3 of 13 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

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

pragma solidity ^0.8.0;

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

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

File 5 of 13 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 6 of 13 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 7 of 13 : IERC165.sol
// 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);
}

File 8 of 13 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

File 9 of 13 : IERC20.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.5.0;

interface IERC20 {
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );
    event Transfer(address indexed from, address indexed to, uint256 value);

    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);

    function totalSupply() external view returns (uint256);

    function balanceOf(address owner) external view returns (uint256);

    function allowance(
        address owner,
        address spender
    ) external view returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);
}

File 10 of 13 : IOwnedDistributor.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.5.0;

interface IOwnedDistributor {
    function totalShares() external view returns (uint256);

    function recipients(
        address
    )
        external
        view
        returns (uint256 shares, uint256 lastShareIndex, uint256 credit);

    function editRecipient(address account, uint256 shares) external;
}

File 11 of 13 : VelocoreInterfaces.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import "./IERC20.sol";

bytes32 constant TOKEN_MASK = 0x000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
bytes32 constant ID_MASK = 0x00FFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000;

uint256 constant ID_SHIFT = 160;
bytes32 constant TOKENSPEC_MASK = 0xFF00000000000000000000000000000000000000000000000000000000000000;

type Token is bytes32;
type TokenSpecType is bytes32;

library TokenSpec {
    TokenSpecType constant ERC20 =
        TokenSpecType.wrap(
            0x0000000000000000000000000000000000000000000000000000000000000000
        );

    TokenSpecType constant ERC721 =
        TokenSpecType.wrap(
            0x0100000000000000000000000000000000000000000000000000000000000000
        );

    TokenSpecType constant ERC1155 =
        TokenSpecType.wrap(
            0x0200000000000000000000000000000000000000000000000000000000000000
        );

    TokenSpecType constant NATIVE =
        TokenSpecType.wrap(
            0xEE00000000000000000000000000000000000000000000000000000000000000
        );
}

library TokenLib {
    using TokenLib for Token;
    using TokenLib for bytes32;

    function wrap(bytes32 data) internal pure returns (Token) {
        return Token.wrap(data);
    }

    function unwrap(Token tok) internal pure returns (bytes32) {
        return Token.unwrap(tok);
    }

    function addr(Token tok) internal pure returns (address) {
        return address(uint160(uint256(tok.unwrap() & TOKEN_MASK)));
    }

    function id(Token tok) internal pure returns (uint256) {
        return uint256((tok.unwrap() & ID_MASK) >> ID_SHIFT);
    }

    function spec(Token tok) internal pure returns (TokenSpecType) {
        return TokenSpecType.wrap(tok.unwrap() & TOKENSPEC_MASK);
    }
}

function toToken(IERC20 tok) pure returns (Token) {
    return Token.wrap(bytes32(uint256(uint160(address(tok)))));
}

function toToken(
    TokenSpecType spec_,
    uint88 id_,
    address addr_
) pure returns (Token) {
    return
        Token.wrap(
            TokenSpecType.unwrap(spec_) |
                bytes32((bytes32(uint256(id_)) << ID_SHIFT) & ID_MASK) |
                bytes32(uint256(uint160(addr_)))
        );
}

interface IAuthorizer {
    /**
     * @dev Returns true if `account` can perform the action described by `actionId` in the contract `where`.
     */
    function canPerform(
        bytes32 actionId,
        address account,
        address where
    ) external view returns (bool);
}

interface IPool {
    function poolParams() external view returns (bytes memory);
}

interface ISwap is IPool {
    function velocore__execute(
        address user,
        Token[] calldata tokens,
        int128[] memory amounts,
        bytes calldata data
    ) external returns (int128[] memory, int128[] memory);

    function swapType() external view returns (string memory);

    function listedTokens() external view returns (Token[] memory);

    function lpTokens() external view returns (Token[] memory);

    function underlyingTokens(Token lp) external view returns (Token[] memory);
    //function spotPrice(Token token, Token base) external view returns (uint256);
}

interface IGauge is IPool {
    /**
     * @dev This method is called by Vault.execute().
     * the parameters and return values are the same as velocore__execute.
     * The only difference is that the vault will call velocore__emission before calling velocore__gauge.
     */
    function velocore__gauge(
        address user,
        Token[] calldata tokens,
        int128[] memory amounts,
        bytes calldata data
    ) external returns (int128[] memory deltaGauge, int128[] memory deltaPool);

    /**
     * @dev This method is called by Vault.execute() before calling velocore__emission or changing votes.
     *
     * The vault will credit emitted VC into the gauge balance.
     * IGauge is expected to update its internal ledger.
     * @param newEmissions newly emitted VCs since last emission
     */
    function velocore__emission(uint256 newEmissions) external;

    function stakeableTokens() external view returns (Token[] memory);

    function stakedTokens(
        address user
    ) external view returns (uint256[] memory);

    function stakedTokens() external view returns (uint256[] memory);

    function emissionShare(address user) external view returns (uint256);

    function naturalBribes() external view returns (Token[] memory);
}

interface IConverter {
    /**
     * @dev This method is called by Vault.execute().
     * Vault will transfer any positively specified amounts directly to the IConverter before calling velocore__convert.
     *
     * Instead of returning balance delta numbers, IConverter is expected to directly transfer outputs back to vault.
     * Vault will measure the difference, and credit the user.
     */
    function velocore__convert(
        address user,
        Token[] calldata tokens,
        int128[] memory amounts,
        bytes calldata data
    ) external;
}

interface IBribe is IPool {
    /**
     * @dev This method is called when someone vote/harvest from/to a @param gauge,
     * and when this IBribe happens to be attached to the gauge.
     *
     * Attachment can happen without IBribe's permission. Implementations must verify that @param gauge is correct.
     *
     * Returns balance deltas; their net differences are credited as bribe.
     * deltaExternal must be zero or negative; Vault will take specified amounts from the contract's balance
     *
     * @param  gauge  the gauge to bribe for.
     * @param  elapsed  elapsed time after last call; can be used to save gas.
     */
    function velocore__bribe(
        IGauge gauge,
        uint256 elapsed
    )
        external
        returns (
            Token[] memory bribeTokens,
            int128[] memory deltaGauge,
            int128[] memory deltaPool,
            int128[] memory deltaExternal
        );

    function bribeTokens(IGauge gauge) external view returns (Token[] memory);

    function bribeRates(IGauge gauge) external view returns (uint256[] memory);
}

interface IFacet {
    function initializeFacet() external;
}

interface IFactory {
    function pools(Token quote, Token base) external view returns (IPool pool);
}

struct VelocoreOperation {
    bytes32 poolId;
    bytes32[] tokenInformations;
    bytes data;
}

interface IVault {
    event Swap(
        ISwap indexed pool,
        address indexed user,
        Token[] tokenRef,
        int128[] delta
    );
    event Gauge(
        IGauge indexed pool,
        address indexed user,
        Token[] tokenRef,
        int128[] delta
    );
    event Convert(
        IConverter indexed pool,
        address indexed user,
        Token[] tokenRef,
        int128[] delta
    );
    event Vote(IGauge indexed pool, address indexed user, int256 voteDelta);
    event UserBalance(
        address indexed to,
        address indexed from,
        Token[] tokenRef,
        int128[] delta
    );
    event BribeAttached(IGauge indexed gauge, IBribe indexed bribe);
    event BribeKilled(IGauge indexed gauge, IBribe indexed bribe);
    event GaugeKilled(IGauge indexed gauge, bool killed);

    function notifyInitialSupply(Token, uint128, uint128) external;

    function attachBribe(IGauge gauge, IBribe bribe) external;

    function killBribe(IGauge gauge, IBribe bribe) external;

    function killGauge(IGauge gauge, bool t) external;

    function ballotToken() external returns (Token);

    function emissionToken() external returns (Token);

    function execute(
        Token[] calldata tokenRef,
        int128[] memory deposit,
        VelocoreOperation[] calldata ops
    ) external payable;

    function query(
        address user,
        Token[] calldata tokenRef,
        int128[] memory deposit,
        VelocoreOperation[] calldata ops
    ) external returns (int128[] memory);

    function admin_setFunctions(
        address implementation,
        bytes4[] calldata sigs
    ) external;

    function admin_addFacet(IFacet implementation) external;

    function admin_setAuthorizer(IAuthorizer auth_) external;

    function inspect(address lens, bytes memory data) external;
}

File 12 of 13 : SafeMath.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;

// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, errorMessage);

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot underflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction underflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot underflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, errorMessage);

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers.
     * Reverts on division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers.
     * Reverts with custom message on division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

File 13 of 13 : SafeToken.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;

interface ERC20Interface {
    function balanceOf(address user) external view returns (uint256);
}

library SafeToken {
    function myBalance(address token) internal view returns (uint256) {
        return ERC20Interface(token).balanceOf(address(this));
    }

    function balanceOf(
        address token,
        address user
    ) internal view returns (uint256) {
        return ERC20Interface(token).balanceOf(user);
    }

    function safeApprove(address token, address to, uint256 value) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(0x095ea7b3, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "!safeApprove"
        );
    }

    function safeTransfer(address token, address to, uint256 value) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(0xa9059cbb, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "!safeTransfer"
        );
    }

    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(0x23b872dd, from, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "!safeTransferFrom"
        );
    }

    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, "!safeTransferETH");
    }
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"liquidityGenerator_","type":"address"},{"internalType":"contract IVault","name":"vault_","type":"address"},{"internalType":"contract IFactory","name":"factory_","type":"address"},{"internalType":"address","name":"mendi_","type":"address"},{"internalType":"address","name":"usdc_","type":"address"},{"internalType":"address","name":"vc_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HARVESTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"_recover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"contract IFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finalize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBlockTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidityGenerator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mendi","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mendiToken","outputs":[{"internalType":"Token","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mendiUSDCPool","outputs":[{"internalType":"contract IPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mendiUSDCPoolToken","outputs":[{"internalType":"Token","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdcToken","outputs":[{"internalType":"Token","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vcToken","outputs":[{"internalType":"Token","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101e06040527f3fc733b4d20d27a28452ddf0e9351aced28242fe03389a653cdb783955316b9b6003553480156200003657600080fd5b506040516200242738038062002427833981016040819052620000599162000214565b620000666000336200015a565b6001600160a01b0386811660805285811660a05284811660c05283811660e0819052838216610100529082166101205261014052610100516001600160a01b031661016052610120516001600160a01b03166101805260c05161014051610160516040516308311f8f60e21b8152600481019290925260248201526001600160a01b03909116906320c47e3c90604401602060405180830381865afa15801562000114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200013a9190620002a8565b6001600160a01b03166101a08190526101c05250620002cf945050505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001f7576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001b63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6001600160a01b03811681146200021157600080fd5b50565b60008060008060008060c087890312156200022e57600080fd5b86516200023b81620001fb565b60208801519096506200024e81620001fb565b60408801519095506200026181620001fb565b60608801519094506200027481620001fb565b60808801519093506200028781620001fb565b60a08801519092506200029a81620001fb565b809150509295509295509295565b600060208284031215620002bb57600080fd5b8151620002c881620001fb565b9392505050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c051611ff86200042f60003960008181610337015281816106a401528181610b0601528181610e0301528181610ec401528181610f330152610f6b015260008181610278015281816108c801528181610a4901528181610ae301528181610d760152610f100152600081816101a5015281816104eb015281816108eb0152610b330152600081816101ef01528181610d2a01528181610dcd0152610e7a0152600081816103b901528181610ce001528181610d980152610e3001526000610216015260006102c501526000818161030701526107fc015260006103e001526000818161042201528181610d0101528181610d4b01528181610e5101528181610e9b01528181610ee501528181610f8c015281816111a50152818161145a01526117b701526000818161036401526105c30152611ff86000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c80635f33f281116100de578063a217fddf11610097578063c45a015511610071578063c45a0155146103db578063d0e30db014610402578063d547741f1461040a578063fbfa77cf1461041d57600080fd5b8063a217fddf14610399578063ba4af753146103a1578063bab56ac3146103b457600080fd5b80635f33f2811461030257806363a560ec1461032957806378f93bf414610332578063796b89b9146103595780637fbf33991461035f57806391d148541461038657600080fd5b80632512c108116101305780632512c108146102735780632f2ff15d1461029a57806336568abe146102ad5780633e413bee146102c05780634bb278f3146102e757806351cff8d9146102ef57600080fd5b806301ffc9a71461017857806303851ea9146101a05780630e5c011e146101d557806311eac855146101ea578063188cdb3714610211578063248a9ca314610250575b600080fd5b61018b610186366004611b31565b610444565b60405190151581526020015b60405180910390f35b6101c77f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610197565b6101e86101e3366004611b77565b61047b565b005b6101c77f000000000000000000000000000000000000000000000000000000000000000081565b6102387f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610197565b6101c761025e366004611b92565b60009081526020819052604090206001015490565b6102387f000000000000000000000000000000000000000000000000000000000000000081565b6101e86102a8366004611bab565b610514565b6101e86102bb366004611bab565b61053e565b6102387f000000000000000000000000000000000000000000000000000000000000000081565b6101e86105b8565b6101e86102fd366004611b77565b61062e565b6102387f000000000000000000000000000000000000000000000000000000000000000081565b6101c760035481565b6101c77f000000000000000000000000000000000000000000000000000000000000000081565b426101c7565b6102387f000000000000000000000000000000000000000000000000000000000000000081565b61018b610394366004611bab565b6106c9565b6101c7600081565b6101e86103af366004611b77565b6106f2565b6101c77f000000000000000000000000000000000000000000000000000000000000000081565b6102387f000000000000000000000000000000000000000000000000000000000000000081565b6101e8610791565b6101e8610418366004611bab565b61088f565b6102387f000000000000000000000000000000000000000000000000000000000000000081565b60006001600160e01b03198216637965db0b60e01b148061047557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600354610487816108b4565b60025460ff166104de5760405162461bcd60e51b815260206004820152601b60248201527f4c47454465706f7369746f723a204e4f545f4445504f5349544544000000000060448201526064015b60405180910390fd5b6104e66108c1565b6105107f000000000000000000000000000000000000000000000000000000000000000083610915565b5050565b60008281526020819052604090206001015461052f816108b4565b6105398383610948565b505050565b6001600160a01b03811633146105ae5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016104d5565b61051082826109cc565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106285760405162461bcd60e51b81526020600482015260156024820152744c47454465706f7369746f723a204f4e4c595f4c4760581b60448201526064016104d5565b42600155565b6000610639816108b4565b6001546106499062ed4e00611bed565b42116106975760405162461bcd60e51b815260206004820152601760248201527f4c47454465706f7369746f723a204c505f4c4f434b454400000000000000000060448201526064016104d5565b61069f610a31565b6105107f000000000000000000000000000000000000000000000000000000000000000083610915565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006106fd816108b4565b600154158061071a57506001546107179062093a80611bed565b42115b6107665760405162461bcd60e51b815260206004820152601e60248201527f4c47454465706f7369746f723a204e4f545f5245434f5645525f54494d45000060448201526064016104d5565b600061077b6001600160a01b03841630610b5b565b90506105396001600160a01b0384163383610bd0565b6000600154116107e35760405162461bcd60e51b815260206004820152601b60248201527f4c47454465706f7369746f723a204e4f545f46494e414c495a4544000000000060448201526064016104d5565b6a02116545850052128000006108226001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630610b5b565b10156108705760405162461bcd60e51b815260206004820152601e60248201527f4c47454465706f7369746f723a204e4f545f454e4f5547485f4d454e4449000060448201526064016104d5565b610878610cdb565b610880610ebf565b6002805460ff19166001179055565b6000828152602081905260409020600101546108aa816108b4565b61053983836109cc565b6108be8133610fb0565b50565b61091360007f000000000000000000000000000000000000000000000000000000000000000060017f000000000000000000000000000000000000000000000000000000000000000060016000611009565b565b61051081610937306001600160a01b0386165b6001600160a01b031690610b5b565b6001600160a01b0385169190610bd0565b61095282826106c9565b610510576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556109883390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6109d682826106c9565b15610510576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60405163a5b39cfb60e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a5b39cfb90602401600060405180830381865afa158015610a98573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ac09190810190611c1b565b600081518110610ad257610ad2611cd9565b602002602001015190506108be60007f000000000000000000000000000000000000000000000000000000000000000060017f0000000000000000000000000000000000000000000000000000000000000000600086610b3190611cef565b7f000000000000000000000000000000000000000000000000000000000000000060016000611244565b6040516370a0823160e01b81526001600160a01b038281166004830152600091908416906370a0823190602401602060405180830381865afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190611d1f565b9392505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691610c2c9190611d68565b6000604051808303816000865af19150503d8060008114610c69576040519150601f19603f3d011682016040523d82523d6000602084013e610c6e565b606091505b5091509150818015610c98575080511580610c98575080806020019051810190610c989190611d84565b610cd45760405162461bcd60e51b815260206004820152600d60248201526c10b9b0b332aa3930b739b332b960991b60448201526064016104d5565b5050505050565b610d257f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006114fc565b610d6f7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006114fc565b610e2b60007f0000000000000000000000000000000000000000000000000000000000000000817f000000000000000000000000000000000000000000000000000000000000000081610dcb306001600160a01b038416610928565b7f00000000000000000000000000000000000000000000000000000000000000006000610e01306001600160a01b038416610928565b7f00000000000000000000000000000000000000000000000000000000000000006001600061152e565b610e757f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061186b565b6109137f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061186b565b610f097f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006114fc565b610f6660007f000000000000000000000000000000000000000000000000000000000000000060017f000000000000000000000000000000000000000000000000000000000000000083610b31306001600160a01b038416610928565b6109137f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061186b565b610fba82826106c9565b61051057610fc781611880565b610fd2836020611892565b604051602001610fe3929190611da6565b60408051601f198184030181529082905262461bcd60e51b82526104d591600401611e47565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6040805160608082018352600082526020808301829052928201528252600019909201910181611043579050509050848260008151811061108657611086611cd9565b602002602001018181525050866001600160a01b031660001b8660f81b6001600160f81b03191617816000815181106110c1576110c1611cd9565b60209081029190910101515260408051600180825281830190925290816020016020820280368337019050508160008151811061110057611100611cd9565b602002602001015160200181905250604051806020016040528060008152508160008151811061113257611132611cd9565b602090810291909101015160400152805160ff60f01b60f086901b166001600160801b0385161790829060009061116b5761116b611cd9565b60200260200101516020015160008151811061118957611189611cd9565b60209081029190910101526040805160018082528183019092527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169163d3115a8a918b9186919081602001602082028036833701905050856040518563ffffffff1660e01b815260040161120893929190611f07565b6000604051808303818588803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b50505050505050505050505050565b60408051600280825260608201835260009260208301908036833750506040805160018082528183019092529293506000929150602082015b604080516060808201835260008252602080830182905292820152825260001990920191018161127d57905050905087826000815181106112c0576112c0611cd9565b60200260200101818152505084826001815181106112e0576112e0611cd9565b602002602001018181525050896001600160a01b031660001b8960f81b6001600160f81b031916178160008151811061131b5761131b611cd9565b6020908102919091010151526040805160028082526060820190925290816020016020820280368337019050508160008151811061135b5761135b611cd9565b602002602001015160200181905250604051806020016040528060008152508160008151811061138d5761138d611cd9565b602090810291909101015160400152805160ff60f01b60f089901b166001600160801b038816179082906000906113c6576113c6611cd9565b6020026020010151602001516000815181106113e4576113e4611cd9565b6020908102919091010152805160ff60f01b60f086901b166001600160801b03851617600160f81b1790829060009061141f5761141f611cd9565b60200260200101516020015160018151811061143d5761143d611cd9565b6020908102919091010152604080516002808252606082019092527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169163d3115a8a918e9186919081602001602082028036833701905050856040518563ffffffff1660e01b81526004016114bd93929190611f07565b6000604051808303818588803b1580156114d657600080fd5b505af11580156114ea573d6000803e3d6000fd5b50505050505050505050505050505050565b61051081611513306001600160a01b038616610928565b6001600160a01b0385165b6001600160a01b03169190611a2e565b604080516003808252608082019092526000916020820160608036833750506040805160018082528183019092529293506000929150602082015b60408051606080820183526000825260208083018290529282015282526000199092019101816115695790505090508a826000815181106115ac576115ac611cd9565b60200260200101818152505087826001815181106115cc576115cc611cd9565b60200260200101818152505084826002815181106115ec576115ec611cd9565b6020026020010181815250508c6001600160a01b031660001b8c60f81b6001600160f81b031916178160008151811061162757611627611cd9565b6020908102919091010151526040805160038082526080820190925290816020016020820280368337019050508160008151811061166757611667611cd9565b602002602001015160200181905250604051806020016040528060008152508160008151811061169957611699611cd9565b602090810291909101015160400152805160ff60f01b60f08c901b166001600160801b038b16179082906000906116d2576116d2611cd9565b6020026020010151602001516000815181106116f0576116f0611cd9565b6020908102919091010152805160ff60f01b60f089901b166001600160801b03881617600160f81b1790829060009061172b5761172b611cd9565b60200260200101516020015160018151811061174957611749611cd9565b6020908102919091010152805160ff60f01b60f086901b166001600160801b03851617600160f91b1790829060009061178457611784611cd9565b6020026020010151602001516002815181106117a2576117a2611cd9565b60209081029190910101526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663d3115a8a8f846003604051908082528060200260200182016040528015611809578160200160208202803683370190505b50856040518563ffffffff1660e01b815260040161182993929190611f07565b6000604051808303818588803b15801561184257600080fd5b505af1158015611856573d6000803e3d6000fd5b50505050505050505050505050505050505050565b6105108160006001600160a01b03851661151e565b60606104756001600160a01b03831660145b606060006118a1836002611f8c565b6118ac906002611bed565b67ffffffffffffffff8111156118c4576118c4611c05565b6040519080825280601f01601f1916602001820160405280156118ee576020820181803683370190505b509050600360fc1b8160008151811061190957611909611cd9565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061193857611938611cd9565b60200101906001600160f81b031916908160001a905350600061195c846002611f8c565b611967906001611bed565b90505b60018111156119df576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061199b5761199b611cd9565b1a60f81b8282815181106119b1576119b1611cd9565b60200101906001600160f81b031916908160001a90535060049490941c936119d881611fab565b905061196a565b508315610bc95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016104d5565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1790529151600092839290871691611a8a9190611d68565b6000604051808303816000865af19150503d8060008114611ac7576040519150601f19603f3d011682016040523d82523d6000602084013e611acc565b606091505b5091509150818015611af6575080511580611af6575080806020019051810190611af69190611d84565b610cd45760405162461bcd60e51b815260206004820152600c60248201526b2173616665417070726f766560a01b60448201526064016104d5565b600060208284031215611b4357600080fd5b81356001600160e01b031981168114610bc957600080fd5b80356001600160a01b0381168114611b7257600080fd5b919050565b600060208284031215611b8957600080fd5b610bc982611b5b565b600060208284031215611ba457600080fd5b5035919050565b60008060408385031215611bbe57600080fd5b82359150611bce60208401611b5b565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611c0057611c00611bd7565b500190565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611c2e57600080fd5b825167ffffffffffffffff80821115611c4657600080fd5b818501915085601f830112611c5a57600080fd5b815181811115611c6c57611c6c611c05565b8060051b604051601f19603f83011681018181108582111715611c9157611c91611c05565b604052918252848201925083810185019188831115611caf57600080fd5b938501935b82851015611ccd57845184529385019392850192611cb4565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600081600f0b6f7fffffffffffffffffffffffffffffff19811415611d1657611d16611bd7565b60000392915050565b600060208284031215611d3157600080fd5b5051919050565b60005b83811015611d53578181015183820152602001611d3b565b83811115611d62576000848401525b50505050565b60008251611d7a818460208701611d38565b9190910192915050565b600060208284031215611d9657600080fd5b81518015158114610bc957600080fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611dde816017850160208801611d38565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611e0f816028840160208801611d38565b01602801949350505050565b60008151808452611e33816020860160208601611d38565b601f01601f19169290920160200192915050565b602081526000610bc96020830184611e1b565b6000815180845260208085019450848260051b86018286016000805b86811015611ef9578484038a528251805185528681015160608887018190528151908701819052608087019189019085905b80821015611ec85782518452928a0192918a019160019190910190611ea8565b50505060408083015192508682038188015250611ee58183611e1b565b9b88019b9550505091850191600101611e76565b509198975050505050505050565b606080825284519082018190526000906020906080840190828801845b82811015611f4057815184529284019290840190600101611f24565b5050508381038285015285518082528683019183019060005b81811015611f78578351600f0b83529284019291840191600101611f59565b50508481036040860152611ccd8187611e5a565b6000816000190483118215151615611fa657611fa6611bd7565b500290565b600081611fba57611fba611bd7565b50600019019056fea26469706673582212206cc4793a62bfd9e5c5b65f3cc61e87e770a423a735de682a17e99bc803112d5964736f6c634300080a003300000000000000000000000055231f67b289815483a037d459877d85819e91440000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc7535000000000000000000000000be6c6a389b82306e88d74d1692b67285a9db9a4700000000000000000000000043e8809ea748eff3204ee01f08872f063e44065f000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff000000000000000000000000cc22f6aa610d1b2a0e89ef228079cb3e1831b1d1

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101735760003560e01c80635f33f281116100de578063a217fddf11610097578063c45a015511610071578063c45a0155146103db578063d0e30db014610402578063d547741f1461040a578063fbfa77cf1461041d57600080fd5b8063a217fddf14610399578063ba4af753146103a1578063bab56ac3146103b457600080fd5b80635f33f2811461030257806363a560ec1461032957806378f93bf414610332578063796b89b9146103595780637fbf33991461035f57806391d148541461038657600080fd5b80632512c108116101305780632512c108146102735780632f2ff15d1461029a57806336568abe146102ad5780633e413bee146102c05780634bb278f3146102e757806351cff8d9146102ef57600080fd5b806301ffc9a71461017857806303851ea9146101a05780630e5c011e146101d557806311eac855146101ea578063188cdb3714610211578063248a9ca314610250575b600080fd5b61018b610186366004611b31565b610444565b60405190151581526020015b60405180910390f35b6101c77f000000000000000000000000cc22f6aa610d1b2a0e89ef228079cb3e1831b1d181565b604051908152602001610197565b6101e86101e3366004611b77565b61047b565b005b6101c77f000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff81565b6102387f000000000000000000000000cc22f6aa610d1b2a0e89ef228079cb3e1831b1d181565b6040516001600160a01b039091168152602001610197565b6101c761025e366004611b92565b60009081526020819052604090206001015490565b6102387f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf79481565b6101e86102a8366004611bab565b610514565b6101e86102bb366004611bab565b61053e565b6102387f000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff81565b6101e86105b8565b6101e86102fd366004611b77565b61062e565b6102387f00000000000000000000000043e8809ea748eff3204ee01f08872f063e44065f81565b6101c760035481565b6101c77f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf79481565b426101c7565b6102387f00000000000000000000000055231f67b289815483a037d459877d85819e914481565b61018b610394366004611bab565b6106c9565b6101c7600081565b6101e86103af366004611b77565b6106f2565b6101c77f00000000000000000000000043e8809ea748eff3204ee01f08872f063e44065f81565b6102387f000000000000000000000000be6c6a389b82306e88d74d1692b67285a9db9a4781565b6101e8610791565b6101e8610418366004611bab565b61088f565b6102387f0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc753581565b60006001600160e01b03198216637965db0b60e01b148061047557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600354610487816108b4565b60025460ff166104de5760405162461bcd60e51b815260206004820152601b60248201527f4c47454465706f7369746f723a204e4f545f4445504f5349544544000000000060448201526064015b60405180910390fd5b6104e66108c1565b6105107f000000000000000000000000cc22f6aa610d1b2a0e89ef228079cb3e1831b1d183610915565b5050565b60008281526020819052604090206001015461052f816108b4565b6105398383610948565b505050565b6001600160a01b03811633146105ae5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016104d5565b61051082826109cc565b336001600160a01b037f00000000000000000000000055231f67b289815483a037d459877d85819e914416146106285760405162461bcd60e51b81526020600482015260156024820152744c47454465706f7369746f723a204f4e4c595f4c4760581b60448201526064016104d5565b42600155565b6000610639816108b4565b6001546106499062ed4e00611bed565b42116106975760405162461bcd60e51b815260206004820152601760248201527f4c47454465706f7369746f723a204c505f4c4f434b454400000000000000000060448201526064016104d5565b61069f610a31565b6105107f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf79483610915565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006106fd816108b4565b600154158061071a57506001546107179062093a80611bed565b42115b6107665760405162461bcd60e51b815260206004820152601e60248201527f4c47454465706f7369746f723a204e4f545f5245434f5645525f54494d45000060448201526064016104d5565b600061077b6001600160a01b03841630610b5b565b90506105396001600160a01b0384163383610bd0565b6000600154116107e35760405162461bcd60e51b815260206004820152601b60248201527f4c47454465706f7369746f723a204e4f545f46494e414c495a4544000000000060448201526064016104d5565b6a02116545850052128000006108226001600160a01b037f00000000000000000000000043e8809ea748eff3204ee01f08872f063e44065f1630610b5b565b10156108705760405162461bcd60e51b815260206004820152601e60248201527f4c47454465706f7369746f723a204e4f545f454e4f5547485f4d454e4449000060448201526064016104d5565b610878610cdb565b610880610ebf565b6002805460ff19166001179055565b6000828152602081905260409020600101546108aa816108b4565b61053983836109cc565b6108be8133610fb0565b50565b61091360007f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf79460017f000000000000000000000000cc22f6aa610d1b2a0e89ef228079cb3e1831b1d160016000611009565b565b61051081610937306001600160a01b0386165b6001600160a01b031690610b5b565b6001600160a01b0385169190610bd0565b61095282826106c9565b610510576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556109883390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6109d682826106c9565b15610510576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60405163a5b39cfb60e01b81523060048201526000907f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf7946001600160a01b03169063a5b39cfb90602401600060405180830381865afa158015610a98573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ac09190810190611c1b565b600081518110610ad257610ad2611cd9565b602002602001015190506108be60007f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf79460017f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf794600086610b3190611cef565b7f000000000000000000000000cc22f6aa610d1b2a0e89ef228079cb3e1831b1d160016000611244565b6040516370a0823160e01b81526001600160a01b038281166004830152600091908416906370a0823190602401602060405180830381865afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190611d1f565b9392505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691610c2c9190611d68565b6000604051808303816000865af19150503d8060008114610c69576040519150601f19603f3d011682016040523d82523d6000602084013e610c6e565b606091505b5091509150818015610c98575080511580610c98575080806020019051810190610c989190611d84565b610cd45760405162461bcd60e51b815260206004820152600d60248201526c10b9b0b332aa3930b739b332b960991b60448201526064016104d5565b5050505050565b610d257f00000000000000000000000043e8809ea748eff3204ee01f08872f063e44065f7f0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc75356114fc565b610d6f7f000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff7f0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc75356114fc565b610e2b60007f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf794817f00000000000000000000000043e8809ea748eff3204ee01f08872f063e44065f81610dcb306001600160a01b038416610928565b7f000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff6000610e01306001600160a01b038416610928565b7f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf7946001600061152e565b610e757f00000000000000000000000043e8809ea748eff3204ee01f08872f063e44065f7f0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc753561186b565b6109137f000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff7f0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc753561186b565b610f097f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf7947f0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc75356114fc565b610f6660007f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf79460017f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf79483610b31306001600160a01b038416610928565b6109137f000000000000000000000000d0e67ce5e72beba9d0986479ea4e4021120cf7947f0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc753561186b565b610fba82826106c9565b61051057610fc781611880565b610fd2836020611892565b604051602001610fe3929190611da6565b60408051601f198184030181529082905262461bcd60e51b82526104d591600401611e47565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6040805160608082018352600082526020808301829052928201528252600019909201910181611043579050509050848260008151811061108657611086611cd9565b602002602001018181525050866001600160a01b031660001b8660f81b6001600160f81b03191617816000815181106110c1576110c1611cd9565b60209081029190910101515260408051600180825281830190925290816020016020820280368337019050508160008151811061110057611100611cd9565b602002602001015160200181905250604051806020016040528060008152508160008151811061113257611132611cd9565b602090810291909101015160400152805160ff60f01b60f086901b166001600160801b0385161790829060009061116b5761116b611cd9565b60200260200101516020015160008151811061118957611189611cd9565b60209081029190910101526040805160018082528183019092527f0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc75356001600160a01b03169163d3115a8a918b9186919081602001602082028036833701905050856040518563ffffffff1660e01b815260040161120893929190611f07565b6000604051808303818588803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b50505050505050505050505050565b60408051600280825260608201835260009260208301908036833750506040805160018082528183019092529293506000929150602082015b604080516060808201835260008252602080830182905292820152825260001990920191018161127d57905050905087826000815181106112c0576112c0611cd9565b60200260200101818152505084826001815181106112e0576112e0611cd9565b602002602001018181525050896001600160a01b031660001b8960f81b6001600160f81b031916178160008151811061131b5761131b611cd9565b6020908102919091010151526040805160028082526060820190925290816020016020820280368337019050508160008151811061135b5761135b611cd9565b602002602001015160200181905250604051806020016040528060008152508160008151811061138d5761138d611cd9565b602090810291909101015160400152805160ff60f01b60f089901b166001600160801b038816179082906000906113c6576113c6611cd9565b6020026020010151602001516000815181106113e4576113e4611cd9565b6020908102919091010152805160ff60f01b60f086901b166001600160801b03851617600160f81b1790829060009061141f5761141f611cd9565b60200260200101516020015160018151811061143d5761143d611cd9565b6020908102919091010152604080516002808252606082019092527f0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc75356001600160a01b03169163d3115a8a918e9186919081602001602082028036833701905050856040518563ffffffff1660e01b81526004016114bd93929190611f07565b6000604051808303818588803b1580156114d657600080fd5b505af11580156114ea573d6000803e3d6000fd5b50505050505050505050505050505050565b61051081611513306001600160a01b038616610928565b6001600160a01b0385165b6001600160a01b03169190611a2e565b604080516003808252608082019092526000916020820160608036833750506040805160018082528183019092529293506000929150602082015b60408051606080820183526000825260208083018290529282015282526000199092019101816115695790505090508a826000815181106115ac576115ac611cd9565b60200260200101818152505087826001815181106115cc576115cc611cd9565b60200260200101818152505084826002815181106115ec576115ec611cd9565b6020026020010181815250508c6001600160a01b031660001b8c60f81b6001600160f81b031916178160008151811061162757611627611cd9565b6020908102919091010151526040805160038082526080820190925290816020016020820280368337019050508160008151811061166757611667611cd9565b602002602001015160200181905250604051806020016040528060008152508160008151811061169957611699611cd9565b602090810291909101015160400152805160ff60f01b60f08c901b166001600160801b038b16179082906000906116d2576116d2611cd9565b6020026020010151602001516000815181106116f0576116f0611cd9565b6020908102919091010152805160ff60f01b60f089901b166001600160801b03881617600160f81b1790829060009061172b5761172b611cd9565b60200260200101516020015160018151811061174957611749611cd9565b6020908102919091010152805160ff60f01b60f086901b166001600160801b03851617600160f91b1790829060009061178457611784611cd9565b6020026020010151602001516002815181106117a2576117a2611cd9565b60209081029190910101526001600160a01b037f0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc75351663d3115a8a8f846003604051908082528060200260200182016040528015611809578160200160208202803683370190505b50856040518563ffffffff1660e01b815260040161182993929190611f07565b6000604051808303818588803b15801561184257600080fd5b505af1158015611856573d6000803e3d6000fd5b50505050505050505050505050505050505050565b6105108160006001600160a01b03851661151e565b60606104756001600160a01b03831660145b606060006118a1836002611f8c565b6118ac906002611bed565b67ffffffffffffffff8111156118c4576118c4611c05565b6040519080825280601f01601f1916602001820160405280156118ee576020820181803683370190505b509050600360fc1b8160008151811061190957611909611cd9565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061193857611938611cd9565b60200101906001600160f81b031916908160001a905350600061195c846002611f8c565b611967906001611bed565b90505b60018111156119df576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061199b5761199b611cd9565b1a60f81b8282815181106119b1576119b1611cd9565b60200101906001600160f81b031916908160001a90535060049490941c936119d881611fab565b905061196a565b508315610bc95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016104d5565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1790529151600092839290871691611a8a9190611d68565b6000604051808303816000865af19150503d8060008114611ac7576040519150601f19603f3d011682016040523d82523d6000602084013e611acc565b606091505b5091509150818015611af6575080511580611af6575080806020019051810190611af69190611d84565b610cd45760405162461bcd60e51b815260206004820152600c60248201526b2173616665417070726f766560a01b60448201526064016104d5565b600060208284031215611b4357600080fd5b81356001600160e01b031981168114610bc957600080fd5b80356001600160a01b0381168114611b7257600080fd5b919050565b600060208284031215611b8957600080fd5b610bc982611b5b565b600060208284031215611ba457600080fd5b5035919050565b60008060408385031215611bbe57600080fd5b82359150611bce60208401611b5b565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611c0057611c00611bd7565b500190565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611c2e57600080fd5b825167ffffffffffffffff80821115611c4657600080fd5b818501915085601f830112611c5a57600080fd5b815181811115611c6c57611c6c611c05565b8060051b604051601f19603f83011681018181108582111715611c9157611c91611c05565b604052918252848201925083810185019188831115611caf57600080fd5b938501935b82851015611ccd57845184529385019392850192611cb4565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600081600f0b6f7fffffffffffffffffffffffffffffff19811415611d1657611d16611bd7565b60000392915050565b600060208284031215611d3157600080fd5b5051919050565b60005b83811015611d53578181015183820152602001611d3b565b83811115611d62576000848401525b50505050565b60008251611d7a818460208701611d38565b9190910192915050565b600060208284031215611d9657600080fd5b81518015158114610bc957600080fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611dde816017850160208801611d38565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611e0f816028840160208801611d38565b01602801949350505050565b60008151808452611e33816020860160208601611d38565b601f01601f19169290920160200192915050565b602081526000610bc96020830184611e1b565b6000815180845260208085019450848260051b86018286016000805b86811015611ef9578484038a528251805185528681015160608887018190528151908701819052608087019189019085905b80821015611ec85782518452928a0192918a019160019190910190611ea8565b50505060408083015192508682038188015250611ee58183611e1b565b9b88019b9550505091850191600101611e76565b509198975050505050505050565b606080825284519082018190526000906020906080840190828801845b82811015611f4057815184529284019290840190600101611f24565b5050508381038285015285518082528683019183019060005b81811015611f78578351600f0b83529284019291840191600101611f59565b50508481036040860152611ccd8187611e5a565b6000816000190483118215151615611fa657611fa6611bd7565b500290565b600081611fba57611fba611bd7565b50600019019056fea26469706673582212206cc4793a62bfd9e5c5b65f3cc61e87e770a423a735de682a17e99bc803112d5964736f6c634300080a0033

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

00000000000000000000000055231f67b289815483a037d459877d85819e91440000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc7535000000000000000000000000be6c6a389b82306e88d74d1692b67285a9db9a4700000000000000000000000043e8809ea748eff3204ee01f08872f063e44065f000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff000000000000000000000000cc22f6aa610d1b2a0e89ef228079cb3e1831b1d1

-----Decoded View---------------
Arg [0] : liquidityGenerator_ (address): 0x55231F67b289815483a037D459877D85819e9144
Arg [1] : vault_ (address): 0x1d0188c4B276A09366D05d6Be06aF61a73bC7535
Arg [2] : factory_ (address): 0xBe6c6A389b82306e88d74d1692B67285A9db9A47
Arg [3] : mendi_ (address): 0x43E8809ea748EFf3204ee01F08872F063e44065f
Arg [4] : usdc_ (address): 0x176211869cA2b568f2A7D4EE941E073a821EE1ff
Arg [5] : vc_ (address): 0xcc22F6AA610D1b2a0e89EF228079cB3e1831b1D1

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 00000000000000000000000055231f67b289815483a037d459877d85819e9144
Arg [1] : 0000000000000000000000001d0188c4b276a09366d05d6be06af61a73bc7535
Arg [2] : 000000000000000000000000be6c6a389b82306e88d74d1692b67285a9db9a47
Arg [3] : 00000000000000000000000043e8809ea748eff3204ee01f08872f063e44065f
Arg [4] : 000000000000000000000000176211869ca2b568f2a7d4ee941e073a821ee1ff
Arg [5] : 000000000000000000000000cc22f6aa610d1b2a0e89ef228079cb3e1831b1d1


Block Transaction Gas Used Reward
view all blocks sequenced

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

Validator Index Block Amount
View All Withdrawals

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