FTM Price: $0.42 (-1.98%)
Gas: 14 Gwei

Contract

0xf26d401C8051C664c1d2047F0cbc34105AC68Cd0
 

Overview

FTM Balance

Fantom LogoFantom LogoFantom Logo0 FTM

FTM Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Harvest256643252021-12-22 2:13:36790 days 19 hrs ago1640139216IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.01086425106.6975
Harvest255712902021-12-21 2:39:58791 days 18 hrs ago1640054398IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.01282898111.4759
Harvest250772122021-12-16 0:03:00796 days 21 hrs ago1639612980IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.02851012247.7353
Harvest245899632021-12-10 21:56:15801 days 23 hrs ago1639173375IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.06735246585.2512
Harvest243020492021-12-08 0:05:50804 days 21 hrs ago1638921950IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.02382761207.0472
Harvest241085782021-12-06 0:37:54806 days 20 hrs ago1638751074IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.04044127351.4096
Harvest237314622021-12-02 2:19:21810 days 19 hrs ago1638411561IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.02129448185.0359
Harvest235330252021-11-30 2:26:43812 days 19 hrs ago1638239203IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.01275834110.8621
Harvest234211492021-11-28 23:07:41813 days 22 hrs ago1638140861IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.02225631193.3936
Harvest233384062021-11-28 2:09:58814 days 19 hrs ago1638065398IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.02235174194.2228
Harvest231085812021-11-25 17:35:37817 days 3 hrs ago1637861737IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.02833073246.1765
Harvest227517072021-11-22 0:45:19820 days 20 hrs ago1637541919IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.03551853308.6341
Harvest225659322021-11-20 2:35:33822 days 18 hrs ago1637375733IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.02038748177.1546
Harvest224731002021-11-19 3:18:11823 days 18 hrs ago1637291891IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.02130104185.0929
Harvest223666612021-11-18 0:24:18824 days 21 hrs ago1637195058IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.03406086295.9678
Harvest221765252021-11-16 1:31:53826 days 19 hrs ago1637026313IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.11232653976.048
Harvest220814552021-11-15 2:03:25827 days 19 hrs ago1636941805IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.01943545168.8821
Harvest219908512021-11-14 3:45:49828 days 17 hrs ago1636861549IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.01551046132.1513
Harvest218835262021-11-13 1:07:07829 days 20 hrs ago1636765627IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.01393857121.1176
Harvest217817962021-11-11 23:59:04830 days 21 hrs ago1636675144IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.02312561200.9473
Harvest216963442021-11-11 2:57:08831 days 18 hrs ago1636599428IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.01819421158.0965
Harvest215884012021-11-10 0:23:55832 days 21 hrs ago1636503835IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.01418591123.2668
Harvest214993662021-11-09 2:32:29833 days 18 hrs ago1636425149IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.01580395137.3266
Harvest213718572021-11-07 19:32:15835 days 1 hr ago1636313535IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.03762286326.9194
Harvest213717982021-11-07 19:31:18835 days 1 hr ago1636313478IN
Beethoven X: Locked Liquidity Vesting 2
0 FTM0.03379098293.6227
View all transactions

Latest 1 internal transaction

Parent Txn Hash Block From To Value
185909572021-10-08 11:46:19865 days 9 hrs ago1633693579  Contract Creation0 FTM
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MasterChefLpTokenTimelock

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU LGPLv3 license

Contract Source Code (Solidity)

/**
 *Submitted for verification at ftmscan.com on 2021-10-08
*/

// SPDX-License-Identifier: MIXED

// Sources flattened with hardhat v2.6.4 https://hardhat.org

// File @openzeppelin/contracts/token/ERC20/[email protected]

// License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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


// File @openzeppelin/contracts/utils/[email protected]

// License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}


// File @openzeppelin/contracts/token/ERC20/utils/[email protected]

// License-Identifier: MIT

pragma solidity ^0.8.0;


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

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

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

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


// File @openzeppelin/contracts/utils/structs/[email protected]

// License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

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

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

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

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

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

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

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

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly {
            result := store
        }

        return result;
    }
}


// File @openzeppelin/contracts/token/ERC20/extensions/[email protected]

// License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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


// File @openzeppelin/contracts/utils/[email protected]

// License-Identifier: MIT

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 @openzeppelin/contracts/token/ERC20/[email protected]

// License-Identifier: MIT

pragma solidity ^0.8.0;



/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}


// File @openzeppelin/contracts/access/[email protected]

// License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// File contracts_unflattened/token/BeethovenxToken.sol

// License-Identifier: MIT

pragma solidity 0.8.7;


contract BeethovenxToken is ERC20("BeethovenxToken", "BEETS"), Ownable {
    uint256 public constant MAX_SUPPLY = 250_000_000e18; // 250 million beets

    /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
    function mint(address _to, uint256 _amount) public onlyOwner {
        require(
            totalSupply() + _amount <= MAX_SUPPLY,
            "BEETS::mint: cannot exceed max supply"
        );
        _mint(_to, _amount);
    }
}


// File contracts_unflattened/interfaces/IRewarder.sol

// License-Identifier: MIT

pragma solidity 0.8.7;

interface IRewarder {
    function onBeetsReward(
        uint256 pid,
        address user,
        address recipient,
        uint256 beetsAmount,
        uint256 newLpAmount
    ) external;

    function pendingTokens(
        uint256 pid,
        address user,
        uint256 beetsAmount
    ) external view returns (IERC20[] memory, uint256[] memory);
}


// File contracts_unflattened/token/BeethovenxMasterChef.sol

// License-Identifier: MIT

pragma solidity 0.8.7;




