Contract 0xbda1f897e851c7ef22cd490d2cf2dace4645a904 3

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xc4504da9822a4eb4132acb0cc0bcb265a6f672690b8e82a9657dc37a3d60c438Deposit317800872022-08-11 20:06:2758 mins ago0x86f430e4670d27e3e4d20fa19989417fe21c25bd IN  Polycat Finance: VaultChef0 MATIC0.0056154436 40.1
0xe794470446d4a76b13cbe366be5191ff630a55b672ce6fa36b61910011532e23Withdraw317751952022-08-11 16:51:594 hrs 12 mins ago0xe0ac537f3baffb2220c734cf2aab35dfa66390ce IN  Polycat Finance: VaultChef0 MATIC0.0076368558 42.1
0xfa80a2d8250ed8737405284c8016781381e4dd7be677edeff3ba5531ca71fc3eWithdraw317751862022-08-11 16:51:414 hrs 13 mins ago0xe0ac537f3baffb2220c734cf2aab35dfa66390ce IN  Polycat Finance: VaultChef0 MATIC0.0051889572 50.1
0x2f2b32d2d5c4cc0908197f871426a0e2b7139b76bece97d53cfa3c790b57ff6dDeposit317751182022-08-11 16:49:214 hrs 15 mins ago0x885f6af0174e6aae75954022d209add43f963d1d IN  Polycat Finance: VaultChef0 MATIC0.0070164048 50.1
0xc5f5cec4c3009928a3915c28983b49b112ad1030a3802f637e934ab2b6458509Withdraw317722882022-08-11 14:57:056 hrs 7 mins ago0x4b32f38b02f56d6f79f79b688628d1061af3c334 IN  Polycat Finance: VaultChef0 MATIC0.0194065676 47.6
0xfc4aae1f4bfbc4e861942d88be478de66f23c04798aeb11f0a6ffa623aa1a721Withdraw317721472022-08-11 14:52:116 hrs 12 mins ago0x4b32f38b02f56d6f79f79b688628d1061af3c334 IN  Polycat Finance: VaultChef0 MATIC0.007248674252.7
0x709d39e6e8ea1d71d9ffb78202069e0fe5987fc44b0e5eacb6bf920e154e73c6Deposit317684522022-08-11 12:32:038 hrs 32 mins ago0xe45c3cb1de44509fcd98601ad356236699d99633 IN  Polycat Finance: VaultChef0 MATIC0.006371136 40.5
0xed9b17a4d36634cd75a115880edede506e6b940f41a2d82650c8fa219e686e18Deposit317673122022-08-11 11:50:439 hrs 14 mins ago0xef0f6abcdaeec97219abb66af47e6f0f7537e16e IN  Polycat Finance: VaultChef0 MATIC0.0042000156 39.6
0xf32b067ad12802b2e643147a1aadb0419f07335116503bbeef0e24a14bdf22d3Deposit317627372022-08-11 9:00:3712 hrs 4 mins ago0x81f5e99ba9beaa2b503db6272ebdbafa9711ce31 IN  Polycat Finance: VaultChef0 MATIC0.00560192 40
0x0cd0e697878f45c413b5d610a28fae2a2338b3f50980605cf19ddf2f802511c1Deposit317578592022-08-11 5:59:5215 hrs 4 mins ago0x40e388b0e3aa56577c0820f33d4cf62223898bbc IN  Polycat Finance: VaultChef0 MATIC0.004419232035 31.555124214
0x9a5dd43e84620a3b9630ff12588d0b560c8a588b168f5b18a2911552ffb68132Deposit317540242022-08-11 3:37:3017 hrs 27 mins ago0x356408dea96d1497429647676281b9213be0f12e IN  Polycat Finance: VaultChef0 MATIC0.0098901408 50.1
0x63b269d6b24299c8134ff92a76fb5aa3bbadab4a1e82f21faf8eded7e229ae62Deposit317537382022-08-11 3:25:3417 hrs 39 mins ago0x34695996ac8d05d4846a39e1406d6e0855510fe2 IN  Polycat Finance: VaultChef0 MATIC0.0072406 50
0x810f96d1b9ff7433fd713e27b11b13f11f2e9b7b4026d77716e015b1c8c99786Deposit317531842022-08-11 3:04:2218 hrs ago0xd4dfa1428e0d7c0cf213b2f63223159193b33a90 IN  Polycat Finance: VaultChef0 MATIC0.0053136561 50.1
0x525d3a3dbca3250874c05d7f7c13cda8ed2703b56877f622ab203d8db29638f1Deposit317484432022-08-11 0:10:3720 hrs 54 mins ago0x5ae41f574153e17996474485536e5fe8cea52b9c IN  Polycat Finance: VaultChef0 MATIC0.0032666788 30.8
0xbca3719de0738ea7347c6f4d96bca3dad9b3fdeb0a72f7164ff31d1b6572f10eDeposit317483172022-08-11 0:06:1720 hrs 58 mins ago0x80c0632fdec7d293d58b829eee92e2f6a557dd17 IN  Polycat Finance: VaultChef0 MATIC0.003606482 34
0x54a16c4b9db33a26a8347e510f73936f3aa78028c5330ee1965f84a04630520cDeposit317474442022-08-10 23:31:5921 hrs 32 mins ago0xd2e6bf71319de42f43c163e2d29e3d769cde7962 IN  Polycat Finance: VaultChef0 MATIC0.0049710592 31.6
0x57abd4b69a6baa1e46601ee3436d27301e9bd0330dbbf491e463deefecc4e93cDeposit317461852022-08-10 22:42:0622 hrs 22 mins ago0x00ff9ff4ba4a5593485f7644f4093894baabfa73 IN  Polycat Finance: VaultChef0 MATIC0.0039560753 37.3
0x55c7f7f029f6da33e6cd016ef1a6c6385f3028d7053f52ffc1f87aeeeec5184eDeposit317376692022-08-10 16:51:171 day 4 hrs ago0x5f1bf015d9cecc1b0a0ecb96a01af247e33c5b73 IN  Polycat Finance: VaultChef0 MATIC0.00857991653 61.264113234
0x4ae06f417b6832a8edb3f9902fc075b5d5a1cae530722a0e687bc20ee0dd525dDeposit317268132022-08-10 9:15:541 day 11 hrs ago0x40e388b0e3aa56577c0820f33d4cf62223898bbc IN  Polycat Finance: VaultChef0 MATIC0.005079198604 36.267555441
0x1c5badd41e603707017d18ee0616742fbba1dad6c8b54463d18022c72efb007fDeposit317262952022-08-10 8:53:491 day 12 hrs ago0x88a2cd766343514c74ec1b252164baf597d57230 IN  Polycat Finance: VaultChef0 MATIC0.003418580262 32.22856205
0xb2d3bd1c302d0324659a447afe3f6da25ffbeaf81d67115862fda9970488a565Deposit317247852022-08-10 7:55:281 day 13 hrs ago0x81f5e99ba9beaa2b503db6272ebdbafa9711ce31 IN  Polycat Finance: VaultChef0 MATIC0.0056475008 35.9
0xc3df03d35b730969fa0b6a88b2352a320f71cc2a646aa05ae2a6e7e500480107Deposit317169172022-08-10 2:18:331 day 18 hrs ago0xfdf020873c7635f5334deced0c8fde7bf2f37439 IN  Polycat Finance: VaultChef0 MATIC0.004803651133 34.300033797
0x29a2e110a5b44a0f2d2cb38fbe014d99b380b0ef3c75cb7ad836cd95549ff944Withdraw317148432022-08-10 0:52:011 day 20 hrs ago0x02c4a98ccdfca694807554bec1cff46152b6d3d8 IN  Polycat Finance: VaultChef0 MATIC0.020275060308 48.855920183
0x32ea1886df9b5092a879eade1eae878b8d47b8b6a69882b03a24e49d32ab79c3Deposit317135712022-08-09 23:58:081 day 21 hrs ago0x560e6643a3a420707160ad279426955fdeae1375 IN  Polycat Finance: VaultChef0 MATIC0.005615443640.1
0xd59010bf462cd8fe178eef319bd2317d246f7d13bacc7164c994e065145e6cc0Deposit317122922022-08-09 23:03:131 day 22 hrs ago0x27f72c342685398c86cff026bc813e7ea74876c3 IN  Polycat Finance: VaultChef0 MATIC0.0044651681 42.1
[ Download CSV Export 

OVERVIEW

The VaultChef controls the Polycat Vault functions.

Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VaultChef

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at polygonscan.com on 2021-06-09
*/

// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

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

    struct Set {
        // Storage of set values
        bytes32[] _values;

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

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

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

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

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

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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


    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

/*
 * @dev 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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

/**
 * @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.
 */
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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

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

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

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

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

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

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

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

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

    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

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

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

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

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

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

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

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

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

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

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

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

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

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

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

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

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

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

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

/**
 * @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].
 */
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 () internal {
        _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 make 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;
    }
}

contract Operators is Ownable {
    mapping(address => bool) public operators;

    event OperatorUpdated(address indexed operator, bool indexed status);

    modifier onlyOperator() {
        require(operators[msg.sender], "Operator: caller is not the operator");
        _;
    }

    // Update the status of the operator
    function updateOperator(address _operator, bool _status) external onlyOwner {
        operators[_operator] = _status;
        emit OperatorUpdated(_operator, _status);
    }
}

// For interacting with our own strategy
interface IStrategy {
    // Want address
    function wantAddress() external view returns (address);
    
    // Total want tokens managed by strategy
    function wantLockedTotal() external view returns (uint256);

    // Sum of all shares of users to wantLockedTotal
    function sharesTotal() external view returns (uint256);

    // Main want token compounding function
    function earn() external;

    // Transfer want tokens autoFarm -> strategy
    function deposit(address _userAddress, uint256 _wantAmt) external returns (uint256);

    // Transfer want tokens strategy -> vaultChef
    function withdraw(address _userAddress, uint256 _wantAmt) external returns (uint256);
}

contract VaultChef is Ownable, ReentrancyGuard, Operators {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    // Info of each user.
    struct UserInfo {
        uint256 shares; // How many LP tokens the user has provided.
    }

    struct PoolInfo {
        IERC20 want; // Address of the want token.
        address strat; // Strategy address that will auto compound want tokens
    }

    PoolInfo[] public poolInfo; // Info of each pool.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo; // Info of each user that stakes LP tokens.
    mapping(address => bool) private strats;

    event AddPool(address indexed strat);
    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);

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

    /**
     * @dev Add a new want to the pool. Can only be called by the owner.
     */
    function addPool(address _strat) external onlyOwner nonReentrant {
        require(!strats[_strat], "Existing strategy");
        poolInfo.push(
            PoolInfo({
                want: IERC20(IStrategy(_strat).wantAddress()),
                strat: _strat
            })
        );
        strats[_strat] = true;
        resetSingleAllowance(poolInfo.length.sub(1));
        emit AddPool(_strat);
    }

    // View function to see staked Want tokens on frontend.
    function stakedWantTokens(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];

        uint256 sharesTotal = IStrategy(pool.strat).sharesTotal();
        uint256 wantLockedTotal = IStrategy(poolInfo[_pid].strat).wantLockedTotal();
        if (sharesTotal == 0) {
            return 0;
        }
        return user.shares.mul(wantLockedTotal).div(sharesTotal);
    }

    // Want tokens moved from user -> this -> Strat (compounding)
    function deposit(uint256 _pid, uint256 _wantAmt) external nonReentrant {
        _deposit(_pid, _wantAmt, msg.sender);
    }

    // For unique contract calls
    function deposit(uint256 _pid, uint256 _wantAmt, address _to) external nonReentrant onlyOperator {
        _deposit(_pid, _wantAmt, _to);
    }
    
    function _deposit(uint256 _pid, uint256 _wantAmt, address _to) internal {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_to];

        if (_wantAmt > 0) {
            pool.want.safeTransferFrom(msg.sender, address(this), _wantAmt);

            uint256 sharesAdded = IStrategy(poolInfo[_pid].strat).deposit(_to, _wantAmt);
            user.shares = user.shares.add(sharesAdded);
        }
        emit Deposit(_to, _pid, _wantAmt);
    }

    // Withdraw LP tokens from MasterChef.
    function withdraw(uint256 _pid, uint256 _wantAmt) external nonReentrant {
        _withdraw(_pid, _wantAmt, msg.sender);
    }

    // For unique contract calls
    function withdraw(uint256 _pid, uint256 _wantAmt, address _to) external nonReentrant onlyOperator {
        _withdraw(_pid, _wantAmt, _to);
    }

    function _withdraw(uint256 _pid, uint256 _wantAmt, address _to) internal {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        uint256 wantLockedTotal = IStrategy(poolInfo[_pid].strat).wantLockedTotal();
        uint256 sharesTotal = IStrategy(poolInfo[_pid].strat).sharesTotal();

        require(user.shares > 0, "user.shares is 0");
        require(sharesTotal > 0, "sharesTotal is 0");

        // Withdraw want tokens
        uint256 amount = user.shares.mul(wantLockedTotal).div(sharesTotal);
        if (_wantAmt > amount) {
            _wantAmt = amount;
        }
        if (_wantAmt > 0) {
            uint256 sharesRemoved = IStrategy(poolInfo[_pid].strat).withdraw(msg.sender, _wantAmt);

            if (sharesRemoved > user.shares) {
                user.shares = 0;
            } else {
                user.shares = user.shares.sub(sharesRemoved);
            }

            uint256 wantBal = IERC20(pool.want).balanceOf(address(this));
            if (wantBal < _wantAmt) {
                _wantAmt = wantBal;
            }
            pool.want.safeTransfer(_to, _wantAmt);
        }
        emit Withdraw(msg.sender, _pid, _wantAmt);
    }

    // Withdraw everything from pool for yourself
    function withdrawAll(uint256 _pid) external {
        _withdraw(_pid, uint256(-1), msg.sender);
    }

    function resetAllowances() external onlyOwner {
        for (uint256 i=0; i<poolInfo.length; i++) {
            PoolInfo storage pool = poolInfo[i];
            pool.want.safeApprove(pool.strat, uint256(0));
            pool.want.safeIncreaseAllowance(pool.strat, uint256(-1));
        }
    }

    function resetSingleAllowance(uint256 _pid) public onlyOwner {
        PoolInfo storage pool = poolInfo[_pid];
        pool.want.safeApprove(pool.strat, uint256(0));
        pool.want.safeIncreaseAllowance(pool.strat, uint256(-1));
    }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"strat","type":"address"}],"name":"AddPool","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":"operator","type":"address"},{"indexed":true,"internalType":"bool","name":"status","type":"bool"}],"name":"OperatorUpdated","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":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"_strat","type":"address"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_wantAmt","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_wantAmt","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"operators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"want","type":"address"},{"internalType":"address","name":"strat","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetAllowances","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"resetSingleAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"stakedWantTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"updateOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_wantAmt","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_wantAmt","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50600061001b61006e565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055610072565b3390565b611b79806100816000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063715018a6116100a257806393f1a40b1161007157806393f1a40b146102e4578063958e2d3114610310578063d914cd4b1461032d578063e2bbb15814610353578063f2fde38b146103765761010b565b8063715018a61461025a5780637b84daec146102625780638da5cb5b1461028e5780638dbdbe6d146102b25761010b565b806323e1ad7d116100de57806323e1ad7d146101e45780633505b09f14610201578063441a3e70146102095780636d44a3b21461022c5761010b565b8063081e3eda146101105780630ad58d2f1461012a57806313e7c9d81461015e5780631526fe2714610198575b600080fd5b61011861039c565b60408051918252519081900360200190f35b61015c6004803603606081101561014057600080fd5b50803590602081013590604001356001600160a01b03166103a2565b005b6101846004803603602081101561017457600080fd5b50356001600160a01b0316610452565b604080519115158252519081900360200190f35b6101b5600480360360208110156101ae57600080fd5b5035610467565b60405180836001600160a01b03168152602001826001600160a01b031681526020019250505060405180910390f35b61015c600480360360208110156101fa57600080fd5b503561049d565b61015c61055b565b61015c6004803603604081101561021f57600080fd5b508035906020013561062e565b61015c6004803603604081101561024257600080fd5b506001600160a01b038135169060200135151561068c565b61015c610738565b6101186004803603604081101561027857600080fd5b50803590602001356001600160a01b03166107da565b610296610952565b604080516001600160a01b039092168252519081900360200190f35b61015c600480360360608110156102c857600080fd5b50803590602081013590604001356001600160a01b0316610961565b610118600480360360408110156102fa57600080fd5b50803590602001356001600160a01b0316610a08565b61015c6004803603602081101561032657600080fd5b5035610a25565b61015c6004803603602081101561034357600080fd5b50356001600160a01b0316610a32565b61015c6004803603604081101561036957600080fd5b5080359060200135610c6c565b61015c6004803603602081101561038c57600080fd5b50356001600160a01b0316610cc2565b60035490565b600260015414156103e8576040805162461bcd60e51b815260206004820152601f6024820152600080516020611a39833981519152604482015290519081900360640190fd5b60026001819055336000908152602091909152604090205460ff1661043e5760405162461bcd60e51b8152600401808060200182810382526024815260200180611b206024913960400191505060405180910390fd5b610449838383610dba565b50506001805550565b60026020526000908152604090205460ff1681565b6003818154811061047457fe5b6000918252602090912060029091020180546001909101546001600160a01b0391821692501682565b6104a561116e565b6000546001600160a01b039081169116146104f5576040805162461bcd60e51b81526020600482018190526024820152600080516020611aa0833981519152604482015290519081900360640190fd5b60006003828154811061050457fe5b6000918252602082206001600290920201908101548154919350610537926001600160a01b039283169290911690611172565b60018101548154610557916001600160a01b03918216911660001961128a565b5050565b61056361116e565b6000546001600160a01b039081169116146105b3576040805162461bcd60e51b81526020600482018190526024820152600080516020611aa0833981519152604482015290519081900360640190fd5b60005b60035481101561062b576000600382815481106105cf57fe5b6000918252602082206001600290920201908101548154919350610602926001600160a01b039283169290911690611172565b60018101548154610622916001600160a01b03918216911660001961128a565b506001016105b6565b50565b60026001541415610674576040805162461bcd60e51b815260206004820152601f6024820152600080516020611a39833981519152604482015290519081900360640190fd5b6002600155610684828233610dba565b505060018055565b61069461116e565b6000546001600160a01b039081169116146106e4576040805162461bcd60e51b81526020600482018190526024820152600080516020611aa0833981519152604482015290519081900360640190fd5b6001600160a01b038216600081815260026020526040808220805460ff191685151590811790915590519092917f966c160e1c4dbc7df8d69af4ace01e9297c3cf016397b7914971f2fbfa32672d91a35050565b61074061116e565b6000546001600160a01b03908116911614610790576040805162461bcd60e51b81526020600482018190526024820152600080516020611aa0833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600080600384815481106107ea57fe5b60009182526020808320878452600480835260408086206001600160a01b03808b16885290855281872060016002909702909401958601548251632251caaf60e11b815292519698509396959316936344a3955e93828401939192909190829003018186803b15801561085c57600080fd5b505afa158015610870573d6000803e3d6000fd5b505050506040513d602081101561088657600080fd5b5051600380549192506000918890811061089c57fe5b600091825260209182902060016002909202010154604080516342da4eb360e01b815290516001600160a01b03909216926342da4eb392600480840193829003018186803b1580156108ed57600080fd5b505afa158015610901573d6000803e3d6000fd5b505050506040513d602081101561091757600080fd5b505190508161092d57600094505050505061094c565b825461094590839061093f908461137b565b906113db565b9450505050505b92915050565b6000546001600160a01b031690565b600260015414156109a7576040805162461bcd60e51b815260206004820152601f6024820152600080516020611a39833981519152604482015290519081900360640190fd5b60026001819055336000908152602091909152604090205460ff166109fd5760405162461bcd60e51b8152600401808060200182810382526024815260200180611b206024913960400191505060405180910390fd5b61044983838361141d565b600460209081526000928352604080842090915290825290205481565b61062b8160001933610dba565b610a3a61116e565b6000546001600160a01b03908116911614610a8a576040805162461bcd60e51b81526020600482018190526024820152600080516020611aa0833981519152604482015290519081900360640190fd5b60026001541415610ad0576040805162461bcd60e51b815260206004820152601f6024820152600080516020611a39833981519152604482015290519081900360640190fd5b60026001556001600160a01b03811660009081526005602052604090205460ff1615610b37576040805162461bcd60e51b81526020600482015260116024820152704578697374696e6720737472617465677960781b604482015290519081900360640190fd5b60036040518060400160405280836001600160a01b031663e7a036796040518163ffffffff1660e01b815260040160206040518083038186803b158015610b7d57600080fd5b505afa158015610b91573d6000803e3d6000fd5b505050506040513d6020811015610ba757600080fd5b50516001600160a01b03908116825284811660209283018190528454600181810187556000968752848720865160029093020180549285166001600160a01b03199384161781559585015195810180549690941695909116949094179091558352600590526040909120805460ff191682179055600354610c3191610c2c919061158a565b61049d565b6040516001600160a01b038216907f8c82d670bc9247c2cfb6964089bc9cff0255f9caade6fbc74a13368083e5546690600090a25060018055565b60026001541415610cb2576040805162461bcd60e51b815260206004820152601f6024820152600080516020611a39833981519152604482015290519081900360640190fd5b600260015561068482823361141d565b610cca61116e565b6000546001600160a01b03908116911614610d1a576040805162461bcd60e51b81526020600482018190526024820152600080516020611aa0833981519152604482015290519081900360640190fd5b6001600160a01b038116610d5f5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a596026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600060038481548110610dc957fe5b600091825260208083208784526004825260408085203386529092529083206003805460029094029092019450929187908110610e0257fe5b600091825260209182902060016002909202010154604080516342da4eb360e01b815290516001600160a01b03909216926342da4eb392600480840193829003018186803b158015610e5357600080fd5b505afa158015610e67573d6000803e3d6000fd5b505050506040513d6020811015610e7d57600080fd5b50516003805491925060009188908110610e9357fe5b60009182526020918290206001600290920201015460408051632251caaf60e11b815290516001600160a01b03909216926344a3955e92600480840193829003018186803b158015610ee457600080fd5b505afa158015610ef8573d6000803e3d6000fd5b505050506040513d6020811015610f0e57600080fd5b50518354909150610f59576040805162461bcd60e51b815260206004820152601060248201526f0757365722e73686172657320697320360841b604482015290519081900360640190fd5b60008111610fa1576040805162461bcd60e51b815260206004820152601060248201526f0736861726573546f74616c20697320360841b604482015290519081900360640190fd5b8254600090610fb690839061093f908661137b565b905080871115610fc4578096505b861561112d57600060038981548110610fd957fe5b60009182526020808320600160029093020191909101546040805163f3fef3a360e01b8152336004820152602481018d905290516001600160a01b039092169363f3fef3a39360448084019491939192918390030190829087803b15801561104057600080fd5b505af1158015611054573d6000803e3d6000fd5b505050506040513d602081101561106a57600080fd5b505185549091508111156110815760008555611090565b845461108d908261158a565b85555b8554604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156110da57600080fd5b505afa1580156110ee573d6000803e3d6000fd5b505050506040513d602081101561110457600080fd5b5051905088811015611114578098505b865461112a906001600160a01b0316898b6115cc565b50505b604080518881529051899133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a35050505050505050565b3390565b8015806111f8575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156111ca57600080fd5b505afa1580156111de573d6000803e3d6000fd5b505050506040513d60208110156111f457600080fd5b5051155b6112335760405162461bcd60e51b8152600401808060200182810382526036815260200180611aea6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261128590849061161a565b505050565b600061132082856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b1580156112ee57600080fd5b505afa158015611302573d6000803e3d6000fd5b505050506040513d602081101561131857600080fd5b5051906116cb565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905290915061137590859061161a565b50505050565b60008261138a5750600061094c565b8282028284828161139757fe5b04146113d45760405162461bcd60e51b8152600401808060200182810382526021815260200180611a7f6021913960400191505060405180910390fd5b9392505050565b60006113d483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611725565b60006003848154811061142c57fe5b600091825260208083208784526004825260408085206001600160a01b0388168652909252922060029091029091019150831561154357815461147a906001600160a01b03163330876117c7565b60006003868154811061148957fe5b906000526020600020906002020160010160009054906101000a90046001600160a01b03166001600160a01b03166347e7ef2485876040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561150457600080fd5b505af1158015611518573d6000803e3d6000fd5b505050506040513d602081101561152e57600080fd5b5051825490915061153f90826116cb565b8255505b60408051858152905186916001600160a01b038616917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a35050505050565b60006113d483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611821565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526112859084905b606061166f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661187b9092919063ffffffff16565b8051909150156112855780806020019051602081101561168e57600080fd5b50516112855760405162461bcd60e51b815260040180806020018281038252602a815260200180611ac0602a913960400191505060405180910390fd5b6000828201838110156113d4576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081836117b15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177657818101518382015260200161175e565b50505050905090810190601f1680156117a35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816117bd57fe5b0495945050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261137590859061161a565b600081848411156118735760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561177657818101518382015260200161175e565b505050900390565b606061188a8484600085611892565b949350505050565b606061189d856119ff565b6118ee576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061192d5780518252601f19909201916020918201910161190e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461198f576040519150601f19603f3d011682016040523d82523d6000602084013e611994565b606091505b509150915081156119a857915061188a9050565b8051156119b85780518082602001fd5b60405162461bcd60e51b815260206004820181815286516024840152865187939192839260440191908501908083836000831561177657818101518382015260200161175e565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061188a57505015159291505056fe5265656e7472616e637947756172643a207265656e7472616e742063616c6c004f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e63654f70657261746f723a2063616c6c6572206973206e6f7420746865206f70657261746f72a264697066735822122026de536f744bd69e4a1589263732f0f157bc6531a868e739a9df7aa4a1a438a764736f6c634300060c0033

