Contract 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x4f6a6ccc9fa93bfaa232a8d7bb7e6563c405f3ca98211923ab1e2242c41b49dcDeposit590088882023-02-08 5:41:091 hr 29 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00005599
0x5714af1a20976cfe48b46bbbf3aeca295fffd880a39edfd0c4942db05844cad6Deposit590088472023-02-08 5:40:591 hr 29 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00005599
0xb9acf85e56de9729fa30976c95fec46f9eb4eaf2407b1a4a538e5603deeec662Deposit590087572023-02-08 5:40:351 hr 29 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00005599
0x8e977ad4e1189b7f38d72b5ac704d76881fccf3d6aa4ca37bc84ae64f5ac34abEmergency Withdr...589066412023-02-07 21:13:019 hrs 57 mins ago0xef669b7c021853c091b5ef77068594ff081f987e IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00005323
0x864e035284748c5449b4d959d3e17183f23edf34a582311ca07523e8eed578b9Emergency Withdr...589061702023-02-07 21:10:579 hrs 59 mins ago0xef669b7c021853c091b5ef77068594ff081f987e IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00005415
0x878f6e70ea25e73ad5af2f76dde0ab4a106ee57d779729c89727e18adf921eebWithdraw588131762023-02-07 14:02:4517 hrs 7 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00006884
0x52d39f93a629d2241eaa2cafd63fa15dc7536f7bacfd1d39b5a282d1323c4822Deposit587088002023-02-07 6:17:451 day 52 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00005103
0x7b91b92088bce763aab5c1d0cf1c694a232b2c8d8ef2ae8769dc38967d4c4d3dDeposit587067562023-02-07 6:07:301 day 1 hr ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00004605
0x4251183f9c8f39fa83a9ba1f4e03a12bddf5612a72c5663e6346ef9dd3b38fcbDeposit587067152023-02-07 6:07:181 day 1 hr ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00004605
0xb8ac4753db31358742e5fe8bc720b0c395b1477ea40341ebd8894ec50281e2acDeposit587066812023-02-07 6:07:071 day 1 hr ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00004605
0x2057795d86e1e738817db7f6c6ba5d759ced2ab285192dd7535d19e268c6e43aWithdraw586314672023-02-06 22:59:221 day 8 hrs ago0x590da95c1c8e4b4a867504530c2c5f32abd5731d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.0000657
0xa91c6ef0115a3e8a92654a80ffb655c9cab7d1135e24d40e5cd923dd7d8fde44Harvest Many586309322023-02-06 22:55:321 day 8 hrs ago0x590da95c1c8e4b4a867504530c2c5f32abd5731d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00007778
0xff618547a5cac998035f86f72fc3dd8b2b10c8e0b89d8184a5c39e6ada815389Harvest Many585927132023-02-06 19:27:031 day 11 hrs ago0xb4c24b0fe698c8d3fef2f773c49a323ba586ffbe IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00007524
0x2218fcc0a8eba89295b4fba37751a8c627f58e040ce14c51e227472764496092Deposit585037382023-02-06 12:36:191 day 18 hrs ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00004864
0x0f99cdd20fb51490e69a839cc85560d53eedced068f1188dd694c30c710d7cb6Deposit584587552023-02-06 9:07:441 day 22 hrs ago0x25d620ae7847dbb7ceda8bd562bf3cb3f05a2562 IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00003477
0x9da451ee6f2434f2d4d437b1e4033adfd305b43129d46d0e7dfdad4d01742b4dHarvest Many584586862023-02-06 9:07:261 day 22 hrs ago0x25d620ae7847dbb7ceda8bd562bf3cb3f05a2562 IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00003602
0x5fc534bbf5c082aba6c9bfc0dbf822a92e71a7a417c513ae5b4e795d923d3184Deposit584291852023-02-06 6:52:422 days 17 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00004639
0xe4817ca55bbabf38dfc53dd3d7dff71ace0df4a8c3cad1cb58e1a5e731d6b92aDeposit584268652023-02-06 6:40:482 days 29 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00004287
0x1eefc5dba9db7b08263183a1d24f5b6b9cc46e637ee21c3018d556889ed81ab2Deposit584268352023-02-06 6:40:392 days 29 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00004287
0x6c0634a461f810b90f1f6852e1dffdf42d5168ad11bd299e3927ca60cc4b35e6Deposit584267842023-02-06 6:40:282 days 29 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00004273
0xe9424b479c5c622d1db59c2c7a6f2a8d6fc92335d334bee9824b80765f76ed06Deposit581503812023-02-05 7:03:223 days 6 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.000041
0x1f586d94fdcd3090985308a1d9a1acafefc74b82388755a21f97a7a79ff44778Deposit581503532023-02-05 7:03:123 days 7 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.000041
0x204383e08bbeb711a0273e82efe246d977b595a004bdccc84dc8aec598728060Deposit581503182023-02-05 7:03:013 days 7 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.000041
0xf17d6e79e2a8fb423fb00b598c068e698519605da402b283b45ef151cc595197Harvest Many580532042023-02-04 21:36:043 days 9 hrs ago0xb4c24b0fe698c8d3fef2f773c49a323ba586ffbe IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00006501
0xee261420f06f39fb3c32b9ffc0a125da1d41abe21e34d7dc0e23061768280f22Deposit578762962023-02-04 6:21:574 days 48 mins ago0x6285f201641ae13d7ae9a272987f756c0a17c68d IN  0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70 ETH0.00004834
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x4f6a6ccc9fa93bfaa232a8d7bb7e6563c405f3ca98211923ab1e2242c41b49dc590088882023-02-08 5:41:091 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x4f6a6ccc9fa93bfaa232a8d7bb7e6563c405f3ca98211923ab1e2242c41b49dc590088882023-02-08 5:41:091 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x4f6a6ccc9fa93bfaa232a8d7bb7e6563c405f3ca98211923ab1e2242c41b49dc590088882023-02-08 5:41:091 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x4f6a6ccc9fa93bfaa232a8d7bb7e6563c405f3ca98211923ab1e2242c41b49dc590088882023-02-08 5:41:091 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x4f6a6ccc9fa93bfaa232a8d7bb7e6563c405f3ca98211923ab1e2242c41b49dc590088882023-02-08 5:41:091 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x5714af1a20976cfe48b46bbbf3aeca295fffd880a39edfd0c4942db05844cad6590088472023-02-08 5:40:591 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x5714af1a20976cfe48b46bbbf3aeca295fffd880a39edfd0c4942db05844cad6590088472023-02-08 5:40:591 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x5714af1a20976cfe48b46bbbf3aeca295fffd880a39edfd0c4942db05844cad6590088472023-02-08 5:40:591 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x5714af1a20976cfe48b46bbbf3aeca295fffd880a39edfd0c4942db05844cad6590088472023-02-08 5:40:591 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x5714af1a20976cfe48b46bbbf3aeca295fffd880a39edfd0c4942db05844cad6590088472023-02-08 5:40:591 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0xb9acf85e56de9729fa30976c95fec46f9eb4eaf2407b1a4a538e5603deeec662590087572023-02-08 5:40:351 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0xb9acf85e56de9729fa30976c95fec46f9eb4eaf2407b1a4a538e5603deeec662590087572023-02-08 5:40:351 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0xb9acf85e56de9729fa30976c95fec46f9eb4eaf2407b1a4a538e5603deeec662590087572023-02-08 5:40:351 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0xb9acf85e56de9729fa30976c95fec46f9eb4eaf2407b1a4a538e5603deeec662590087572023-02-08 5:40:351 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0xb9acf85e56de9729fa30976c95fec46f9eb4eaf2407b1a4a538e5603deeec662590087572023-02-08 5:40:351 hr 29 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x8e977ad4e1189b7f38d72b5ac704d76881fccf3d6aa4ca37bc84ae64f5ac34ab589066412023-02-07 21:13:019 hrs 57 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70xd8db394c02c9f654c99a57f9b4902f4df12ec50d0 ETH
0x864e035284748c5449b4d959d3e17183f23edf34a582311ca07523e8eed578b9589061702023-02-07 21:10:579 hrs 59 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70xc372a8d6f0f5ce190d014b8043c63fc13ace4b600 ETH
0x878f6e70ea25e73ad5af2f76dde0ab4a106ee57d779729c89727e18adf921eeb588131762023-02-07 14:02:4517 hrs 7 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70xc372a8d6f0f5ce190d014b8043c63fc13ace4b600 ETH
0x878f6e70ea25e73ad5af2f76dde0ab4a106ee57d779729c89727e18adf921eeb588131762023-02-07 14:02:4517 hrs 7 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x878f6e70ea25e73ad5af2f76dde0ab4a106ee57d779729c89727e18adf921eeb588131762023-02-07 14:02:4517 hrs 7 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x878f6e70ea25e73ad5af2f76dde0ab4a106ee57d779729c89727e18adf921eeb588131762023-02-07 14:02:4517 hrs 7 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x878f6e70ea25e73ad5af2f76dde0ab4a106ee57d779729c89727e18adf921eeb588131762023-02-07 14:02:4517 hrs 7 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x878f6e70ea25e73ad5af2f76dde0ab4a106ee57d779729c89727e18adf921eeb588131762023-02-07 14:02:4517 hrs 7 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c7 0x04f764c2e76faa98e66b61da47370f550874cc3d0 ETH
0x52d39f93a629d2241eaa2cafd63fa15dc7536f7bacfd1d39b5a282d1323c4822587088002023-02-07 6:17:451 day 52 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70x6473bd49339386779df1a04cf7d4bb00d3ca325b0 ETH
0x52d39f93a629d2241eaa2cafd63fa15dc7536f7bacfd1d39b5a282d1323c4822587088002023-02-07 6:17:451 day 52 mins ago 0xd5be49cb7fc47e16d2ded3560f2e6354c428c6c70x6473bd49339386779df1a04cf7d4bb00d3ca325b0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TurtleChef

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

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

    /**
     * @dev 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 {
        _transferOwnership(address(0));
    }

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

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

File 2 of 9 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 3 of 9 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://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 4 of 9 : 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 9 : ITurtleswapPair.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

interface ITurtleswapPair {
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    function initialize(address, address) external;
}

File 6 of 9 : BoringERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

// solhint-disable avoid-low-level-calls
import "./IBoringERC20.sol";

library BoringERC20 {
    bytes4 private constant SIG_SYMBOL = 0x95d89b41; // symbol()
    bytes4 private constant SIG_NAME = 0x06fdde03; // name()
    bytes4 private constant SIG_DECIMALS = 0x313ce567; // decimals()
    bytes4 private constant SIG_TRANSFER = 0xa9059cbb; // transfer(address,uint256)
    bytes4 private constant SIG_TRANSFER_FROM = 0x23b872dd; // transferFrom(address,address,uint256)

    function returnDataToString(bytes memory data)
        internal
        pure
        returns (string memory)
    {
        if (data.length >= 64) {
            return abi.decode(data, (string));
        } else if (data.length == 32) {
            uint8 i = 0;
            while (i < 32 && data[i] != 0) {
                i++;
            }
            bytes memory bytesArray = new bytes(i);
            for (i = 0; i < 32 && data[i] != 0; i++) {
                bytesArray[i] = data[i];
            }
            return string(bytesArray);
        } else {
            return "???";
        }
    }

    /// @notice Provides a safe ERC20.symbol version which returns '???' as fallback string.
    /// @param token The address of the ERC-20 token contract.
    /// @return (string) Token symbol.
    function safeSymbol(IBoringERC20 token)
        internal
        view
        returns (string memory)
    {
        (bool success, bytes memory data) = address(token).staticcall(
            abi.encodeWithSelector(SIG_SYMBOL)
        );
        return success ? returnDataToString(data) : "???";
    }

    /// @notice Provides a safe ERC20.name version which returns '???' as fallback string.
    /// @param token The address of the ERC-20 token contract.
    /// @return (string) Token name.
    function safeName(IBoringERC20 token)
        internal
        view
        returns (string memory)
    {
        (bool success, bytes memory data) = address(token).staticcall(
            abi.encodeWithSelector(SIG_NAME)
        );
        return success ? returnDataToString(data) : "???";
    }

    /// @notice Provides a safe ERC20.decimals version which returns '18' as fallback value.
    /// @param token The address of the ERC-20 token contract.
    /// @return (uint8) Token decimals.
    function safeDecimals(IBoringERC20 token) internal view returns (uint8) {
        (bool success, bytes memory data) = address(token).staticcall(
            abi.encodeWithSelector(SIG_DECIMALS)
        );
        return success && data.length == 32 ? abi.decode(data, (uint8)) : 18;
    }

    /// @notice Provides a safe ERC20.transfer version for different ERC-20 implementations.
    /// Reverts on a failed transfer.
    /// @param token The address of the ERC-20 token.
    /// @param to Transfer tokens to.
    /// @param amount The token amount.
    function safeTransfer(
        IBoringERC20 token,
        address to,
        uint256 amount
    ) internal {
        (bool success, bytes memory data) = address(token).call(
            abi.encodeWithSelector(SIG_TRANSFER, to, amount)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "BoringERC20: Transfer failed"
        );
    }

    /// @notice Provides a safe ERC20.transferFrom version for different ERC-20 implementations.
    /// Reverts on a failed transfer.
    /// @param token The address of the ERC-20 token.
    /// @param from Transfer tokens from.
    /// @param to Transfer tokens to.
    /// @param amount The token amount.
    function safeTransferFrom(
        IBoringERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        (bool success, bytes memory data) = address(token).call(
            abi.encodeWithSelector(SIG_TRANSFER_FROM, from, to, amount)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "BoringERC20: TransferFrom failed"
        );
    }
}

File 7 of 9 : IBoringERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

interface IBoringERC20 {
    function mint(address to, uint256 amount) external;

    function totalSupply() external view returns (uint256);

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

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

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

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

    /// @notice EIP 2612
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

File 8 of 9 : IMultipleRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import "../libraries/IBoringERC20.sol";

interface IMultipleRewards {
    function onTurtlReward(
        uint256 pid,
        address user,
        uint256 newLpAmount
    ) external;

    function pendingTokens(uint256 pid, address user)
        external
        view
        returns (uint256 pending);

    function rewardToken() external view returns (IBoringERC20);

    function poolRewardsPerSec(uint256 pid) external view returns (uint256);
}

File 9 of 9 : TurtleChef.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./rewarders/IMultipleRewards.sol";
import "./libraries/BoringERC20.sol";
import "./ITurtleswapPair.sol";

//new distributor to handle multiple rewardooors

contract TurtleChef is Ownable, ReentrancyGuard {
    using BoringERC20 for IBoringERC20;

    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        uint256 rewardLockedUp; // Reward locked up.
        uint256 nextHarvestUntil; // When can the user harvest again.
    }

    // Info of each pool.
    struct PoolInfo {
        IBoringERC20 lpToken; // Address of LP token contract.
        uint256 allocPoint; // How many allocation points assigned to this pool. Turtl to distribute per block.
        uint256 lastRewardTimestamp; // Last block number that Turtl distribution occurs.
        uint256 accTurtlPerShare; // Accumulated Turtl per share, times 1e18. See below.
        uint16 depositFeeBP; // Deposit fee in basis points
        uint256 harvestInterval; // Harvest interval in seconds
        uint256 totalLp; // Total token in Pool
        IMultipleRewards[] rewarders; // Array of rewarder contract for pools with incentives
    }

    IBoringERC20 public turtl;

    // Turtl tokens created per second
    uint256 public turtlPerSec;

    // Max harvest interval: 14 days
    uint256 public constant MAXIMUM_HARVEST_INTERVAL = 14 days;

    // Maximum deposit fee rate: 10%
    uint16 public constant MAXIMUM_DEPOSIT_FEE_RATE = 1000;

    // Info of each pool
    PoolInfo[] public poolInfo;

    // Info of each user that stakes LP tokens.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;

    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint;

    // The timestamp when Turtl mining starts.
    uint256 public startTimestamp;

    // Total locked up rewards
    uint256 public totalLockedUpRewards;

    // Total Turtl in Turtl Pools (can be multiple pools)
    uint256 public totalTurtlInPools;

    // xTURTL address.
    address public xTURTLAddress;

    // deposit fee address if needed
    address public feeAddress;

    // Percentage of pool rewards that goto the team.
    uint256 public xTURTLPercent;

    // The precision factor
    uint256 private constant ACC_TOKEN_PRECISION = 1e12;

    modifier validatePoolByPid(uint256 _pid) {
        require(_pid < poolInfo.length, "Pool does not exist");
        _;
    }

    event Add(
        uint256 indexed pid,
        uint256 allocPoint,
        IBoringERC20 indexed lpToken,
        uint16 depositFeeBP,
        uint256 harvestInterval,
        IMultipleRewards[] indexed rewarders
    );

    event Set(
        uint256 indexed pid,
        uint256 allocPoint,
        uint16 depositFeeBP,
        uint256 harvestInterval,
        IMultipleRewards[] indexed rewarders
    );

    event UpdatePool(
        uint256 indexed pid,
        uint256 lastRewardTimestamp,
        uint256 lpSupply,
        uint256 accTurtlPerShare
    );

    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);

    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);

    event EmergencyWithdraw(
        address indexed user,
        uint256 indexed pid,
        uint256 amount
    );

    event EmissionRateUpdated(
        address indexed caller,
        uint256 previousValue,
        uint256 newValue
    );

    event RewardLockedUp(
        address indexed user,
        uint256 indexed pid,
        uint256 amountLockedUp
    );

    event AllocPointsUpdated(
        address indexed caller,
        uint256 previousAmount,
        uint256 newAmount
    );

    event SetxTURTLAddress(
        address indexed oldAddress,
        address indexed newAddress
    );

    event SetFeeAddress(address indexed oldAddress, address indexed newAddress);

    event SetInvestorAddress(
        address indexed oldAddress,
        address indexed newAddress
    );

    event SetxTURTLPercent(uint256 oldPercent, uint256 newPercent);

    constructor(
        IBoringERC20 _turtl,
        uint256 _turtlPerSec,
        address _xTURTLAddress,
        uint256 _xTURTLPercent,
        address _feeAddress
    ) {
        require(
            _xTURTLPercent <= 1000,
            "constructor: invalid xTURTL percent value"
        );

        startTimestamp = block.timestamp + (60 * 60 * 24 * 365);

        turtl = _turtl;
        turtlPerSec = _turtlPerSec;
        xTURTLAddress = _xTURTLAddress;
        xTURTLPercent = _xTURTLPercent;
        feeAddress = _feeAddress;
    }

    // Set farming start, can call only once
    function startFarming() public onlyOwner {
        require(block.timestamp < startTimestamp, "farm already started");

        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            PoolInfo storage pool = poolInfo[pid];
            pool.lastRewardTimestamp = block.timestamp;
        }

        startTimestamp = block.timestamp;
    }

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

    // Add a new lp to the pool. Can only be called by the owner.
    // Can add multiple pool with same lp token without messing up rewards, because each pool's balance is tracked using its own totalLp
    function add(
        uint256 _allocPoint,
        IBoringERC20 _lpToken,
        uint16 _depositFeeBP,
        uint256 _harvestInterval,
        IMultipleRewards[] calldata _rewarders
    ) public onlyOwner {
        require(_rewarders.length <= 10, "add: too many rewarders");
        require(
            _depositFeeBP <= MAXIMUM_DEPOSIT_FEE_RATE,
            "add: deposit fee too high"
        );
        require(
            _harvestInterval <= MAXIMUM_HARVEST_INTERVAL,
            "add: invalid harvest interval"
        );
        for (
            uint256 rewarderId = 0;
            rewarderId < _rewarders.length;
            ++rewarderId
        ) {
            require(
                Address.isContract(address(_rewarders[rewarderId])),
                "add: rewarder must be contract"
            );
        }

        _massUpdatePools();

        uint256 lastRewardTimestamp = block.timestamp > startTimestamp
            ? block.timestamp
            : startTimestamp;

        totalAllocPoint += _allocPoint;

        poolInfo.push(
            PoolInfo({
                lpToken: _lpToken,
                allocPoint: _allocPoint,
                lastRewardTimestamp: lastRewardTimestamp,
                accTurtlPerShare: 0,
                depositFeeBP: _depositFeeBP,
                harvestInterval: _harvestInterval,
                totalLp: 0,
                rewarders: _rewarders
            })
        );

        emit Add(
            poolInfo.length - 1,
            _allocPoint,
            _lpToken,
            _depositFeeBP,
            _harvestInterval,
            _rewarders
        );
    }

    // Update the given pool's Turtl allocation point and deposit fee. Can only be called by the owner.
    function set(
        uint256 _pid,
        uint256 _allocPoint,
        uint16 _depositFeeBP,
        uint256 _harvestInterval,
        IMultipleRewards[] calldata _rewarders
    ) public onlyOwner validatePoolByPid(_pid) {
        require(_rewarders.length <= 10, "set: too many rewarders");

        require(
            _depositFeeBP <= MAXIMUM_DEPOSIT_FEE_RATE,
            "set: deposit fee too high"
        );
        require(
            _harvestInterval <= MAXIMUM_HARVEST_INTERVAL,
            "set: invalid harvest interval"
        );

        for (
            uint256 rewarderId = 0;
            rewarderId < _rewarders.length;
            ++rewarderId
        ) {
            require(
                Address.isContract(address(_rewarders[rewarderId])),
                "set: rewarder must be contract"
            );
        }

        _massUpdatePools();

        totalAllocPoint =
            totalAllocPoint -
            poolInfo[_pid].allocPoint +
            _allocPoint;

        poolInfo[_pid].allocPoint = _allocPoint;
        poolInfo[_pid].depositFeeBP = _depositFeeBP;
        poolInfo[_pid].harvestInterval = _harvestInterval;
        poolInfo[_pid].rewarders = _rewarders;

        emit Set(
            _pid,
            _allocPoint,
            _depositFeeBP,
            _harvestInterval,
            _rewarders
        );
    }

    // View function to see pending rewards on frontend.
    function pendingTokens(uint256 _pid, address _user)
        external
        view
        validatePoolByPid(_pid)
        returns (
            address[] memory addresses,
            string[] memory symbols,
            uint256[] memory decimals,
            uint256[] memory amounts
        )
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accTurtlPerShare = pool.accTurtlPerShare;
        uint256 lpSupply = pool.totalLp;

        if (block.timestamp > pool.lastRewardTimestamp && lpSupply != 0) {
            uint256 multiplier = block.timestamp - pool.lastRewardTimestamp;
            uint256 total = 1000;
            uint256 lpPercent = total - xTURTLPercent;

            uint256 turtlReward = (multiplier *
                turtlPerSec *
                pool.allocPoint *
                lpPercent) /
                totalAllocPoint /
                total;

            accTurtlPerShare += (
                ((turtlReward * ACC_TOKEN_PRECISION) / lpSupply)
            );
        }

        uint256 pendingTurtl = (((user.amount * accTurtlPerShare) /
            ACC_TOKEN_PRECISION) - user.rewardDebt) + user.rewardLockedUp;

        addresses = new address[](pool.rewarders.length + 1);
        symbols = new string[](pool.rewarders.length + 1);
        amounts = new uint256[](pool.rewarders.length + 1);
        decimals = new uint256[](pool.rewarders.length + 1);

        addresses[0] = address(turtl);
        symbols[0] = IBoringERC20(turtl).safeSymbol();
        decimals[0] = IBoringERC20(turtl).safeDecimals();
        amounts[0] = pendingTurtl;

        for (
            uint256 rewarderId = 0;
            rewarderId < pool.rewarders.length;
            ++rewarderId
        ) {
            addresses[rewarderId + 1] = address(
                pool.rewarders[rewarderId].rewardToken()
            );

            symbols[rewarderId + 1] = IBoringERC20(
                pool.rewarders[rewarderId].rewardToken()
            ).safeSymbol();

            decimals[rewarderId + 1] = IBoringERC20(
                pool.rewarders[rewarderId].rewardToken()
            ).safeDecimals();

            amounts[rewarderId + 1] = pool.rewarders[rewarderId].pendingTokens(
                _pid,
                _user
            );
        }
    }

    /// @notice View function to see pool rewards per sec
    function poolRewardsPerSec(uint256 _pid)
        external
        view
        validatePoolByPid(_pid)
        returns (
            address[] memory addresses,
            string[] memory symbols,
            uint256[] memory decimals,
            uint256[] memory rewardsPerSec
        )
    {
        PoolInfo storage pool = poolInfo[_pid];

        addresses = new address[](pool.rewarders.length + 1);
        symbols = new string[](pool.rewarders.length + 1);
        decimals = new uint256[](pool.rewarders.length + 1);
        rewardsPerSec = new uint256[](pool.rewarders.length + 1);

        addresses[0] = address(turtl);
        symbols[0] = IBoringERC20(turtl).safeSymbol();
        decimals[0] = IBoringERC20(turtl).safeDecimals();

        uint256 total = 1000;
        uint256 lpPercent = total - xTURTLPercent;

        rewardsPerSec[0] =
            (pool.allocPoint * turtlPerSec * lpPercent) /
            totalAllocPoint /
            total;

        for (
            uint256 rewarderId = 0;
            rewarderId < pool.rewarders.length;
            ++rewarderId
        ) {
            addresses[rewarderId + 1] = address(
                pool.rewarders[rewarderId].rewardToken()
            );

            symbols[rewarderId + 1] = IBoringERC20(
                pool.rewarders[rewarderId].rewardToken()
            ).safeSymbol();

            decimals[rewarderId + 1] = IBoringERC20(
                pool.rewarders[rewarderId].rewardToken()
            ).safeDecimals();

            rewardsPerSec[rewarderId + 1] = pool
                .rewarders[rewarderId]
                .poolRewardsPerSec(_pid);
        }
    }

    // View function to see rewarders for a pool
    function poolRewarders(uint256 _pid)
        external
        view
        validatePoolByPid(_pid)
        returns (address[] memory rewarders)
    {
        PoolInfo storage pool = poolInfo[_pid];
        rewarders = new address[](pool.rewarders.length);
        for (
            uint256 rewarderId = 0;
            rewarderId < pool.rewarders.length;
            ++rewarderId
        ) {
            rewarders[rewarderId] = address(pool.rewarders[rewarderId]);
        }
    }

    // View function to see if user can harvest Turtl.
    function canHarvest(uint256 _pid, address _user)
        public
        view
        validatePoolByPid(_pid)
        returns (bool)
    {
        UserInfo storage user = userInfo[_pid][_user];
        return
            block.timestamp >= startTimestamp &&
            block.timestamp >= user.nextHarvestUntil;
    }

    // Update reward vairables for all pools. Be careful of gas spending!
    function massUpdatePools() external nonReentrant {
        _massUpdatePools();
    }

    // Internal method for massUpdatePools
    function _massUpdatePools() internal {
        for (uint256 pid = 0; pid < poolInfo.length; ++pid) {
            _updatePool(pid);
        }
    }

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) external nonReentrant {
        _updatePool(_pid);
    }

    // Internal method for _updatePool
    function _updatePool(uint256 _pid) internal validatePoolByPid(_pid) {
        PoolInfo storage pool = poolInfo[_pid];

        if (block.timestamp <= pool.lastRewardTimestamp) {
            return;
        }

        uint256 lpSupply = pool.totalLp;

        if (lpSupply == 0 || pool.allocPoint == 0) {
            pool.lastRewardTimestamp = block.timestamp;
            return;
        }

        uint256 multiplier = block.timestamp - pool.lastRewardTimestamp;

        uint256 turtlReward = ((multiplier * turtlPerSec) * pool.allocPoint) /
            totalAllocPoint;

        uint256 total = 1000;
        uint256 lpPercent = total - xTURTLPercent;

        if (xTURTLPercent > 0) {
            turtl.mint(xTURTLAddress, (turtlReward * xTURTLPercent) / total);
        }

        turtl.mint(address(this), (turtlReward * lpPercent) / total);

        pool.accTurtlPerShare +=
            (turtlReward * ACC_TOKEN_PRECISION * lpPercent) /
            pool.totalLp /
            total;

        pool.lastRewardTimestamp = block.timestamp;

        emit UpdatePool(
            _pid,
            pool.lastRewardTimestamp,
            lpSupply,
            pool.accTurtlPerShare
        );
    }

    function depositWithPermit(
        uint256 pid,
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public nonReentrant validatePoolByPid(pid) {
        PoolInfo storage pool = poolInfo[pid];
        ITurtleswapPair pair = ITurtleswapPair(address(pool.lpToken));
        pair.permit(msg.sender, address(this), amount, deadline, v, r, s);
        _deposit(pid, amount);
    }

    // Deposit tokens for Turtl allocation.
    function deposit(uint256 _pid, uint256 _amount) public nonReentrant {
        _deposit(_pid, _amount);
    }

    // Deposit tokens for Turtl allocation.
    function _deposit(uint256 _pid, uint256 _amount)
        internal
        validatePoolByPid(_pid)
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        _updatePool(_pid);

        payOrLockupPendingTurtl(_pid);

        if (_amount > 0) {
            uint256 beforeDeposit = pool.lpToken.balanceOf(address(this));
            pool.lpToken.safeTransferFrom(msg.sender, address(this), _amount);
            uint256 afterDeposit = pool.lpToken.balanceOf(address(this));

            _amount = afterDeposit - beforeDeposit;

            if (pool.depositFeeBP > 0) {
                uint256 depositFee = (_amount * pool.depositFeeBP) / 10000;
                pool.lpToken.safeTransfer(feeAddress, depositFee);

                _amount = _amount - depositFee;
            }

            user.amount += _amount;

            if (address(pool.lpToken) == address(turtl)) {
                totalTurtlInPools += _amount;
            }
        }
        user.rewardDebt =
            (user.amount * pool.accTurtlPerShare) /
            ACC_TOKEN_PRECISION;

        for (
            uint256 rewarderId = 0;
            rewarderId < pool.rewarders.length;
            ++rewarderId
        ) {
            pool.rewarders[rewarderId].onTurtlReward(
                _pid,
                msg.sender,
                user.amount
            );
        }

        if (_amount > 0) {
            pool.totalLp += _amount;
        }

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

    //withdraw tokens
    function withdraw(uint256 _pid, uint256 _amount)
        public
        nonReentrant
        validatePoolByPid(_pid)
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        //this will make sure that user can only withdraw from his pool
        require(user.amount >= _amount, "withdraw: user amount not enough");

        //cannot withdraw more than pool's balance
        require(pool.totalLp >= _amount, "withdraw: pool total not enough");

        _updatePool(_pid);

        payOrLockupPendingTurtl(_pid);

        if (_amount > 0) {
            user.amount -= _amount;
            if (address(pool.lpToken) == address(turtl)) {
                totalTurtlInPools -= _amount;
            }
            pool.lpToken.safeTransfer(msg.sender, _amount);
        }

        user.rewardDebt =
            (user.amount * pool.accTurtlPerShare) /
            ACC_TOKEN_PRECISION;

        for (
            uint256 rewarderId = 0;
            rewarderId < pool.rewarders.length;
            ++rewarderId
        ) {
            pool.rewarders[rewarderId].onTurtlReward(
                _pid,
                msg.sender,
                user.amount
            );
        }

        if (_amount > 0) {
            pool.totalLp -= _amount;
        }

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

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 _pid) public nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint256 amount = user.amount;

        //Cannot withdraw more than pool's balance
        require(
            pool.totalLp >= amount,
            "emergency withdraw: pool total not enough"
        );

        user.amount = 0;
        user.rewardDebt = 0;
        user.rewardLockedUp = 0;
        user.nextHarvestUntil = 0;
        pool.totalLp -= amount;

        for (
            uint256 rewarderId = 0;
            rewarderId < pool.rewarders.length;
            ++rewarderId
        ) {
            pool.rewarders[rewarderId].onTurtlReward(_pid, msg.sender, 0);
        }

        if (address(pool.lpToken) == address(turtl)) {
            totalTurtlInPools -= amount;
        }

        pool.lpToken.safeTransfer(msg.sender, amount);

        emit EmergencyWithdraw(msg.sender, _pid, amount);
    }

    // Pay or lockup pending Turtl.
    function payOrLockupPendingTurtl(uint256 _pid) internal {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        if (user.nextHarvestUntil == 0 && block.timestamp >= startTimestamp) {
            user.nextHarvestUntil = block.timestamp + pool.harvestInterval;
        }

        if (user.nextHarvestUntil != 0 && pool.harvestInterval == 0) {
            user.nextHarvestUntil = 0;
        }

        uint256 pending = ((user.amount * pool.accTurtlPerShare) /
            ACC_TOKEN_PRECISION) - user.rewardDebt;

        if (canHarvest(_pid, msg.sender)) {
            if (pending > 0 || user.rewardLockedUp > 0) {
                uint256 pendingRewards = pending + user.rewardLockedUp;

                // reset lockup
                totalLockedUpRewards -= user.rewardLockedUp;
                user.rewardLockedUp = 0;
                user.nextHarvestUntil = block.timestamp + pool.harvestInterval;
                safeTurtlTransfer(msg.sender, pendingRewards);
            }
        } else if (pending > 0) {
            totalLockedUpRewards += pending;
            user.rewardLockedUp += pending;
            emit RewardLockedUp(msg.sender, _pid, pending);
        }
    }

    function safeTurtlTransfer(address _to, uint256 _amount) internal {
        if (turtl.balanceOf(address(this)) > totalTurtlInPools) {
            uint256 turtlBal = turtl.balanceOf(address(this)) -
                totalTurtlInPools;
            if (_amount >= turtlBal) {
                turtl.safeTransfer(_to, turtlBal);
            } else if (_amount > 0) {
                turtl.safeTransfer(_to, _amount);
            }
        }
    }

    function updateAllocPoint(uint256 _pid, uint256 _allocPoint)
        public
        onlyOwner
    {
        _massUpdatePools();

        emit AllocPointsUpdated(
            msg.sender,
            poolInfo[_pid].allocPoint,
            _allocPoint
        );

        totalAllocPoint =
            totalAllocPoint -
            poolInfo[_pid].allocPoint +
            _allocPoint;
        poolInfo[_pid].allocPoint = _allocPoint;
    }

    function updateEmissionRate(uint256 _turtlPerSec) public onlyOwner {
        _massUpdatePools();

        emit EmissionRateUpdated(msg.sender, turtlPerSec, _turtlPerSec);

        turtlPerSec = _turtlPerSec;
    }

    function poolTotalLp(uint256 pid) external view returns (uint256) {
        return poolInfo[pid].totalLp;
    }

    // Function to harvest many pools in a single transaction
    function harvestMany(uint256[] calldata _pids) public nonReentrant {
        require(_pids.length <= 30, "harvest many: too many pool ids");
        for (uint256 index = 0; index < _pids.length; ++index) {
            _deposit(_pids[index], 0);
        }
    }

    // Update xTURTL address
    function setxTURTLAddress(address _xTURTLAddress) public onlyOwner {
        require(_xTURTLAddress != address(0), "invalid new xTURTL address");
        xTURTLAddress = _xTURTLAddress;
        emit SetxTURTLAddress(msg.sender, _xTURTLAddress);
    }

    function setxTURTLPercent(uint256 _newxTURTLPercent) public onlyOwner {
        require(_newxTURTLPercent <= 1000, "invalid percent value");
        emit SetxTURTLPercent(xTURTLPercent, _newxTURTLPercent);
        xTURTLPercent = _newxTURTLPercent;
    }

    function setFeeAddress(address _feeAddress) public onlyOwner {
        require(_feeAddress != address(0), "wrong address");
        feeAddress = _feeAddress;
        emit SetFeeAddress(msg.sender, _feeAddress);
    }

    function getTurtlPerSec() public view returns (uint256) {
        return turtlPerSec;
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"contract IBoringERC20","name":"_turtl","type":"address"},{"internalType":"uint256","name":"_turtlPerSec","type":"uint256"},{"internalType":"address","name":"_xTURTLAddress","type":"address"},{"internalType":"uint256","name":"_xTURTLPercent","type":"uint256"},{"internalType":"address","name":"_feeAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":true,"internalType":"contract IBoringERC20","name":"lpToken","type":"address"},{"indexed":false,"internalType":"uint16","name":"depositFeeBP","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"harvestInterval","type":"uint256"},{"indexed":true,"internalType":"contract IMultipleRewards[]","name":"rewarders","type":"address[]"}],"name":"Add","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAmount","type":"uint256"}],"name":"AllocPointsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"EmissionRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountLockedUp","type":"uint256"}],"name":"RewardLockedUp","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"depositFeeBP","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"harvestInterval","type":"uint256"},{"indexed":true,"internalType":"contract IMultipleRewards[]","name":"rewarders","type":"address[]"}],"name":"Set","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetFeeAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetInvestorAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetxTURTLAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldPercent","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPercent","type":"uint256"}],"name":"SetxTURTLPercent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastRewardTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accTurtlPerShare","type":"uint256"}],"name":"UpdatePool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"MAXIMUM_DEPOSIT_FEE_RATE","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_HARVEST_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IBoringERC20","name":"_lpToken","type":"address"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"uint256","name":"_harvestInterval","type":"uint256"},{"internalType":"contract IMultipleRewards[]","name":"_rewarders","type":"address[]"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"canHarvest","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"depositWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTurtlPerSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_pids","type":"uint256[]"}],"name":"harvestMany","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingTokens","outputs":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"string[]","name":"symbols","type":"string[]"},{"internalType":"uint256[]","name":"decimals","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IBoringERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardTimestamp","type":"uint256"},{"internalType":"uint256","name":"accTurtlPerShare","type":"uint256"},{"internalType":"uint16","name":"depositFeeBP","type":"uint16"},{"internalType":"uint256","name":"harvestInterval","type":"uint256"},{"internalType":"uint256","name":"totalLp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"poolRewarders","outputs":[{"internalType":"address[]","name":"rewarders","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"poolRewardsPerSec","outputs":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"string[]","name":"symbols","type":"string[]"},{"internalType":"uint256[]","name":"decimals","type":"uint256[]"},{"internalType":"uint256[]","name":"rewardsPerSec","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"poolTotalLp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"uint256","name":"_harvestInterval","type":"uint256"},{"internalType":"contract IMultipleRewards[]","name":"_rewarders","type":"address[]"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_xTURTLAddress","type":"address"}],"name":"setxTURTLAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newxTURTLPercent","type":"uint256"}],"name":"setxTURTLPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startFarming","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLockedUpRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTurtlInPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"turtl","outputs":[{"internalType":"contract IBoringERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"turtlPerSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"}],"name":"updateAllocPoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_turtlPerSec","type":"uint256"}],"name":"updateEmissionRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"rewardLockedUp","type":"uint256"},{"internalType":"uint256","name":"nextHarvestUntil","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xTURTLAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xTURTLPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620050f9380380620050f9833981016040819052620000349162000174565b6200003f336200010b565b600180556103e8821115620000ac5760405162461bcd60e51b815260206004820152602960248201527f636f6e7374727563746f723a20696e76616c69642078545552544c2070657263604482015268656e742076616c756560b81b606482015260840160405180910390fd5b620000bc426301e13380620001dc565b600755600280546001600160a01b039687166001600160a01b031991821617909155600394909455600a805493861693851693909317909255600c55600b805491909316911617905562000204565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200017157600080fd5b50565b600080600080600060a086880312156200018d57600080fd5b85516200019a816200015b565b602087015160408801519196509450620001b4816200015b565b606087015160808801519194509250620001ce816200015b565b809150509295509295909350565b80820180821115620001fe57634e487b7160e01b600052601160045260246000fd5b92915050565b614ee580620002146000396000f3fe608060405234801561001057600080fd5b50600436106102925760003560e01c8063715018a611610160578063afbcfea1116100d8578063e6fd48bc1161008c578063eff8976b11610071578063eff8976b146105e2578063f2fde38b14610602578063ffcd42631461061557600080fd5b8063e6fd48bc146105c6578063eddf9652146105cf57600080fd5b8063dc640ac9116100bd578063dc640ac914610596578063de73149d146105a9578063e2bbb158146105b357600080fd5b8063afbcfea11461057b578063c339ed881461058357600080fd5b80638da5cb5b1161012f57806393f1a40b1161011457806393f1a40b1461050a5780639afd87971461056a578063a031bf471461057357600080fd5b80638da5cb5b146104cc5780638dab2b96146104ea57600080fd5b8063715018a61461048c578063812c64f1146104945780638705fcd4146104b0578063898be814146104c357600080fd5b8063412753581161020e578063515bc323116101c25780635312ea8e116101a75780635312ea8e1461045e578063630b5ba114610471578063654c9ece1461047957600080fd5b8063515bc3231461043857806351eb05a61461044b57600080fd5b8063465e81ec116101f3578063465e81ec146103f9578063474fa6301461041c578063508593ab1461042557600080fd5b806341275358146103c6578063441a3e70146103e657600080fd5b80631526fe271161026557806317caf6f11161024a57806317caf6f1146103875780632081ccc4146103905780632e6c998d146103a357600080fd5b80631526fe271461031b578063152e265a1461037e57600080fd5b806305497c0214610297578063081e3eda146102e15780630ba84cd2146102f35780630fc6102014610308575b600080fd5b600a546102b79073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6004545b6040519081526020016102d8565b6103066103013660046147af565b610628565b005b6103066103163660046147af565b6106f9565b61032e6103293660046147af565b610827565b6040805173ffffffffffffffffffffffffffffffffffffffff9098168852602088019690965294860193909352606085019190915261ffff16608084015260a083015260c082015260e0016102d8565b6102e560035481565b6102e560065481565b61030661039e366004614826565b610891565b6103b66103b13660046148b9565b610d05565b60405190151581526020016102d8565b600b546102b79073ffffffffffffffffffffffffffffffffffffffff1681565b6103066103f43660046148e9565b610dc3565b61040c6104073660046147af565b6111a2565b6040516102d894939291906149b0565b6102e560085481565b610306610433366004614a80565b6118b4565b610306610446366004614ac8565b611d4b565b6103066104593660046147af565b611f17565b61030661046c3660046147af565b611f98565b610306612283565b6102e56104873660046147af565b612302565b610306612330565b61049d6103e881565b60405161ffff90911681526020016102d8565b6103066104be366004614b1b565b6123bd565b6102e560095481565b60005473ffffffffffffffffffffffffffffffffffffffff166102b7565b6002546102b79073ffffffffffffffffffffffffffffffffffffffff1681565b61054a6105183660046148b9565b600560209081526000928352604080842090915290825290208054600182015460028301546003909301549192909184565b6040805194855260208501939093529183015260608201526080016102d8565b6102e5600c5481565b6003546102e5565b61030661252c565b610306610591366004614b1b565b61266e565b6103066105a4366004614b38565b6127dd565b6102e56212750081565b6103066105c13660046148e9565b612900565b6102e560075481565b6103066105dd3660046148e9565b612983565b6105f56105f03660046147af565b612af9565b6040516102d89190614b7a565b610306610610366004614b1b565b612c78565b61040c6106233660046148b9565b612da8565b60005473ffffffffffffffffffffffffffffffffffffffff1633146106ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6106b6613443565b600354604080519182526020820183905233917feedc6338c9c1ad8f3cd6c90dd09dbe98dbd57e610d3e59a17996d07acb0d9511910160405180910390a2600355565b60005473ffffffffffffffffffffffffffffffffffffffff16331461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a5565b6103e88111156107e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f696e76616c69642070657263656e742076616c7565000000000000000000000060448201526064016106a5565b600c5460408051918252602082018390527f92bcf53c385ba0a9d13895686848c4bd6f83d29b747ee49cbf653a6ceaf8cad8910160405180910390a1600c55565b6004818154811061083757600080fd5b6000918252602090912060089091020180546001820154600283015460038401546004850154600586015460069096015473ffffffffffffffffffffffffffffffffffffffff909516965092949193909261ffff16919087565b60005473ffffffffffffffffffffffffffffffffffffffff163314610912576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a5565b6004548690811061097f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f506f6f6c20646f6573206e6f742065786973740000000000000000000000000060448201526064016106a5565b600a8211156109ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f7365743a20746f6f206d616e792072657761726465727300000000000000000060448201526064016106a5565b6103e861ffff86161115610a5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f7365743a206465706f7369742066656520746f6f20686967680000000000000060448201526064016106a5565b62127500841115610ac7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f7365743a20696e76616c6964206861727665737420696e74657276616c00000060448201526064016106a5565b60005b82811015610b8e57610b18848483818110610ae757610ae7614b8d565b9050602002016020810190610afc9190614b1b565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b610b7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f7365743a207265776172646572206d75737420626520636f6e7472616374000060448201526064016106a5565b610b8781614beb565b9050610aca565b50610b97613443565b8560048881548110610bab57610bab614b8d565b906000526020600020906008020160010154600654610bca9190614c23565b610bd49190614c36565b6006819055508560048881548110610bee57610bee614b8d565b9060005260206000209060080201600101819055508460048881548110610c1757610c17614b8d565b906000526020600020906008020160040160006101000a81548161ffff021916908361ffff1602179055508360048881548110610c5657610c56614b8d565b906000526020600020906008020160050181905550828260048981548110610c8057610c80614b8d565b90600052602060002090600802016007019190610c9e929190614698565b508282604051610caf929190614c49565b6040805191829003822088835261ffff881660208401529082018690529088907f5ed6f0deef9ab49d02900b40d596df4cd637a2a7fbfa56bbcb377389d3ce8d289060600160405180910390a350505050505050565b60045460009083908110610d75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f506f6f6c20646f6573206e6f742065786973740000000000000000000000000060448201526064016106a5565b600084815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915290206007544210801590610dba575080600301544210155b95945050505050565b600260015403610e2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a5565b600260015560045482908110610ea1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f506f6f6c20646f6573206e6f742065786973740000000000000000000000000060448201526064016106a5565b600060048481548110610eb657610eb6614b8d565b600091825260208083208784526005825260408085203386529092529220805460089092029092019250841115610f49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f77697468647261773a207573657220616d6f756e74206e6f7420656e6f75676860448201526064016106a5565b8382600601541015610fb7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f77697468647261773a20706f6f6c20746f74616c206e6f7420656e6f7567680060448201526064016106a5565b610fc085613469565b610fc9856137b2565b83156110475783816000016000828254610fe39190614c23565b9091555050600254825473ffffffffffffffffffffffffffffffffffffffff91821691160361102457836009600082825461101e9190614c23565b90915550505b81546110479073ffffffffffffffffffffffffffffffffffffffff16338661396e565b6003820154815464e8d4a510009161105e91614c98565b6110689190614cd5565b600182015560005b600783015481101561113f5782600701818154811061109157611091614b8d565b60009182526020909120015482546040517f92b3bbc700000000000000000000000000000000000000000000000000000000815260048101899052336024820152604481019190915273ffffffffffffffffffffffffffffffffffffffff909116906392b3bbc790606401600060405180830381600087803b15801561111657600080fd5b505af115801561112a573d6000803e3d6000fd5b505050508061113890614beb565b9050611070565b508315611160578382600601600082825461115a9190614c23565b90915550505b604051848152859033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a3505060018055505050565b606080606080846004805490508110611217576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f506f6f6c20646f6573206e6f742065786973740000000000000000000000000060448201526064016106a5565b60006004878154811061122c5761122c614b8d565b90600052602060002090600802019050806007018054905060016112509190614c36565b67ffffffffffffffff81111561126857611268614d10565b604051908082528060200260200182016040528015611291578160200160208202803683370190505b5060078201549096506112a5906001614c36565b67ffffffffffffffff8111156112bd576112bd614d10565b6040519080825280602002602001820160405280156112f057816020015b60608152602001906001900390816112db5790505b506007820154909550611304906001614c36565b67ffffffffffffffff81111561131c5761131c614d10565b604051908082528060200260200182016040528015611345578160200160208202803683370190505b506007820154909450611359906001614c36565b67ffffffffffffffff81111561137157611371614d10565b60405190808252806020026020018201604052801561139a578160200160208202803683370190505b50600254875191945073ffffffffffffffffffffffffffffffffffffffff169087906000906113cb576113cb614b8d565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526002546113fb9116613ade565b8560008151811061140e5761140e614b8d565b602090810291909101015260025461143b9073ffffffffffffffffffffffffffffffffffffffff16613bf6565b60ff168460008151811061145157611451614b8d565b6020908102919091010152600c546103e8906000906114709083614c23565b9050816006548260035486600101546114899190614c98565b6114939190614c98565b61149d9190614cd5565b6114a79190614cd5565b856000815181106114ba576114ba614b8d565b60200260200101818152505060005b60078401548110156118a8578360070181815481106114ea576114ea614b8d565b60009182526020918290200154604080517ff7c618c1000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169263f7c618c1926004808401938290030181865afa15801561155e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115829190614d3f565b8961158e836001614c36565b8151811061159e5761159e614b8d565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506116a38460070182815481106115f0576115f0614b8d565b60009182526020918290200154604080517ff7c618c1000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169263f7c618c1926004808401938290030181865afa158015611664573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116889190614d3f565b73ffffffffffffffffffffffffffffffffffffffff16613ade565b886116af836001614c36565b815181106116bf576116bf614b8d565b60200260200101819052506117958460070182815481106116e2576116e2614b8d565b60009182526020918290200154604080517ff7c618c1000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169263f7c618c1926004808401938290030181865afa158015611756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177a9190614d3f565b73ffffffffffffffffffffffffffffffffffffffff16613bf6565b60ff16876117a4836001614c36565b815181106117b4576117b4614b8d565b6020026020010181815250508360070181815481106117d5576117d5614b8d565b6000918252602090912001546040517f465e81ec000000000000000000000000000000000000000000000000000000008152600481018c905273ffffffffffffffffffffffffffffffffffffffff9091169063465e81ec90602401602060405180830381865afa15801561184d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118719190614d5c565b8661187d836001614c36565b8151811061188d5761188d614b8d565b60209081029190910101526118a181614beb565b90506114c9565b50505050509193509193565b60005473ffffffffffffffffffffffffffffffffffffffff163314611935576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a5565b600a8111156119a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f6164643a20746f6f206d616e792072657761726465727300000000000000000060448201526064016106a5565b6103e861ffff85161115611a10576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f6164643a206465706f7369742066656520746f6f20686967680000000000000060448201526064016106a5565b62127500831115611a7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f6164643a20696e76616c6964206861727665737420696e74657276616c00000060448201526064016106a5565b60005b81811015611b1357611a9d838383818110610ae757610ae7614b8d565b611b03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f6164643a207265776172646572206d75737420626520636f6e7472616374000060448201526064016106a5565b611b0c81614beb565b9050611a80565b50611b1c613443565b60006007544211611b2f57600754611b31565b425b90508660066000828254611b459190614c36565b9250508190555060046040518061010001604052808873ffffffffffffffffffffffffffffffffffffffff168152602001898152602001838152602001600081526020018761ffff168152602001868152602001600081526020018585808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939094525050835460018082018655948252602091829020845160089092020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911781558382015194810194909455604083015160028501556060830151600385015560808301516004850180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff90921691909117905560a0830151600585015560c0830151600685015560e08301518051939493611cbb935060078501929190910190614720565b5050508282604051611cce929190614c49565b60405190819003902060045473ffffffffffffffffffffffffffffffffffffffff881690611cfe90600190614c23565b604080518b815261ffff8a1660208201529081018890527f5ed295c4f5af5aeb1ccd905e1cd55a86ab3bb9fc1fe2346ff64ac47dbef366619060600160405180910390a450505050505050565b600260015403611db7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a5565b600260015560045486908110611e29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f506f6f6c20646f6573206e6f742065786973740000000000000000000000000060448201526064016106a5565b600060048881548110611e3e57611e3e614b8d565b6000918252602090912060089091020180546040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018a90526064810189905260ff8816608482015260a4810187905260c4810186905291925073ffffffffffffffffffffffffffffffffffffffff1690819063d505accf9060e401600060405180830381600087803b158015611ee657600080fd5b505af1158015611efa573d6000803e3d6000fd5b50505050611f088989613ce9565b50506001805550505050505050565b600260015403611f83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a5565b6002600155611f9181613469565b5060018055565b600260015403612004576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a5565b600260018190555060006004828154811061202157612021614b8d565b600091825260208083208584526005825260408085203386529092529220805460089290920290920160068101549093508111156120e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f656d657267656e63792077697468647261773a20706f6f6c20746f74616c206e60448201527f6f7420656e6f756768000000000000000000000000000000000000000000000060648201526084016106a5565b600080835560018301819055600283018190556003830181905560068401805483929061210f908490614c23565b90915550600090505b60078401548110156121e25783600701818154811061213957612139614b8d565b60009182526020822001546040517f92b3bbc700000000000000000000000000000000000000000000000000000000815260048101889052336024820152604481019290925273ffffffffffffffffffffffffffffffffffffffff16906392b3bbc790606401600060405180830381600087803b1580156121b957600080fd5b505af11580156121cd573d6000803e3d6000fd5b50505050806121db90614beb565b9050612118565b50600254835473ffffffffffffffffffffffffffffffffffffffff91821691160361221f5780600960008282546122199190614c23565b90915550505b82546122429073ffffffffffffffffffffffffffffffffffffffff16338361396e565b604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a35050600180555050565b6002600154036122ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a5565b60026001556122fc613443565b60018055565b60006004828154811061231757612317614b8d565b9060005260206000209060080201600601549050919050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146123b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a5565b6123bb6000614120565b565b60005473ffffffffffffffffffffffffffffffffffffffff16331461243e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a5565b73ffffffffffffffffffffffffffffffffffffffff81166124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f77726f6e6720616464726573730000000000000000000000000000000000000060448201526064016106a5565b600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811790915560405133907fd44190acf9d04bdb5d3a1aafff7e6dee8b40b93dfb8c5d3f0eea4b9f4539c3f790600090a350565b60005473ffffffffffffffffffffffffffffffffffffffff1633146125ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a5565b6007544210612618576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f6661726d20616c7265616479207374617274656400000000000000000000000060448201526064016106a5565b60045460005b818110156126665760006004828154811061263b5761263b614b8d565b90600052602060002090600802019050428160020181905550508061265f90614beb565b905061261e565b505042600755565b60005473ffffffffffffffffffffffffffffffffffffffff1633146126ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a5565b73ffffffffffffffffffffffffffffffffffffffff811661276c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f696e76616c6964206e65772078545552544c206164647265737300000000000060448201526064016106a5565b600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811790915560405133907f55f07e7272c946c01eb39a09c9c3aaf0b7287ec8c4868c288967a99e927a59fb90600090a350565b600260015403612849576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a5565b6002600155601e8111156128b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f68617276657374206d616e793a20746f6f206d616e7920706f6f6c206964730060448201526064016106a5565b60005b818110156128f7576128e78383838181106128d9576128d9614b8d565b905060200201356000613ce9565b6128f081614beb565b90506128bc565b50506001805550565b60026001540361296c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106a5565b600260015561297b8282613ce9565b505060018055565b60005473ffffffffffffffffffffffffffffffffffffffff163314612a04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a5565b612a0c613443565b3373ffffffffffffffffffffffffffffffffffffffff167f802633c8d26237616d81bdac01bc40fcdf36e098832601582ec19d7e431c5ef360048481548110612a5757612a57614b8d565b90600052602060002090600802016001015483604051612a81929190918252602082015260400190565b60405180910390a28060048381548110612a9d57612a9d614b8d565b906000526020600020906008020160010154600654612abc9190614c23565b612ac69190614c36565b6006819055508060048381548110612ae057612ae0614b8d565b9060005260206000209060080201600101819055505050565b60045460609082908110612b69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f506f6f6c20646f6573206e6f742065786973740000000000000000000000000060448201526064016106a5565b600060048481548110612b7e57612b7e614b8d565b90600052602060002090600802019050806007018054905067ffffffffffffffff811115612bae57612bae614d10565b604051908082528060200260200182016040528015612bd7578160200160208202803683370190505b50925060005b6007820154811015612c7057816007018181548110612bfe57612bfe614b8d565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16848281518110612c3b57612c3b614b8d565b73ffffffffffffffffffffffffffffffffffffffff90921660209283029190910190910152612c6981614beb565b9050612bdd565b505050919050565b60005473ffffffffffffffffffffffffffffffffffffffff163314612cf9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106a5565b73ffffffffffffffffffffffffffffffffffffffff8116612d9c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016106a5565b612da581614120565b50565b606080606080856004805490508110612e1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f506f6f6c20646f6573206e6f742065786973740000000000000000000000000060448201526064016106a5565b600060048881548110612e3257612e32614b8d565b600091825260208083208b845260058252604080852073ffffffffffffffffffffffffffffffffffffffff8d1686529092529220600360089092029092019081015460068201546002830154929450909142118015612e9057508015155b15612f2f576000846002015442612ea79190614c23565b600c549091506103e890600090612ebe9083614c23565b9050600082600654838a6001015460035488612eda9190614c98565b612ee49190614c98565b612eee9190614c98565b612ef89190614cd5565b612f029190614cd5565b905084612f1464e8d4a5100083614c98565b612f1e9190614cd5565b612f289087614c36565b9550505050505b60008360020154846001015464e8d4a51000858760000154612f519190614c98565b612f5b9190614cd5565b612f659190614c23565b612f6f9190614c36565b6007860154909150612f82906001614c36565b67ffffffffffffffff811115612f9a57612f9a614d10565b604051908082528060200260200182016040528015612fc3578160200160208202803683370190505b506007860154909a50612fd7906001614c36565b67ffffffffffffffff811115612fef57612fef614d10565b60405190808252806020026020018201604052801561302257816020015b606081526020019060019003908161300d5790505b506007860154909950613036906001614c36565b67ffffffffffffffff81111561304e5761304e614d10565b604051908082528060200260200182016040528015613077578160200160208202803683370190505b50600786015490975061308b906001614c36565b67ffffffffffffffff8111156130a3576130a3614d10565b6040519080825280602002602001820160405280156130cc578160200160208202803683370190505b506002548b5191995073ffffffffffffffffffffffffffffffffffffffff16908b906000906130fd576130fd614b8d565b73ffffffffffffffffffffffffffffffffffffffff928316602091820292909201015260025461312d9116613ade565b8960008151811061314057613140614b8d565b602090810291909101015260025461316d9073ffffffffffffffffffffffffffffffffffffffff16613bf6565b60ff168860008151811061318357613183614b8d565b60200260200101818152505080876000815181106131a3576131a3614b8d565b60200260200101818152505060005b6007860154811015613433578560070181815481106131d3576131d3614b8d565b60009182526020918290200154604080517ff7c618c1000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169263f7c618c1926004808401938290030181865afa158015613247573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061326b9190614d3f565b8b613277836001614c36565b8151811061328757613287614b8d565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506132d98660070182815481106115f0576115f0614b8d565b8a6132e5836001614c36565b815181106132f5576132f5614b8d565b60200260200101819052506133188660070182815481106116e2576116e2614b8d565b60ff1689613327836001614c36565b8151811061333757613337614b8d565b60200260200101818152505085600701818154811061335857613358614b8d565b6000918252602090912001546040517fffcd4263000000000000000000000000000000000000000000000000000000008152600481018f905273ffffffffffffffffffffffffffffffffffffffff8e811660248301529091169063ffcd426390604401602060405180830381865afa1580156133d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133fc9190614d5c565b88613408836001614c36565b8151811061341857613418614b8d565b602090810291909101015261342c81614beb565b90506131b2565b5050505050505092959194509250565b60005b600454811015612da55761345981613469565b61346281614beb565b9050613446565b600454819081106134d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f506f6f6c20646f6573206e6f742065786973740000000000000000000000000060448201526064016106a5565b6000600483815481106134eb576134eb614b8d565b906000526020600020906008020190508060020154421161350b57505050565b600681015480158061351f57506001820154155b156135305750426002909101555050565b60008260020154426135429190614c23565b9050600060065484600101546003548461355c9190614c98565b6135669190614c98565b6135709190614cd5565b600c549091506103e8906000906135879083614c23565b600c549091501561365657600254600a54600c5473ffffffffffffffffffffffffffffffffffffffff928316926340c10f1992169085906135c89088614c98565b6135d29190614cd5565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b15801561363d57600080fd5b505af1158015613651573d6000803e3d6000fd5b505050505b60025473ffffffffffffffffffffffffffffffffffffffff166340c10f1930846136808588614c98565b61368a9190614cd5565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401600060405180830381600087803b1580156136f557600080fd5b505af1158015613709573d6000803e3d6000fd5b50505060068701548391508261372464e8d4a5100087614c98565b61372e9190614c98565b6137389190614cd5565b6137429190614cd5565b8660030160008282546137559190614c36565b909155505042600287018190556003870154604080519283526020830188905282015288907f3be3541fc42237d611b30329040bfa4569541d156560acdbbae57640d20b8f469060600160405180910390a25050505050505b5050565b6000600482815481106137c7576137c7614b8d565b60009182526020808320858452600582526040808520338652909252922060038101546008909202909201925015801561380357506007544210155b1561381d5760058201546138179042614c36565b60038201555b60038101541580159061383257506005820154155b1561383f57600060038201555b6000816001015464e8d4a51000846003015484600001546138609190614c98565b61386a9190614cd5565b6138749190614c23565b90506138808433610d05565b156138f8576000811180613898575060008260020154115b156138f35760008260020154826138af9190614c36565b90508260020154600860008282546138c79190614c23565b90915550506000600284015560058401546138e29042614c36565b60038401556138f13382614195565b505b613968565b80156139685780600860008282546139109190614c36565b925050819055508082600201600082825461392b9190614c36565b9091555050604051818152849033907fee470483107f579a55c754fa00613c45a9a3b617a418b39cb0be97e5381ba7c19060200160405180910390a35b50505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691613a059190614d75565b6000604051808303816000865af19150503d8060008114613a42576040519150601f19603f3d011682016040523d82523d6000602084013e613a47565b606091505b5091509150818015613a71575080511580613a71575080806020019051810190613a719190614d91565b613ad7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f426f72696e6745524332303a205472616e73666572206661696c65640000000060448201526064016106a5565b5050505050565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f95d89b41000000000000000000000000000000000000000000000000000000001790529051606091600091829173ffffffffffffffffffffffffffffffffffffffff861691613b609190614d75565b600060405180830381855afa9150503d8060008114613b9b576040519150601f19603f3d011682016040523d82523d6000602084013e613ba0565b606091505b509150915081613be5576040518060400160405280600381526020017f3f3f3f0000000000000000000000000000000000000000000000000000000000815250613bee565b613bee8161432d565b949350505050565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f313ce5670000000000000000000000000000000000000000000000000000000017905290516000918291829173ffffffffffffffffffffffffffffffffffffffff861691613c779190614d75565b600060405180830381855afa9150503d8060008114613cb2576040519150601f19603f3d011682016040523d82523d6000602084013e613cb7565b606091505b5091509150818015613cca575080516020145b613cd5576012613bee565b80806020019051810190613bee9190614db3565b60045482908110613d56576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f506f6f6c20646f6573206e6f742065786973740000000000000000000000000060448201526064016106a5565b600060048481548110613d6b57613d6b614b8d565b60009182526020808320878452600582526040808520338652909252922060089091029091019150613d9c85613469565b613da5856137b2565b8315613fc95781546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015613e19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e3d9190614d5c565b8354909150613e649073ffffffffffffffffffffffffffffffffffffffff1633308861451f565b82546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015613ed2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ef69190614d5c565b9050613f028282614c23565b600485015490965061ffff1615613f7157600484015460009061271090613f2d9061ffff1689614c98565b613f379190614cd5565b600b548654919250613f639173ffffffffffffffffffffffffffffffffffffffff90811691168361396e565b613f6d8188614c23565b9650505b85836000016000828254613f859190614c36565b9091555050600254845473ffffffffffffffffffffffffffffffffffffffff918216911603613fc6578560096000828254613fc09190614c36565b90915550505b50505b6003820154815464e8d4a5100091613fe091614c98565b613fea9190614cd5565b600182015560005b60078301548110156140c15782600701818154811061401357614013614b8d565b60009182526020909120015482546040517f92b3bbc700000000000000000000000000000000000000000000000000000000815260048101899052336024820152604481019190915273ffffffffffffffffffffffffffffffffffffffff909116906392b3bbc790606401600060405180830381600087803b15801561409857600080fd5b505af11580156140ac573d6000803e3d6000fd5b50505050806140ba90614beb565b9050613ff2565b5083156140e257838260060160008282546140dc9190614c36565b90915550505b604051848152859033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159060200160405180910390a35050505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6009546002546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015614206573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061422a9190614d5c565b11156137ae576009546002546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000929173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa1580156142a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142c79190614d5c565b6142d19190614c23565b9050808210614303576002546142fe9073ffffffffffffffffffffffffffffffffffffffff16848361396e565b505050565b81156142fe576002546142fe9073ffffffffffffffffffffffffffffffffffffffff16848461396e565b60606040825110614352578180602001905181019061434c9190614dd0565b92915050565b81516020036144e15760005b60208160ff161080156143ab5750828160ff168151811061438157614381614b8d565b01602001517fff000000000000000000000000000000000000000000000000000000000000001615155b156143c257806143ba81614e90565b91505061435e565b60008160ff1667ffffffffffffffff8111156143e0576143e0614d10565b6040519080825280601f01601f19166020018201604052801561440a576020820181803683370190505b509050600091505b60208260ff1610801561445f5750838260ff168151811061443557614435614b8d565b01602001517fff000000000000000000000000000000000000000000000000000000000000001615155b156144da57838260ff168151811061447957614479614b8d565b602001015160f81c60f81b818360ff168151811061449957614499614b8d565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350816144d281614e90565b925050614412565b9392505050565b505060408051808201909152600381527f3f3f3f0000000000000000000000000000000000000000000000000000000000602082015290565b919050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905291516000928392908816916145be9190614d75565b6000604051808303816000865af19150503d80600081146145fb576040519150601f19603f3d011682016040523d82523d6000602084013e614600565b606091505b509150915081801561462a57508051158061462a57508080602001905181019061462a9190614d91565b614690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f426f72696e6745524332303a205472616e7366657246726f6d206661696c656460448201526064016106a5565b505050505050565b828054828255906000526020600020908101928215614710579160200282015b828111156147105781547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8435161782556020909201916001909101906146b8565b5061471c92915061479a565b5090565b828054828255906000526020600020908101928215614710579160200282015b8281111561471057825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190614740565b5b8082111561471c576000815560010161479b565b6000602082840312156147c157600080fd5b5035919050565b803561ffff8116811461451a57600080fd5b60008083601f8401126147ec57600080fd5b50813567ffffffffffffffff81111561480457600080fd5b6020830191508360208260051b850101111561481f57600080fd5b9250929050565b60008060008060008060a0878903121561483f57600080fd5b8635955060208701359450614856604088016147c8565b935060608701359250608087013567ffffffffffffffff81111561487957600080fd5b61488589828a016147da565b979a9699509497509295939492505050565b73ffffffffffffffffffffffffffffffffffffffff81168114612da557600080fd5b600080604083850312156148cc57600080fd5b8235915060208301356148de81614897565b809150509250929050565b600080604083850312156148fc57600080fd5b50508035926020909101359150565b600081518084526020808501945080840160005b8381101561495157815173ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161491f565b509495945050505050565b60005b8381101561497757818101518382015260200161495f565b50506000910152565b600081518084526020808501945080840160005b8381101561495157815187529582019590820190600101614994565b6080815260006149c3608083018761490b565b6020838203818501528187518084528284019150828160051b850101838a0160005b83811015614a49577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08088850301865282518051808652614a2b818a88018b850161495c565b96880196601f019091169390930186019250908501906001016149e5565b50508681036040880152614a5d818a614980565b9450505050508281036060840152614a758185614980565b979650505050505050565b60008060008060008060a08789031215614a9957600080fd5b863595506020870135614aab81614897565b9450614856604088016147c8565b60ff81168114612da557600080fd5b60008060008060008060c08789031215614ae157600080fd5b8635955060208701359450604087013593506060870135614b0181614ab9565b9598949750929560808101359460a0909101359350915050565b600060208284031215614b2d57600080fd5b81356144da81614897565b60008060208385031215614b4b57600080fd5b823567ffffffffffffffff811115614b6257600080fd5b614b6e858286016147da565b90969095509350505050565b6020815260006144da602083018461490b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614c1c57614c1c614bbc565b5060010190565b8181038181111561434c5761434c614bbc565b8082018082111561434c5761434c614bbc565b60008184825b85811015614c8d578135614c6281614897565b73ffffffffffffffffffffffffffffffffffffffff1683526020928301929190910190600101614c4f565b509095945050505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614cd057614cd0614bbc565b500290565b600082614d0b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215614d5157600080fd5b81516144da81614897565b600060208284031215614d6e57600080fd5b5051919050565b60008251614d8781846020870161495c565b9190910192915050565b600060208284031215614da357600080fd5b815180151581146144da57600080fd5b600060208284031215614dc557600080fd5b81516144da81614ab9565b600060208284031215614de257600080fd5b815167ffffffffffffffff80821115614dfa57600080fd5b818401915084601f830112614e0e57600080fd5b815181811115614e2057614e20614d10565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715614e6657614e66614d10565b81604052828152876020848701011115614e7f57600080fd5b614a7583602083016020880161495c565b600060ff821660ff8103614ea657614ea6614bbc565b6001019291505056fea264697066735822122048ddda196eb1f2c46d6e8239cefdcee1a6c75ee4a9d87a856556c5909dc9382764736f6c6343000810003300000000000000000000000004f764c2e76faa98e66b61da47370f550874cc3d000000000000000000000000000000000000000000000000026912227f09a00000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000730bcc8f5002eb67203570763efe17abcc97bb86

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

00000000000000000000000004f764c2e76faa98e66b61da47370f550874cc3d000000000000000000000000000000000000000000000000026912227f09a00000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000730bcc8f5002eb67203570763efe17abcc97bb86

-----Decoded View---------------
Arg [0] : _turtl (address): 0x04f764c2e76faa98e66b61da47370f550874cc3d
Arg [1] : _turtlPerSec (uint256): 173690000000000000
Arg [2] : _xTURTLAddress (address): 0x0000000000000000000000000000000000000002
Arg [3] : _xTURTLPercent (uint256): 0
Arg [4] : _feeAddress (address): 0x730bcc8f5002eb67203570763efe17abcc97bb86

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000004f764c2e76faa98e66b61da47370f550874cc3d
Arg [1] : 000000000000000000000000000000000000000000000000026912227f09a000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 000000000000000000000000730bcc8f5002eb67203570763efe17abcc97bb86


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.