Contract 0xADed2aEE9dAbecbbcfc7AbCf8Cda03DD57e1F2Af

 
Txn Hash
Method
Block
From
To
Value
0x7b8c8c6e624595194399329856345fd6c5a1fc9b7d8ffbd47d87d39f35723176Unstake146913642022-05-01 10:11:56149 days 11 hrs ago0x1f92d728f2ca8b589cd2432c86864166ca34c285 IN  0xaded2aee9dabecbbcfc7abcf8cda03dd57e1f2af0 Ether0.00424806 50.24383226
0x750964fb7f30650c3050b97f834e7f6be7bb0f82a8c5160869cd00bc3a0d8a9dWithdraw128185032021-07-13 11:27:21441 days 10 hrs agoDePay: Deployer IN  0xaded2aee9dabecbbcfc7abcf8cda03dd57e1f2af0 Ether0.0013570324
0x88fe1e027b046f58f36f391a9ee928539cd84f71c7a3195a8e919ff09510c1f1Stake123745212021-05-05 13:39:53510 days 7 hrs agoENS Name misterb.eth IN  0xaded2aee9dabecbbcfc7abcf8cda03dd57e1f2af0 Ether0.0034109137
0x10c864fe672c467dbde9bb8da5664cbdc1a6ff7f20c499ba852d966adb6400e1Stake123612662021-05-03 12:39:31512 days 8 hrs ago0x1f92d728f2ca8b589cd2432c86864166ca34c285 IN  0xaded2aee9dabecbbcfc7abcf8cda03dd57e1f2af0 Ether0.0060665748
0xaa4eedc5e29e95e2715e8f74db031636ea19d8982b60f4afc521f7b3884f198cInit123600292021-05-03 8:08:17512 days 13 hrs agoDePay: Deployer IN  0xaded2aee9dabecbbcfc7abcf8cda03dd57e1f2af0 Ether0.0091798138
0x23e520d4e59de64daf3cf4f66dfc30729e2bd94e6c2f8a1ef1769680708ccabd0x60806040123279172021-04-28 8:47:28517 days 12 hrs agoDePay: Deployer IN  Contract Creation0 Ether0.053273334
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
Loading

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x7d4735d924995ed437c413b69814ec49e904b81e

Contract Name:
DePayLiquidityStaking

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-04-01
*/

// Dependency file: contracts/interfaces/IUniswapV2Pair.sol

// SPDX-License-Identifier: MIT

// pragma solidity >=0.7.5 <0.8.0;

interface IUniswapV2Pair {
    
    function totalSupply() external view returns (uint);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);
    function token0() external view returns (address);

}


// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol


// pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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


// Dependency file: @openzeppelin/contracts/math/SafeMath.sol


// pragma solidity >=0.6.0 <0.8.0;

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


// Dependency file: @openzeppelin/contracts/utils/Address.sol


// pragma solidity >=0.6.2 <0.8.0;

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

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // 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");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

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


// Dependency file: @openzeppelin/contracts/token/ERC20/SafeERC20.sol


// pragma solidity >=0.6.0 <0.8.0;

// import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// import "@openzeppelin/contracts/math/SafeMath.sol";
// import "@openzeppelin/contracts/utils/Address.sol";

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


// Dependency file: @openzeppelin/contracts/utils/ReentrancyGuard.sol


// pragma solidity >=0.6.0 <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 () 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;
    }
}


// Dependency file: @openzeppelin/contracts/GSN/Context.sol


// pragma solidity >=0.6.0 <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 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;
    }
}


// Dependency file: @openzeppelin/contracts/access/Ownable.sol


// pragma solidity >=0.6.0 <0.8.0;

// import "@openzeppelin/contracts/GSN/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 () 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;
    }
}


// Root file: contracts/DePayLiquidityStaking.sol


pragma solidity >=0.7.5 <0.8.0;

// import 'contracts/interfaces/IUniswapV2Pair.sol';