Deployed ByteCode Sourcemap

43716:5359:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;44653:95;;;:::i;:::-;;;;;;;;;;;;;;;;46944:147;;;;;;;;;;;;;;;;-1:-1:-1;46944:147:0;;;;;;;;;;;-1:-1:-1;;;;;46944:147:0;;:::i;:::-;;42481:41;;;;;;;;;;;;;;;;-1:-1:-1;42481:41:0;-1:-1:-1;;;;;42481:41:0;;:::i;:::-;;;;;;;;;;;;;;;;;;44142:26;;;;;;;;;;;;;;;;-1:-1:-1;44142:26:0;;:::i;:::-;;;;;-1:-1:-1;;;;;44142:26:0;;;;;;-1:-1:-1;;;;;44142:26:0;;;;;;;;;;;;;;;;48831:241;;;;;;;;;;;;;;;;-1:-1:-1;48831:241:0;;:::i;48524:299::-;;;:::i;46774:128::-;;;;;;;;;;;;;;;;-1:-1:-1;46774:128:0;;;;;;;:::i;42783:176::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;42783:176:0;;;;;;;;;;:::i;10579:148::-;;;:::i;45335:490::-;;;;;;;;;;;;;;;;-1:-1:-1;45335:490:0;;;;;;-1:-1:-1;;;;;45335:490:0;;:::i;9937:79::-;;;:::i;:::-;;;;-1:-1:-1;;;;;9937:79:0;;;;;;;;;;;;;;46068:145;;;;;;;;;;;;;;;;-1:-1:-1;46068:145:0;;;;;;;;;;;-1:-1:-1;;;;;46068:145:0;;:::i;44197:64::-;;;;;;;;;;;;;;;;-1:-1:-1;44197:64:0;;;;;;-1:-1:-1;;;;;44197:64:0;;:::i;48413:103::-;;;;;;;;;;;;;;;;-1:-1:-1;48413:103:0;;:::i;44848:418::-;;;;;;;;;;;;;;;;-1:-1:-1;44848:418:0;-1:-1:-1;;;;;44848:418:0;;:::i;45900:126::-;;;;;;;;;;;;;;;;-1:-1:-1;45900:126:0;;;;;;;:::i;10882:244::-;;;;;;;;;;;;;;;;-1:-1:-1;10882:244:0;-1:-1:-1;;;;;10882:244:0;;:::i;44653:95::-;44725:8;:15;44653:95;:::o;46944:147::-;41489:1;42095:7;;:19;;42087:63;;;;;-1:-1:-1;;;42087:63:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;42087:63:0;;;;;;;;;;;;;;;41489:1;42228:7;:18;;;42661:10:::1;42651:21;::::0;;;::::1;::::0;;;;;;;;::::1;;42643:70;;;;-1:-1:-1::0;;;42643:70:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;47053:30:::2;47063:4;47069:8;47079:3;47053:9;:30::i;:::-;-1:-1:-1::0;;41445:1:0;42407:22;;-1:-1:-1;46944:147:0:o;42481:41::-;;;;;;;;;;;;;;;:::o;44142:26::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;44142:26:0;;;;-1:-1:-1;44142:26:0;;:::o;48831:241::-;10159:12;:10;:12::i;:::-;10149:6;;-1:-1:-1;;;;;10149:6:0;;;:22;;;10141:67;;;;;-1:-1:-1;;;10141:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;10141:67:0;;;;;;;;;;;;;;;48903:21:::1;48927:8;48936:4;48927:14;;;;;;;;;::::0;;;::::1;::::0;;48974:10:::1;48927:14;::::0;;::::1;;48974:10:::0;;::::1;::::0;48952:9;;48927:14;;-1:-1:-1;48952:45:0::1;::::0;-1:-1:-1;;;;;48952:9:0;;::::1;::::0;48974:10;;::::1;::::0;48952:21:::1;:45::i;:::-;49040:10;::::0;::::1;::::0;49008:9;;:56:::1;::::0;-1:-1:-1;;;;;49008:9:0;;::::1;::::0;49040:10:::1;-1:-1:-1::0;;49008:31:0::1;:56::i;:::-;10219:1;48831:241:::0;:::o;48524:299::-;10159:12;:10;:12::i;:::-;10149:6;;-1:-1:-1;;;;;10149:6:0;;;:22;;;10141:67;;;;;-1:-1:-1;;;10141:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;10141:67:0;;;;;;;;;;;;;;;48586:9:::1;48581:235;48601:8;:15:::0;48599:17;::::1;48581:235;;;48638:21;48662:8;48671:1;48662:11;;;;;;;;;::::0;;;::::1;::::0;;48710:10:::1;48662:11;::::0;;::::1;;48710:10:::0;;::::1;::::0;48688:9;;48662:11;;-1:-1:-1;48688:45:0::1;::::0;-1:-1:-1;;;;;48688:9:0;;::::1;::::0;48710:10;;::::1;::::0;48688:21:::1;:45::i;:::-;48780:10;::::0;::::1;::::0;48748:9;;:56:::1;::::0;-1:-1:-1;;;;;48748:9:0;;::::1;::::0;48780:10:::1;-1:-1:-1::0;;48748:31:0::1;:56::i;:::-;-1:-1:-1::0;48618:3:0::1;;48581:235;;;;48524:299::o:0;46774:128::-;41489:1;42095:7;;:19;;42087:63;;;;;-1:-1:-1;;;42087:63:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;42087:63:0;;;;;;;;;;;;;;;41489:1;42228:7;:18;46857:37:::1;46867:4:::0;46873:8;46883:10:::1;46857:9;:37::i;:::-;-1:-1:-1::0;;41445:1:0;42407:22;;46774:128::o;42783:176::-;10159:12;:10;:12::i;:::-;10149:6;;-1:-1:-1;;;;;10149:6:0;;;:22;;;10141:67;;;;;-1:-1:-1;;;10141:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;10141:67:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;42870:20:0;::::1;;::::0;;;:9:::1;:20;::::0;;;;;:30;;-1:-1:-1;;42870:30:0::1;::::0;::::1;;::::0;;::::1;::::0;;;42916:35;;42870:30;;:20;42916:35:::1;::::0;::::1;42783:176:::0;;:::o;10579:148::-;10159:12;:10;:12::i;:::-;10149:6;;-1:-1:-1;;;;;10149:6:0;;;:22;;;10141:67;;;;;-1:-1:-1;;;10141:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;10141:67:0;;;;;;;;;;;;;;;10686:1:::1;10670:6:::0;;10649:40:::1;::::0;-1:-1:-1;;;;;10670:6:0;;::::1;::::0;10649:40:::1;::::0;10686:1;;10649:40:::1;10717:1;10700:19:::0;;-1:-1:-1;;;;;;10700:19:0::1;::::0;;10579:148::o;45335:490::-;45413:7;45433:21;45457:8;45466:4;45457:14;;;;;;;;;;;;;;;;45506;;;:8;:14;;;;;;;-1:-1:-1;;;;;45506:21:0;;;;;;;;;;;45572:10;45457:14;;;;;;;45572:10;;;;45562:35;;-1:-1:-1;;;45562:35:0;;;;45457:14;;-1:-1:-1;45506:21:0;;45457:14;45572:10;;;45562:33;;:35;;;;45457:14;;45562:35;;;;;;;;45572:10;45562:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;45562:35:0;45644:8;:14;;45562:35;;-1:-1:-1;45608:23:0;;45653:4;;45644:14;;;;;;;;;;;;;;;:20;:14;;;;;:20;;45634:49;;;-1:-1:-1;;;45634:49:0;;;;-1:-1:-1;;;;;45644:20:0;;;;45634:47;;:49;;;;;;;;;;45644:20;45634:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;45634:49:0;;-1:-1:-1;45698:16:0;45694:57;;45738:1;45731:8;;;;;;;;45694:57;45768:11;;:49;;45805:11;;45768:32;;45784:15;45768;:32::i;:::-;:36;;:49::i;:::-;45761:56;;;;;;45335:490;;;;;:::o;9937:79::-;9975:7;10002:6;-1:-1:-1;;;;;10002:6:0;9937:79;:::o;46068:145::-;41489:1;42095:7;;:19;;42087:63;;;;;-1:-1:-1;;;42087:63:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;42087:63:0;;;;;;;;;;;;;;;41489:1;42228:7;:18;;;42661:10:::1;42651:21;::::0;;;::::1;::::0;;;;;;;;::::1;;42643:70;;;;-1:-1:-1::0;;;42643:70:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;46176:29:::2;46185:4;46191:8;46201:3;46176:8;:29::i;44197:64::-:0;;;;;;;;;;;;;;;;;;;;;;;;:::o;48413:103::-;48468:40;48478:4;-1:-1:-1;;48497:10:0;48468:9;:40::i;44848:418::-;10159:12;:10;:12::i;:::-;10149:6;;-1:-1:-1;;;;;10149:6:0;;;:22;;;10141:67;;;;;-1:-1:-1;;;10141:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;10141:67:0;;;;;;;;;;;;;;;41489:1:::1;42095:7;;:19;;42087:63;;;::::0;;-1:-1:-1;;;42087:63:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;;;;;;;;;42087:63:0;;;;;;;;;;;;;::::1;;41489:1;42228:7;:18:::0;-1:-1:-1;;;;;44933:14:0;::::2;;::::0;;;:6:::2;:14;::::0;;;;;::::2;;44932:15;44924:45;;;::::0;;-1:-1:-1;;;44924:45:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;44924:45:0;;;;;;;;;;;;;::::2;;44980:8;45008:121;;;;;;;;45059:6;-1:-1:-1::0;;;;;45049:29:0::2;;:31;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;45049:31:0;-1:-1:-1;;;;;45008:121:0;;::::2;::::0;;;;::::2;45049:31;45008:121:::0;;::::2;::::0;;;44980:160;;::::2;::::0;;::::2;::::0;;-1:-1:-1;44980:160:0;;;;;;;;::::2;::::0;;::::2;;::::0;;;;::::2;-1:-1:-1::0;;;;;;44980:160:0;;::::2;;::::0;;;;::::2;::::0;;;::::2;::::0;;;;;::::2;::::0;;;::::2;::::0;;;::::2;::::0;;;45151:14;;:6:::2;:14:::0;;;;;;:21;;-1:-1:-1;;45151:21:0::2;::::0;::::2;::::0;;45204:8:::2;:15:::0;45183:44:::2;::::0;45204:22:::2;::::0;:15;:19:::2;:22::i;:::-;45183:20;:44::i;:::-;45243:15;::::0;-1:-1:-1;;;;;45243:15:0;::::2;::::0;::::2;::::0;;;::::2;-1:-1:-1::0;41445:1:0::1;42407:22:::0;;44848:418::o;45900:126::-;41489:1;42095:7;;:19;;42087:63;;;;;-1:-1:-1;;;42087:63:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;42087:63:0;;;;;;;;;;;;;;;41489:1;42228:7;:18;45982:36:::1;45991:4:::0;45997:8;46007:10:::1;45982:8;:36::i;10882:244::-:0;10159:12;:10;:12::i;:::-;10149:6;;-1:-1:-1;;;;;10149:6:0;;;:22;;;10141:67;;;;;-1:-1:-1;;;10141:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;10141:67:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;10971:22:0;::::1;10963:73;;;;-1:-1:-1::0;;;10963:73:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11073:6;::::0;;11052:38:::1;::::0;-1:-1:-1;;;;;11052:38:0;;::::1;::::0;11073:6;::::1;::::0;11052:38:::1;::::0;::::1;11101:6;:17:::0;;-1:-1:-1;;;;;;11101:17:0::1;-1:-1:-1::0;;;;;11101:17:0;;;::::1;::::0;;;::::1;::::0;;10882:244::o;47099:1255::-;47183:21;47207:8;47216:4;47207:14;;;;;;;;;;;;;;;;47256;;;:8;:14;;;;;;47271:10;47256:26;;;;;;;;47331:8;:14;;47207;;;;;;;;-1:-1:-1;47256:26:0;47207:14;47265:4;;47331:14;;;;;;;;;;;;;;;:20;:14;;;;;:20;;47321:49;;;-1:-1:-1;;;47321:49:0;;;;-1:-1:-1;;;;;47331:20:0;;;;47321:47;;:49;;;;;;;;;;47331:20;47321:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;47321:49:0;47413:8;:14;;47321:49;;-1:-1:-1;47381:19:0;;47422:4;;47413:14;;;;;;;;;;;;;;;:20;:14;;;;;:20;;47403:45;;;-1:-1:-1;;;47403:45:0;;;;-1:-1:-1;;;;;47413:20:0;;;;47403:43;;:45;;;;;;;;;;47413:20;47403:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;47403:45:0;47469:11;;47403:45;;-1:-1:-1;47461:44:0;;;;;-1:-1:-1;;;47461:44:0;;;;;;;;;;;;-1:-1:-1;;;47461:44:0;;;;;;;;;;;;;;;47538:1;47524:11;:15;47516:44;;;;;-1:-1:-1;;;47516:44:0;;;;;;;;;;;;-1:-1:-1;;;47516:44:0;;;;;;;;;;;;;;;47623:11;;47606:14;;47623:49;;47660:11;;47623:32;;47639:15;47623;:32::i;:49::-;47606:66;;47698:6;47687:8;:17;47683:67;;;47732:6;47721:17;;47683:67;47764:12;;47760:535;;47793:21;47827:8;47836:4;47827:14;;;;;;;;;;;;;;;;:20;:14;;;;;:20;;;;;47817:62;;;-1:-1:-1;;;47817:62:0;;47858:10;47817:62;;;;;;;;;;;;-1:-1:-1;;;;;47827:20:0;;;;47817:40;;:62;;;;;47827:14;;47817:62;;;;;;;;;;47827:20;47817:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;47817:62:0;47916:11;;47817:62;;-1:-1:-1;47900:27:0;;47896:168;;;47962:1;47948:15;;47896:168;;;48018:11;;:30;;48034:13;48018:15;:30::i;:::-;48004:44;;47896:168;48105:9;;48098:42;;;-1:-1:-1;;;48098:42:0;;48134:4;48098:42;;;;;;48080:15;;-1:-1:-1;;;;;48105:9:0;;48098:27;;:42;;;;;;;;;;;;;;48105:9;48098:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;48098:42:0;;-1:-1:-1;48159:18:0;;;48155:77;;;48209:7;48198:18;;48155:77;48246:9;;:37;;-1:-1:-1;;;;;48246:9:0;48269:3;48274:8;48246:22;:37::i;:::-;47760:535;;;48310:36;;;;;;;;48331:4;;48319:10;;48310:36;;;;;;;;;47099:1255;;;;;;;;:::o;8575:106::-;8663:10;8575:106;:::o;37433:622::-;37803:10;;;37802:62;;-1:-1:-1;37819:39:0;;;-1:-1:-1;;;37819:39:0;;37843:4;37819:39;;;;-1:-1:-1;;;;;37819:39:0;;;;;;;;;:15;;;;;;:39;;;;;;;;;;;;;;;:15;:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;37819:39:0;:44;37802:62;37794:152;;;;-1:-1:-1;;;37794:152:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;37984:62;;;-1:-1:-1;;;;;37984:62:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;37984:62:0;-1:-1:-1;;;37984:62:0;;;37957:90;;37977:5;;37957:19;:90::i;:::-;37433:622;;;:::o;38063:286::-;38160:20;38183:50;38227:5;38183;-1:-1:-1;;;;;38183:15:0;;38207:4;38214:7;38183:39;;;;;;;;;;;;;-1:-1:-1;;;;;38183:39:0;;;;;;-1:-1:-1;;;;;38183:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;38183:39:0;;:43;:50::i;:::-;38271:69;;;-1:-1:-1;;;;;38271:69:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;38271:69:0;-1:-1:-1;;;38271:69:0;;;38160:73;;-1:-1:-1;38244:97:0;;38264:5;;38244:19;:97::i;:::-;38063:286;;;;:::o;13327:471::-;13385:7;13630:6;13626:47;;-1:-1:-1;13660:1:0;13653:8;;13626:47;13697:5;;;13701:1;13697;:5;:1;13721:5;;;;;:10;13713:56;;;;-1:-1:-1;;;13713:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13789:1;13327:471;-1:-1:-1;;;13327:471:0:o;14274:132::-;14332:7;14359:39;14363:1;14366;14359:39;;;;;;;;;;;;;;;;;:3;:39::i;46225:497::-;46308:21;46332:8;46341:4;46332:14;;;;;;;;;;;;;;;;46381;;;:8;:14;;;;;;-1:-1:-1;;;;;46381:19:0;;;;;;;;;46332:14;;;;;;;;-1:-1:-1;46417:12:0;;46413:258;;46446:9;;:63;;-1:-1:-1;;;;;46446:9:0;46473:10;46493:4;46500:8;46446:26;:63::i;:::-;46526:19;46558:8;46567:4;46558:14;;;;;;;;;;;;;;;;;;:20;;;;;;;;;;-1:-1:-1;;;;;46558:20:0;-1:-1:-1;;;;;46548:39:0;;46588:3;46593:8;46548:54;;;;;;;;;;;;;-1:-1:-1;;;;;46548:54:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;46548:54:0;46631:11;;46548:54;;-1:-1:-1;46631:28:0;;46548:54;46631:15;:28::i;:::-;46617:42;;-1:-1:-1;46413:258:0;46686:28;;;;;;;;46699:4;;-1:-1:-1;;;;;46686:28:0;;;;;;;;;;;;46225:497;;;;;:::o;12437:136::-;12495:7;12522:43;12526:1;12529;12522:43;;;;;;;;;;;;;;;;;:3;:43::i;36774:177::-;36884:58;;;-1:-1:-1;;;;;36884:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;36884:58:0;-1:-1:-1;;;36884:58:0;;;36857:86;;36877:5;;39079:761;39503:23;39529:69;39557:4;39529:69;;;;;;;;;;;;;;;;;39537:5;-1:-1:-1;;;;;39529:27:0;;;:69;;;;;:::i;:::-;39613:17;;39503:95;;-1:-1:-1;39613:21:0;39609:224;;39755:10;39744:30;;;;;;;;;;;;;;;-1:-1:-1;39744:30:0;39736:85;;;;-1:-1:-1;;;39736:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11973:181;12031:7;12063:5;;;12087:6;;;;12079:46;;;;;-1:-1:-1;;;12079:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;14902:278;14988:7;15023:12;15016:5;15008:28;;;;-1:-1:-1;;;15008:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15047:9;15063:1;15059;:5;;;;;;;14902:278;-1:-1:-1;;;;;14902:278:0:o;36959:205::-;37087:68;;;-1:-1:-1;;;;;37087:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;37087:68:0;-1:-1:-1;;;37087:68:0;;;37060:96;;37080:5;;37060:19;:96::i;12876:192::-;12962:7;12998:12;12990:6;;;;12982:29;;;;-1:-1:-1;;;12982:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;13034:5:0;;;12876:192::o;20229:196::-;20332:12;20364:53;20387:6;20395:4;20401:1;20404:12;20364:22;:53::i;:::-;20357:60;20229:196;-1:-1:-1;;;;20229:196:0:o;21606:979::-;21736:12;21769:18;21780:6;21769:10;:18::i;:::-;21761:60;;;;;-1:-1:-1;;;21761:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;21895:12;21909:23;21936:6;-1:-1:-1;;;;;21936:11:0;21956:8;21967:4;21936:36;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;21936:36:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21894:78;;;;21987:7;21983:595;;;22018:10;-1:-1:-1;22011:17:0;;-1:-1:-1;22011:17:0;21983:595;22132:17;;:21;22128:439;;22395:10;22389:17;22456:15;22443:10;22439:2;22435:19;22428:44;22343:148;22531:20;;-1:-1:-1;;;22531:20:0;;;;;;;;;;;;;;;;;22538:12;;22531:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17114:619;17174:4;17642:20;;17485:66;17682:23;;;;;;:42;;-1:-1:-1;;17709:15:0;;;17674:51;-1:-1:-1;;17114:619:0:o

Swarm Source

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