false
true
0

Contract Address Details

0x351BA6791aEE0563B193b30c06363dC5b1938505

Contract Name
SpunkStaking
Creator
0xb48592–12af9f at 0x710017–914606
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
1 Transactions
Transfers
2 Transfers
Gas Used
55,638
Last Balance Update
26132021
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
SpunkStaking




Optimization enabled
true
Compiler version
v0.8.24+commit.e11b9ed9




Optimization runs
200
EVM Version
paris




Verified at
2026-03-25T14:09:04.762334Z

Constructor Arguments

000000000000000000000000d505b51836464398b7eb5c5f07a4b90f1d0aad46000000000000000000000000321c08eb09087c77b24322248b3982da7f7e60ad

Arg [0] (address) : 0xd505b51836464398b7eb5c5f07a4b90f1d0aad46
Arg [1] (address) : 0x321c08eb09087c77b24322248b3982da7f7e60ad

              

contracts/SpunkStaking.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

/// @title SpunkStaking v10 — Rug-proof. Designed for ownership renouncement.
/// @notice Stake Spunk NFTs, earn SPUNK ERC-20 from a pre-funded reward pool.
///         Staking is blocked when the available reward pool is empty.
///
/// Rug-proof design:
///   - No withdrawRewardPool — deposited rewards stay for stakers
///   - No pause — contract runs forever
///   - setRewardPerDay bounded [1, 1000] SPUNK/day — can never be zeroed
///   - emergencyUnstake (admin) claims rewards + returns NFTs to stakers
///   - Users can ALWAYS exit via emergencyRelease (bypasses lock, race lock)
///   - Owner can renounceOwnership() after setup for full trustlessness
///
/// v10 fixes (from v9 audit):
///   - [M-1] Accumulator-based rewards — unlimited rate changes without corruption
///   - [M-2] emergencyRelease partial — forfeits pro-rata share for released tokens only
///   - [M-3] availableRewardPool() — subtracts committed (accrued but unclaimed) rewards
contract SpunkStaking is ERC721Holder, Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    IERC721 public immutable spunksNFT;
    IERC20 public immutable spunkCoin;

    // ── Constants ──
    uint256 public constant MAX_STAKED = 20;
    uint256 public constant MAX_REWARD_PER_DAY = 1000 ether;
    uint256 public constant MIN_REWARD_PER_DAY = 1 ether;

    // ── State ──
    uint256 public rewardPerDay = 10 ether;
    uint256 public totalDistributed;
    uint256 public lockPeriod = 3 days;

    // ── Reward accumulator (replaces single checkpoint — FIX v9-M1) ──
    // Each NFT earns `rewardPerDay / 86400` wei per second.  The accumulator
    // tracks the cumulative per-NFT reward since the contract was deployed.
    // On every rate change or user interaction the accumulator is checkpointed,
    // so an arbitrary number of rate changes are handled correctly.
    uint256 public rewardPerTokenStored;
    uint256 public lastRewardUpdateTime;
    uint256 public totalStakedNFTs;
    uint256 public totalCommittedRewards;  // FIX v9-M3

    mapping(address => uint256) public userRewardPerTokenPaid;
    mapping(address => uint256) public rewardsAccrued;

    struct StakeInfo {
        address owner;
        uint48 stakedAt;
        uint48 effectiveLock;
    }

    mapping(uint256 => StakeInfo) public stakes;
    mapping(address => uint256[]) private _stakedTokens;

    // ── Leaderboard ──
    struct UserStats {
        uint256 totalClaimed;
        uint256 totalStakeTime;
        uint256 currentStreak;
    }
    mapping(address => UserStats) public userStats;
    address[] public leaderboardUsers;
    mapping(address => bool) private _isLeaderboardUser;

    address public raceContract;
    mapping(uint256 => bool) public lockedByRace;

    // ── Events ──
    event Staked(address indexed user, uint256[] tokenIds);
    event Unstaked(address indexed user, uint256[] tokenIds);
    event Claimed(address indexed user, uint256 amount);
    event RewardPerDayChanged(uint256 oldRate, uint256 newRate);
    event LockPeriodChanged(uint256 oldPeriod, uint256 newPeriod);
    event RaceContractChanged(address oldAddr, address newAddr);
    event FundsDeposited(address indexed from, uint256 amount);

    constructor(address _spunks, address _spunkCoin) Ownable(msg.sender) {
        spunksNFT = IERC721(_spunks);
        spunkCoin = IERC20(_spunkCoin);
        lastRewardUpdateTime = block.timestamp;
    }

    // ══════════════════════════════════════
    //  ACCUMULATOR INTERNALS
    // ══════════════════════════════════════

    /// @dev Current cumulative reward per NFT, including elapsed time since last checkpoint.
    function _rewardPerToken() internal view returns (uint256) {
        if (block.timestamp <= lastRewardUpdateTime) return rewardPerTokenStored;
        return rewardPerTokenStored
            + ((block.timestamp - lastRewardUpdateTime) * rewardPerDay) / 1 days;
    }

    /// @dev Checkpoint the global accumulator and snapshot a user's pending rewards.
    ///      Pass address(0) to checkpoint only the global state (e.g. on rate change).
    function _updateReward(address user) internal {
        uint256 rpt = _rewardPerToken();

        // Track new global commitment for all stakers
        if (block.timestamp > lastRewardUpdateTime && totalStakedNFTs > 0) {
            uint256 newGlobal =
                (totalStakedNFTs * (block.timestamp - lastRewardUpdateTime) * rewardPerDay) / 1 days;
            totalCommittedRewards += newGlobal;
        }

        rewardPerTokenStored = rpt;
        lastRewardUpdateTime = block.timestamp;

        if (user != address(0)) {
            uint256 staked = _stakedTokens[user].length;
            if (staked > 0) {
                rewardsAccrued[user] += staked * (rpt - userRewardPerTokenPaid[user]);
            }
            userRewardPerTokenPaid[user] = rpt;
        }
    }

    /// @dev Transfer accrued rewards to the user.  If the pool is insolvent the
    ///      payout is capped at the available balance (excess is lost — same as v9).
    function _payRewards(address user) internal {
        uint256 pending = rewardsAccrued[user];
        if (pending == 0) return;

        rewardsAccrued[user] = 0;
        _reduceCommitted(pending);

        uint256 pool = rewardPoolBalance();
        uint256 payout = pending > pool ? pool : pending;

        if (payout > 0) {
            spunkCoin.safeTransfer(user, payout);
            totalDistributed += payout;
            userStats[user].totalClaimed += payout;
            emit Claimed(user, payout);
        }
    }

    /// @dev Forfeit `amount` of a user's accrued rewards (returns them to the available pool).
    function _forfeitRewards(address user, uint256 amount) internal {
        if (amount > rewardsAccrued[user]) amount = rewardsAccrued[user];
        rewardsAccrued[user] -= amount;
        _reduceCommitted(amount);
    }

    /// @dev Safely decrease totalCommittedRewards (guards against rounding underflow).
    function _reduceCommitted(uint256 amount) internal {
        if (amount >= totalCommittedRewards) {
            totalCommittedRewards = 0;
        } else {
            totalCommittedRewards -= amount;
        }
    }

    // ══════════════════════════════════════
    //  REWARD POOL
    // ══════════════════════════════════════

    /// @notice Raw SPUNK balance held by this contract.
    function rewardPoolBalance() public view returns (uint256) {
        return spunkCoin.balanceOf(address(this));
    }

    /// @notice Effective available pool = balance minus accrued-but-unclaimed rewards.
    ///         Use this instead of rewardPoolBalance() to gauge real runway.
    function availableRewardPool() public view returns (uint256) {
        uint256 balance = spunkCoin.balanceOf(address(this));
        uint256 pendingGlobal = 0;
        if (block.timestamp > lastRewardUpdateTime && totalStakedNFTs > 0) {
            pendingGlobal =
                (totalStakedNFTs * (block.timestamp - lastRewardUpdateTime) * rewardPerDay) / 1 days;
        }
        uint256 committed = totalCommittedRewards + pendingGlobal;
        if (committed >= balance) return 0;
        return balance - committed;
    }

    function depositRewards(uint256 amount) external {
        require(amount > 0, "Zero");
        spunkCoin.safeTransferFrom(msg.sender, address(this), amount);
        emit FundsDeposited(msg.sender, amount);
    }

    // ══════════════════════════════════════
    //  STAKING
    // ══════════════════════════════════════

    function stake(uint256[] calldata tokenIds) external nonReentrant {
        require(tokenIds.length > 0, "Empty");
        require(availableRewardPool() > 0, "Reward pool empty");
        require(
            _stakedTokens[msg.sender].length + tokenIds.length <= MAX_STAKED,
            "Max 20 staked"
        );

        _updateReward(msg.sender);
        _payRewards(msg.sender);

        if (!_isLeaderboardUser[msg.sender]) {
            _isLeaderboardUser[msg.sender] = true;
            leaderboardUsers.push(msg.sender);
        }
        if (_stakedTokens[msg.sender].length == 0) {
            userStats[msg.sender].currentStreak = block.timestamp;
        }

        for (uint256 i = 0; i < tokenIds.length; i++) {
            for (uint256 j = i + 1; j < tokenIds.length; j++) {
                require(tokenIds[i] != tokenIds[j], "Duplicate");
            }
            spunksNFT.transferFrom(msg.sender, address(this), tokenIds[i]);
            stakes[tokenIds[i]] = StakeInfo(msg.sender, uint48(block.timestamp), uint48(lockPeriod));
            _stakedTokens[msg.sender].push(tokenIds[i]);
        }

        totalStakedNFTs += tokenIds.length;
        emit Staked(msg.sender, tokenIds);
    }

    function unstake(uint256[] calldata tokenIds) external nonReentrant {
        require(tokenIds.length > 0, "Empty");

        _updateReward(msg.sender);
        _payRewards(msg.sender);

        for (uint256 i = 0; i < tokenIds.length; i++) {
            StakeInfo memory info = stakes[tokenIds[i]];
            require(info.owner == msg.sender, "Not yours");
            require(!lockedByRace[tokenIds[i]], "In active race");
            require(
                block.timestamp >= uint256(info.stakedAt) + uint256(info.effectiveLock),
                "Lock period active"
            );
            userStats[msg.sender].totalStakeTime += block.timestamp - uint256(info.stakedAt);
            delete stakes[tokenIds[i]];
            _removeFromArray(_stakedTokens[msg.sender], tokenIds[i]);
        }

        totalStakedNFTs -= tokenIds.length;

        if (_stakedTokens[msg.sender].length == 0) {
            userStats[msg.sender].currentStreak = 0;
        }

        for (uint256 i = 0; i < tokenIds.length; i++) {
            spunksNFT.safeTransferFrom(address(this), msg.sender, tokenIds[i]);
        }

        emit Unstaked(msg.sender, tokenIds);
    }

    /// @notice Force unstake — forfeits ALL pending rewards, still enforces lock period.
    function forceUnstake(uint256[] calldata tokenIds) external nonReentrant {
        require(tokenIds.length > 0, "Empty");

        _updateReward(msg.sender);
        _forfeitRewards(msg.sender, rewardsAccrued[msg.sender]);

        for (uint256 i = 0; i < tokenIds.length; i++) {
            StakeInfo memory info = stakes[tokenIds[i]];
            require(info.owner == msg.sender, "Not yours");
            require(!lockedByRace[tokenIds[i]], "In active race");
            require(
                block.timestamp >= uint256(info.stakedAt) + uint256(info.effectiveLock),
                "Lock period active"
            );
            userStats[msg.sender].totalStakeTime += block.timestamp - uint256(info.stakedAt);
            delete stakes[tokenIds[i]];
            _removeFromArray(_stakedTokens[msg.sender], tokenIds[i]);
        }

        totalStakedNFTs -= tokenIds.length;

        if (_stakedTokens[msg.sender].length == 0) {
            userStats[msg.sender].currentStreak = 0;
        }
        for (uint256 i = 0; i < tokenIds.length; i++) {
            spunksNFT.safeTransferFrom(address(this), msg.sender, tokenIds[i]);
        }

        emit Unstaked(msg.sender, tokenIds);
    }

    /// @notice User emergency exit — bypasses lock period AND race lock.
    /// Partial release: forfeits pro-rata rewards for released tokens, pays the rest.
    /// Full release: forfeits all rewards.
    /// FIX v9-M2: no longer overpays on partial release.
    function emergencyRelease(uint256[] calldata tokenIds) external nonReentrant {
        require(tokenIds.length > 0, "Empty");

        _updateReward(msg.sender);
        uint256 stakedBefore = _stakedTokens[msg.sender].length;

        if (tokenIds.length < stakedBefore) {
            // Partial — forfeit only the released tokens' share, pay the rest
            uint256 forfeit = (rewardsAccrued[msg.sender] * tokenIds.length) / stakedBefore;
            _forfeitRewards(msg.sender, forfeit);
            _payRewards(msg.sender);
        } else {
            // Full release — forfeit everything
            _forfeitRewards(msg.sender, rewardsAccrued[msg.sender]);
        }

        for (uint256 i = 0; i < tokenIds.length; i++) {
            require(stakes[tokenIds[i]].owner == msg.sender, "Not yours");
            lockedByRace[tokenIds[i]] = false;
            userStats[msg.sender].totalStakeTime +=
                block.timestamp - uint256(stakes[tokenIds[i]].stakedAt);
            delete stakes[tokenIds[i]];
            _removeFromArray(_stakedTokens[msg.sender], tokenIds[i]);
        }

        totalStakedNFTs -= tokenIds.length;

        if (_stakedTokens[msg.sender].length == 0) {
            userStats[msg.sender].currentStreak = 0;
        }
        for (uint256 i = 0; i < tokenIds.length; i++) {
            spunksNFT.safeTransferFrom(address(this), msg.sender, tokenIds[i]);
        }

        emit Unstaked(msg.sender, tokenIds);
    }

    /// @notice Claim accrued rewards. Always callable — no admin gate.
    function claimRewards() external nonReentrant {
        _updateReward(msg.sender);
        _payRewards(msg.sender);
    }

    /// @notice View: total pending rewards for a user (including un-checkpointed time).
    function pendingRewards(address user) public view returns (uint256) {
        uint256 staked = _stakedTokens[user].length;
        uint256 rpt = _rewardPerToken();
        uint256 newRewards = staked * (rpt - userRewardPerTokenPaid[user]);
        return rewardsAccrued[user] + newRewards;
    }

    function getStakedTokens(address user) external view returns (uint256[] memory) {
        return _stakedTokens[user];
    }

    function stakeOwner(uint256 tokenId) external view returns (address) {
        return stakes[tokenId].owner;
    }

    function lockTimeRemaining(uint256 tokenId) external view returns (uint256) {
        StakeInfo memory info = stakes[tokenId];
        if (info.owner == address(0)) return 0;
        uint256 unlockAt = uint256(info.stakedAt) + uint256(info.effectiveLock);
        if (block.timestamp >= unlockAt) return 0;
        return unlockAt - block.timestamp;
    }

    // ══════════════════════════════════════
    //  LEADERBOARD
    // ══════════════════════════════════════

    function leaderboardLength() external view returns (uint256) {
        return leaderboardUsers.length;
    }

    function getLeaderboard(uint256 offset, uint256 limit)
        external
        view
        returns (
            address[] memory users,
            uint256[] memory claimed,
            uint256[] memory stakeTime,
            uint256[] memory streaks
        )
    {
        uint256 len = leaderboardUsers.length;
        if (offset >= len) {
            return (new address[](0), new uint256[](0), new uint256[](0), new uint256[](0));
        }
        uint256 end = offset + limit;
        if (end > len) end = len;
        uint256 size = end - offset;

        users = new address[](size);
        claimed = new uint256[](size);
        stakeTime = new uint256[](size);
        streaks = new uint256[](size);

        for (uint256 i = 0; i < size; i++) {
            address u = leaderboardUsers[offset + i];
            users[i] = u;
            claimed[i] = userStats[u].totalClaimed;
            stakeTime[i] = userStats[u].totalStakeTime;
            streaks[i] = userStats[u].currentStreak;
        }
    }

    // ══════════════════════════════════════
    //  RACE CONTRACT INTERFACE
    // ══════════════════════════════════════

    function lockForRace(uint256 tokenId) external {
        require(msg.sender == raceContract, "Only race contract");
        require(stakes[tokenId].owner != address(0), "Not staked");
        lockedByRace[tokenId] = true;
    }

    function unlockFromRace(uint256 tokenId) external {
        require(msg.sender == raceContract, "Only race contract");
        lockedByRace[tokenId] = false;
    }

    // ══════════════════════════════════════
    //  ADMIN
    // ══════════════════════════════════════

    /// @notice Change reward rate.  The accumulator is checkpointed first so all
    ///         prior accrual is locked in at the old rate.  Supports unlimited
    ///         consecutive rate changes without reward corruption (FIX v9-M1).
    function setRewardPerDay(uint256 _rate) external onlyOwner {
        require(_rate >= MIN_REWARD_PER_DAY, "Below minimum");
        require(_rate <= MAX_REWARD_PER_DAY, "Too high");
        _updateReward(address(0));
        emit RewardPerDayChanged(rewardPerDay, _rate);
        rewardPerDay = _rate;
    }

    /// @notice Only affects future stakes — existing stakes keep their original lock.
    function setLockPeriod(uint256 _period) external onlyOwner {
        require(_period <= 30 days, "Max 30 days");
        emit LockPeriodChanged(lockPeriod, _period);
        lockPeriod = _period;
    }

    function setRaceContract(address _race) external onlyOwner {
        emit RaceContractChanged(raceContract, _race);
        raceContract = _race;
    }

    /// @notice Owner emergency unstake — claims rewards for stakers + returns NFTs.
    function emergencyUnstake(uint256[] calldata tokenIds) external onlyOwner nonReentrant {
        for (uint256 i = 0; i < tokenIds.length; i++) {
            address staker = stakes[tokenIds[i]].owner;
            if (staker != address(0)) {
                _updateReward(staker);
                _payRewards(staker);

                userStats[staker].totalStakeTime +=
                    block.timestamp - uint256(stakes[tokenIds[i]].stakedAt);

                lockedByRace[tokenIds[i]] = false;
                delete stakes[tokenIds[i]];
                _removeFromArray(_stakedTokens[staker], tokenIds[i]);
                totalStakedNFTs--;

                if (_stakedTokens[staker].length == 0) {
                    userStats[staker].currentStreak = 0;
                }

                spunksNFT.safeTransferFrom(address(this), staker, tokenIds[i]);
            }
        }
    }

    function _removeFromArray(uint256[] storage arr, uint256 val) internal {
        for (uint256 i = 0; i < arr.length; i++) {
            if (arr[i] == val) {
                arr[i] = arr[arr.length - 1];
                arr.pop();
                return;
            }
        }
    }
}
        

/IERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
          

/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @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 EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * 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;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}
          

/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}
          

/utils/ERC721Holder.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.20;

import {IERC721Receiver} from "../IERC721Receiver.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or
 * {IERC721-setApprovalForAll}.
 */
abstract contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {
        return this.onERC721Received.selector;
    }
}
          

/IERC721Receiver.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity >=0.5.0;

/**
 * @title ERC-721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC-721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be
     * reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}
          

/IERC721.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC721/IERC721.sol)

pragma solidity >=0.6.2;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC-721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC-721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
     *   {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}
          

/utils/SafeERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 {
    /**
     * @dev An operation with an ERC-20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}
          

/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}
          

/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)

pragma solidity >=0.4.16;

import {IERC20} from "../token/ERC20/IERC20.sol";
          

/IERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)

pragma solidity >=0.4.16;

import {IERC165} from "../utils/introspection/IERC165.sol";
          

/IERC1363.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)

pragma solidity >=0.6.2;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}
          

/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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);
    }
}
          

Compiler Settings

{"viaIR":true,"remappings":[],"optimizer":{"runs":200,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"paris","compilationTarget":{"contracts/SpunkStaking.sol":"SpunkStaking"}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_spunks","internalType":"address"},{"type":"address","name":"_spunkCoin","internalType":"address"}]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"event","name":"Claimed","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FundsDeposited","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LockPeriodChanged","inputs":[{"type":"uint256","name":"oldPeriod","internalType":"uint256","indexed":false},{"type":"uint256","name":"newPeriod","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RaceContractChanged","inputs":[{"type":"address","name":"oldAddr","internalType":"address","indexed":false},{"type":"address","name":"newAddr","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"RewardPerDayChanged","inputs":[{"type":"uint256","name":"oldRate","internalType":"uint256","indexed":false},{"type":"uint256","name":"newRate","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Staked","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]","indexed":false}],"anonymous":false},{"type":"event","name":"Unstaked","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_REWARD_PER_DAY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_STAKED","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MIN_REWARD_PER_DAY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"availableRewardPool","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimRewards","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"depositRewards","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyRelease","inputs":[{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyUnstake","inputs":[{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"forceUnstake","inputs":[{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"users","internalType":"address[]"},{"type":"uint256[]","name":"claimed","internalType":"uint256[]"},{"type":"uint256[]","name":"stakeTime","internalType":"uint256[]"},{"type":"uint256[]","name":"streaks","internalType":"uint256[]"}],"name":"getLeaderboard","inputs":[{"type":"uint256","name":"offset","internalType":"uint256"},{"type":"uint256","name":"limit","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getStakedTokens","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastRewardUpdateTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"leaderboardLength","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"leaderboardUsers","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"lockForRace","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lockPeriod","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lockTimeRemaining","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"lockedByRace","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"onERC721Received","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingRewards","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"raceContract","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerDay","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerTokenStored","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPoolBalance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardsAccrued","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setLockPeriod","inputs":[{"type":"uint256","name":"_period","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRaceContract","inputs":[{"type":"address","name":"_race","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRewardPerDay","inputs":[{"type":"uint256","name":"_rate","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"spunkCoin","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC721"}],"name":"spunksNFT","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"stake","inputs":[{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"stakeOwner","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint48","name":"stakedAt","internalType":"uint48"},{"type":"uint48","name":"effectiveLock","internalType":"uint48"}],"name":"stakes","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalCommittedRewards","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalDistributed","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalStakedNFTs","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unlockFromRace","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unstake","inputs":[{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userRewardPerTokenPaid","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"totalClaimed","internalType":"uint256"},{"type":"uint256","name":"totalStakeTime","internalType":"uint256"},{"type":"uint256","name":"currentStreak","internalType":"uint256"}],"name":"userStats","inputs":[{"type":"address","name":"","internalType":"address"}]}]
              

Contract Creation Code

0x60c0346200014b57601f6200265e38819003918201601f19168301916001600160401b03831184841017620001505780849260409485528339810103126200014b576200005a6020620000528362000166565b920162000166565b903315620001325760008054336001600160a01b0319821681178355604051946001600160a01b0394909385939192918416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360018055678ac7230489e800006002556203f480600455166080521660a052426006556124e290816200017c82396080518181816103800152818161082b0152818161098001528181611150015281816115890152611728015260a051818181610d460152818161132d01528181611f190152818161202901526122820152f35b604051631e4fbdf760e01b815260006004820152602490fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036200014b5756fe6040608081526004908136101561001557600080fd5b600091823560e01c9081630fbf0a9314611688578163150b7a02146115d7578163186ca969146115b857816320d36b42146115745781632671e351146115515781632bd1755a146115325781632c9dcbb41461151357816331d7a262146114ae578163372500ab1461147c5781633aec9890146113f65781633dbd46bd146113c35781633fd8b02f146113a5578163447749701461138557816351c2ee8a1461135c578163528fdab31461131857816357dece76146110a957816363c28db114611023578163715018a614610fc957816373af16fc14610f27578163779972da14610e9a5781637a5c08ae14610e7d5781637fb5ad3814610e455781638a65d87414610df75781638b87634714610dbf5781638bdf67f214610cf25781638da5cb5b14610cca57816390c35a9314610b8d5781639f17ec5314610b60578163ab4cf35d1461090d578163af8f42b8146108ee578163bf0e5b95146106e5578163c18ac52b146106a8578163c39722e614610689578163c96e616c14610665578163d5a44f861461061a578163d85fb84c146105f6578163db15e2d6146105da578163df136d65146105bb578163e00df13514610577578163e449f3411461031a578163efca2eed146102fb578163f2fde38b14610270575063fc680d8c146101fc57600080fd5b3461026c57602036600319011261026c57610215611a91565b9061021e612402565b7f9c3833a4dcf7cda54ce74bdfa6f3eab334d51f154b74b5f3c7271e85d864f53a6010549160018060a01b0381519481851686521693846020820152a16001600160a01b0319161760105580f35b5080fd5b9050346102f75760203660031901126102f75761028b611a91565b90610294612402565b6001600160a01b039182169283156102e157505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b51631e4fbdf760e01b8152908101849052602490fd5b8280fd5b50503461026c578160031936011261026c576020906003549051908152f35b919050346102f75761032b36611a3f565b9190926103366120f1565b610341831515611bc4565b61034a33612114565b610353336121d1565b845b838110610476575061036983600754611c54565b600755338552600c6020528185205415610464575b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169085805b8581106103f05750835133907f20748b935fd9f21155c2e98cb2bd5df6fe86f21b193cebaae8d9ad7db0ba541690806103e6898b83611c2b565b0390a26001805580f35b6103fb818789611c1b565b35843b156102f7578551632142170760e11b815230858201908152336020820152604081019290925290839082908190606001038183895af1801561045a57906001929161044b575b50016103ac565b61045490611aa7565b38610444565b86513d85823e3d90fd5b600d602052846002838220015561037e565b610481818587611c1b565b358652600b60209080825284882085519061049b82611ad1565b5490600160a01b6001900382169182825265ffffffffffff928886840193858460a01c168552019160d01c825233146104d390611d2b565b6104de868a8c611c1b565b358b5260118552878b205460ff16156104f690611f90565b828083511691511661050791611bf8565b42101561051390611fcd565b5161051f911642611c54565b338952600d83528589206001019081549061053991611bf8565b9055610546838789611c1b565b35885281528684812055338752600c9052828620610565828688611c1b565b3561056f91612368565b600101610355565b9050346102f75760203660031901126102f7573591600e548310156105b857506105a2602092611b5f565b905491519160018060a01b039160031b1c168152f35b80fd5b50503461026c578160031936011261026c576020906005549051908152f35b50503461026c578160031936011261026c576020905160148152f35b50503461026c578160031936011261026c5760209051683635c9adc5dea000008152f35b9050346102f75760203660031901126102f7576060928291358152600b60205220549080519160018060a01b038116835265ffffffffffff8160a01c16602084015260d01c90820152f35b50503461026c578160031936011261026c5760209061068261200e565b9051908152f35b50503461026c578160031936011261026c576020906008549051908152f35b9050346102f75760203660031901126102f7576106d060018060a01b03601054163314611c74565b35825260116020528120805460ff1916905580f35b9050346102f7576106f536611a3f565b610700939193612402565b6107086120f1565b845b81811061071957856001805580f35b610724818387611c1b565b358652600b6020818152848820546001600160a01b0390811692909183610752575b5050505060010161070a565b61075b84612114565b610764846121d1565b61076f85878b611c1b565b358a52818152898961078f65ffffffffffff8a84205460a01c1642611c54565b93868352600d948585526107aa60018c862001918254611bf8565b90556107b7888a84611c1b565b3583526107d5888a6011948588528d872060ff198154169055611c1b565b358352835281898120558582526108008b6107f9898b8d600c97888a522093611c1b565b3590612368565b60079081549081156108dd5750600019019055848b528152868a20548a93929190156108cd575b50507f00000000000000000000000000000000000000000000000000000000000000001661085684868a611c1b565b3590803b156102f7578651632142170760e11b8152308982019081526001600160a01b0390951660208601526040850192909252909283919082908490829060600103925af180156108c35790600192916108b4575b819281610746565b6108bd90611aa7565b386108ac565b84513d89823e3d90fd5b5281600287822001553880610827565b634e487b7160e01b8e528b5260248dfd5b50503461026c578160031936011261026c576020906002549051908152f35b919050346102f75761091e36611a3f565b9190926109296120f1565b610934831515611bc4565b61093d33612114565b3385526020600a81526109538387205433612326565b855b848110610a62575061096984600754611c54565b600755338652600c81528286205415610a50575b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169085805b8581106109e65750835133907f20748b935fd9f21155c2e98cb2bd5df6fe86f21b193cebaae8d9ad7db0ba541690806103e6898b83611c2b565b6109f1818789611c1b565b35843b156102f7578551632142170760e11b815230858201908152336020820152604081019290925290839082908190606001038183895af1801561045a579060019291610a41575b50016109ac565b610a4a90611aa7565b38610a3a565b600d905284600283822001553861097d565b610a6d818688611c1b565b358752600b808352848820855190610a8482611ad1565b5490600160a01b6001900382169182825265ffffffffffff928887840193858460a01c168552019160d01c82523314610abc90611d2b565b610ac7858a8c611c1b565b358b5260118652878b205460ff1615610adf90611f90565b8280835116915116610af091611bf8565b421015610afc90611fcd565b51610b08911642611c54565b338952600d845285892060010190815490610b2291611bf8565b9055610b2f828789611c1b565b35885282528684812055338752600c8252838720610b4e828789611c1b565b35610b5891612368565b600101610955565b9050346102f75760203660031901126102f7578160209360ff923581526011855220541690519015158152f35b919050346102f75760203660031901126102f757813591610bac612402565b670de0b6b3a76400008310610c9857683635c9adc5dea000008311610c6b57507f970e0af109ddf8f9d45761dc1a3b304886e4a1f579e45d4bf713e1493afd221190610bf66122f5565b60065480421180610c60575b610c24575b50600555426006556002548151908152836020820152a160025580f35b62015180610c4e610c45610c5793610c3f6007549142611c54565b90611c61565b60025490611c61565b04600854611bf8565b60085538610c07565b506007541515610c02565b6020606492519162461bcd60e51b835282015260086024820152670a8dede40d0d2ced60c31b6044820152fd5b6020606492519162461bcd60e51b8352820152600d60248201526c42656c6f77206d696e696d756d60981b6044820152fd5b50503461026c578160031936011261026c57905490516001600160a01b039091168152602090f35b919050346102f75760203660031901126102f7578135918215610d97575080516323b872dd60e01b602082015233602482015230604482015260648082018490528152610d6a90610d44608482611b09565b7f0000000000000000000000000000000000000000000000000000000000000000612450565b519081527f543ba50a5eec5e6178218e364b1d0f396157b3c8fa278522c2cb7fd99407d47460203392a280f35b606491519062461bcd60e51b82526020818301526024820152635a65726f60e01b6044820152fd5b50503461026c57602036600319011261026c5760209181906001600160a01b03610de7611a91565b1681526009845220549051908152f35b50503461026c57602036600319011261026c5760609181906001600160a01b03610e1f611a91565b168152600d60205220805491600260018301549201549181519384526020840152820152f35b50503461026c57602036600319011261026c5760209181906001600160a01b03610e6d611a91565b168152600a845220549051908152f35b50503461026c578160031936011261026c57602090610682611efe565b9050346102f75760203660031901126102f757803591610eb8612402565b62278d008311610ef6577f215ad44af04f93b13eb61772a293ca5bf60435095285cf459417ae102dde988b9082548151908152846020820152a15580f35b906020606492519162461bcd60e51b8352820152600b60248201526a4d6178203330206461797360a81b6044820152fd5b9050346102f757816003193601126102f757610f4883916024359035611dc1565b9294918251946080860160808752875180915260a08701976020809101925b828110610fac5750508680610fa888610f9a8989610f8d8f8b88820360208a0152611b2b565b9186830390870152611b2b565b908382036060850152611b2b565b0390f35b83516001600160a01b03168a529881019892810192600101610f67565b83346105b857806003193601126105b857610fe2612402565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50503461026c57602090816003193601126102f7576001600160a01b03611048611a91565b168352600c8252808320815190819485928583549182815201928252858220915b86828210611092578590610fa88861108384890385611b09565b51928284938452830190611b2b565b835485528895509093019260019283019201611069565b919050346102f7576110ba36611a3f565b9190926110c56120f1565b6110d0831515611bc4565b6110d933612114565b338552600c602090600c82528387205480861060001461130157338852600a835261110786868a2054611c61565b81156112ee5790611119910433612326565b611122336121d1565b865b85811061123257505061113984600754611c54565b600755338652600c81528286205415611220575b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169085805b8581106111b65750835133907f20748b935fd9f21155c2e98cb2bd5df6fe86f21b193cebaae8d9ad7db0ba541690806103e6898b83611c2b565b6111c1818789611c1b565b35843b156102f7578551632142170760e11b815230858201908152336020820152604081019290925290839082908190606001038183895af1801561045a579060019291611211575b500161117c565b61121a90611aa7565b3861120a565b600d905284600283822001553861114d565b80611240600192888a611c1b565b358952600b80855261125d33848060a01b03898d20541614611d2b565b61126882898b611c1b565b358a5260118552868a20805460ff1916905561128582898b611c1b565b358a528085526112a365ffffffffffff888c205460a01c1642611c54565b338b52600d86526112ba84898d2001918254611bf8565b90556112c782898b611c1b565b358a52845288868120553389528284526112e8868a206107f9838a8c611c1b565b01611124565b634e487b7160e01b895260128552602489fd5b50600a82526113138488205433612326565b611122565b50503461026c578160031936011261026c57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50503461026c578160031936011261026c5760105490516001600160a01b039091168152602090f35b8284346105b85760203660031901126105b8575061068260209235611cb5565b9050346102f757826003193601126102f75760209250549051908152f35b9050346102f75760203660031901126102f757358252600b6020908152918190205490516001600160a01b039091168152f35b9050346102f75760203660031901126102f75780359060018060a01b0361142281601054163314611c74565b828552600b60205283852054161561144c5750825260116020528120805460ff1916600117905580f35b606490602084519162461bcd60e51b8352820152600a602482015269139bdd081cdd185ad95960b21b6044820152fd5b83346105b857806003193601126105b8576114956120f1565b61149e33612114565b6114a7336121d1565b6001805580f35b50503461026c57602036600319011261026c5760209161068290826001600160a01b036114d9611a91565b1691828152600c865261150582822054610c3f6114f46122f5565b86855260098a528585205490611c54565b928152600a86522054611bf8565b50503461026c578160031936011261026c576020906007549051908152f35b50503461026c578160031936011261026c576020906006549051908152f35b50503461026c578160031936011261026c5760209051670de0b6b3a76400008152f35b50503461026c578160031936011261026c57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50503461026c578160031936011261026c57602090600e549051908152f35b8284346105b85760803660031901126105b8576115f2611a91565b506024356001600160a01b038116036105b8576064359267ffffffffffffffff908185116102f757366023860112156102f757848101359182116116755750825193611648601f8301601f191660200186611b09565b81855236602483830101116102f757906020948160248794018483013701015251630a85bd0160e11b8152f35b634e487b7160e01b835260419052602482fd5b919050346102f75761169936611a3f565b9190926116a46120f1565b6116af831515611bc4565b6116b761200e565b15611a0957338552600c6020600c815260146116d686868a2054611bf8565b116119d7576116e433612114565b6116ed336121d1565b338752600f8152838720805460ff811615611979575b5050338752600c81528387205415611968575b65ffffffffffff916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811692904285168a5b89811061179a578b8b7f134b166c6094cc1ccbf1e3353ce5c3cd9fd29869051bdb999895854d77cc5ef66103e68d8d61178b82600754611bf8565b60075551918291339583611c2b565b6001808201808311611955575b8b81106118ef57508c6117bb838d8f611c1b565b35883b1561026c578b516323b872dd60e01b815233818d019081523060208201526040810192909252908290829081906060010381838d5af180156118e5578d8f94938e90868f8f600b8e918d9361187c9a8e9a6118d6575b5054169161183d898989519761182989611ad1565b3389528489019788528a8901968752611c1b565b358652528c8585209351169165ffffffffffff60a01b905160a01b169065ffffffffffff60d01b905160d01b1691171790553381528b8b522094611c1b565b3591805491600160401b8310156118c2578260019594926118a3926118bc95018155611bac565b90919082549060031b91821b91600019901b1916179055565b01611750565b50634e487b7160e01b8f5260418b5260248ffd5b6118df90611aa7565b38611814565b8c513d84823e3d90fd5b611903838e9b9f9c99939d809b959f611c1b565b3561190f828b8d611c1b565b3514611926578b019c989b91979a9096999c6117a7565b875162461bcd60e51b8152808f0187905260096024820152684475706c696361746560b81b6044820152606490fd5b634e487b7160e01b8e5260118a5260248efd5b600d81524260028589200155611716565b60ff19166001179055600e54600160401b8110156119c4578060016119a19201600e55611b5f565b81546001600160a01b0360039290921b91821b19163390911b1790553880611703565b634e487b7160e01b885260418452602488fd5b9050606492519162461bcd60e51b8352820152600d60248201526c13585e080c8c081cdd185ad959609a1b6044820152fd5b6020606492519162461bcd60e51b8352820152601160248201527052657761726420706f6f6c20656d70747960781b6044820152fd5b906020600319830112611a8c5760043567ffffffffffffffff92838211611a8c5780602383011215611a8c578160040135938411611a8c5760248460051b83010111611a8c576024019190565b600080fd5b600435906001600160a01b0382168203611a8c57565b67ffffffffffffffff8111611abb57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff821117611abb57604052565b6020810190811067ffffffffffffffff821117611abb57604052565b90601f8019910116810190811067ffffffffffffffff821117611abb57604052565b90815180825260208080930193019160005b828110611b4b575050505090565b835185529381019392810192600101611b3d565b600e54811015611b9657600e6000527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0190600090565b634e487b7160e01b600052603260045260246000fd5b8054821015611b965760005260206000200190600090565b15611bcb57565b60405162461bcd60e51b8152602060048201526005602482015264456d70747960d81b6044820152606490fd5b91908201809211611c0557565b634e487b7160e01b600052601160045260246000fd5b9190811015611b965760051b0190565b602080825281018390526001600160fb1b038311611a8c5760409260051b809284830137010190565b91908203918211611c0557565b81810292918115918404141715611c0557565b15611c7b57565b60405162461bcd60e51b815260206004820152601260248201527113db9b1e481c9858d94818dbdb9d1c9858dd60721b6044820152606490fd5b600052600b60205260406000206040805191611cd083611ad1565b549160018060a01b0383169081815265ffffffffffff8460a01c169384602083015260d01c928391015215611d2457611d0891611bf8565b80421015611d1e57611d1b904290611c54565b90565b50600090565b5050600090565b15611d3257565b60405162461bcd60e51b81526020600482015260096024820152684e6f7420796f75727360b81b6044820152606490fd5b67ffffffffffffffff8111611abb5760051b60200190565b90611d8582611d63565b611d926040519182611b09565b8281528092611da3601f1991611d63565b0190602036910137565b8051821015611b965760209160051b010190565b9190600e549081841015611eb057611ded91611dde859283611bf8565b90808211611ea8575b50611c54565b611df681611d7b565b92611e0082611d7b565b92611e0a83611d7b565b92611e1481611d7b565b9260005b828110611e2457505050565b806002611e3b611e3660019486611bf8565b611b5f565b848060a01b0391549060031b1c1680611e54848d611dad565b5280600052600d60208181526040928c611e7387866000205492611dad565b52806000528282528b611e8d878987600020015492611dad565b52600052526000200154611ea18288611dad565b5201611e18565b905038611de7565b50509050604051611ec081611aed565b600080825260405192611ed284611aed565b81845260405192611ee284611aed565b82845260405192611ef284611aed565b80845236813793929190565b6040516370a0823160e01b81523060048201526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115611f8457600091611f55575090565b90506020813d602011611f7c575b81611f7060209383611b09565b81010312611a8c575190565b3d9150611f63565b6040513d6000823e3d90fd5b15611f9757565b60405162461bcd60e51b815260206004820152600e60248201526d496e20616374697665207261636560901b6044820152606490fd5b15611fd457565b60405162461bcd60e51b81526020600482015260126024820152714c6f636b20706572696f642061637469766560701b6044820152606490fd5b6040516370a0823160e01b81523060048201526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115611f84576000916120bf575b506120826000600654804211806120b4575b612093575b50600854611bf8565b81811015611d2457611d1b91611c54565b620151809150610c456120ad91610c3f6007549142611c54565b0438612079565b506007541515612074565b90506020813d6020116120e9575b816120da60209383611b09565b81010312611a8c575138612062565b3d91506120cd565b600260015414612102576002600155565b604051633ee5aeb560e01b8152600490fd5b61211c6122f5565b90600654804211806121c6575b6121a2575b506005829055426006556001600160a01b03168061214a575050565b604090600090808252600c602052828220548061216e575b50815260096020522055565b612184906009602052610c3f8585205487611c54565b818352600a60205261219a848420918254611bf8565b905538612162565b62015180610c4e610c456121bd93610c3f6007549142611c54565b6008553861212e565b506007541515612129565b6001600160a01b03166000818152600a6020526040812080549081156122ef578290556121fd8161242e565b612205611efe565b90818111156122e75750905b8161221b57505050565b60405163a9059cbb60e01b6020820152836024820152826044820152604481526080810181811067ffffffffffffffff8211176122d3576020926122a67fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a959360409384527f0000000000000000000000000000000000000000000000000000000000000000612450565b6122b283600354611bf8565b600355858152600d8452206122c8828254611bf8565b9055604051908152a2565b634e487b7160e01b83526041600452602483fd5b905090612211565b50505050565b6006548042111561231f57611d1b9062015180612318610c456005549342611c54565b0490611bf8565b5060055490565b6001600160a01b03166000908152600a60205260409020805461235e929190808311612360575b8261235791611c54565b905561242e565b565b91508161234d565b9060005b8254808210156122ef5782906123828386611bac565b929054600393841b1c1461239a57505060010161236c565b9093925060001991828201918211611c05576118a36123bc6123c99386611bac565b905490871b1c9185611bac565b815480156123ec578101926123de8484611bac565b81939154921b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b6000546001600160a01b0316330361241657565b60405163118cdaa760e01b8152336004820152602490fd5b600854908181106124425750506000600855565b61244b91611c54565b600855565b906000602091828151910182855af115611f84576000513d6124a357506001600160a01b0381163b155b6124815750565b604051635274afe760e01b81526001600160a01b039091166004820152602490fd5b6001141561247a56fea2646970667358221220f247ec2024cac7c090964d566bbbf9f38daaae97146897a2d5185c9be967c34664736f6c63430008180033000000000000000000000000d505b51836464398b7eb5c5f07a4b90f1d0aad46000000000000000000000000321c08eb09087c77b24322248b3982da7f7e60ad

Deployed ByteCode

0x6040608081526004908136101561001557600080fd5b600091823560e01c9081630fbf0a9314611688578163150b7a02146115d7578163186ca969146115b857816320d36b42146115745781632671e351146115515781632bd1755a146115325781632c9dcbb41461151357816331d7a262146114ae578163372500ab1461147c5781633aec9890146113f65781633dbd46bd146113c35781633fd8b02f146113a5578163447749701461138557816351c2ee8a1461135c578163528fdab31461131857816357dece76146110a957816363c28db114611023578163715018a614610fc957816373af16fc14610f27578163779972da14610e9a5781637a5c08ae14610e7d5781637fb5ad3814610e455781638a65d87414610df75781638b87634714610dbf5781638bdf67f214610cf25781638da5cb5b14610cca57816390c35a9314610b8d5781639f17ec5314610b60578163ab4cf35d1461090d578163af8f42b8146108ee578163bf0e5b95146106e5578163c18ac52b146106a8578163c39722e614610689578163c96e616c14610665578163d5a44f861461061a578163d85fb84c146105f6578163db15e2d6146105da578163df136d65146105bb578163e00df13514610577578163e449f3411461031a578163efca2eed146102fb578163f2fde38b14610270575063fc680d8c146101fc57600080fd5b3461026c57602036600319011261026c57610215611a91565b9061021e612402565b7f9c3833a4dcf7cda54ce74bdfa6f3eab334d51f154b74b5f3c7271e85d864f53a6010549160018060a01b0381519481851686521693846020820152a16001600160a01b0319161760105580f35b5080fd5b9050346102f75760203660031901126102f75761028b611a91565b90610294612402565b6001600160a01b039182169283156102e157505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b51631e4fbdf760e01b8152908101849052602490fd5b8280fd5b50503461026c578160031936011261026c576020906003549051908152f35b919050346102f75761032b36611a3f565b9190926103366120f1565b610341831515611bc4565b61034a33612114565b610353336121d1565b845b838110610476575061036983600754611c54565b600755338552600c6020528185205415610464575b7f000000000000000000000000d505b51836464398b7eb5c5f07a4b90f1d0aad466001600160a01b03169085805b8581106103f05750835133907f20748b935fd9f21155c2e98cb2bd5df6fe86f21b193cebaae8d9ad7db0ba541690806103e6898b83611c2b565b0390a26001805580f35b6103fb818789611c1b565b35843b156102f7578551632142170760e11b815230858201908152336020820152604081019290925290839082908190606001038183895af1801561045a57906001929161044b575b50016103ac565b61045490611aa7565b38610444565b86513d85823e3d90fd5b600d602052846002838220015561037e565b610481818587611c1b565b358652600b60209080825284882085519061049b82611ad1565b5490600160a01b6001900382169182825265ffffffffffff928886840193858460a01c168552019160d01c825233146104d390611d2b565b6104de868a8c611c1b565b358b5260118552878b205460ff16156104f690611f90565b828083511691511661050791611bf8565b42101561051390611fcd565b5161051f911642611c54565b338952600d83528589206001019081549061053991611bf8565b9055610546838789611c1b565b35885281528684812055338752600c9052828620610565828688611c1b565b3561056f91612368565b600101610355565b9050346102f75760203660031901126102f7573591600e548310156105b857506105a2602092611b5f565b905491519160018060a01b039160031b1c168152f35b80fd5b50503461026c578160031936011261026c576020906005549051908152f35b50503461026c578160031936011261026c576020905160148152f35b50503461026c578160031936011261026c5760209051683635c9adc5dea000008152f35b9050346102f75760203660031901126102f7576060928291358152600b60205220549080519160018060a01b038116835265ffffffffffff8160a01c16602084015260d01c90820152f35b50503461026c578160031936011261026c5760209061068261200e565b9051908152f35b50503461026c578160031936011261026c576020906008549051908152f35b9050346102f75760203660031901126102f7576106d060018060a01b03601054163314611c74565b35825260116020528120805460ff1916905580f35b9050346102f7576106f536611a3f565b610700939193612402565b6107086120f1565b845b81811061071957856001805580f35b610724818387611c1b565b358652600b6020818152848820546001600160a01b0390811692909183610752575b5050505060010161070a565b61075b84612114565b610764846121d1565b61076f85878b611c1b565b358a52818152898961078f65ffffffffffff8a84205460a01c1642611c54565b93868352600d948585526107aa60018c862001918254611bf8565b90556107b7888a84611c1b565b3583526107d5888a6011948588528d872060ff198154169055611c1b565b358352835281898120558582526108008b6107f9898b8d600c97888a522093611c1b565b3590612368565b60079081549081156108dd5750600019019055848b528152868a20548a93929190156108cd575b50507f000000000000000000000000d505b51836464398b7eb5c5f07a4b90f1d0aad461661085684868a611c1b565b3590803b156102f7578651632142170760e11b8152308982019081526001600160a01b0390951660208601526040850192909252909283919082908490829060600103925af180156108c35790600192916108b4575b819281610746565b6108bd90611aa7565b386108ac565b84513d89823e3d90fd5b5281600287822001553880610827565b634e487b7160e01b8e528b5260248dfd5b50503461026c578160031936011261026c576020906002549051908152f35b919050346102f75761091e36611a3f565b9190926109296120f1565b610934831515611bc4565b61093d33612114565b3385526020600a81526109538387205433612326565b855b848110610a62575061096984600754611c54565b600755338652600c81528286205415610a50575b507f000000000000000000000000d505b51836464398b7eb5c5f07a4b90f1d0aad466001600160a01b03169085805b8581106109e65750835133907f20748b935fd9f21155c2e98cb2bd5df6fe86f21b193cebaae8d9ad7db0ba541690806103e6898b83611c2b565b6109f1818789611c1b565b35843b156102f7578551632142170760e11b815230858201908152336020820152604081019290925290839082908190606001038183895af1801561045a579060019291610a41575b50016109ac565b610a4a90611aa7565b38610a3a565b600d905284600283822001553861097d565b610a6d818688611c1b565b358752600b808352848820855190610a8482611ad1565b5490600160a01b6001900382169182825265ffffffffffff928887840193858460a01c168552019160d01c82523314610abc90611d2b565b610ac7858a8c611c1b565b358b5260118652878b205460ff1615610adf90611f90565b8280835116915116610af091611bf8565b421015610afc90611fcd565b51610b08911642611c54565b338952600d845285892060010190815490610b2291611bf8565b9055610b2f828789611c1b565b35885282528684812055338752600c8252838720610b4e828789611c1b565b35610b5891612368565b600101610955565b9050346102f75760203660031901126102f7578160209360ff923581526011855220541690519015158152f35b919050346102f75760203660031901126102f757813591610bac612402565b670de0b6b3a76400008310610c9857683635c9adc5dea000008311610c6b57507f970e0af109ddf8f9d45761dc1a3b304886e4a1f579e45d4bf713e1493afd221190610bf66122f5565b60065480421180610c60575b610c24575b50600555426006556002548151908152836020820152a160025580f35b62015180610c4e610c45610c5793610c3f6007549142611c54565b90611c61565b60025490611c61565b04600854611bf8565b60085538610c07565b506007541515610c02565b6020606492519162461bcd60e51b835282015260086024820152670a8dede40d0d2ced60c31b6044820152fd5b6020606492519162461bcd60e51b8352820152600d60248201526c42656c6f77206d696e696d756d60981b6044820152fd5b50503461026c578160031936011261026c57905490516001600160a01b039091168152602090f35b919050346102f75760203660031901126102f7578135918215610d97575080516323b872dd60e01b602082015233602482015230604482015260648082018490528152610d6a90610d44608482611b09565b7f000000000000000000000000321c08eb09087c77b24322248b3982da7f7e60ad612450565b519081527f543ba50a5eec5e6178218e364b1d0f396157b3c8fa278522c2cb7fd99407d47460203392a280f35b606491519062461bcd60e51b82526020818301526024820152635a65726f60e01b6044820152fd5b50503461026c57602036600319011261026c5760209181906001600160a01b03610de7611a91565b1681526009845220549051908152f35b50503461026c57602036600319011261026c5760609181906001600160a01b03610e1f611a91565b168152600d60205220805491600260018301549201549181519384526020840152820152f35b50503461026c57602036600319011261026c5760209181906001600160a01b03610e6d611a91565b168152600a845220549051908152f35b50503461026c578160031936011261026c57602090610682611efe565b9050346102f75760203660031901126102f757803591610eb8612402565b62278d008311610ef6577f215ad44af04f93b13eb61772a293ca5bf60435095285cf459417ae102dde988b9082548151908152846020820152a15580f35b906020606492519162461bcd60e51b8352820152600b60248201526a4d6178203330206461797360a81b6044820152fd5b9050346102f757816003193601126102f757610f4883916024359035611dc1565b9294918251946080860160808752875180915260a08701976020809101925b828110610fac5750508680610fa888610f9a8989610f8d8f8b88820360208a0152611b2b565b9186830390870152611b2b565b908382036060850152611b2b565b0390f35b83516001600160a01b03168a529881019892810192600101610f67565b83346105b857806003193601126105b857610fe2612402565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50503461026c57602090816003193601126102f7576001600160a01b03611048611a91565b168352600c8252808320815190819485928583549182815201928252858220915b86828210611092578590610fa88861108384890385611b09565b51928284938452830190611b2b565b835485528895509093019260019283019201611069565b919050346102f7576110ba36611a3f565b9190926110c56120f1565b6110d0831515611bc4565b6110d933612114565b338552600c602090600c82528387205480861060001461130157338852600a835261110786868a2054611c61565b81156112ee5790611119910433612326565b611122336121d1565b865b85811061123257505061113984600754611c54565b600755338652600c81528286205415611220575b507f000000000000000000000000d505b51836464398b7eb5c5f07a4b90f1d0aad466001600160a01b03169085805b8581106111b65750835133907f20748b935fd9f21155c2e98cb2bd5df6fe86f21b193cebaae8d9ad7db0ba541690806103e6898b83611c2b565b6111c1818789611c1b565b35843b156102f7578551632142170760e11b815230858201908152336020820152604081019290925290839082908190606001038183895af1801561045a579060019291611211575b500161117c565b61121a90611aa7565b3861120a565b600d905284600283822001553861114d565b80611240600192888a611c1b565b358952600b80855261125d33848060a01b03898d20541614611d2b565b61126882898b611c1b565b358a5260118552868a20805460ff1916905561128582898b611c1b565b358a528085526112a365ffffffffffff888c205460a01c1642611c54565b338b52600d86526112ba84898d2001918254611bf8565b90556112c782898b611c1b565b358a52845288868120553389528284526112e8868a206107f9838a8c611c1b565b01611124565b634e487b7160e01b895260128552602489fd5b50600a82526113138488205433612326565b611122565b50503461026c578160031936011261026c57517f000000000000000000000000321c08eb09087c77b24322248b3982da7f7e60ad6001600160a01b03168152602090f35b50503461026c578160031936011261026c5760105490516001600160a01b039091168152602090f35b8284346105b85760203660031901126105b8575061068260209235611cb5565b9050346102f757826003193601126102f75760209250549051908152f35b9050346102f75760203660031901126102f757358252600b6020908152918190205490516001600160a01b039091168152f35b9050346102f75760203660031901126102f75780359060018060a01b0361142281601054163314611c74565b828552600b60205283852054161561144c5750825260116020528120805460ff1916600117905580f35b606490602084519162461bcd60e51b8352820152600a602482015269139bdd081cdd185ad95960b21b6044820152fd5b83346105b857806003193601126105b8576114956120f1565b61149e33612114565b6114a7336121d1565b6001805580f35b50503461026c57602036600319011261026c5760209161068290826001600160a01b036114d9611a91565b1691828152600c865261150582822054610c3f6114f46122f5565b86855260098a528585205490611c54565b928152600a86522054611bf8565b50503461026c578160031936011261026c576020906007549051908152f35b50503461026c578160031936011261026c576020906006549051908152f35b50503461026c578160031936011261026c5760209051670de0b6b3a76400008152f35b50503461026c578160031936011261026c57517f000000000000000000000000d505b51836464398b7eb5c5f07a4b90f1d0aad466001600160a01b03168152602090f35b50503461026c578160031936011261026c57602090600e549051908152f35b8284346105b85760803660031901126105b8576115f2611a91565b506024356001600160a01b038116036105b8576064359267ffffffffffffffff908185116102f757366023860112156102f757848101359182116116755750825193611648601f8301601f191660200186611b09565b81855236602483830101116102f757906020948160248794018483013701015251630a85bd0160e11b8152f35b634e487b7160e01b835260419052602482fd5b919050346102f75761169936611a3f565b9190926116a46120f1565b6116af831515611bc4565b6116b761200e565b15611a0957338552600c6020600c815260146116d686868a2054611bf8565b116119d7576116e433612114565b6116ed336121d1565b338752600f8152838720805460ff811615611979575b5050338752600c81528387205415611968575b65ffffffffffff916001600160a01b037f000000000000000000000000d505b51836464398b7eb5c5f07a4b90f1d0aad46811692904285168a5b89811061179a578b8b7f134b166c6094cc1ccbf1e3353ce5c3cd9fd29869051bdb999895854d77cc5ef66103e68d8d61178b82600754611bf8565b60075551918291339583611c2b565b6001808201808311611955575b8b81106118ef57508c6117bb838d8f611c1b565b35883b1561026c578b516323b872dd60e01b815233818d019081523060208201526040810192909252908290829081906060010381838d5af180156118e5578d8f94938e90868f8f600b8e918d9361187c9a8e9a6118d6575b5054169161183d898989519761182989611ad1565b3389528489019788528a8901968752611c1b565b358652528c8585209351169165ffffffffffff60a01b905160a01b169065ffffffffffff60d01b905160d01b1691171790553381528b8b522094611c1b565b3591805491600160401b8310156118c2578260019594926118a3926118bc95018155611bac565b90919082549060031b91821b91600019901b1916179055565b01611750565b50634e487b7160e01b8f5260418b5260248ffd5b6118df90611aa7565b38611814565b8c513d84823e3d90fd5b611903838e9b9f9c99939d809b959f611c1b565b3561190f828b8d611c1b565b3514611926578b019c989b91979a9096999c6117a7565b875162461bcd60e51b8152808f0187905260096024820152684475706c696361746560b81b6044820152606490fd5b634e487b7160e01b8e5260118a5260248efd5b600d81524260028589200155611716565b60ff19166001179055600e54600160401b8110156119c4578060016119a19201600e55611b5f565b81546001600160a01b0360039290921b91821b19163390911b1790553880611703565b634e487b7160e01b885260418452602488fd5b9050606492519162461bcd60e51b8352820152600d60248201526c13585e080c8c081cdd185ad959609a1b6044820152fd5b6020606492519162461bcd60e51b8352820152601160248201527052657761726420706f6f6c20656d70747960781b6044820152fd5b906020600319830112611a8c5760043567ffffffffffffffff92838211611a8c5780602383011215611a8c578160040135938411611a8c5760248460051b83010111611a8c576024019190565b600080fd5b600435906001600160a01b0382168203611a8c57565b67ffffffffffffffff8111611abb57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff821117611abb57604052565b6020810190811067ffffffffffffffff821117611abb57604052565b90601f8019910116810190811067ffffffffffffffff821117611abb57604052565b90815180825260208080930193019160005b828110611b4b575050505090565b835185529381019392810192600101611b3d565b600e54811015611b9657600e6000527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0190600090565b634e487b7160e01b600052603260045260246000fd5b8054821015611b965760005260206000200190600090565b15611bcb57565b60405162461bcd60e51b8152602060048201526005602482015264456d70747960d81b6044820152606490fd5b91908201809211611c0557565b634e487b7160e01b600052601160045260246000fd5b9190811015611b965760051b0190565b602080825281018390526001600160fb1b038311611a8c5760409260051b809284830137010190565b91908203918211611c0557565b81810292918115918404141715611c0557565b15611c7b57565b60405162461bcd60e51b815260206004820152601260248201527113db9b1e481c9858d94818dbdb9d1c9858dd60721b6044820152606490fd5b600052600b60205260406000206040805191611cd083611ad1565b549160018060a01b0383169081815265ffffffffffff8460a01c169384602083015260d01c928391015215611d2457611d0891611bf8565b80421015611d1e57611d1b904290611c54565b90565b50600090565b5050600090565b15611d3257565b60405162461bcd60e51b81526020600482015260096024820152684e6f7420796f75727360b81b6044820152606490fd5b67ffffffffffffffff8111611abb5760051b60200190565b90611d8582611d63565b611d926040519182611b09565b8281528092611da3601f1991611d63565b0190602036910137565b8051821015611b965760209160051b010190565b9190600e549081841015611eb057611ded91611dde859283611bf8565b90808211611ea8575b50611c54565b611df681611d7b565b92611e0082611d7b565b92611e0a83611d7b565b92611e1481611d7b565b9260005b828110611e2457505050565b806002611e3b611e3660019486611bf8565b611b5f565b848060a01b0391549060031b1c1680611e54848d611dad565b5280600052600d60208181526040928c611e7387866000205492611dad565b52806000528282528b611e8d878987600020015492611dad565b52600052526000200154611ea18288611dad565b5201611e18565b905038611de7565b50509050604051611ec081611aed565b600080825260405192611ed284611aed565b81845260405192611ee284611aed565b82845260405192611ef284611aed565b80845236813793929190565b6040516370a0823160e01b81523060048201526020816024817f000000000000000000000000321c08eb09087c77b24322248b3982da7f7e60ad6001600160a01b03165afa908115611f8457600091611f55575090565b90506020813d602011611f7c575b81611f7060209383611b09565b81010312611a8c575190565b3d9150611f63565b6040513d6000823e3d90fd5b15611f9757565b60405162461bcd60e51b815260206004820152600e60248201526d496e20616374697665207261636560901b6044820152606490fd5b15611fd457565b60405162461bcd60e51b81526020600482015260126024820152714c6f636b20706572696f642061637469766560701b6044820152606490fd5b6040516370a0823160e01b81523060048201526020816024817f000000000000000000000000321c08eb09087c77b24322248b3982da7f7e60ad6001600160a01b03165afa908115611f84576000916120bf575b506120826000600654804211806120b4575b612093575b50600854611bf8565b81811015611d2457611d1b91611c54565b620151809150610c456120ad91610c3f6007549142611c54565b0438612079565b506007541515612074565b90506020813d6020116120e9575b816120da60209383611b09565b81010312611a8c575138612062565b3d91506120cd565b600260015414612102576002600155565b604051633ee5aeb560e01b8152600490fd5b61211c6122f5565b90600654804211806121c6575b6121a2575b506005829055426006556001600160a01b03168061214a575050565b604090600090808252600c602052828220548061216e575b50815260096020522055565b612184906009602052610c3f8585205487611c54565b818352600a60205261219a848420918254611bf8565b905538612162565b62015180610c4e610c456121bd93610c3f6007549142611c54565b6008553861212e565b506007541515612129565b6001600160a01b03166000818152600a6020526040812080549081156122ef578290556121fd8161242e565b612205611efe565b90818111156122e75750905b8161221b57505050565b60405163a9059cbb60e01b6020820152836024820152826044820152604481526080810181811067ffffffffffffffff8211176122d3576020926122a67fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a959360409384527f000000000000000000000000321c08eb09087c77b24322248b3982da7f7e60ad612450565b6122b283600354611bf8565b600355858152600d8452206122c8828254611bf8565b9055604051908152a2565b634e487b7160e01b83526041600452602483fd5b905090612211565b50505050565b6006548042111561231f57611d1b9062015180612318610c456005549342611c54565b0490611bf8565b5060055490565b6001600160a01b03166000908152600a60205260409020805461235e929190808311612360575b8261235791611c54565b905561242e565b565b91508161234d565b9060005b8254808210156122ef5782906123828386611bac565b929054600393841b1c1461239a57505060010161236c565b9093925060001991828201918211611c05576118a36123bc6123c99386611bac565b905490871b1c9185611bac565b815480156123ec578101926123de8484611bac565b81939154921b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b6000546001600160a01b0316330361241657565b60405163118cdaa760e01b8152336004820152602490fd5b600854908181106124425750506000600855565b61244b91611c54565b600855565b906000602091828151910182855af115611f84576000513d6124a357506001600160a01b0381163b155b6124815750565b604051635274afe760e01b81526001600160a01b039091166004820152602490fd5b6001141561247a56fea2646970667358221220f247ec2024cac7c090964d566bbbf9f38daaae97146897a2d5185c9be967c34664736f6c63430008180033