// import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
// import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
// import "@openzeppelin/contracts/access/Ownable.sol";
// import "@openzeppelin/contracts/math/SafeMath.sol";

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

  // Epoch time when staking starts: People are allowed to stake
  uint256 public startTime;

  // Epoch time when staking has been closed: People are not allowed to stake anymore
  uint256 public closeTime;

  // Epoch time when staking releases staked liquidity + rewards: People can withdrawal
  uint256 public releaseTime;

  // Total amount of staking rewards available
  uint256 public rewardsAmount;

  // Percentage Yield, will be divided by 100, e.g. set 80 for 80%
  uint256 public percentageYield;

  // Total amount of already allocated staking rewards
  uint256 public allocatedStakingRewards;

  // Address of the Uniswap liquidity pair (token)
  IUniswapV2Pair public liquidityToken;

  // Address of the token used for rewards
  IERC20 public token;

  // Indicating if unstaking early is allowed or not
  // This is used to upgrade liquidity to uniswap v3
  bool public unstakeEarlyAllowed;

  // Stores all rewards per address
  mapping (address => uint256) public rewardsPerAddress;

  // Stores all amounts of staked liquidity tokens per address
  mapping (address => uint256) public stakedLiquidityTokenPerAddress;

  // Token Reserve On initialization, used to calculate rewards upon staking
  uint256 public tokenReserveOnInit;
  
  // Liquidity Token Total Supply on initialization, used to calculate rewards upon staking
  uint256 public liquidityTokenTotalSupplyOnInit;

  modifier onlyUnstarted() {
    require(
      startTime == 0 || block.timestamp < startTime,
      "Staking has already started!"
    );
    _;
  }

  modifier onlyStarted() {
    require(block.timestamp > startTime, "Staking has not yet started!");
    _;
  }

  modifier onlyUnclosed() {
    require(block.timestamp < closeTime, "Staking has been closed!");
    _;
  }

  modifier onlyReleasable() {
    require(block.timestamp > releaseTime, "Staking is not releasable yet!");
    _;
  }
  
  modifier onlyUnstakeEarly() {
    require(unstakeEarlyAllowed, "Unstaking early not allowed!");
    _;
  }

  modifier onlyDistributedRewards(){
    require(allocatedStakingRewards == 0, 'Rewards were not distributed yet!');
    _;
  }

  function init(
      uint256 _startTime,
      uint256 _closeTime,
      uint256 _releaseTime,
      uint256 _percentageYield,
      address _liquidityToken,
      address _token
  ) external onlyOwner onlyUnstarted returns(bool) {
    require(isContract(_token), '_token address needs to be a contract!');
    require(isContract(_liquidityToken), '_liquidityToken address needs to be a contract!');
    require(_startTime < _closeTime && _closeTime < _releaseTime, '_startTime needs to be before _closeTime needs to be before _releaseTime!');
    
    startTime = _startTime;
    closeTime = _closeTime;
    releaseTime = _releaseTime;
    percentageYield = _percentageYield;
    liquidityToken = IUniswapV2Pair(_liquidityToken);
    token = IERC20(_token);
    rewardsAmount = token.balanceOf(address(this));

    require(liquidityToken.token0() == address(token), 'Rewards must be calculated based on the reward token address!');
    (tokenReserveOnInit,,) = liquidityToken.getReserves();
    liquidityTokenTotalSupplyOnInit = liquidityToken.totalSupply();

    return true;
  }

  function stake(
    uint256 stakedLiquidityTokenAmount
  ) external onlyStarted onlyUnclosed nonReentrant returns(bool) {
    require(
      liquidityToken.transferFrom(msg.sender, address(this), stakedLiquidityTokenAmount),
      'Depositing liquidity token failed!'
    );

    uint256 rewards = stakedLiquidityTokenAmount
      .mul(tokenReserveOnInit)
      .div(liquidityTokenTotalSupplyOnInit)
      .mul(percentageYield)
      .div(100);

    rewardsPerAddress[msg.sender] = rewardsPerAddress[msg.sender].add(rewards);
    stakedLiquidityTokenPerAddress[msg.sender] = stakedLiquidityTokenPerAddress[msg.sender].add(stakedLiquidityTokenAmount);

    allocatedStakingRewards = allocatedStakingRewards.add(rewards);
    require(allocatedStakingRewards <= rewardsAmount, 'Staking overflows rewards!');

    return true;
  }

  function payableOwner() view private returns(address payable) {
    return payable(owner());
  }
    
  function withdraw(
    address tokenAddress,
    uint amount
  ) external onlyOwner nonReentrant returns(bool) {
    require(tokenAddress != address(liquidityToken), 'Not allowed to withdrawal liquidity tokens!');
    
    if(tokenAddress == address(token)) {
      require(
        allocatedStakingRewards <= token.balanceOf(address(this)).sub(amount),
        'Only unallocated staking rewards are allowed to be withdrawn for roll-over to next staking contract!'
      );
      rewardsAmount = rewardsAmount.sub(amount);
    }

    IERC20(tokenAddress).safeTransfer(payableOwner(), amount);
    return true;
  }

  function _unstakeLiquidity() private {
    uint256 liquidityTokenAmount = stakedLiquidityTokenPerAddress[msg.sender];
    stakedLiquidityTokenPerAddress[msg.sender] = 0;
    require(
      liquidityToken.transfer(msg.sender, liquidityTokenAmount),
      'Unstaking liquidity token failed!'
    );
  }

  function _unstakeRewards() private {
    uint256 rewards = rewardsPerAddress[msg.sender];
    allocatedStakingRewards = allocatedStakingRewards.sub(rewards);
    rewardsPerAddress[msg.sender] = 0;
    require(
      token.transfer(msg.sender, rewards),
      'Unstaking rewards failed!'
    );
  }

  function unstake() external onlyReleasable nonReentrant returns(bool) {
    _unstakeLiquidity();
    _unstakeRewards();
    return true;
  }

  function enableUnstakeEarly() external onlyOwner returns(bool) {
    unstakeEarlyAllowed = true;
    return true;
  }

  function unstakeEarly() external onlyUnstakeEarly nonReentrant returns(bool) {
    _unstakeLiquidity();
    allocatedStakingRewards = allocatedStakingRewards.sub(rewardsPerAddress[msg.sender]);
    rewardsPerAddress[msg.sender] = 0;
    return true;
  }

  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);
  }

  function destroy() public onlyOwner onlyDistributedRewards returns(bool) {
    selfdestruct(payable(owner()));
    return true;
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"allocatedStakingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"destroy","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableUnstakeEarly","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_closeTime","type":"uint256"},{"internalType":"uint256","name":"_releaseTime","type":"uint256"},{"internalType":"uint256","name":"_percentageYield","type":"uint256"},{"internalType":"address","name":"_liquidityToken","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"name":"init","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidityToken","outputs":[{"internalType":"contract IUniswapV2Pair","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidityTokenTotalSupplyOnInit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"percentageYield","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"releaseTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardsPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakedLiquidityTokenAmount","type":"uint256"}],"name":"stake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakedLiquidityTokenPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenReserveOnInit","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":"unstake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unstakeEarly","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unstakeEarlyAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50600061001b61006e565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055610072565b3390565b611a86806100816000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c806378e97925116100c3578063b91d40011161007c578063b91d4001146102ad578063c13d995c146102b5578063c7545394146102bd578063f2fde38b146102c5578063f3fef3a3146102eb578063fc0c546a146103175761014d565b806378e979251461024a57806383197ef0146102525780638c17cd1d1461025a5780638da5cb5b1461026257806394d57ed11461026a578063a694fc3a146102905761014d565b80632def6620116101155780632def6620146101fc57806343cd8f7e146102045780635fe8082d14610228578063627749e6146102305780637061dba714610238578063715018a6146102405761014d565b80630da930b71461015257806311a1db3c1461016c5780631b48a3a81461019257806328b9424a146101ec5780632a7d65c8146101f4575b600080fd5b61015a61031f565b60408051918252519081900360200190f35b61015a6004803603602081101561018257600080fd5b50356001600160a01b0316610325565b6101d8600480360360c08110156101a857600080fd5b508035906020810135906040810135906060810135906001600160a01b03608082013581169160a0013516610337565b604080519115158252519081900360200190f35b61015a610740565b6101d8610746565b6101d8610756565b61020c610812565b604080516001600160a01b039092168252519081900360200190f35b6101d8610821565b61015a610894565b61015a61089a565b6102486108a0565b005b61015a610942565b6101d8610948565b61015a6109f4565b61020c6109fa565b61015a6004803603602081101561028057600080fd5b50356001600160a01b0316610a09565b6101d8600480360360208110156102a657600080fd5b5035610a1b565b61015a610cd0565b61015a610cd6565b6101d8610cdc565b610248600480360360208110156102db57600080fd5b50356001600160a01b0316610dc8565b6101d86004803603604081101561030157600080fd5b506001600160a01b038135169060200135610ec0565b61020c6110c4565b60075481565b600a6020526000908152604090205481565b60006103416110d3565b6000546001600160a01b03908116911614610391576040805162461bcd60e51b81526020600482018190526024820152600080516020611909833981519152604482015290519081900360640190fd5b60025415806103a1575060025442105b6103f2576040805162461bcd60e51b815260206004820152601c60248201527f5374616b696e672068617320616c726561647920737461727465642100000000604482015290519081900360640190fd5b6103fb826110d7565b6104365760405162461bcd60e51b81526004018080602001828103825260268152602001806119296026913960400191505060405180910390fd5b61043f836110d7565b61047a5760405162461bcd60e51b815260040180806020018281038252602f815260200180611839602f913960400191505060405180910390fd5b858710801561048857508486105b6104c35760405162461bcd60e51b815260040180806020018281038252604981526020018061194f6049913960600191505060405180910390fd5b6002879055600386905560048581556006859055600880546001600160a01b038087166001600160a01b0319928316179092556009805486841692169190911790819055604080516370a0823160e01b81523094810194909452519116916370a08231916024808301926020929190829003018186803b15801561054657600080fd5b505afa15801561055a573d6000803e3d6000fd5b505050506040513d602081101561057057600080fd5b505160055560095460085460408051630dfe168160e01b815290516001600160a01b039384169390921691630dfe168191600480820192602092909190829003018186803b1580156105c157600080fd5b505afa1580156105d5573d6000803e3d6000fd5b505050506040513d60208110156105eb57600080fd5b50516001600160a01b0316146106325760405162461bcd60e51b815260040180806020018281038252603d815260200180611868603d913960400191505060405180910390fd5b600860009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561068057600080fd5b505afa158015610694573d6000803e3d6000fd5b505050506040513d60608110156106aa57600080fd5b50516dffffffffffffffffffffffffffff16600c55600854604080516318160ddd60e01b815290516001600160a01b03909216916318160ddd91600480820192602092909190829003018186803b15801561070457600080fd5b505afa158015610718573d6000803e3d6000fd5b505050506040513d602081101561072e57600080fd5b5051600d555060019695505050505050565b600c5481565b600954600160a01b900460ff1681565b600060045442116107ae576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742072656c65617361626c6520796574210000604482015290519081900360640190fd5b600260015414156107f4576040805162461bcd60e51b815260206004820152601f60248201526000805160206117d2833981519152604482015290519081900360640190fd5b6002600155610801611113565b6108096111e9565b50600180805590565b6008546001600160a01b031681565b600061082b6110d3565b6000546001600160a01b0390811691161461087b576040805162461bcd60e51b81526020600482018190526024820152600080516020611909833981519152604482015290519081900360640190fd5b506009805460ff60a01b1916600160a01b179055600190565b60035481565b60065481565b6108a86110d3565b6000546001600160a01b039081169116146108f8576040805162461bcd60e51b81526020600482018190526024820152600080516020611909833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60025481565b60006109526110d3565b6000546001600160a01b039081169116146109a2576040805162461bcd60e51b81526020600482018190526024820152600080516020611909833981519152604482015290519081900360640190fd5b600754156109e15760405162461bcd60e51b81526004018080602001828103825260218152602001806118a56021913960400191505060405180910390fd5b6109e96109fa565b6001600160a01b0316ff5b600d5481565b6000546001600160a01b031690565b600b6020526000908152604090205481565b60006002544211610a73576040805162461bcd60e51b815260206004820152601c60248201527f5374616b696e6720686173206e6f742079657420737461727465642100000000604482015290519081900360640190fd5b6003544210610ac9576040805162461bcd60e51b815260206004820152601860248201527f5374616b696e6720686173206265656e20636c6f736564210000000000000000604482015290519081900360640190fd5b60026001541415610b0f576040805162461bcd60e51b815260206004820152601f60248201526000805160206117d2833981519152604482015290519081900360640190fd5b6002600155600854604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610b6e57600080fd5b505af1158015610b82573d6000803e3d6000fd5b505050506040513d6020811015610b9857600080fd5b5051610bd55760405162461bcd60e51b81526004018080602001828103825260228152602001806118c66022913960400191505060405180910390fd5b6000610c096064610bfd600654610c03600d54610bfd600c548a6112eb90919063ffffffff16565b9061134d565b906112eb565b336000908152600a6020526040902054909150610c26908261138f565b336000908152600a6020908152604080832093909355600b90522054610c4c908461138f565b336000908152600b6020526040902055600754610c69908261138f565b60078190556005541015610cc4576040805162461bcd60e51b815260206004820152601a60248201527f5374616b696e67206f766572666c6f7773207265776172647321000000000000604482015290519081900360640190fd5b50506001808055919050565b60045481565b60055481565b600954600090600160a01b900460ff16610d3d576040805162461bcd60e51b815260206004820152601c60248201527f556e7374616b696e67206561726c79206e6f7420616c6c6f7765642100000000604482015290519081900360640190fd5b60026001541415610d83576040805162461bcd60e51b815260206004820152601f60248201526000805160206117d2833981519152604482015290519081900360640190fd5b6002600155610d90611113565b336000908152600a6020526040902054600754610dac916113e9565b60075550336000908152600a6020526040812055600180805590565b610dd06110d3565b6000546001600160a01b03908116911614610e20576040805162461bcd60e51b81526020600482018190526024820152600080516020611909833981519152604482015290519081900360640190fd5b6001600160a01b038116610e655760405162461bcd60e51b81526004018080602001828103825260268152602001806117f26026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610eca6110d3565b6000546001600160a01b03908116911614610f1a576040805162461bcd60e51b81526020600482018190526024820152600080516020611909833981519152604482015290519081900360640190fd5b60026001541415610f60576040805162461bcd60e51b815260206004820152601f60248201526000805160206117d2833981519152604482015290519081900360640190fd5b60026001556008546001600160a01b0384811691161415610fb25760405162461bcd60e51b815260040180806020018281038252602b815260200180611a26602b913960400191505060405180910390fd5b6009546001600160a01b038481169116141561109c57600954604080516370a0823160e01b8152306004820152905161104b9285926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b15801561101957600080fd5b505afa15801561102d573d6000803e3d6000fd5b505050506040513d602081101561104357600080fd5b5051906113e9565b600754111561108b5760405162461bcd60e51b81526004018080602001828103825260648152602001806119986064913960800191505060405180910390fd5b60055461109890836113e9565b6005555b6110b86110a761142b565b6001600160a01b038516908461143a565b50600180805592915050565b6009546001600160a01b031681565b3390565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061110b57508115155b949350505050565b336000818152600b60209081526040808320805490849055600854825163a9059cbb60e01b8152600481019690965260248601829052915190946001600160a01b039092169363a9059cbb93604480850194919392918390030190829087803b15801561117f57600080fd5b505af1158015611193573d6000803e3d6000fd5b505050506040513d60208110156111a957600080fd5b50516111e65760405162461bcd60e51b81526004018080602001828103825260218152602001806118186021913960400191505060405180910390fd5b50565b336000908152600a602052604090205460075461120690826113e9565b600755336000818152600a60209081526040808320839055600954815163a9059cbb60e01b815260048101959095526024850186905290516001600160a01b039091169363a9059cbb9360448083019493928390030190829087803b15801561126e57600080fd5b505af1158015611282573d6000803e3d6000fd5b505050506040513d602081101561129857600080fd5b50516111e6576040805162461bcd60e51b815260206004820152601960248201527f556e7374616b696e672072657761726473206661696c65642100000000000000604482015290519081900360640190fd5b6000826112fa57506000611347565b8282028284828161130757fe5b04146113445760405162461bcd60e51b81526004018080602001828103825260218152602001806118e86021913960400191505060405180910390fd5b90505b92915050565b600061134483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611491565b600082820183811015611344576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061134483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611535565b60006114356109fa565b905090565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261148c90849061158f565b505050565b6000818361151d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156114e25781810151838201526020016114ca565b50505050905090810190601f16801561150f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161152957fe5b049150505b9392505050565b600081848411156115875760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114e25781810151838201526020016114ca565b505050900390565b60006115e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116409092919063ffffffff16565b80519091501561148c5780806020019051602081101561160357600080fd5b505161148c5760405162461bcd60e51b815260040180806020018281038252602a8152602001806119fc602a913960400191505060405180910390fd5b606061110b84846000858561165485611765565b6116a5576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106116e35780518252601f1990920191602091820191016116c4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611745576040519150601f19603f3d011682016040523d82523d6000602084013e61174a565b606091505b509150915061175a82828661176b565b979650505050505050565b3b151590565b6060831561177a57508161152e565b82511561178a5782518084602001fd5b60405162461bcd60e51b81526020600482018181528451602484015284518593919283926044019190850190808383600083156114e25781810151838201526020016114ca56fe5265656e7472616e637947756172643a207265656e7472616e742063616c6c004f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373556e7374616b696e67206c697175696469747920746f6b656e206661696c6564215f6c6971756964697479546f6b656e2061646472657373206e6565647320746f206265206120636f6e74726163742152657761726473206d7573742062652063616c63756c61746564206261736564206f6e207468652072657761726420746f6b656e206164647265737321526577617264732077657265206e6f7420646973747269627574656420796574214465706f736974696e67206c697175696469747920746f6b656e206661696c656421536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f746f6b656e2061646472657373206e6565647320746f206265206120636f6e7472616374215f737461727454696d65206e6565647320746f206265206265666f7265205f636c6f736554696d65206e6565647320746f206265206265666f7265205f72656c6561736554696d65214f6e6c7920756e616c6c6f6361746564207374616b696e6720726577617264732061726520616c6c6f77656420746f2062652077697468647261776e20666f7220726f6c6c2d6f76657220746f206e657874207374616b696e6720636f6e7472616374215361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644e6f7420616c6c6f77656420746f207769746864726177616c206c697175696469747920746f6b656e7321a264697066735822122054f57da149810ba6ea164e5044c5b2c41d714af2bb849cb3df30014983bd002364736f6c63430007060033

Deployed ByteCode Sourcemap

26324:6936:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27037:38;;;:::i;:::-;;;;;;;;;;;;;;;;27430:53;;;;;;;;;;;;;;;;-1:-1:-1;27430:53:0;-1:-1:-1;;;;;27430:53:0;;:::i;28661:1106::-;;;;;;;;;;;;;;;;-1:-1:-1;28661:1106:0;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;28661:1106:0;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;27705:33;;;:::i;27355:31::-;;;:::i;31993:144::-;;;:::i;27134:36::-;;;:::i;:::-;;;;-1:-1:-1;;;;;27134:36:0;;;;;;;;;;;;;;32143:120;;;:::i;26640:24::-;;;:::i;26944:30::-;;;:::i;25318:148::-;;;:::i;:::-;;26522:24;;;:::i;33123:134::-;;;:::i;27840:46::-;;;:::i;24676:79::-;;;:::i;27554:66::-;;;;;;;;;;;;;;;;-1:-1:-1;27554:66:0;-1:-1:-1;;;;;27554:66:0;;:::i;29773:847::-;;;;;;;;;;;;;;;;-1:-1:-1;29773:847:0;;:::i;26760:26::-;;;:::i;26841:28::-;;;:::i;32269:258::-;;;:::i;25621:244::-;;;;;;;;;;;;;;;;-1:-1:-1;25621:244:0;-1:-1:-1;;;;;25621:244:0;;:::i;30734:629::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;30734:629:0;;;;;;;;:::i;27221:19::-;;;:::i;27037:38::-;;;;:::o;27430:53::-;;;;;;;;;;;;;:::o;28661:1106::-;28892:4;24898:12;:10;:12::i;:::-;24888:6;;-1:-1:-1;;;;;24888:6:0;;;:22;;;24880:67;;;;;-1:-1:-1;;;24880:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;24880:67:0;;;;;;;;;;;;;;;27941:9:::1;::::0;:14;;:45:::1;;;27977:9;;27959:15;:27;27941:45;27925:107;;;::::0;;-1:-1:-1;;;27925:107:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;28913:18:::2;28924:6;28913:10;:18::i;:::-;28905:69;;;;-1:-1:-1::0;;;28905:69:0::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;28989:27;29000:15;28989:10;:27::i;:::-;28981:87;;;;-1:-1:-1::0;;;28981:87:0::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29096:10;29083;:23;:52;;;;;29123:12;29110:10;:25;29083:52;29075:138;;;;-1:-1:-1::0;;;29075:138:0::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29226:9;:22:::0;;;29255:9:::2;:22:::0;;;29284:11:::2;:26:::0;;;29317:15:::2;:34:::0;;;29358:14:::2;:48:::0;;-1:-1:-1;;;;;29358:48:0;;::::2;-1:-1:-1::0;;;;;;29358:48:0;;::::2;;::::0;;;29413:5:::2;:22:::0;;;;::::2;::::0;::::2;::::0;;;::::2;::::0;;;;29458:30:::2;::::0;;-1:-1:-1;;;29458:30:0;;29482:4:::2;29458:30:::0;;::::2;::::0;;;;;:5;::::2;::::0;:15:::2;::::0;:30;;;;;::::2;::::0;;;;;;;;:5;:30;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;29458:30:0;29442:13:::2;:46:::0;29540:5:::2;::::0;29505:14:::2;::::0;:23:::2;::::0;;-1:-1:-1;;;29505:23:0;;;;-1:-1:-1;;;;;29540:5:0;;::::2;::::0;29505:14;;::::2;::::0;:21:::2;::::0;:23:::2;::::0;;::::2;::::0;29458:30:::2;::::0;29505:23;;;;;;;;:14;:23;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;29505:23:0;-1:-1:-1;;;;;29505:41:0::2;;29497:115;;;;-1:-1:-1::0;;;29497:115:0::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29644:14;;;;;;;;;-1:-1:-1::0;;;;;29644:14:0::2;-1:-1:-1::0;;;;;29644:26:0::2;;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;29644:28:0;29619:53:::2;;29620:18;29619:53:::0;29713:14:::2;::::0;29644:28;29713;;-1:-1:-1;;;29713:28:0;;;;-1:-1:-1;;;;;29713:14:0;;::::2;::::0;:26:::2;::::0;:28:::2;::::0;;::::2;::::0;29644::::2;::::0;29713;;;;;;;;:14;:28;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;29713:28:0;29679:31:::2;:62:::0;-1:-1:-1;29757:4:0::2;28661:1106:::0;;;;;;;;:::o;27705:33::-;;;;:::o;27355:31::-;;;-1:-1:-1;;;27355:31:0;;;;;:::o;31993:144::-;32057:4;28344:11;;28326:15;:29;28318:72;;;;;-1:-1:-1;;;28318:72:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;21540:1:::1;22146:7;;:19;;22138:63;;;::::0;;-1:-1:-1;;;22138:63:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;;;;;;;;;22138:63:0;;;;;;;;;;;;;::::1;;21540:1;22279:7;:18:::0;32070:19:::2;:17;:19::i;:::-;32096:17;:15;:17::i;:::-;-1:-1:-1::0;32127:4:0::2;21496:1:::0;22458:22;;31993:144;:::o;27134:36::-;;;-1:-1:-1;;;;;27134:36:0;;:::o;32143:120::-;32200:4;24898:12;:10;:12::i;:::-;24888:6;;-1:-1:-1;;;;;24888:6:0;;;:22;;;24880:67;;;;;-1:-1:-1;;;24880:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;24880:67:0;;;;;;;;;;;;;;;-1:-1:-1;32213:19:0::1;:26:::0;;-1:-1:-1;;;;32213:26:0::1;-1:-1:-1::0;;;32213:26:0::1;::::0;;32235:4:::1;32143:120:::0;:::o;26640:24::-;;;;:::o;26944:30::-;;;;:::o;25318:148::-;24898:12;:10;:12::i;:::-;24888:6;;-1:-1:-1;;;;;24888:6:0;;;:22;;;24880:67;;;;;-1:-1:-1;;;24880:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;24880:67:0;;;;;;;;;;;;;;;25425:1:::1;25409:6:::0;;25388:40:::1;::::0;-1:-1:-1;;;;;25409:6:0;;::::1;::::0;25388:40:::1;::::0;25425:1;;25388:40:::1;25456:1;25439:19:::0;;-1:-1:-1;;;;;;25439:19:0::1;::::0;;25318:148::o;26522:24::-;;;;:::o;33123:134::-;33190:4;24898:12;:10;:12::i;:::-;24888:6;;-1:-1:-1;;;;;24888:6:0;;;:22;;;24880:67;;;;;-1:-1:-1;;;24880:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;24880:67:0;;;;;;;;;;;;;;;28575:23:::1;::::0;:28;28567:74:::1;;;;-1:-1:-1::0;;;28567:74:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;33224:7:::2;:5;:7::i;:::-;-1:-1:-1::0;;;;;33203:30:0::2;;27840:46:::0;;;;:::o;24676:79::-;24714:7;24741:6;-1:-1:-1;;;;;24741:6:0;24676:79;:::o;27554:66::-;;;;;;;;;;;;;:::o;29773:847::-;29889:4;28108:9;;28090:15;:27;28082:68;;;;;-1:-1:-1;;;28082:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;28227:9:::1;;28209:15;:27;28201:64;;;::::0;;-1:-1:-1;;;28201:64:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;21540:1:::2;22146:7;;:19;;22138:63;;;::::0;;-1:-1:-1;;;22138:63:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;;;;;;;;;22138:63:0;;;;;;;;;;;;;::::2;;21540:1;22279:7;:18:::0;29918:14:::3;::::0;:82:::3;::::0;;-1:-1:-1;;;29918:82:0;;29946:10:::3;29918:82;::::0;::::3;::::0;29966:4:::3;29918:82:::0;;;;;;;;;;;;-1:-1:-1;;;;;29918:14:0;;::::3;::::0;:27:::3;::::0;:82;;;;;::::3;::::0;;;;;;;;;:14:::3;::::0;:82;::::3;;::::0;::::3;;;;::::0;::::3;;;;;;;;;;;;::::0;::::3;;;;;;;;;;;;;;;;;;;::::0;::::3;;-1:-1:-1::0;29918:82:0;29902:150:::3;;;;-1:-1:-1::0;;;29902:150:0::3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30061:15;30079:149;30224:3;30079:132;30195:15;;30079:103;30150:31;;30079:58;30118:18;;30079:26;:38;;:58;;;;:::i;:::-;:70:::0;::::3;:103::i;:::-;:115:::0;::::3;:132::i;:149::-;30287:10;30269:29;::::0;;;:17:::3;:29;::::0;;;;;30061:167;;-1:-1:-1;30269:42:0::3;::::0;30061:167;30269:33:::3;:42::i;:::-;30255:10;30237:29;::::0;;;:17:::3;:29;::::0;;;;;;;:74;;;;30363:30:::3;:42:::0;;;;:74:::3;::::0;30410:26;30363:46:::3;:74::i;:::-;30349:10;30318:42;::::0;;;:30:::3;:42;::::0;;;;:119;30472:23:::3;::::0;:36:::3;::::0;30500:7;30472:27:::3;:36::i;:::-;30446:23;:62:::0;;;30550:13:::3;::::0;-1:-1:-1;30523:40:0::3;30515:79;;;::::0;;-1:-1:-1;;;30515:79:0;;::::3;;::::0;::::3;::::0;::::3;::::0;;;;::::3;::::0;;;;;;;;;;;;;::::3;;-1:-1:-1::0;;30610:4:0::3;22458:22:::0;;;30610:4;29773:847;-1:-1:-1;29773:847:0:o;26760:26::-;;;;:::o;26841:28::-;;;;:::o;32269:258::-;28455:19;;32340:4;;-1:-1:-1;;;28455:19:0;;;;28447:60;;;;;-1:-1:-1;;;28447:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;21540:1:::1;22146:7;;:19;;22138:63;;;::::0;;-1:-1:-1;;;22138:63:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;;;;;;;;;22138:63:0;;;;;;;;;;;;;::::1;;21540:1;22279:7;:18:::0;32353:19:::2;:17;:19::i;:::-;32451:10;32433:29;::::0;;;:17:::2;:29;::::0;;;;;32405:23:::2;::::0;:58:::2;::::0;:27:::2;:58::i;:::-;32379:23;:84:::0;-1:-1:-1;32488:10:0::2;32502:1;32470:29:::0;;;:17:::2;:29;::::0;;;;:33;32517:4:::2;21496:1:::0;22458:22;;32269:258;:::o;25621:244::-;24898:12;:10;:12::i;:::-;24888:6;;-1:-1:-1;;;;;24888:6:0;;;:22;;;24880:67;;;;;-1:-1:-1;;;24880:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;24880:67:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;25710:22:0;::::1;25702:73;;;;-1:-1:-1::0;;;25702:73:0::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;25812:6;::::0;;25791:38:::1;::::0;-1:-1:-1;;;;;25791:38:0;;::::1;::::0;25812:6;::::1;::::0;25791:38:::1;::::0;::::1;25840:6;:17:::0;;-1:-1:-1;;;;;;25840:17:0::1;-1:-1:-1::0;;;;;25840:17:0;;;::::1;::::0;;;::::1;::::0;;25621:244::o;30734:629::-;30842:4;24898:12;:10;:12::i;:::-;24888:6;;-1:-1:-1;;;;;24888:6:0;;;:22;;;24880:67;;;;;-1:-1:-1;;;24880:67:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;24880:67:0;;;;;;;;;;;;;;;21540:1:::1;22146:7;;:19;;22138:63;;;::::0;;-1:-1:-1;;;22138:63:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;;;;;;;;;22138:63:0;;;;;;;;;;;;;::::1;;21540:1;22279:7;:18:::0;30887:14:::2;::::0;-1:-1:-1;;;;;30863:39:0;;::::2;30887:14:::0;::::2;30863:39;;30855:95;;;;-1:-1:-1::0;;;30855:95:0::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30990:5;::::0;-1:-1:-1;;;;;30966:30:0;;::::2;30990:5:::0;::::2;30966:30;30963:311;;;31052:5;::::0;:30:::2;::::0;;-1:-1:-1;;;31052:30:0;;31076:4:::2;31052:30;::::0;::::2;::::0;;;:42:::2;::::0;31087:6;;-1:-1:-1;;;;;31052:5:0;;::::2;::::0;:15:::2;::::0;:30;;;;;::::2;::::0;;;;;;;;;:5;:30;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;31052:30:0;;:34:::2;:42::i;:::-;31025:23;;:69;;31007:209;;;;-1:-1:-1::0;;;31007:209:0::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31241:13;::::0;:25:::2;::::0;31259:6;31241:17:::2;:25::i;:::-;31225:13;:41:::0;30963:311:::2;31282:57;31316:14;:12;:14::i;:::-;-1:-1:-1::0;;;;;31282:33:0;::::2;::::0;31332:6;31282:33:::2;:57::i;:::-;-1:-1:-1::0;31353:4:0::2;21496:1:::0;22458:22;;30734:629;;-1:-1:-1;;30734:629:0:o;27221:19::-;;;-1:-1:-1;;;;;27221:19:0;;:::o;23143:106::-;23231:10;23143:106;:::o;32533:584::-;32592:4;33032:20;;32883:66;33068:23;;;;;;:42;;-1:-1:-1;33095:15:0;;;33068:42;33060:51;32533:584;-1:-1:-1;;;;32533:584:0:o;31369:307::-;31475:10;31413:28;31444:42;;;:30;:42;;;;;;;;;;31493:46;;;;31562:14;;:57;;-1:-1:-1;;;31562:57:0;;;;;;;;;;;;;;;;;31444:42;;-1:-1:-1;;;;;31562:14:0;;;;:23;;:57;;;;;31444:42;;31562:57;;;;;;;;;:14;:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;31562:57:0;31546:124;;;;-1:-1:-1;;;31546:124:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31369:307;:::o;31682:305::-;31760:10;31724:15;31742:29;;;:17;:29;;;;;;31804:23;;:36;;31742:29;31804:27;:36::i;:::-;31778:23;:62;31865:10;31879:1;31847:29;;;:17;:29;;;;;;;;:33;;;31903:5;;:35;;-1:-1:-1;;;31903:35:0;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;31903:5:0;;;;:14;;:35;;;;;31847:29;31903:35;;;;;;;;:5;:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;31903:35:0;31887:94;;;;;-1:-1:-1;;;31887:94:0;;;;;;;;;;;;;;;;;;;;;;;;;;;5697:471;5755:7;6000:6;5996:47;;-1:-1:-1;6030:1:0;6023:8;;5996:47;6067:5;;;6071:1;6067;:5;:1;6091:5;;;;;:10;6083:56;;;;-1:-1:-1;;;6083:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6159:1;-1:-1:-1;5697:471:0;;;;;:::o;6644:132::-;6702:7;6729:39;6733:1;6736;6729:39;;;;;;;;;;;;;;;;;:3;:39::i;4343:181::-;4401:7;4433:5;;;4457:6;;;;4449:46;;;;;-1:-1:-1;;;4449:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;4807:136;4865:7;4892:43;4896:1;4899;4892:43;;;;;;;;;;;;;;;;;:3;:43::i;30626:98::-;30671:15;30710:7;:5;:7::i;:::-;30695:23;;30626:98;:::o;16701:177::-;16811:58;;;-1:-1:-1;;;;;16811:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;16811:58:0;-1:-1:-1;;;16811:58:0;;;16784:86;;16804:5;;16784:19;:86::i;:::-;16701:177;;;:::o;7272:278::-;7358:7;7393:12;7386:5;7378:28;;;;-1:-1:-1;;;7378:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7417:9;7433:1;7429;:5;;;;;;;-1:-1:-1;;7272:278:0;;;;;;:::o;5246:192::-;5332:7;5368:12;5360:6;;;;5352:29;;;;-1:-1:-1;;;5352:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;5404:5:0;;;5246:192::o;19006:761::-;19430:23;19456:69;19484:4;19456:69;;;;;;;;;;;;;;;;;19464:5;-1:-1:-1;;;;;19456:27:0;;;:69;;;;;:::i;:::-;19540:17;;19430:95;;-1:-1:-1;19540:21:0;19536:224;;19682:10;19671:30;;;;;;;;;;;;;;;-1:-1:-1;19671:30:0;19663:85;;;;-1:-1:-1;;;19663:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12515:195;12618:12;12650:52;12672:6;12680:4;12686:1;12689:12;12618;13819:18;13830:6;13819:10;:18::i;:::-;13811:60;;;;;-1:-1:-1;;;13811:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;13945:12;13959:23;13986:6;-1:-1:-1;;;;;13986:11:0;14006:5;14014:4;13986:33;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;13986:33:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13944:75;;;;14037:52;14055:7;14064:10;14076:12;14037:17;:52::i;:::-;14030:59;13567:530;-1:-1:-1;;;;;;;13567:530:0:o;9594:422::-;9961:20;10000:8;;;9594:422::o;15103:742::-;15218:12;15247:7;15243:595;;;-1:-1:-1;15278:10:0;15271:17;;15243:595;15392:17;;:21;15388:439;;15655:10;15649:17;15716:15;15703:10;15699:2;15695:19;15688:44;15603:148;15791:20;;-1:-1:-1;;;15791:20:0;;;;;;;;;;;;;;;;;15798:12;;15791:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Swarm Source

ipfs://54f57da149810ba6ea164e5044c5b2c41d714af2bb849cb3df30014983bd0023
Block Transaction Difficulty Gas Used Reward
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.

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.