ETH Price: $3,307.52 (-3.27%)
Gas: 12 Gwei

Contract

0x154647059327569F2C89Ca97979b00696b5CB246
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x60a06040190840772024-01-25 13:58:23160 days ago1706191103IN
 Create: LPFarming
0 ETH0.0582519232.07003969

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LPFarming

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 300 runs

Other Settings:
default evmVersion
File 1 of 9 : LPFarming.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;

import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";

import "../utils/NoContractUpgradeable.sol";

interface UnderlyingDepositContract {
    function deposit(address _to, uint256 _amount) external returns (uint256);

    function withdraw(address _to, uint256 _shares) external returns (uint256);
}

/// @title JPEG'd LP Farming
/// @notice Users can stake their JPEG'd ecosystem LP tokens to get JPEG rewards
/// @dev This contract doesn't mint JPEG tokens, instead the owner (the JPEG'd DAO) allocates x amount of JPGD to be distributed as a reward for liquidity providers.
/// To ensure that enough tokens are allocated, an epoch system is implemented.
/// The owner is required to allocate enough tokens (`_rewardPerBlock * (_endBlock - _startBlock)`) when creating a new epoch.
/// When there no epoch is ongoing, the contract stops emitting rewards
contract LPFarming is ReentrancyGuardUpgradeable, NoContractUpgradeable {
    using SafeERC20Upgradeable for IERC20Upgradeable;

    error InvalidBlock();
    error InvalidAmount();
    error ZeroAddress();
    error InvalidPID();
    error NoReward();

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

    /// @dev Data relative to a user's staking position
    /// @param amount The amount of LP tokens the user has provided
    /// @param lastAccRewardPerShare The `accRewardPerShare` pool value at the time of the user's last claim
    struct UserInfo {
        uint256 amount;
        uint256 lastAccRewardPerShare;
    }

    /// @dev Data relative to an LP pool
    /// @param lpToken The LP token accepted by the pool
    /// @param allocPoint Allocation points assigned to the pool. Determines the share of `rewardPerBlock` allocated to this pool
    /// @param lastRewardBlock Last block number in which reward distribution occurred
    /// @param accRewardPerShare Accumulated rewards per share, times 1e36. The amount of rewards the pool has accumulated per unit of LP token deposited
    /// @param depositedAmount Total number of tokens deposited in the pool.
    struct PoolInfo {
        IERC20Upgradeable lpToken;
        uint256 allocPoint;
        uint256 lastRewardBlock;
        uint256 accRewardPerShare;
        uint256 depositedAmount;
    }

    struct UnderlyingDepositInfo {
        IERC20Upgradeable underlyingToken;
        UnderlyingDepositContract depositContract;
    }

    /// @dev Data relative to an epoch
    /// @param startBlock The epoch's starting block
    /// @param endBlock The epoch's starting block
    /// @param rewardPerBlock The amount of JPEG rewards distributed per block during this epoch
    struct EpochInfo {
        uint256 startBlock;
        uint256 endBlock;
        uint256 rewardPerBlock;
    }

    /// @notice The reward token, JPGD
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    IERC20Upgradeable public immutable jpgd;

    /// @notice The current epoch
    /// @dev We don't need to store data about previous epochs, to simplify logic we only store data about the current epoch
    EpochInfo public epoch;
    /// @notice All the LP pools, active and inactive
    PoolInfo[] public poolInfo;
    /// @notice User staking positions, divided by PID
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;
    /// @notice Sum of the allocation points for all the pools
    /// @dev Used to calculate the share of `rewardPerBlock` for each pool.
    uint256 public totalAllocPoint;

    /// @dev User's withdrawable rewards per pool
    mapping(address => mapping(uint256 => uint256)) private userRewards;

    mapping(uint256 => UnderlyingDepositInfo) public underlyingTokens;

    /// @param _jpgd The reward token
    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor(address _jpgd) {
        jpgd = IERC20Upgradeable(_jpgd);
    }

    function initialize() external initializer {
        __noContract_init();
    }

    /// @notice Allows the owner to start a new epoch. Can only be called when there's no ongoing epoch
    /// @param _startBlock The new epoch's start block. If 0, takes the value of `block.number`
    /// @param _endBlock The new epoch's end block. Has to be greater than `_startBlock`
    /// @param _rewardPerBlock The new epoch's amount of rewards to distribute per block. Must be greater than 0
    function newEpoch(
        uint256 _startBlock,
        uint256 _endBlock,
        uint256 _rewardPerBlock
    ) external onlyOwner {
        if (_startBlock == 0) _startBlock = block.number;
        else if (_startBlock < block.number) revert InvalidBlock();
        if (_endBlock <= _startBlock) revert InvalidBlock();
        if (_rewardPerBlock == 0) revert InvalidAmount();

        //update all pools to ensure that they have all been updated up to the last epoch's `endBlock`
        _massUpdatePools();

        uint256 remainingRewards = epoch.rewardPerBlock *
            (epoch.endBlock - _blockNumber());
        uint256 newRewards = _rewardPerBlock * (_endBlock - _startBlock);

        epoch.startBlock = _startBlock;
        epoch.endBlock = _endBlock;
        epoch.rewardPerBlock = _rewardPerBlock;

        if (remainingRewards > newRewards) {
            unchecked {
                jpgd.safeTransfer(msg.sender, remainingRewards - newRewards);
            }
        } else if (remainingRewards < newRewards) {
            unchecked {
                jpgd.safeTransferFrom(
                    msg.sender,
                    address(this),
                    newRewards - remainingRewards
                );
            }
        }
    }

    /// @notice Allows the owner to add a new pool
    /// @param _allocPoint Allocation points to assign to the new pool
    /// @param _lpToken The LP token accepted by the new pool
    function add(
        uint256 _allocPoint,
        IERC20Upgradeable _lpToken
    ) external onlyOwner {
        _massUpdatePools();

        uint256 lastRewardBlock = _blockNumber();
        totalAllocPoint = totalAllocPoint + _allocPoint;
        poolInfo.push(
            PoolInfo({
                lpToken: _lpToken,
                allocPoint: _allocPoint,
                lastRewardBlock: lastRewardBlock,
                accRewardPerShare: 0,
                depositedAmount: 0
            })
        );
    }

    /// @notice Allows the owner to change a pool's allocation points
    /// @param _pid The pool id of the pool to modify
    /// @param _allocPoint The new allocation points
    function set(uint256 _pid, uint256 _allocPoint) external onlyOwner {
        _massUpdatePools();

        uint256 prevAllocPoint = poolInfo[_pid].allocPoint;
        poolInfo[_pid].allocPoint = _allocPoint;
        if (prevAllocPoint != _allocPoint) {
            totalAllocPoint = totalAllocPoint - prevAllocPoint + _allocPoint;
        }
    }

    function setUnderlyingInfo(
        uint256 _pid,
        IERC20Upgradeable _underlyingToken,
        UnderlyingDepositContract _depositContract
    ) external onlyOwner {
        if (
            address(_underlyingToken) == address(0) ||
            address(_depositContract) == address(0)
        ) revert ZeroAddress();

        underlyingTokens[_pid] = UnderlyingDepositInfo(
            _underlyingToken,
            _depositContract
        );
    }

    function deleteUnderlyingInfo(uint256 _pid) external onlyOwner {
        delete underlyingTokens[_pid];
    }

    /// @notice Returns the number of pools available
    /// @return The length of the `poolInfo` array
    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    /// @notice Frontend function used to calculate the amount of rewards `_user` can claim from the pool with id `_pid`
    /// @param _pid The pool id
    /// @param _user The address of the user
    /// @return The amount of rewards claimable from `_pid` by user `_user`
    function pendingReward(
        uint256 _pid,
        address _user
    ) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accRewardPerShare = pool.accRewardPerShare;
        uint256 blockNumber = _blockNumber();
        //normalizing the pool's `lastRewardBlock` ensures that no rewards are distributed by staking outside of an epoch
        uint256 lastRewardBlock = _normalizeBlockNumber(pool.lastRewardBlock);
        uint256 lpSupply = pool.depositedAmount;
        //if blockNumber is greater than the pool's `lastRewardBlock` the pool's `accRewardPerShare` is outdated,
        //we need to calculate the up to date amount to return an accurate reward value
        if (blockNumber > lastRewardBlock && lpSupply != 0) {
            uint256 reward = ((blockNumber - lastRewardBlock) *
                epoch.rewardPerBlock *
                1e36 *
                pool.allocPoint) / totalAllocPoint;
            accRewardPerShare += reward / lpSupply;
        }
        return
            //rewards that the user had already accumulated but not claimed
            userRewards[_user][_pid] +
            //subtracting the user's `lastAccRewardPerShare` from the pool's `accRewardPerShare` results in the amount of rewards per share
            //the pool has accumulated since the user's last claim, multiplying it by the user's shares results in the amount of new rewards claimable
            //by the user
            (user.amount * (accRewardPerShare - user.lastAccRewardPerShare)) /
            1e36;
    }

    /// @notice Allows users to deposit `_amount` of LP tokens in the pool with id `_pid`. Non whitelisted contracts can't call this function
    /// @dev Emits a {Deposit} event
    /// @param _pid The id of the pool to deposit into
    /// @param _amount The amount of LP tokens to deposit
    function deposit(uint256 _pid, uint256 _amount) external noContract {
        IERC20Upgradeable _lpToken = _deposit(_pid, _amount);
        _lpToken.safeTransferFrom(msg.sender, address(this), _amount);
    }

    function depositUnderlying(
        uint256 _pid,
        uint256 _amount
    ) external noContract {
        if (_amount == 0) revert InvalidAmount();

        UnderlyingDepositInfo memory underlyingInfo = underlyingTokens[_pid];
        if (address(underlyingInfo.underlyingToken) == address(0))
            revert InvalidPID();

        underlyingInfo.underlyingToken.safeTransferFrom(
            msg.sender,
            address(this),
            _amount
        );

        underlyingInfo.underlyingToken.approve(
            address(underlyingInfo.depositContract),
            _amount
        );

        uint256 _receivedTokens = underlyingInfo.depositContract.deposit(
            address(this),
            _amount
        );

        _deposit(_pid, _receivedTokens);
    }

    /// @notice Allows users to withdraw `_amount` of LP tokens from the pool with id `_pid`. Non whitelisted contracts can't call this function
    /// @dev Emits a {Withdraw} event
    /// @param _pid The id of the pool to withdraw from
    /// @param _amount The amount of LP tokens to withdraw
    function withdraw(uint256 _pid, uint256 _amount) external noContract {
        IERC20Upgradeable _lpToken = _withdraw(_pid, _amount);
        _lpToken.safeTransfer(address(msg.sender), _amount);
    }

    function withdrawUnderlying(
        uint256 _pid,
        uint256 _amount
    ) external noContract {
        if (_amount == 0) revert InvalidAmount();

        UnderlyingDepositInfo memory underlyingInfo = underlyingTokens[_pid];
        if (address(underlyingInfo.underlyingToken) == address(0))
            revert InvalidPID();

        _withdraw(_pid, _amount);

        underlyingInfo.depositContract.withdraw(msg.sender, _amount);
    }

    function _deposit(
        uint256 _pid,
        uint256 _amount
    ) internal returns (IERC20Upgradeable) {
        if (_amount == 0) revert InvalidAmount();

        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        _updatePool(_pid);
        _withdrawReward(_pid);

        pool.depositedAmount += _amount;
        user.amount += _amount;

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

        return pool.lpToken;
    }

    function _withdraw(
        uint256 _pid,
        uint256 _amount
    ) internal returns (IERC20Upgradeable) {
        if (_amount == 0) revert InvalidAmount();

        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        if (user.amount < _amount) revert InvalidAmount();

        _updatePool(_pid);
        _withdrawReward(_pid);

        pool.depositedAmount -= _amount;
        unchecked {
            user.amount -= _amount;
        }

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

        return pool.lpToken;
    }

    /// @dev Normalizes the current `block.number`. See {_normalizeBlockNumber} for more info
    /// @return Normalized `block.number`
    function _blockNumber() internal view returns (uint256) {
        return _normalizeBlockNumber(block.number);
    }

    /// @dev Normalizes `blockNumber` to fit within the bounds of an epoch.
    /// This is done to ensure that no rewards are distributed for staking outside of an epoch without modifying the reward logic.
    /// For example:
    /// `blockNumber` is 1100, the epoch's `endBlock` is 1000. In this case the function would return 1000. If this value were to be used
    /// in the {_updatePool} function, where the pool's `lastRewardBlock` is 990, only the rewards from block 990 to block 1000 would be distributed
    /// @return Normalized `blockNumber`
    function _normalizeBlockNumber(
        uint256 blockNumber
    ) internal view returns (uint256) {
        if (blockNumber < epoch.startBlock) return epoch.startBlock;

        if (blockNumber > epoch.endBlock) return epoch.endBlock;

        return blockNumber;
    }

    /// @dev Calls {_updatePool} for every pool
    function _massUpdatePools() internal {
        uint256 length = poolInfo.length;
        for (uint256 pid; pid < length; ++pid) {
            _updatePool(pid);
        }
    }

    /// @dev Updates the state of the pool at index `_pid`
    /// @param _pid The pool to update
    function _updatePool(uint256 _pid) internal {
        PoolInfo storage pool = poolInfo[_pid];
        if (pool.allocPoint == 0) {
            return;
        }

        uint256 blockNumber = _blockNumber();
        //normalizing the pool's `lastRewardBlock` ensures that no rewards are distributed by staking outside of an epoch
        uint256 lastRewardBlock = _normalizeBlockNumber(pool.lastRewardBlock);
        if (blockNumber <= lastRewardBlock) {
            return;
        }
        uint256 lpSupply = pool.depositedAmount;
        if (lpSupply == 0) {
            pool.lastRewardBlock = blockNumber;
            return;
        }
        uint256 reward = ((blockNumber - lastRewardBlock) *
            epoch.rewardPerBlock *
            1e36 *
            pool.allocPoint) / totalAllocPoint;
        pool.accRewardPerShare = pool.accRewardPerShare + reward / lpSupply;
        pool.lastRewardBlock = blockNumber;
    }

    /// @dev Updates `msg.sender`'s claimable rewards by adding pending rewards from `_pid`
    /// @param _pid The pool to withdraw rewards from
    function _withdrawReward(uint256 _pid) internal returns (uint256) {
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint256 accRewardPerShare = poolInfo[_pid].accRewardPerShare;
        uint256 pending = (user.amount *
            (accRewardPerShare - user.lastAccRewardPerShare)) / 1e36;
        if (pending != 0) {
            userRewards[msg.sender][_pid] += pending;
        }

        user.lastAccRewardPerShare = accRewardPerShare;

        return pending;
    }

    /// @notice Allows users to claim rewards from the pool with id `_pid`. Non whitelisted contracts can't call this function
    /// @dev Emits a {Claim} event
    /// @param _pid The pool to claim rewards from
    function claim(uint256 _pid) external nonReentrant noContract {
        _updatePool(_pid);
        _withdrawReward(_pid);

        uint256 _rewards = userRewards[msg.sender][_pid];
        if (_rewards == 0) revert NoReward();

        userRewards[msg.sender][_pid] = 0;
        jpgd.safeTransfer(msg.sender, _rewards);

        emit Claim(msg.sender, _pid, _rewards);
    }

    /// @notice Allows users to claim rewards from all pools. Non whitelisted contracts can't call this function
    /// @dev Emits a {ClaimAll} event
    function claimAll() external nonReentrant noContract {
        uint256 _length = poolInfo.length;
        uint256 _rewards;
        for (uint256 i; i < _length; ++i) {
            _updatePool(i);
            _withdrawReward(i);
            _rewards += userRewards[msg.sender][i];
            userRewards[msg.sender][i] = 0;
        }
        if (_rewards == 0) revert NoReward();

        jpgd.safeTransfer(msg.sender, _rewards);

        emit ClaimAll(msg.sender, _rewards);
    }

    /// @dev Prevent the owner from renouncing ownership. Having no owner would render this contract unusable due to the inability to create new epochs
    function renounceOwnership() public view override onlyOwner {
        revert("");
    }
}

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

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

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

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

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

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ReentrancyGuardUpgradeable is Initializable {
    // 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;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 5 of 9 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);

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

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

File 6 of 9 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
    using AddressUpgradeable for address;

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

    function safeTransferFrom(
        IERC20Upgradeable 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(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 8 of 9 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 9 of 9 : NoContractUpgradeable.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

abstract contract NoContractUpgradeable is OwnableUpgradeable {
    event ContractWhitelistChanged(address indexed addr, bool isWhitelisted);

    /// @notice Contracts that are allowed to interact with functions executing the {noContract} modifier.
    /// @dev See the {noContract} modifier for more info
    mapping(address => bool) public whitelistedContracts;

    /// @dev Modifier that ensures that non-whitelisted contracts can't interact with functions executing it.
    modifier noContract() {
        require(
            msg.sender == tx.origin || whitelistedContracts[msg.sender],
            "NO_CONTRACTS"
        );
        _;
    }

    function __noContract_init() internal onlyInitializing {
        __Ownable_init();
    }

    /// @notice Allows the owner to whitelist/blacklist contracts
    /// @param addr The contract address to whitelist/blacklist
    /// @param isWhitelisted Whereter to whitelist or blacklist `_contract`
    function setContractWhitelisted(
        address addr,
        bool isWhitelisted
    ) external onlyOwner {
        whitelistedContracts[addr] = isWhitelisted;

        emit ContractWhitelistChanged(addr, isWhitelisted);
    }

    uint256[50] __gap;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_jpgd","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidBlock","type":"error"},{"inputs":[],"name":"InvalidPID","type":"error"},{"inputs":[],"name":"NoReward","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"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":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"bool","name":"isWhitelisted","type":"bool"}],"name":"ContractWhitelistChanged","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":"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":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20Upgradeable","name":"_lpToken","type":"address"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"deleteUnderlyingInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositUnderlying","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"endBlock","type":"uint256"},{"internalType":"uint256","name":"rewardPerBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"jpgd","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_endBlock","type":"uint256"},{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"}],"name":"newEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20Upgradeable","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accRewardPerShare","type":"uint256"},{"internalType":"uint256","name":"depositedAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"isWhitelisted","type":"bool"}],"name":"setContractWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"contract IERC20Upgradeable","name":"_underlyingToken","type":"address"},{"internalType":"contract UnderlyingDepositContract","name":"_depositContract","type":"address"}],"name":"setUnderlyingInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalAllocPoint","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":"uint256","name":"","type":"uint256"}],"name":"underlyingTokens","outputs":[{"internalType":"contract IERC20Upgradeable","name":"underlyingToken","type":"address"},{"internalType":"contract UnderlyingDepositContract","name":"depositContract","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lastAccRewardPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedContracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawUnderlying","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b5060405161208938038061208983398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c611fdd6100ac600039600081816102b90152818161089401528181610d8f01528181610dd201526112d80152611fdd6000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80638129fc1c116100ee57806398969e8211610097578063d1058e5911610071578063d1058e5914610428578063e2bbb15814610430578063e494b0c814610443578063f2fde38b1461045657600080fd5b806398969e82146103ae578063a3bf224b146103c1578063c22fb4ef1461041557600080fd5b80638da5cb5b116100c85780638da5cb5b14610329578063900cf0cf1461033a57806393f1a40b1461036757600080fd5b80638129fc1c146102fb57806383afab561461030357806389f67df11461031657600080fd5b8063379607f5116101505780634d5693ab1161012a5780634d5693ab146102a157806370d50c44146102b4578063715018a6146102f357600080fd5b8063379607f514610248578063391feebb1461025b578063441a3e701461028e57600080fd5b806317caf6f11161018157806317caf6f1146102195780631ab06ee5146102225780632b8bbbe81461023557600080fd5b8063081e3eda146101a8578063118f8169146101bf5780631526fe27146101d4575b600080fd5b60cd545b6040519081526020015b60405180910390f35b6101d26101cd366004611cb5565b610469565b005b6101e76101e2366004611d09565b6104fb565b604080516001600160a01b0390961686526020860194909452928401919091526060830152608082015260a0016101b6565b6101ac60cf5481565b6101d2610230366004611d9e565b610546565b6101d2610243366004611d39565b61060f565b6101d2610256366004611d09565b610777565b61027e610269366004611c99565b60976020526000908152604090205460ff1681565b60405190151581526020016101b6565b6101d261029c366004611d9e565b610902565b6101d26102af366004611d9e565b61097c565b6102db7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101b6565b6101d2610b82565b6101d2610bce565b6101d2610311366004611dbf565b610c8f565b6101d2610324366004611d5d565b610dfc565b6065546001600160a01b03166102db565b60ca5460cb5460cc5461034c92919083565b604080519384526020840192909252908201526060016101b6565b610399610375366004611d39565b60ce6020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101b6565b6101ac6103bc366004611d39565b610eb9565b6103f56103cf366004611d09565b60d160205260009081526040902080546001909101546001600160a01b03918216911682565b604080516001600160a01b039384168152929091166020830152016101b6565b6101d2610423366004611d9e565b611026565b6101d2611188565b6101d261043e366004611d9e565b61133c565b6101d2610451366004611d09565b6113b7565b6101d2610464366004611c99565b61140d565b6065546001600160a01b0316331461049c5760405162461bcd60e51b815260040161049390611e39565b60405180910390fd5b6001600160a01b038216600081815260976020908152604091829020805460ff191685151590811790915591519182527f5f4d080f2a2d4cbddbc3ae19a7cc2ef681d2d3f2a7d7271b95b7d051be541239910160405180910390a25050565b60cd818154811061050b57600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909185565b6065546001600160a01b031633146105705760405162461bcd60e51b815260040161049390611e39565b6105786114a5565b600060cd838154811061059b57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016001015490508160cd84815481106105d157634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016001018190555081811461060a57818160cf546105fc9190611f10565b6106069190611eb9565b60cf555b505050565b6065546001600160a01b031633146106395760405162461bcd60e51b815260040161049390611e39565b6106416114a5565b600061064b6114d0565b90508260cf5461065b9190611eb9565b60cf556040805160a0810182526001600160a01b039384168152602081019485529081019182526000606082018181526080830182815260cd8054600181018255935292517f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db2e600590930292830180546001600160a01b031916919096161790945593517f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db2f85015590517f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db3084015590517f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db31830155517f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db3290910155565b600260015414156107ca5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610493565b6002600155333214806107ec57503360009081526097602052604090205460ff165b6108275760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b610830816114e0565b610839816115e0565b5033600090815260d060209081526040808320848452909152902054806108735760405163374c934360e11b815260040160405180910390fd5b33600081815260d0602090815260408083208684529091528120556108c3907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690836116ae565b604051818152829033907f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf79060200160405180910390a3505060018055565b3332148061091f57503360009081526097602052604090205460ff165b61095a5760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b60006109668383611711565b905061060a6001600160a01b03821633846116ae565b3332148061099957503360009081526097602052604090205460ff165b6109d45760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b806109f25760405163162908e360e11b815260040160405180910390fd5b600082815260d16020908152604091829020825180840190935280546001600160a01b039081168085526001909201541691830191909152610a47576040516314dd868f60e11b815260040160405180910390fd5b8051610a5e906001600160a01b031633308561181b565b8051602082015160405163095ea7b360e01b81526001600160a01b0391821660048201526024810185905291169063095ea7b390604401602060405180830381600087803b158015610aaf57600080fd5b505af1158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae79190611ced565b5060208101516040516311f9fbc960e21b8152306004820152602481018490526000916001600160a01b0316906347e7ef2490604401602060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6f9190611d21565b9050610b7b8482611853565b5050505050565b6065546001600160a01b03163314610bac5760405162461bcd60e51b815260040161049390611e39565b60405162461bcd60e51b81526020600482015260006024820152604401610493565b600054610100900460ff16610be95760005460ff1615610bed565b303b155b610c505760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610493565b600054610100900460ff16158015610c72576000805461ffff19166101011790555b610c7a611937565b8015610c8c576000805461ff00191690555b50565b6065546001600160a01b03163314610cb95760405162461bcd60e51b815260040161049390611e39565b82610cc657439250610ce7565b43831015610ce75760405163be5a36cf60e01b815260040160405180910390fd5b828211610d075760405163be5a36cf60e01b815260040160405180910390fd5b80610d255760405163162908e360e11b815260040160405180910390fd5b610d2d6114a5565b6000610d376114d0565b60cb54610d449190611f10565b60cc54610d519190611ef1565b90506000610d5f8585611f10565b610d699084611ef1565b60ca86905560cb85905560cc849055905080821115610dbd57610db86001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016338385036116ae565b610b7b565b80821015610b7b57610b7b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085850361181b565b6065546001600160a01b03163314610e265760405162461bcd60e51b815260040161049390611e39565b6001600160a01b0382161580610e4357506001600160a01b038116155b15610e615760405163d92e233d60e01b815260040160405180910390fd5b6040805180820182526001600160a01b0393841681529183166020808401918252600095865260d190529320905181546001600160a01b03199081169184169190911782559251600190910180549093169116179055565b60008060cd8481548110610edd57634e487b7160e01b600052603260045260246000fd5b6000918252602080832087845260ce825260408085206001600160a01b03891686529092529083206005929092020160038101549093509091610f1e6114d0565b90506000610f2f8560020154611968565b60048601549091508183118015610f4557508015155b15610fb55760cf54600187015460cc546000929190610f648688611f10565b610f6e9190611ef1565b610f87906ec097ce7bc90715b34b9f1000000000611ef1565b610f919190611ef1565b610f9b9190611ed1565b9050610fa78282611ed1565b610fb19086611eb9565b9450505b6ec097ce7bc90715b34b9f1000000000856001015485610fd59190611f10565b8654610fe19190611ef1565b610feb9190611ed1565b6001600160a01b038916600090815260d0602090815260408083208d84529091529020546110199190611eb9565b9998505050505050505050565b3332148061104357503360009081526097602052604090205460ff165b61107e5760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b8061109c5760405163162908e360e11b815260040160405180910390fd5b600082815260d16020908152604091829020825180840190935280546001600160a01b0390811680855260019092015416918301919091526110f1576040516314dd868f60e11b815260040160405180910390fd5b6110fb8383611711565b50602081015160405163f3fef3a360e01b8152336004820152602481018490526001600160a01b039091169063f3fef3a390604401602060405180830381600087803b15801561114a57600080fd5b505af115801561115e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111829190611d21565b50505050565b600260015414156111db5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610493565b6002600155333214806111fd57503360009081526097602052604090205460ff165b6112385760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b60cd546000805b828110156112ac57611250816114e0565b611259816115e0565b5033600090815260d06020908152604080832084845290915290205461127f9083611eb9565b33600090815260d06020908152604080832085845290915281205591506112a581611f53565b905061123f565b50806112cb5760405163374c934360e11b815260040160405180910390fd5b6112ff6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836116ae565b60405181815233907f87c8f5d0edc1925e2c5f0557944a55a97424c9ded0e2ac25a5515137603c9ad39060200160405180910390a2505060018055565b3332148061135957503360009081526097602052604090205460ff165b6113945760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b60006113a08383611853565b905061060a6001600160a01b03821633308561181b565b6065546001600160a01b031633146113e15760405162461bcd60e51b815260040161049390611e39565b600090815260d16020526040902080546001600160a01b03199081168255600190910180549091169055565b6065546001600160a01b031633146114375760405162461bcd60e51b815260040161049390611e39565b6001600160a01b03811661149c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610493565b610c8c81611993565b60cd5460005b818110156114cc576114bc816114e0565b6114c581611f53565b90506114ab565b5050565b60006114db43611968565b905090565b600060cd828154811061150357634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502019050806001015460001415611524575050565b600061152e6114d0565b9050600061153f8360020154611968565b905080821161154e5750505050565b60048301548061156357505060029091015550565b60cf54600185015460cc54600092919061157d8688611f10565b6115879190611ef1565b6115a0906ec097ce7bc90715b34b9f1000000000611ef1565b6115aa9190611ef1565b6115b49190611ed1565b90506115c08282611ed1565b85600301546115cf9190611eb9565b600386015550505060029091015550565b600081815260ce60209081526040808320338452909152812060cd80548391908590811061161e57634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160030154905060006ec097ce7bc90715b34b9f10000000008360010154836116549190611f10565b84546116609190611ef1565b61166a9190611ed1565b905080156116a25733600090815260d0602090815260408083208884529091528120805483929061169c908490611eb9565b90915550505b60019092015592915050565b6040516001600160a01b03831660248201526044810182905261060a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526119e5565b6000816117315760405163162908e360e11b815260040160405180910390fd5b600060cd848154811061175457634e487b7160e01b600052603260045260246000fd5b6000918252602080832087845260ce82526040808520338652909252922080546005909202909201925084111561179e5760405163162908e360e11b815260040160405180910390fd5b6117a7856114e0565b6117b0856115e0565b50838260040160008282546117c59190611f10565b909155505080548490038155604051848152859033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568906020015b60405180910390a350546001600160a01b03169392505050565b6040516001600160a01b03808516602483015283166044820152606481018290526111829085906323b872dd60e01b906084016116da565b6000816118735760405163162908e360e11b815260040160405180910390fd5b600060cd848154811061189657634e487b7160e01b600052603260045260246000fd5b6000918252602080832087845260ce825260408085203386529092529220600590910290910191506118c7856114e0565b6118d0856115e0565b50838260040160008282546118e59190611eb9565b90915550508054849082906000906118fe908490611eb9565b9091555050604051848152859033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1590602001611801565b600054610100900460ff1661195e5760405162461bcd60e51b815260040161049390611e6e565b611966611ab7565b565b60ca5460009082101561197d57505060ca5490565b60cb5482111561198f57505060cb5490565b5090565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611a3a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611ae69092919063ffffffff16565b80519091501561060a5780806020019051810190611a589190611ced565b61060a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610493565b600054610100900460ff16611ade5760405162461bcd60e51b815260040161049390611e6e565b611966611aff565b6060611af58484600085611b2f565b90505b9392505050565b600054610100900460ff16611b265760405162461bcd60e51b815260040161049390611e6e565b61196633611993565b606082471015611b905760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610493565b6001600160a01b0385163b611be75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610493565b600080866001600160a01b03168587604051611c039190611dea565b60006040518083038185875af1925050503d8060008114611c40576040519150601f19603f3d011682016040523d82523d6000602084013e611c45565b606091505b5091509150611c55828286611c60565b979650505050505050565b60608315611c6f575081611af8565b825115611c7f5782518084602001fd5b8160405162461bcd60e51b81526004016104939190611e06565b600060208284031215611caa578081fd5b8135611af881611f84565b60008060408385031215611cc7578081fd5b8235611cd281611f84565b91506020830135611ce281611f99565b809150509250929050565b600060208284031215611cfe578081fd5b8151611af881611f99565b600060208284031215611d1a578081fd5b5035919050565b600060208284031215611d32578081fd5b5051919050565b60008060408385031215611d4b578182fd5b823591506020830135611ce281611f84565b600080600060608486031215611d71578081fd5b833592506020840135611d8381611f84565b91506040840135611d9381611f84565b809150509250925092565b60008060408385031215611db0578182fd5b50508035926020909101359150565b600080600060608486031215611dd3578283fd5b505081359360208301359350604090920135919050565b60008251611dfc818460208701611f27565b9190910192915050565b6020815260008251806020840152611e25816040850160208701611f27565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115611ecc57611ecc611f6e565b500190565b600082611eec57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611f0b57611f0b611f6e565b500290565b600082821015611f2257611f22611f6e565b500390565b60005b83811015611f42578181015183820152602001611f2a565b838111156111825750506000910152565b6000600019821415611f6757611f67611f6e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610c8c57600080fd5b8015158114610c8c57600080fdfea2646970667358221220ca36c5397cf18a3aabeecb8fc995cfea4c82e5fb6afb9ee3ff6acfc94e261c0a64736f6c63430008040033000000000000000000000000ce722f60f35c37ab295adc4e6ba45bcc7ca89dd6

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101a35760003560e01c80638129fc1c116100ee57806398969e8211610097578063d1058e5911610071578063d1058e5914610428578063e2bbb15814610430578063e494b0c814610443578063f2fde38b1461045657600080fd5b806398969e82146103ae578063a3bf224b146103c1578063c22fb4ef1461041557600080fd5b80638da5cb5b116100c85780638da5cb5b14610329578063900cf0cf1461033a57806393f1a40b1461036757600080fd5b80638129fc1c146102fb57806383afab561461030357806389f67df11461031657600080fd5b8063379607f5116101505780634d5693ab1161012a5780634d5693ab146102a157806370d50c44146102b4578063715018a6146102f357600080fd5b8063379607f514610248578063391feebb1461025b578063441a3e701461028e57600080fd5b806317caf6f11161018157806317caf6f1146102195780631ab06ee5146102225780632b8bbbe81461023557600080fd5b8063081e3eda146101a8578063118f8169146101bf5780631526fe27146101d4575b600080fd5b60cd545b6040519081526020015b60405180910390f35b6101d26101cd366004611cb5565b610469565b005b6101e76101e2366004611d09565b6104fb565b604080516001600160a01b0390961686526020860194909452928401919091526060830152608082015260a0016101b6565b6101ac60cf5481565b6101d2610230366004611d9e565b610546565b6101d2610243366004611d39565b61060f565b6101d2610256366004611d09565b610777565b61027e610269366004611c99565b60976020526000908152604090205460ff1681565b60405190151581526020016101b6565b6101d261029c366004611d9e565b610902565b6101d26102af366004611d9e565b61097c565b6102db7f000000000000000000000000ce722f60f35c37ab295adc4e6ba45bcc7ca89dd681565b6040516001600160a01b0390911681526020016101b6565b6101d2610b82565b6101d2610bce565b6101d2610311366004611dbf565b610c8f565b6101d2610324366004611d5d565b610dfc565b6065546001600160a01b03166102db565b60ca5460cb5460cc5461034c92919083565b604080519384526020840192909252908201526060016101b6565b610399610375366004611d39565b60ce6020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101b6565b6101ac6103bc366004611d39565b610eb9565b6103f56103cf366004611d09565b60d160205260009081526040902080546001909101546001600160a01b03918216911682565b604080516001600160a01b039384168152929091166020830152016101b6565b6101d2610423366004611d9e565b611026565b6101d2611188565b6101d261043e366004611d9e565b61133c565b6101d2610451366004611d09565b6113b7565b6101d2610464366004611c99565b61140d565b6065546001600160a01b0316331461049c5760405162461bcd60e51b815260040161049390611e39565b60405180910390fd5b6001600160a01b038216600081815260976020908152604091829020805460ff191685151590811790915591519182527f5f4d080f2a2d4cbddbc3ae19a7cc2ef681d2d3f2a7d7271b95b7d051be541239910160405180910390a25050565b60cd818154811061050b57600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909185565b6065546001600160a01b031633146105705760405162461bcd60e51b815260040161049390611e39565b6105786114a5565b600060cd838154811061059b57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016001015490508160cd84815481106105d157634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016001018190555081811461060a57818160cf546105fc9190611f10565b6106069190611eb9565b60cf555b505050565b6065546001600160a01b031633146106395760405162461bcd60e51b815260040161049390611e39565b6106416114a5565b600061064b6114d0565b90508260cf5461065b9190611eb9565b60cf556040805160a0810182526001600160a01b039384168152602081019485529081019182526000606082018181526080830182815260cd8054600181018255935292517f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db2e600590930292830180546001600160a01b031916919096161790945593517f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db2f85015590517f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db3084015590517f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db31830155517f83978b4c69c48dd978ab43fe30f077615294f938fb7f936d9eb340e51ea7db3290910155565b600260015414156107ca5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610493565b6002600155333214806107ec57503360009081526097602052604090205460ff165b6108275760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b610830816114e0565b610839816115e0565b5033600090815260d060209081526040808320848452909152902054806108735760405163374c934360e11b815260040160405180910390fd5b33600081815260d0602090815260408083208684529091528120556108c3907f000000000000000000000000ce722f60f35c37ab295adc4e6ba45bcc7ca89dd66001600160a01b031690836116ae565b604051818152829033907f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf79060200160405180910390a3505060018055565b3332148061091f57503360009081526097602052604090205460ff165b61095a5760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b60006109668383611711565b905061060a6001600160a01b03821633846116ae565b3332148061099957503360009081526097602052604090205460ff165b6109d45760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b806109f25760405163162908e360e11b815260040160405180910390fd5b600082815260d16020908152604091829020825180840190935280546001600160a01b039081168085526001909201541691830191909152610a47576040516314dd868f60e11b815260040160405180910390fd5b8051610a5e906001600160a01b031633308561181b565b8051602082015160405163095ea7b360e01b81526001600160a01b0391821660048201526024810185905291169063095ea7b390604401602060405180830381600087803b158015610aaf57600080fd5b505af1158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae79190611ced565b5060208101516040516311f9fbc960e21b8152306004820152602481018490526000916001600160a01b0316906347e7ef2490604401602060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6f9190611d21565b9050610b7b8482611853565b5050505050565b6065546001600160a01b03163314610bac5760405162461bcd60e51b815260040161049390611e39565b60405162461bcd60e51b81526020600482015260006024820152604401610493565b600054610100900460ff16610be95760005460ff1615610bed565b303b155b610c505760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610493565b600054610100900460ff16158015610c72576000805461ffff19166101011790555b610c7a611937565b8015610c8c576000805461ff00191690555b50565b6065546001600160a01b03163314610cb95760405162461bcd60e51b815260040161049390611e39565b82610cc657439250610ce7565b43831015610ce75760405163be5a36cf60e01b815260040160405180910390fd5b828211610d075760405163be5a36cf60e01b815260040160405180910390fd5b80610d255760405163162908e360e11b815260040160405180910390fd5b610d2d6114a5565b6000610d376114d0565b60cb54610d449190611f10565b60cc54610d519190611ef1565b90506000610d5f8585611f10565b610d699084611ef1565b60ca86905560cb85905560cc849055905080821115610dbd57610db86001600160a01b037f000000000000000000000000ce722f60f35c37ab295adc4e6ba45bcc7ca89dd616338385036116ae565b610b7b565b80821015610b7b57610b7b6001600160a01b037f000000000000000000000000ce722f60f35c37ab295adc4e6ba45bcc7ca89dd616333085850361181b565b6065546001600160a01b03163314610e265760405162461bcd60e51b815260040161049390611e39565b6001600160a01b0382161580610e4357506001600160a01b038116155b15610e615760405163d92e233d60e01b815260040160405180910390fd5b6040805180820182526001600160a01b0393841681529183166020808401918252600095865260d190529320905181546001600160a01b03199081169184169190911782559251600190910180549093169116179055565b60008060cd8481548110610edd57634e487b7160e01b600052603260045260246000fd5b6000918252602080832087845260ce825260408085206001600160a01b03891686529092529083206005929092020160038101549093509091610f1e6114d0565b90506000610f2f8560020154611968565b60048601549091508183118015610f4557508015155b15610fb55760cf54600187015460cc546000929190610f648688611f10565b610f6e9190611ef1565b610f87906ec097ce7bc90715b34b9f1000000000611ef1565b610f919190611ef1565b610f9b9190611ed1565b9050610fa78282611ed1565b610fb19086611eb9565b9450505b6ec097ce7bc90715b34b9f1000000000856001015485610fd59190611f10565b8654610fe19190611ef1565b610feb9190611ed1565b6001600160a01b038916600090815260d0602090815260408083208d84529091529020546110199190611eb9565b9998505050505050505050565b3332148061104357503360009081526097602052604090205460ff165b61107e5760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b8061109c5760405163162908e360e11b815260040160405180910390fd5b600082815260d16020908152604091829020825180840190935280546001600160a01b0390811680855260019092015416918301919091526110f1576040516314dd868f60e11b815260040160405180910390fd5b6110fb8383611711565b50602081015160405163f3fef3a360e01b8152336004820152602481018490526001600160a01b039091169063f3fef3a390604401602060405180830381600087803b15801561114a57600080fd5b505af115801561115e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111829190611d21565b50505050565b600260015414156111db5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610493565b6002600155333214806111fd57503360009081526097602052604090205460ff165b6112385760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b60cd546000805b828110156112ac57611250816114e0565b611259816115e0565b5033600090815260d06020908152604080832084845290915290205461127f9083611eb9565b33600090815260d06020908152604080832085845290915281205591506112a581611f53565b905061123f565b50806112cb5760405163374c934360e11b815260040160405180910390fd5b6112ff6001600160a01b037f000000000000000000000000ce722f60f35c37ab295adc4e6ba45bcc7ca89dd61633836116ae565b60405181815233907f87c8f5d0edc1925e2c5f0557944a55a97424c9ded0e2ac25a5515137603c9ad39060200160405180910390a2505060018055565b3332148061135957503360009081526097602052604090205460ff165b6113945760405162461bcd60e51b815260206004820152600c60248201526b4e4f5f434f4e54524143545360a01b6044820152606401610493565b60006113a08383611853565b905061060a6001600160a01b03821633308561181b565b6065546001600160a01b031633146113e15760405162461bcd60e51b815260040161049390611e39565b600090815260d16020526040902080546001600160a01b03199081168255600190910180549091169055565b6065546001600160a01b031633146114375760405162461bcd60e51b815260040161049390611e39565b6001600160a01b03811661149c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610493565b610c8c81611993565b60cd5460005b818110156114cc576114bc816114e0565b6114c581611f53565b90506114ab565b5050565b60006114db43611968565b905090565b600060cd828154811061150357634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502019050806001015460001415611524575050565b600061152e6114d0565b9050600061153f8360020154611968565b905080821161154e5750505050565b60048301548061156357505060029091015550565b60cf54600185015460cc54600092919061157d8688611f10565b6115879190611ef1565b6115a0906ec097ce7bc90715b34b9f1000000000611ef1565b6115aa9190611ef1565b6115b49190611ed1565b90506115c08282611ed1565b85600301546115cf9190611eb9565b600386015550505060029091015550565b600081815260ce60209081526040808320338452909152812060cd80548391908590811061161e57634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160030154905060006ec097ce7bc90715b34b9f10000000008360010154836116549190611f10565b84546116609190611ef1565b61166a9190611ed1565b905080156116a25733600090815260d0602090815260408083208884529091528120805483929061169c908490611eb9565b90915550505b60019092015592915050565b6040516001600160a01b03831660248201526044810182905261060a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526119e5565b6000816117315760405163162908e360e11b815260040160405180910390fd5b600060cd848154811061175457634e487b7160e01b600052603260045260246000fd5b6000918252602080832087845260ce82526040808520338652909252922080546005909202909201925084111561179e5760405163162908e360e11b815260040160405180910390fd5b6117a7856114e0565b6117b0856115e0565b50838260040160008282546117c59190611f10565b909155505080548490038155604051848152859033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568906020015b60405180910390a350546001600160a01b03169392505050565b6040516001600160a01b03808516602483015283166044820152606481018290526111829085906323b872dd60e01b906084016116da565b6000816118735760405163162908e360e11b815260040160405180910390fd5b600060cd848154811061189657634e487b7160e01b600052603260045260246000fd5b6000918252602080832087845260ce825260408085203386529092529220600590910290910191506118c7856114e0565b6118d0856115e0565b50838260040160008282546118e59190611eb9565b90915550508054849082906000906118fe908490611eb9565b9091555050604051848152859033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1590602001611801565b600054610100900460ff1661195e5760405162461bcd60e51b815260040161049390611e6e565b611966611ab7565b565b60ca5460009082101561197d57505060ca5490565b60cb5482111561198f57505060cb5490565b5090565b606580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611a3a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611ae69092919063ffffffff16565b80519091501561060a5780806020019051810190611a589190611ced565b61060a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610493565b600054610100900460ff16611ade5760405162461bcd60e51b815260040161049390611e6e565b611966611aff565b6060611af58484600085611b2f565b90505b9392505050565b600054610100900460ff16611b265760405162461bcd60e51b815260040161049390611e6e565b61196633611993565b606082471015611b905760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610493565b6001600160a01b0385163b611be75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610493565b600080866001600160a01b03168587604051611c039190611dea565b60006040518083038185875af1925050503d8060008114611c40576040519150601f19603f3d011682016040523d82523d6000602084013e611c45565b606091505b5091509150611c55828286611c60565b979650505050505050565b60608315611c6f575081611af8565b825115611c7f5782518084602001fd5b8160405162461bcd60e51b81526004016104939190611e06565b600060208284031215611caa578081fd5b8135611af881611f84565b60008060408385031215611cc7578081fd5b8235611cd281611f84565b91506020830135611ce281611f99565b809150509250929050565b600060208284031215611cfe578081fd5b8151611af881611f99565b600060208284031215611d1a578081fd5b5035919050565b600060208284031215611d32578081fd5b5051919050565b60008060408385031215611d4b578182fd5b823591506020830135611ce281611f84565b600080600060608486031215611d71578081fd5b833592506020840135611d8381611f84565b91506040840135611d9381611f84565b809150509250925092565b60008060408385031215611db0578182fd5b50508035926020909101359150565b600080600060608486031215611dd3578283fd5b505081359360208301359350604090920135919050565b60008251611dfc818460208701611f27565b9190910192915050565b6020815260008251806020840152611e25816040850160208701611f27565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008219821115611ecc57611ecc611f6e565b500190565b600082611eec57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611f0b57611f0b611f6e565b500290565b600082821015611f2257611f22611f6e565b500390565b60005b83811015611f42578181015183820152602001611f2a565b838111156111825750506000910152565b6000600019821415611f6757611f67611f6e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610c8c57600080fd5b8015158114610c8c57600080fdfea2646970667358221220ca36c5397cf18a3aabeecb8fc995cfea4c82e5fb6afb9ee3ff6acfc94e261c0a64736f6c63430008040033

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

000000000000000000000000ce722f60f35c37ab295adc4e6ba45bcc7ca89dd6

-----Decoded View---------------
Arg [0] : _jpgd (address): 0xCE722f60F35C37aB295adc4E6bA45bCC7ca89Dd6

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ce722f60f35c37ab295adc4e6ba45bcc7ca89dd6


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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