/*
    This master chef is based on SUSHI's version with some adjustments:
     - Upgrade to pragma 0.8.7
     - therefore remove usage of SafeMath (built in overflow check for solidity > 8)
     - Merge sushi's master chef V1 & V2 (no usage of dummy pool)
     - remove withdraw function (without harvest) => requires the rewardDebt to be an signed int instead of uint which requires a lot of casting and has no real usecase for us
     - no dev emissions, but treasury emissions instead
     - treasury percentage is subtracted from emissions instead of added on top
     - update of emission rate with upper limit of 6 BEETS/block
     - more require checks in general
*/

// Have fun reading it. Hopefully it's still bug-free
contract BeethovenxMasterChef is Ownable {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        //
        // We do some fancy math here. Basically, any point in time, the amount of BEETS
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accBeetsPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accBeetsPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }
    // Info of each pool.
    struct PoolInfo {
        // we have a fixed number of BEETS tokens released per block, each pool gets his fraction based on the allocPoint
        uint256 allocPoint; // How many allocation points assigned to this pool. the fraction BEETS to distribute per block.
        uint256 lastRewardBlock; // Last block number that BEETS distribution occurs.
        uint256 accBeetsPerShare; // Accumulated BEETS per LP share. this is multiplied by ACC_BEETS_PRECISION for more exact results (rounding errors)
    }
    // The BEETS TOKEN!
    BeethovenxToken public beets;

    // Treasury address.
    address public treasuryAddress;

    // BEETS tokens created per block.
    uint256 public beetsPerBlock;

    uint256 private constant ACC_BEETS_PRECISION = 1e12;

    // distribution percentages: a value of 1000 = 100%
    // 12.8% percentage of pool rewards that goes to the treasury.
    uint256 public constant TREASURY_PERCENTAGE = 128;

    // 87.2% percentage of pool rewards that goes to LP holders.
    uint256 public constant POOL_PERCENTAGE = 872;

    // Info of each pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes LP tokens per pool. poolId => address => userInfo
    /// @notice Address of the LP token for each MCV pool.
    IERC20[] public lpTokens;

    EnumerableSet.AddressSet private lpTokenAddresses;

    /// @notice Address of each `IRewarder` contract in MCV.
    IRewarder[] public rewarder;

    mapping(uint256 => mapping(address => UserInfo)) public userInfo; // mapping form poolId => user Address => User Info
    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint = 0;
    // The block number when BEETS mining starts.
    uint256 public startBlock;

    event Deposit(
        address indexed user,
        uint256 indexed pid,
        uint256 amount,
        address indexed to
    );
    event Withdraw(
        address indexed user,
        uint256 indexed pid,
        uint256 amount,
        address indexed to
    );
    event EmergencyWithdraw(
        address indexed user,
        uint256 indexed pid,
        uint256 amount,
        address indexed to
    );
    event Harvest(address indexed user, uint256 indexed pid, uint256 amount);
    event LogPoolAddition(
        uint256 indexed pid,
        uint256 allocPoint,
        IERC20 indexed lpToken,
        IRewarder indexed rewarder
    );
    event LogSetPool(
        uint256 indexed pid,
        uint256 allocPoint,
        IRewarder indexed rewarder,
        bool overwrite
    );
    event LogUpdatePool(
        uint256 indexed pid,
        uint256 lastRewardBlock,
        uint256 lpSupply,
        uint256 accBeetsPerShare
    );
    event SetTreasuryAddress(
        address indexed oldAddress,
        address indexed newAddress
    );
    event UpdateEmissionRate(address indexed user, uint256 _beetsPerSec);

    constructor(
        BeethovenxToken _beets,
        address _treasuryAddress,
        uint256 _beetsPerBlock,
        uint256 _startBlock
    ) {
        require(
            _beetsPerBlock <= 6e18,
            "maximum emission rate of 6 beets per block exceeded"
        );
        beets = _beets;
        treasuryAddress = _treasuryAddress;
        beetsPerBlock = _beetsPerBlock;
        startBlock = _startBlock;
    }

    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    // Add a new lp to the pool. Can only be called by the owner.
    function add(
        uint256 _allocPoint,
        IERC20 _lpToken,
        IRewarder _rewarder
    ) public onlyOwner {
        require(
            Address.isContract(address(_lpToken)),
            "add: LP token must be a valid contract"
        );
        require(
            Address.isContract(address(_rewarder)) ||
                address(_rewarder) == address(0),
            "add: rewarder must be contract or zero"
        );
        // we make sure the same LP cannot be added twice which would cause trouble
        require(
            !lpTokenAddresses.contains(address(_lpToken)),
            "add: LP already added"
        );

        // respect startBlock!
        uint256 lastRewardBlock = block.number > startBlock
            ? block.number
            : startBlock;
        totalAllocPoint = totalAllocPoint + _allocPoint;

        // LP tokens, rewarders & pools are always on the same index which translates into the pid
        lpTokens.push(_lpToken);
        lpTokenAddresses.add(address(_lpToken));
        rewarder.push(_rewarder);

        poolInfo.push(
            PoolInfo({
                allocPoint: _allocPoint,
                lastRewardBlock: lastRewardBlock,
                accBeetsPerShare: 0
            })
        );
        emit LogPoolAddition(
            lpTokens.length - 1,
            _allocPoint,
            _lpToken,
            _rewarder
        );
    }

    // Update the given pool's BEETS allocation point. Can only be called by the owner.
    /// @param _pid The index of the pool. See `poolInfo`.
    /// @param _allocPoint New AP of the pool.
    /// @param _rewarder Address of the rewarder delegate.
    /// @param overwrite True if _rewarder should be `set`. Otherwise `_rewarder` is ignored.
    function set(
        uint256 _pid,
        uint256 _allocPoint,
        IRewarder _rewarder,
        bool overwrite
    ) public onlyOwner {
        require(
            Address.isContract(address(_rewarder)) ||
                address(_rewarder) == address(0),
            "set: rewarder must be contract or zero"
        );

        // we re-adjust the total allocation points
        totalAllocPoint =
            totalAllocPoint -
            poolInfo[_pid].allocPoint +
            _allocPoint;

        poolInfo[_pid].allocPoint = _allocPoint;

        if (overwrite) {
            rewarder[_pid] = _rewarder;
        }
        emit LogSetPool(
            _pid,
            _allocPoint,
            overwrite ? _rewarder : rewarder[_pid],
            overwrite
        );
    }

    // View function to see pending BEETS on frontend.
    function pendingBeets(uint256 _pid, address _user)
        external
        view
        returns (uint256 pending)
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        // how many BEETS per lp token
        uint256 accBeetsPerShare = pool.accBeetsPerShare;
        // total staked lp tokens in this pool
        uint256 lpSupply = lpTokens[_pid].balanceOf(address(this));

        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 blocksSinceLastReward = block.number - pool.lastRewardBlock;
            // based on the pool weight (allocation points) we calculate the beets rewarded for this specific pool
            uint256 beetsRewards = (blocksSinceLastReward *
                beetsPerBlock *
                pool.allocPoint) / totalAllocPoint;

            // we take parts of the rewards for treasury, these can be subject to change, so we recalculate it
            // a value of 1000 = 100%
            uint256 beetsRewardsForPool = (beetsRewards * POOL_PERCENTAGE) /
                1000;

            // we calculate the new amount of accumulated beets per LP token
            accBeetsPerShare =
                accBeetsPerShare +
                ((beetsRewardsForPool * ACC_BEETS_PRECISION) / lpSupply);
        }
        // based on the number of LP tokens the user owns, we calculate the pending amount by subtracting the amount
        // which he is not eligible for (joined the pool later) or has already harvested
        pending =
            (user.amount * accBeetsPerShare) /
            ACC_BEETS_PRECISION -
            user.rewardDebt;
    }

    /// @notice Update reward variables for all pools. Be careful of gas spending!
    /// @param pids Pool IDs of all to be updated. Make sure to update all active pools.
    function massUpdatePools(uint256[] calldata pids) external {
        uint256 len = pids.length;
        for (uint256 i = 0; i < len; ++i) {
            updatePool(pids[i]);
        }
    }

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) public returns (PoolInfo memory pool) {
        pool = poolInfo[_pid];

        if (block.number > pool.lastRewardBlock) {
            // total lp tokens staked for this pool
            uint256 lpSupply = lpTokens[_pid].balanceOf(address(this));
            if (lpSupply > 0) {
                uint256 blocksSinceLastReward = block.number -
                    pool.lastRewardBlock;

                // rewards for this pool based on his allocation points
                uint256 beetsRewards = (blocksSinceLastReward *
                    beetsPerBlock *
                    pool.allocPoint) / totalAllocPoint;

                uint256 beetsRewardsForPool = (beetsRewards * POOL_PERCENTAGE) /
                    1000;

                beets.mint(
                    treasuryAddress,
                    (beetsRewards * TREASURY_PERCENTAGE) / 1000
                );

                beets.mint(address(this), beetsRewardsForPool);

                pool.accBeetsPerShare =
                    pool.accBeetsPerShare +
                    ((beetsRewardsForPool * ACC_BEETS_PRECISION) / lpSupply);
            }
            pool.lastRewardBlock = block.number;
            poolInfo[_pid] = pool;

            emit LogUpdatePool(
                _pid,
                pool.lastRewardBlock,
                lpSupply,
                pool.accBeetsPerShare
            );
        }
    }

    // Deposit LP tokens to MasterChef for BEETS allocation.
    function deposit(
        uint256 _pid,
        uint256 _amount,
        address _to
    ) public {
        PoolInfo memory pool = updatePool(_pid);
        UserInfo storage user = userInfo[_pid][_to];

        user.amount = user.amount + _amount;
        // since we add more LP tokens, we have to keep track of the rewards he is not eligible for
        // if we would not do that, he would get rewards like he added them since the beginning of this pool
        // note that only the accBeetsPerShare have the precision applied
        user.rewardDebt =
            user.rewardDebt +
            (_amount * pool.accBeetsPerShare) /
            ACC_BEETS_PRECISION;

        IRewarder _rewarder = rewarder[_pid];
        if (address(_rewarder) != address(0)) {
            _rewarder.onBeetsReward(_pid, _to, _to, 0, user.amount);
        }

        lpTokens[_pid].safeTransferFrom(msg.sender, address(this), _amount);

        emit Deposit(msg.sender, _pid, _amount, _to);
    }

    function harvestAll(uint256[] calldata _pids, address _to) external {
        for (uint256 i = 0; i < _pids.length; i++) {
            if (userInfo[_pids[i]][msg.sender].amount > 0) {
                harvest(_pids[i], _to);
            }
        }
    }

    /// @notice Harvest proceeds for transaction sender to `_to`.
    /// @param _pid The index of the pool. See `poolInfo`.
    /// @param _to Receiver of BEETS rewards.
    function harvest(uint256 _pid, address _to) public {
        PoolInfo memory pool = updatePool(_pid);
        UserInfo storage user = userInfo[_pid][msg.sender];

        // this would  be the amount if the user joined right from the start of the farm
        uint256 accumulatedBeets = (user.amount * pool.accBeetsPerShare) /
            ACC_BEETS_PRECISION;
        // subtracting the rewards the user is not eligible for
        uint256 eligibleBeets = accumulatedBeets - user.rewardDebt;

        // we set the new rewardDebt to the current accumulated amount of rewards for his amount of LP token
        user.rewardDebt = accumulatedBeets;

        if (eligibleBeets > 0) {
            safeBeetsTransfer(_to, eligibleBeets);
        }

        IRewarder _rewarder = rewarder[_pid];
        if (address(_rewarder) != address(0)) {
            _rewarder.onBeetsReward(
                _pid,
                msg.sender,
                _to,
                eligibleBeets,
                user.amount
            );
        }

        emit Harvest(msg.sender, _pid, eligibleBeets);
    }

    /// @notice Withdraw LP tokens from MCV and harvest proceeds for transaction sender to `_to`.
    /// @param _pid The index of the pool. See `poolInfo`.
    /// @param _amount LP token amount to withdraw.
    /// @param _to Receiver of the LP tokens and BEETS rewards.
    function withdrawAndHarvest(
        uint256 _pid,
        uint256 _amount,
        address _to
    ) public {
        PoolInfo memory pool = updatePool(_pid);
        UserInfo storage user = userInfo[_pid][msg.sender];

        require(_amount <= user.amount, "cannot withdraw more than deposited");

        // this would  be the amount if the user joined right from the start of the farm
        uint256 accumulatedBeets = (user.amount * pool.accBeetsPerShare) /
            ACC_BEETS_PRECISION;
        // subtracting the rewards the user is not eligible for
        uint256 eligibleBeets = accumulatedBeets - user.rewardDebt;

        /*
            after harvest & withdraw, he should be eligible for exactly 0 tokens
            => userInfo.amount * pool.accBeetsPerShare / ACC_BEETS_PRECISION == userInfo.rewardDebt
            since we are removing some LP's from userInfo.amount, we also have to remove
            the equivalent amount of reward debt
        */

        user.rewardDebt =
            accumulatedBeets -
            (_amount * pool.accBeetsPerShare) /
            ACC_BEETS_PRECISION;
        user.amount = user.amount - _amount;

        safeBeetsTransfer(_to, eligibleBeets);

        IRewarder _rewarder = rewarder[_pid];
        if (address(_rewarder) != address(0)) {
            _rewarder.onBeetsReward(
                _pid,
                msg.sender,
                _to,
                eligibleBeets,
                user.amount
            );
        }

        lpTokens[_pid].safeTransfer(_to, _amount);

        emit Withdraw(msg.sender, _pid, _amount, _to);
        emit Harvest(msg.sender, _pid, eligibleBeets);
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 _pid, address _to) public {
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint256 amount = user.amount;
        user.amount = 0;
        user.rewardDebt = 0;

        IRewarder _rewarder = rewarder[_pid];
        if (address(_rewarder) != address(0)) {
            _rewarder.onBeetsReward(_pid, msg.sender, _to, 0, 0);
        }

        // Note: transfer can fail or succeed if `amount` is zero.
        lpTokens[_pid].safeTransfer(_to, amount);
        emit EmergencyWithdraw(msg.sender, _pid, amount, _to);
    }

    // Safe BEETS transfer function, just in case if rounding error causes pool to not have enough BEETS.
    function safeBeetsTransfer(address _to, uint256 _amount) internal {
        uint256 beetsBalance = beets.balanceOf(address(this));
        if (_amount > beetsBalance) {
            beets.transfer(_to, beetsBalance);
        } else {
            beets.transfer(_to, _amount);
        }
    }

    // Update treasury address by the owner.
    function treasury(address _treasuryAddress) public onlyOwner {
        treasuryAddress = _treasuryAddress;
        emit SetTreasuryAddress(treasuryAddress, _treasuryAddress);
    }

    function updateEmissionRate(uint256 _beetsPerBlock) public onlyOwner {
        require(
            _beetsPerBlock <= 6e18,
            "maximum emission rate of 6 beets per block exceeded"
        );
        beetsPerBlock = _beetsPerBlock;
        emit UpdateEmissionRate(msg.sender, _beetsPerBlock);
    }
}


// File contracts_unflattened/vesting/MasterChefLpTokenTimelock.sol

// License-Identifier: MIT

pragma solidity 0.8.7;


// based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.3.0/contracts/token/ERC20/utils/TokenTimelock.sol

/**
 * @dev A token holder contract that will allow a beneficiary to extract the
 * tokens after a given release time.
 *
 * Useful for simple vesting schedules like "advisors get all of their tokens
 * after 1 year".
 */

/*
    Additions:
        - stake tokens on deposit in master chef pool
        - allow withdrawal of master chef rewards at any time
        - un-stake and transfer tokens to beneficiary on release
*/
contract MasterChefLpTokenTimelock {
    using SafeERC20 for IERC20;

    // ERC20 basic token contract being held
    IERC20 private immutable _token;

    // beneficiary of tokens after they are released
    address private immutable _beneficiary;

    // timestamp when token release is enabled
    uint256 private immutable _releaseTime;

    BeethovenxMasterChef private _masterChef;

    uint256 private immutable _masterChefPoolId;

    constructor(
        IERC20 token_,
        address beneficiary_,
        uint256 releaseTime_,
        BeethovenxMasterChef masterChef_,
        uint256 masterChefPoolId_
    ) {
        require(
            releaseTime_ > block.timestamp,
            "TokenTimelock: release time is before current time"
        );
        require(
            masterChef_.lpTokens(masterChefPoolId_) == token_,
            "Provided poolId not eligible for this token"
        );
        _token = token_;
        _beneficiary = beneficiary_;
        _releaseTime = releaseTime_;
        _masterChef = masterChef_;
        _masterChefPoolId = masterChefPoolId_;
    }

    /**
     * @return the token being held.
     */
    function token() public view returns (IERC20) {
        return _token;
    }

    /**
     * @return the beneficiary of the tokens.
     */
    function beneficiary() public view returns (address) {
        return _beneficiary;
    }

    /**
     * @return the time when the tokens are released.
     */
    function releaseTime() public view returns (uint256) {
        return _releaseTime;
    }

    /**
     * @notice Transfers tokens held by timelock to beneficiary.
     */
    function release() public {
        require(
            block.timestamp >= releaseTime(),
            "TokenTimelock: current time is before release time"
        );

        (uint256 amount, uint256 rewardDebt) = _masterChef.userInfo(
            masterChefPoolId(),
            address(this)
        );
        // withdraw & harvest all from master chef
        _masterChef.withdrawAndHarvest(
            masterChefPoolId(),
            amount,
            beneficiary()
        );

        // release everything which remained on this contract
        uint256 localAmount = token().balanceOf(address(this));

        if (localAmount > 0) {
            token().safeTransfer(beneficiary(), localAmount);
        }
    }

    function masterChefPoolId() public view returns (uint256) {
        return _masterChefPoolId;
    }

    /**
     * @notice Transfers tokens held by timelock to master chef pool.
     */
    function depositAllToMasterChef(uint256 amount) external {
        _token.safeTransferFrom(msg.sender, address(this), amount);

        _token.approve(address(_masterChef), _token.balanceOf(address(this)));
        _masterChef.deposit(
            _masterChefPoolId,
            _token.balanceOf(address(this)),
            address(this)
        );
    }

    function harvest() external {
        _masterChef.harvest(masterChefPoolId(), beneficiary());
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"token_","type":"address"},{"internalType":"address","name":"beneficiary_","type":"address"},{"internalType":"uint256","name":"releaseTime_","type":"uint256"},{"internalType":"contract BeethovenxMasterChef","name":"masterChef_","type":"address"},{"internalType":"uint256","name":"masterChefPoolId_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"beneficiary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositAllToMasterChef","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"masterChefPoolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"releaseTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6101006040523480156200001257600080fd5b5060405162000eb938038062000eb9833981016040819052620000359162000202565b428311620000a55760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2072656c656173652074696d65206973206260448201527165666f72652063757272656e742074696d6560701b60648201526084015b60405180910390fd5b6040516306ed78b760e21b8152600481018290526001600160a01b038087169190841690631bb5e2dc9060240160206040518083038186803b158015620000eb57600080fd5b505afa15801562000100573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001269190620001db565b6001600160a01b031614620001925760405162461bcd60e51b815260206004820152602b60248201527f50726f766964656420706f6f6c4964206e6f7420656c696769626c6520666f7260448201526a103a3434b9903a37b5b2b760a91b60648201526084016200009c565b606094851b6001600160601b03199081166080529390941b90921660a05260c052600080546001600160a01b0319166001600160a01b0390921691909117905560e05262000283565b600060208284031215620001ee57600080fd5b8151620001fb816200026a565b9392505050565b600080600080600060a086880312156200021b57600080fd5b855162000228816200026a565b60208701519095506200023b816200026a565b60408701516060880151919550935062000255816200026a565b80925050608086015190509295509295909350565b6001600160a01b03811681146200028057600080fd5b50565b60805160601c60a05160601c60c05160e051610b9d6200031c6000396000818160cd015281816101750152818161039a0152818161053901526105e2015260008181610118015261049701526000818160840152818161019601528181610604015261076301526000818161013e015281816102230152818161026b015281816103bc0152818161069101526107410152610b9d6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80636e29a56b1161005b5780636e29a56b146100fb57806386d1a69f1461010e578063b91d400114610116578063fc0c546a1461013c57600080fd5b806338af3eed146100825780634641257d146100c15780636b4788a9146100cb575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b6100c9610162565b005b7f00000000000000000000000000000000000000000000000000000000000000005b6040519081526020016100b8565b6100c9610109366004610a96565b610216565b6100c9610495565b7f00000000000000000000000000000000000000000000000000000000000000006100ed565b7f00000000000000000000000000000000000000000000000000000000000000006100a4565b6000546001600160a01b03166318fccc767f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401600060405180830381600087803b1580156101fc57600080fd5b505af1158015610210573d6000803e3d6000fd5b50505050565b61024b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308461078d565b6000546040516370a0823160e01b81523060048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169263095ea7b39291169083906370a082319060240160206040518083038186803b1580156102b957600080fd5b505afa1580156102cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f19190610aaf565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561033757600080fd5b505af115801561034b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036f9190610a74565b506000546040516370a0823160e01b81523060048201526001600160a01b0391821691638dbdbe6d917f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000016906370a082319060240160206040518083038186803b1580156103fe57600080fd5b505afa158015610412573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104369190610aaf565b6040516001600160e01b031960e085901b16815260048101929092526024820152306044820152606401600060405180830381600087803b15801561047a57600080fd5b505af115801561048e573d6000803e3d6000fd5b5050505050565b7f00000000000000000000000000000000000000000000000000000000000000004210156105255760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206260448201527165666f72652072656c656173652074696d6560701b60648201526084015b60405180910390fd5b60008054604080516393f1a40b60e01b81527f00000000000000000000000000000000000000000000000000000000000000006004820152306024820152815184936001600160a01b0316926393f1a40b9260448082019391829003018186803b15801561059257600080fd5b505afa1580156105a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ca9190610ac8565b60005491935091506001600160a01b031663d1abb9077f0000000000000000000000000000000000000000000000000000000000000000847f00000000000000000000000000000000000000000000000000000000000000006040516001600160e01b031960e086901b168152600481019390935260248301919091526001600160a01b03166044820152606401600060405180830381600087803b15801561067257600080fd5b505af1158015610686573d6000803e3d6000fd5b5050505060006106b37f000000000000000000000000000000000000000000000000000000000000000090565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b1580156106f457600080fd5b505afa158015610708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072c9190610aaf565b90508015610788576107886001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000836107f8565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526102109085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610828565b6040516001600160a01b03831660248201526044810182905261078890849063a9059cbb60e01b906064016107c1565b600061087d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166108fa9092919063ffffffff16565b805190915015610788578080602001905181019061089b9190610a74565b6107885760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161051c565b60606109098484600085610913565b90505b9392505050565b6060824710156109745760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161051c565b843b6109c25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161051c565b600080866001600160a01b031685876040516109de9190610aec565b60006040518083038185875af1925050503d8060008114610a1b576040519150601f19603f3d011682016040523d82523d6000602084013e610a20565b606091505b5091509150610a30828286610a3b565b979650505050505050565b60608315610a4a57508161090c565b825115610a5a5782518084602001fd5b8160405162461bcd60e51b815260040161051c9190610b08565b600060208284031215610a8657600080fd5b8151801515811461090c57600080fd5b600060208284031215610aa857600080fd5b5035919050565b600060208284031215610ac157600080fd5b5051919050565b60008060408385031215610adb57600080fd5b505080516020909101519092909150565b60008251610afe818460208701610b3b565b9190910192915050565b6020815260008251806020840152610b27816040850160208701610b3b565b601f01601f19169190910160400192915050565b60005b83811015610b56578181015183820152602001610b3e565b83811115610210575050600091015256fea26469706673582212206e9c4066ccd70e76cf4ba5dc5a85bff5e3198e6628a05e7264cf552349ea0d3d64736f6c6343000807003300000000000000000000000003c6b3f09d2504606936b1a4decefad204687890000000000000000000000000c84f644bbe4dca6df7441463472817211637f99b0000000000000000000000000000000000000000000000000000018050c494700000000000000000000000008166994d9ebbe5829ec86bd81258149b87facfd30000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80636e29a56b1161005b5780636e29a56b146100fb57806386d1a69f1461010e578063b91d400114610116578063fc0c546a1461013c57600080fd5b806338af3eed146100825780634641257d146100c15780636b4788a9146100cb575b600080fd5b7f000000000000000000000000c84f644bbe4dca6df7441463472817211637f99b5b6040516001600160a01b0390911681526020015b60405180910390f35b6100c9610162565b005b7f00000000000000000000000000000000000000000000000000000000000000005b6040519081526020016100b8565b6100c9610109366004610a96565b610216565b6100c9610495565b7f0000000000000000000000000000000000000000000000000000018050c494706100ed565b7f00000000000000000000000003c6b3f09d2504606936b1a4decefad2046878906100a4565b6000546001600160a01b03166318fccc767f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000c84f644bbe4dca6df7441463472817211637f99b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401600060405180830381600087803b1580156101fc57600080fd5b505af1158015610210573d6000803e3d6000fd5b50505050565b61024b6001600160a01b037f00000000000000000000000003c6b3f09d2504606936b1a4decefad2046878901633308461078d565b6000546040516370a0823160e01b81523060048201526001600160a01b037f00000000000000000000000003c6b3f09d2504606936b1a4decefad20468789081169263095ea7b39291169083906370a082319060240160206040518083038186803b1580156102b957600080fd5b505afa1580156102cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f19190610aaf565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561033757600080fd5b505af115801561034b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036f9190610a74565b506000546040516370a0823160e01b81523060048201526001600160a01b0391821691638dbdbe6d917f0000000000000000000000000000000000000000000000000000000000000000917f00000000000000000000000003c6b3f09d2504606936b1a4decefad20468789016906370a082319060240160206040518083038186803b1580156103fe57600080fd5b505afa158015610412573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104369190610aaf565b6040516001600160e01b031960e085901b16815260048101929092526024820152306044820152606401600060405180830381600087803b15801561047a57600080fd5b505af115801561048e573d6000803e3d6000fd5b5050505050565b7f0000000000000000000000000000000000000000000000000000018050c494704210156105255760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206260448201527165666f72652072656c656173652074696d6560701b60648201526084015b60405180910390fd5b60008054604080516393f1a40b60e01b81527f00000000000000000000000000000000000000000000000000000000000000006004820152306024820152815184936001600160a01b0316926393f1a40b9260448082019391829003018186803b15801561059257600080fd5b505afa1580156105a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ca9190610ac8565b60005491935091506001600160a01b031663d1abb9077f0000000000000000000000000000000000000000000000000000000000000000847f000000000000000000000000c84f644bbe4dca6df7441463472817211637f99b6040516001600160e01b031960e086901b168152600481019390935260248301919091526001600160a01b03166044820152606401600060405180830381600087803b15801561067257600080fd5b505af1158015610686573d6000803e3d6000fd5b5050505060006106b37f00000000000000000000000003c6b3f09d2504606936b1a4decefad20468789090565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b1580156106f457600080fd5b505afa158015610708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072c9190610aaf565b90508015610788576107886001600160a01b037f00000000000000000000000003c6b3f09d2504606936b1a4decefad204687890167f000000000000000000000000c84f644bbe4dca6df7441463472817211637f99b836107f8565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526102109085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610828565b6040516001600160a01b03831660248201526044810182905261078890849063a9059cbb60e01b906064016107c1565b600061087d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166108fa9092919063ffffffff16565b805190915015610788578080602001905181019061089b9190610a74565b6107885760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161051c565b60606109098484600085610913565b90505b9392505050565b6060824710156109745760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161051c565b843b6109c25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161051c565b600080866001600160a01b031685876040516109de9190610aec565b60006040518083038185875af1925050503d8060008114610a1b576040519150601f19603f3d011682016040523d82523d6000602084013e610a20565b606091505b5091509150610a30828286610a3b565b979650505050505050565b60608315610a4a57508161090c565b825115610a5a5782518084602001fd5b8160405162461bcd60e51b815260040161051c9190610b08565b600060208284031215610a8657600080fd5b8151801515811461090c57600080fd5b600060208284031215610aa857600080fd5b5035919050565b600060208284031215610ac157600080fd5b5051919050565b60008060408385031215610adb57600080fd5b505080516020909101519092909150565b60008251610afe818460208701610b3b565b9190910192915050565b6020815260008251806020840152610b27816040850160208701610b3b565b601f01601f19169190910160400192915050565b60005b83811015610b56578181015183820152602001610b3e565b83811115610210575050600091015256fea26469706673582212206e9c4066ccd70e76cf4ba5dc5a85bff5e3198e6628a05e7264cf552349ea0d3d64736f6c63430008070033

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

00000000000000000000000003c6b3f09d2504606936b1a4decefad204687890000000000000000000000000c84f644bbe4dca6df7441463472817211637f99b0000000000000000000000000000000000000000000000000000018050c494700000000000000000000000008166994d9ebbe5829ec86bd81258149b87facfd30000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : token_ (address): 0x03c6B3f09D2504606936b1A4DeCeFaD204687890
Arg [1] : beneficiary_ (address): 0xC84f644BBe4dca6DF7441463472817211637F99b
Arg [2] : releaseTime_ (uint256): 1650622502000
Arg [3] : masterChef_ (address): 0x8166994d9ebBe5829EC86Bd81258149B87faCfd3
Arg [4] : masterChefPoolId_ (uint256): 0

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000003c6b3f09d2504606936b1a4decefad204687890
Arg [1] : 000000000000000000000000c84f644bbe4dca6df7441463472817211637f99b
Arg [2] : 0000000000000000000000000000000000000000000000000000018050c49470
Arg [3] : 0000000000000000000000008166994d9ebbe5829ec86bd81258149b87facfd3
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000


Deployed Bytecode Sourcemap

63388:3128:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;64735:91;64806:12;64735:91;;;-1:-1:-1;;;;;1363:32:1;;;1345:51;;1333:2;1318:18;64735:91:0;;;;;;;;66412:101;;;:::i;:::-;;65843;65919:17;65843:101;;;4416:25:1;;;4404:2;4389:18;65843:101:0;4270:177:1;66041:363:0;;;;;;:::i;:::-;;:::i;65090:745::-;;;:::i;64907:91::-;64978:12;64907:91;;64584:78;64648:6;64584:78;;66412:101;66451:11;;-1:-1:-1;;;;;66451:11:0;:19;65919:17;64806:12;66451:54;;-1:-1:-1;;;;;;66451:54:0;;;;;;;;;;4626:25:1;;;;-1:-1:-1;;;;;4687:32:1;4667:18;;;4660:60;4599:18;;66451:54:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;66412:101::o;66041:363::-;66109:58;-1:-1:-1;;;;;66109:6:0;:23;66133:10;66153:4;66160:6;66109:23;:58::i;:::-;66203:11;;66217:31;;-1:-1:-1;;;66217:31:0;;66242:4;66217:31;;;1345:51:1;-1:-1:-1;;;;;66180:6:0;:14;;;;;66203:11;;;66180:14;;66217:16;;1318:18:1;;66217:31:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;66180:69;;-1:-1:-1;;;;;;66180:69:0;;;;;;;-1:-1:-1;;;;;1979:32:1;;;66180:69:0;;;1961:51:1;2028:18;;;2021:34;1934:18;;66180:69:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;66260:11:0;;66326:31;;-1:-1:-1;;;66326:31:0;;66351:4;66326:31;;;1345:51:1;-1:-1:-1;;;;;66260:11:0;;;;:19;;66294:17;;66326:6;:16;;;;1318:18:1;;66326:31:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;66260:136;;-1:-1:-1;;;;;;66260:136:0;;;;;;;;;;4933:25:1;;;;4974:18;;;4967:34;66380:4:0;5017:18:1;;;5010:60;4906:18;;66260:136:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;66041:363;:::o;65090:745::-;64978:12;65149:15;:32;;65127:132;;;;-1:-1:-1;;;65127:132:0;;2877:2:1;65127:132:0;;;2859:21:1;2916:2;2896:18;;;2889:30;2955:34;2935:18;;;2928:62;-1:-1:-1;;;3006:18:1;;;2999:48;3064:19;;65127:132:0;;;;;;;;;65273:14;65311:11;;:92;;;-1:-1:-1;;;65311:92:0;;65919:17;65311:92;;;4626:25:1;65387:4:0;4667:18:1;;;4660:60;65311:92:0;;65273:14;;-1:-1:-1;;;;;65311:11:0;;:20;;4599:18:1;;;;;65311:92:0;;;;;;:11;:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;65466:11;;65272:131;;-1:-1:-1;65272:131:0;-1:-1:-1;;;;;;65466:11:0;:30;65919:17;65544:6;64806:12;65466:123;;-1:-1:-1;;;;;;65466:123:0;;;;;;;;;;4933:25:1;;;;4974:18;;;4967:34;;;;-1:-1:-1;;;;;5037:32:1;5017:18;;;5010:60;4906:18;;65466:123:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;65665:19;65687:7;64648:6;;64584:78;65687:7;:32;;-1:-1:-1;;;65687:32:0;;65713:4;65687:32;;;1345:51:1;-1:-1:-1;;;;;65687:17:0;;;;;;;1318:18:1;;65687:32:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;65665:54;-1:-1:-1;65736:15:0;;65732:96;;65768:48;-1:-1:-1;;;;;64648:6:0;65768:20;64806:12;65804:11;65768:20;:48::i;:::-;65116:719;;;65090:745::o;11981:248::-;12152:68;;-1:-1:-1;;;;;1665:15:1;;;12152:68:0;;;1647:34:1;1717:15;;1697:18;;;1690:43;1749:18;;;1742:34;;;12125:96:0;;12145:5;;-1:-1:-1;;;12175:27:0;1582:18:1;;12152:68:0;;;;-1:-1:-1;;12152:68:0;;;;;;;;;;;;;;-1:-1:-1;;;;;12152:68:0;-1:-1:-1;;;;;;12152:68:0;;;;;;;;;;12125:19;:96::i;11762:211::-;11906:58;;-1:-1:-1;;;;;1979:32:1;;11906:58:0;;;1961:51:1;2028:18;;;2021:34;;;11879:86:0;;11899:5;;-1:-1:-1;;;11929:23:0;1934:18:1;;11906:58:0;1787:274:1;14335:716:0;14759:23;14785:69;14813:4;14785:69;;;;;;;;;;;;;;;;;14793:5;-1:-1:-1;;;;;14785:27:0;;;:69;;;;;:::i;:::-;14869:17;;14759:95;;-1:-1:-1;14869:21:0;14865:179;;14966:10;14955:30;;;;;;;;;;;;:::i;:::-;14947:85;;;;-1:-1:-1;;;14947:85:0;;4061:2:1;14947:85:0;;;4043:21:1;4100:2;4080:18;;;4073:30;4139:34;4119:18;;;4112:62;-1:-1:-1;;;4190:18:1;;;4183:40;4240:19;;14947:85:0;3859:406:1;6576:229:0;6713:12;6745:52;6767:6;6775:4;6781:1;6784:12;6745:21;:52::i;:::-;6738:59;;6576:229;;;;;;:::o;7696:510::-;7866:12;7924:5;7899:21;:30;;7891:81;;;;-1:-1:-1;;;7891:81:0;;3296:2:1;7891:81:0;;;3278:21:1;3335:2;3315:18;;;3308:30;3374:34;3354:18;;;3347:62;-1:-1:-1;;;3425:18:1;;;3418:36;3471:19;;7891:81:0;3094:402:1;7891:81:0;4093:20;;7983:60;;;;-1:-1:-1;;;7983:60:0;;3703:2:1;7983:60:0;;;3685:21:1;3742:2;3722:18;;;3715:30;3781:31;3761:18;;;3754:59;3830:18;;7983:60:0;3501:353:1;7983:60:0;8057:12;8071:23;8098:6;-1:-1:-1;;;;;8098:11:0;8117:5;8124:4;8098:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8056:73;;;;8147:51;8164:7;8173:10;8185:12;8147:16;:51::i;:::-;8140:58;7696:510;-1:-1:-1;;;;;;;7696:510:0:o;10382:712::-;10532:12;10561:7;10557:530;;;-1:-1:-1;10592:10:0;10585:17;;10557:530;10706:17;;:21;10702:374;;10904:10;10898:17;10965:15;10952:10;10948:2;10944:19;10937:44;10702:374;11047:12;11040:20;;-1:-1:-1;;;11040:20:0;;;;;;;;:::i;14:277:1:-;81:6;134:2;122:9;113:7;109:23;105:32;102:52;;;150:1;147;140:12;102:52;182:9;176:16;235:5;228:13;221:21;214:5;211:32;201:60;;257:1;254;247:12;296:180;355:6;408:2;396:9;387:7;383:23;379:32;376:52;;;424:1;421;414:12;376:52;-1:-1:-1;447:23:1;;296:180;-1:-1:-1;296:180:1:o;481:184::-;551:6;604:2;592:9;583:7;579:23;575:32;572:52;;;620:1;617;610:12;572:52;-1:-1:-1;643:16:1;;481:184;-1:-1:-1;481:184:1:o;670:245::-;749:6;757;810:2;798:9;789:7;785:23;781:32;778:52;;;826:1;823;816:12;778:52;-1:-1:-1;;849:16:1;;905:2;890:18;;;884:25;849:16;;884:25;;-1:-1:-1;670:245:1:o;920:274::-;1049:3;1087:6;1081:13;1103:53;1149:6;1144:3;1137:4;1129:6;1125:17;1103:53;:::i;:::-;1172:16;;;;;920:274;-1:-1:-1;;920:274:1:o;2287:383::-;2436:2;2425:9;2418:21;2399:4;2468:6;2462:13;2511:6;2506:2;2495:9;2491:18;2484:34;2527:66;2586:6;2581:2;2570:9;2566:18;2561:2;2553:6;2549:15;2527:66;:::i;:::-;2654:2;2633:15;-1:-1:-1;;2629:29:1;2614:45;;;;2661:2;2610:54;;2287:383;-1:-1:-1;;2287:383:1:o;5081:258::-;5153:1;5163:113;5177:6;5174:1;5171:13;5163:113;;;5253:11;;;5247:18;5234:11;;;5227:39;5199:2;5192:10;5163:113;;;5294:6;5291:1;5288:13;5285:48;;;-1:-1:-1;;5329:1:1;5311:16;;5304:27;5081:258::o

Swarm Source

ipfs://6e9c4066ccd70e76cf4ba5dc5a85bff5e3198e6628a05e7264cf552349ea0d3d

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn 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.