ETH Price: $2,469.05 (+0.82%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040164242802023-01-17 4:59:23658 days ago1673931563IN
 Create: BitiocracyStakingContract
0 ETH0.0338531815.13412852

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BitiocracyStakingContract

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : StakingContract.sol
//SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {ERC721HolderUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol";
import {IStakingPass} from "./IStakingPass.sol";

contract BitiocracyStakingContract is OwnableUpgradeable, ERC721HolderUpgradeable {

    mapping (address => address) public nftToStakingPass;

    mapping (address => mapping ( uint256 => uint256 ) ) private stakingStarted;
    mapping (address => mapping ( uint256 => uint256 ) ) private stakingTotal;
    mapping (address => mapping ( uint256 => address ) ) private lastStakedWallet;

    // Variables to mint into staking. Impossible to lock user staked tokens
    mapping (address => mapping ( uint256 => bool ) ) private lockedToken;    
    mapping (address => uint256) public totalLockedTokens;
    mapping (address => uint256) public availableToUnlock;
    mapping (address => uint256) public maxUnlockPerTransaction;

    // Variables for external contract managers
    mapping (address => bool ) private managerStatus;   
    event AddManager(address manager); 
    event RemoveManager(address manager);
    event StakeTokens(address collectionAddress, uint256 numberStaked);
    event StakeManual(address collectionAddress, uint256 numberStaked);
    event StakeManualLocked(address collectionAddress, uint256 numberStaked);
    event UnstakeTokens(address collectionAddress, uint256 numberUnstaked);
    event UnlockTokensAdmin(address collectionAddress, uint256 numberUnlocked);
    event UnlockTokens(address collectionAddress, uint256 numberUnlocked);

    function initialize() public initializer {
        __Ownable_init();
        __ERC721Holder_init();
    }


    // Managers allow external mint contracts to stake tokens directly
    modifier onlyOwnerOrManager() {
        require(
            managerStatus[msg.sender] == true || owner() == msg.sender,
            "caller is neither owner nor manager"
        );
        _;
    }

    function addManager(address newManager) external onlyOwner {
        managerStatus[newManager] = true;
        emit AddManager(newManager);
    }

    function removeManager(address newManager) external onlyOwner {
        managerStatus[newManager] = false;
        emit RemoveManager(newManager);
    }

    function isManager(address checkAddress)
        external
        view
        returns (
            bool manager
        )
    {
        if (managerStatus[checkAddress] == true) {
            manager = true;
        } else {
            manager = false;
        }
        
    }


    function stakeTokens(address collectionAddress, uint256[] memory tokens) external {
        uint256[] memory localTokens = tokens;
        uint256 arrayLength = localTokens.length;

        for (uint256 i =0; i<arrayLength;) {
            require(IStakingPass(collectionAddress).ownerOf(localTokens[i]) == msg.sender, "You do not own this Token");
            IStakingPass(collectionAddress).safeTransferFrom(msg.sender, address(this), localTokens[i]);
            if(IStakingPass(nftToStakingPass[collectionAddress]).checkExistence(localTokens[i])) {
                IStakingPass(nftToStakingPass[collectionAddress]).transferFrom( address(this), msg.sender, localTokens[i]);
            } else {
                IStakingPass(nftToStakingPass[collectionAddress]).mint(msg.sender, localTokens[i]);
            }

            // Add time track
            if (stakingTotal[collectionAddress][localTokens[i]] > 0){
                if (lastStakedWallet[collectionAddress][localTokens[i]] != msg.sender) {
                    stakingTotal[collectionAddress][localTokens[i]] = 0;    
                }
            }
            stakingStarted[collectionAddress][localTokens[i]] = block.timestamp;
        unchecked {
            i++;
        }

        emit StakeTokens(collectionAddress, arrayLength);
        }
    }


    /**
        Mint into staking from contracts. User staked tokens can not be locked.
     */
    function stakeManual(address collectionAddress, uint256[] memory tokens, address targetWallet, bool lockTokens) external onlyOwnerOrManager {
        uint256[] memory localTokens = tokens;
        uint256 arrayLength = localTokens.length;

        for (uint256 i =0; i<arrayLength;) {
            // Send tokens to stake first
            require(IStakingPass(collectionAddress).ownerOf(localTokens[i]) == address(this), "Send Token First");
            
            if(IStakingPass(nftToStakingPass[collectionAddress]).checkExistence(localTokens[i])) {
                IStakingPass(nftToStakingPass[collectionAddress]).transferFrom( address(this), targetWallet, localTokens[i]);
            } else {
                IStakingPass(nftToStakingPass[collectionAddress]).mint(targetWallet, localTokens[i]);
            }

            if (stakingTotal[collectionAddress][localTokens[i]] > 0){
                if (lastStakedWallet[collectionAddress][localTokens[i]] != targetWallet) {
                    stakingTotal[collectionAddress][localTokens[i]] = 0;    
                }
            }

            if (lockTokens == true){
                lockedToken[collectionAddress][localTokens[i]] = true;
            }
            stakingStarted[collectionAddress][localTokens[i]] = block.timestamp;
        unchecked {
            i++;
        }
        }

        if (lockTokens == true){
            totalLockedTokens[collectionAddress] += arrayLength;
            emit StakeManualLocked(collectionAddress, arrayLength);
        } else {
            emit StakeTokens(collectionAddress, arrayLength);
        }
    }    

    function unstakeTokens(address collectionAddress, uint256[] memory tokens) external{
        uint256[] memory localTokens = tokens;
        uint256 arrayLength = localTokens.length;

        for (uint256 j = 0; j <arrayLength;) {
            require (IStakingPass(nftToStakingPass[collectionAddress]).ownerOf(localTokens[j]) == msg.sender, "You do not own this staking pass");
            require (lockedToken[collectionAddress][localTokens[j]] != true, "Locked Token");

            IStakingPass(nftToStakingPass[collectionAddress]).safeTransferFrom( msg.sender, address(this), localTokens[j]);
            IStakingPass(collectionAddress).transferFrom(address(this), msg.sender, localTokens[j]);
            // time tracker
            stakingTotal[collectionAddress][localTokens[j]] += block.timestamp - stakingStarted[collectionAddress][localTokens[j]];
            stakingStarted[collectionAddress][localTokens[j]] = 0;
            lastStakedWallet[collectionAddress][localTokens[j]] = msg.sender;
            unchecked {
                j++;
            }
        }
        emit UnstakeTokens(collectionAddress, arrayLength);
    }

    /**
        Transfer without losing staking totals.
     */
    function transferStaked(address collectionAddress, uint256[] memory tokens, address toAddress) external {
        uint256[] memory localTokens = tokens;
        uint256 arrayLength = localTokens.length;

        for (uint256 i =0; i<arrayLength;) {
            require(IStakingPass(collectionAddress).ownerOf(localTokens[i]) == msg.sender, "You do not own this Token");

            IStakingPass(collectionAddress).safeTransferFrom(msg.sender, toAddress, localTokens[i]);

            lastStakedWallet[collectionAddress][localTokens[i]] = toAddress;

        unchecked {
            i++;
        }
        }

    }

    /**
        User unlockable tokens. Sets the rate tokens can be released to trading supply.
     */    
    function setAmountToUnlock(address collectionAddress, uint256 newAmount) external onlyOwner {
        availableToUnlock[collectionAddress] = newAmount;
    }

    function setMaxUnlockPerTransaction(address collectionAddress, uint256 newMax) external onlyOwner {
        maxUnlockPerTransaction[collectionAddress] = newMax;
    }


    /**
        Unlock for Admins.
     */
    function unlockTokensAdmin(address collectionAddress, uint256[] memory tokens) external onlyOwnerOrManager {
        uint256[] memory localTokens = tokens;
        uint256 arrayLength = localTokens.length;
        uint256 totalUnlocked = 0;

        for (uint256 j = 0; j <arrayLength;) {
            if ( lockedToken[collectionAddress][localTokens[j]] == true ) {
                totalUnlocked += 1;
                lockedToken[collectionAddress][localTokens[j]] = false;
            }

            unchecked {
                j++;
            }
        }
        availableToUnlock[collectionAddress] -= totalUnlocked;
        totalLockedTokens[collectionAddress] -= totalUnlocked;

        emit UnlockTokensAdmin(collectionAddress, arrayLength);
    }


    /**
        Unlock for tokens minted into staking. Can unlock when allocations are made available.
     */
    function unlockTokens(address collectionAddress, uint256[] memory tokens) external {
        uint256[] memory localTokens = tokens;
        uint256 totalUnlocked = 0;
        uint256 arrayLength = localTokens.length;

        require(availableToUnlock[collectionAddress] >= arrayLength, "Less available than requested");
        require(maxUnlockPerTransaction[collectionAddress] >= arrayLength, "Too many unlocks in 1 transaction");

        for (uint256 j = 0; j <arrayLength;) {            
            require (IStakingPass(nftToStakingPass[collectionAddress]).ownerOf(localTokens[j]) == msg.sender, "You do not own this staking pass");

            if ( lockedToken[collectionAddress][localTokens[j]] == true ) {
                totalUnlocked += 1;
                lockedToken[collectionAddress][localTokens[j]] = false;
            }

            unchecked {
                j++;
            }
        }
        availableToUnlock[collectionAddress] -= totalUnlocked;
        totalLockedTokens[collectionAddress] -= totalUnlocked;

        emit UnlockTokens(collectionAddress, arrayLength);
    }


    function stakeTotalTime(address collectionAddress, uint256 tokenId)
        external
        view
        returns (
            uint256 current,
            uint256 total
        )
    {
        uint256 start = stakingStarted[collectionAddress][tokenId];
        if (start != 0) {
            current = block.timestamp - start;
        }
        total = current + stakingTotal[collectionAddress][tokenId];
    }


    /**
        Last wallet staking the token. Used to preserve totals.
     */
    function lastWalletUsed(address collectionAddress, uint256 tokenId)
        external
        view
        returns (
            address lastWallet
        )
    {
        lastWallet = lastStakedWallet[collectionAddress][tokenId];
    }


    function isTokenLocked(address collectionAddress, uint256 tokenId)
        external
        view
        returns (
            bool tokenLocked
        )
    {
        if (lockedToken[collectionAddress][tokenId] == true) {
            tokenLocked = true;
        } else {
            tokenLocked = false;
        }
        
    }

    function lockCounts(address collectionAddress)
        external
        view
        returns (
            uint256 totalLocked,
            uint256 totalAvailable,
            uint256 maxPerTransaction
        )
    {
        totalLocked = totalLockedTokens[collectionAddress];
        totalAvailable = availableToUnlock[collectionAddress];
        maxPerTransaction = maxUnlockPerTransaction[collectionAddress];
        
    }    


    function addPassToCollection (address[] memory nftAddress, address[] memory stakingPassAddress) external onlyOwnerOrManager {
        for (uint256 i = 0; i < nftAddress.length;i++) {
            nftToStakingPass[nftAddress[i]] = stakingPassAddress[i];
            availableToUnlock[nftAddress[i]] = 0;
            maxUnlockPerTransaction[nftAddress[i]] = 1;
        }
    }

    function removePassFromCollection (address[] memory nftAddress) external onlyOwner {
        for (uint256 i = 0; i < nftAddress.length;i++) {
            delete nftToStakingPass[nftAddress[i]];
            availableToUnlock[nftAddress[i]] = 0;
            maxUnlockPerTransaction[nftAddress[i]] = 1;
        }
    }
}

File 2 of 11 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

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

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

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

    /**
     * @dev 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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

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

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

pragma solidity ^0.8.2;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

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

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initialized`
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initializing`
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 4 of 11 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

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

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

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

    uint256 private _status;

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

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

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

File 5 of 11 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721ReceiverUpgradeable {
    /**
     * @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);
}

File 6 of 11 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165Upgradeable.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721Upgradeable is IERC165Upgradeable {
    /**
     * @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 ERC721 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 ERC721
     * 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 caller.
     *
     * 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);
}

File 7 of 11 : ERC721HolderUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721ReceiverUpgradeable.sol";
import "../../../proxy/utils/Initializable.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}.
 */
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable {
    function __ERC721Holder_init() internal onlyInitializing {
    }

    function __ERC721Holder_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }

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

File 8 of 11 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

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

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

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

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

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

File 10 of 11 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @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[EIP 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);
}

File 11 of 11 : IStakingPass.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";

interface IStakingPass is IERC721Upgradeable {
    function mint(address _to, uint256 _tokenId) external;
    function checkExistence(uint256 _tokenId) external view returns (bool);
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"manager","type":"address"}],"name":"AddManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"manager","type":"address"}],"name":"RemoveManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collectionAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"numberStaked","type":"uint256"}],"name":"StakeManual","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collectionAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"numberStaked","type":"uint256"}],"name":"StakeManualLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collectionAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"numberStaked","type":"uint256"}],"name":"StakeTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collectionAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"numberUnlocked","type":"uint256"}],"name":"UnlockTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collectionAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"numberUnlocked","type":"uint256"}],"name":"UnlockTokensAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"collectionAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"numberUnstaked","type":"uint256"}],"name":"UnstakeTokens","type":"event"},{"inputs":[{"internalType":"address","name":"newManager","type":"address"}],"name":"addManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"nftAddress","type":"address[]"},{"internalType":"address[]","name":"stakingPassAddress","type":"address[]"}],"name":"addPassToCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"availableToUnlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"checkAddress","type":"address"}],"name":"isManager","outputs":[{"internalType":"bool","name":"manager","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isTokenLocked","outputs":[{"internalType":"bool","name":"tokenLocked","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"lastWalletUsed","outputs":[{"internalType":"address","name":"lastWallet","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"}],"name":"lockCounts","outputs":[{"internalType":"uint256","name":"totalLocked","type":"uint256"},{"internalType":"uint256","name":"totalAvailable","type":"uint256"},{"internalType":"uint256","name":"maxPerTransaction","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxUnlockPerTransaction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nftToStakingPass","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newManager","type":"address"}],"name":"removeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"nftAddress","type":"address[]"}],"name":"removePassFromCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256","name":"newAmount","type":"uint256"}],"name":"setAmountToUnlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256","name":"newMax","type":"uint256"}],"name":"setMaxUnlockPerTransaction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256[]","name":"tokens","type":"uint256[]"},{"internalType":"address","name":"targetWallet","type":"address"},{"internalType":"bool","name":"lockTokens","type":"bool"}],"name":"stakeManual","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256[]","name":"tokens","type":"uint256[]"}],"name":"stakeTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakeTotalTime","outputs":[{"internalType":"uint256","name":"current","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalLockedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256[]","name":"tokens","type":"uint256[]"},{"internalType":"address","name":"toAddress","type":"address"}],"name":"transferStaked","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256[]","name":"tokens","type":"uint256[]"}],"name":"unlockTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256[]","name":"tokens","type":"uint256[]"}],"name":"unlockTokensAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"uint256[]","name":"tokens","type":"uint256[]"}],"name":"unstakeTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50612781806100206000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063be7801af11610097578063ef8ed7bb11610071578063ef8ed7bb1461043b578063f2fde38b1461044e578063f3ae241514610461578063f9b1400c1461047457600080fd5b8063be7801af146103ed578063c0f6058714610400578063d5fc24d51461042857600080fd5b80638da5cb5b1461034d578063915722f11461035e578063952c641d14610394578063a24ecaf1146103a7578063ac18de43146103ba578063b1b3b7fb146103cd57600080fd5b8063562dac241161014b578063715018a611610125578063715018a6146102fa5780637ae1ccf9146103025780638129fc1c1461032557806389f389061461032d57600080fd5b8063562dac2414610279578063670938f01461028c57806369e3e9e7146102e757600080fd5b806304f5d8101461019357806313f09c27146101a8578063150b7a02146101db578063221fc67e146102125780632d06177a14610253578063431e9c6814610266575b600080fd5b6101a66101a13660046122b8565b610487565b005b6101c86101b63660046122fe565b609d6020526000908152604090205481565b6040519081526020015b60405180910390f35b6101f96101e9366004612322565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016101d2565b61023b6102203660046122fe565b6097602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101d2565b6101a66102613660046122fe565b610671565b6101a66102743660046122b8565b6106d4565b6101a661028736600461244a565b610b2a565b6102cc61029a3660046122fe565b6001600160a01b03166000908152609c6020908152604080832054609d835281842054609e9093529220549192909190565b604080519384526020840192909252908201526060016101d2565b6101a66102f53660046124a4565b610caa565b6101a6610cce565b6103156103103660046124a4565b610ce2565b60405190151581526020016101d2565b6101a6610d24565b6101c861033b3660046122fe565b609e6020526000908152604090205481565b6033546001600160a01b031661023b565b61023b61036c3660046124a4565b6001600160a01b039182166000908152609a6020908152604080832093835292905220541690565b6101a66103a23660046124a4565b610e39565b6101a66103b53660046122b8565b610e5d565b6101a66103c83660046122fe565b611341565b6101c86103db3660046122fe565b609c6020526000908152604090205481565b6101a66103fb3660046122b8565b61139a565b61041361040e3660046124a4565b6116ea565b604080519283526020830191909152016101d2565b6101a66104363660046124de565b61175b565b6101a6610449366004612553565b611d01565b6101a661045c3660046122fe565b611e08565b61031561046f3660046122fe565b611e7e565b6101a6610482366004612590565b611eb3565b336000908152609f602052604090205460ff161515600114806104c35750336104b86033546001600160a01b031690565b6001600160a01b0316145b6104e85760405162461bcd60e51b81526004016104df906125f4565b60405180910390fd5b805181906000805b828110156105cc576001600160a01b0386166000908152609b60205260408120855190919086908490811061052757610527612637565b60209081029190910181015182528101919091526040016000205460ff1615156001036105c457610559600183612663565b91506000609b6000886001600160a01b03166001600160a01b03168152602001908152602001600020600086848151811061059657610596612637565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6001016104f0565b506001600160a01b0385166000908152609d6020526040812080548392906105f5908490612676565b90915550506001600160a01b0385166000908152609c602052604081208054839290610622908490612676565b9091555050604080516001600160a01b0387168152602081018490527f9c688f63d0bf8da376f0ebd7673f7ac3650b88f06e68fb22651e09f08ee3931191015b60405180910390a15050505050565b61067961209b565b6001600160a01b0381166000818152609f6020908152604091829020805460ff1916600117905590519182527f3630096a7f9a158ab9fae41e86bfe31fd2202585a26a9668242672566dae028d91015b60405180910390a150565b8051819060005b81811015610ae1576001600160a01b03858116600090815260976020526040902054845133929190911690636352211e9086908590811061071e5761071e612637565b60200260200101516040518263ffffffff1660e01b815260040161074491815260200190565b602060405180830381865afa158015610761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107859190612689565b6001600160a01b0316146107db5760405162461bcd60e51b815260206004820181905260248201527f596f7520646f206e6f74206f776e2074686973207374616b696e67207061737360448201526064016104df565b6001600160a01b0385166000908152609b60205260408120845190919085908490811061080a5761080a612637565b60209081029190910181015182528101919091526040016000205460ff1615156001036108685760405162461bcd60e51b815260206004820152600c60248201526b2637b1b5b2b2102a37b5b2b760a11b60448201526064016104df565b6001600160a01b0380861660009081526097602052604090205484519116906342842e0e90339030908790869081106108a3576108a3612637565b60200260200101516040518463ffffffff1660e01b81526004016108c9939291906126a6565b600060405180830381600087803b1580156108e357600080fd5b505af11580156108f7573d6000803e3d6000fd5b50505050846001600160a01b03166323b872dd303386858151811061091e5761091e612637565b60200260200101516040518463ffffffff1660e01b8152600401610944939291906126a6565b600060405180830381600087803b15801561095e57600080fd5b505af1158015610972573d6000803e3d6000fd5b5050506001600160a01b038616600090815260986020526040812085519092508590849081106109a4576109a4612637565b6020026020010151815260200190815260200160002054426109c69190612676565b6001600160a01b038616600090815260996020526040812085519091908690859081106109f5576109f5612637565b602002602001015181526020019081526020016000206000828254610a1a9190612663565b90915550506001600160a01b038516600090815260986020526040812084518290869085908110610a4d57610a4d612637565b602002602001015181526020019081526020016000208190555033609a6000876001600160a01b03166001600160a01b031681526020019081526020016000206000858481518110610aa157610aa1612637565b602090810291909101810151825281019190915260400160002080546001600160a01b0319166001600160a01b03929092169190911790556001016106db565b50604080516001600160a01b0386168152602081018390527ff74a79d13d6fdbdf26b2c779e6a24490a43e65d60cc7e064740f8d40b2b5ea2c910160405180910390a150505050565b336000908152609f602052604090205460ff16151560011480610b66575033610b5b6033546001600160a01b031690565b6001600160a01b0316145b610b825760405162461bcd60e51b81526004016104df906125f4565b60005b8251811015610ca557818181518110610ba057610ba0612637565b602002602001015160976000858481518110610bbe57610bbe612637565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000609d6000858481518110610c2257610c22612637565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055506001609e6000858481518110610c6657610c66612637565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055508080610c9d906126ca565b915050610b85565b505050565b610cb261209b565b6001600160a01b039091166000908152609d6020526040902055565b610cd661209b565b610ce060006120f5565b565b6001600160a01b0382166000908152609b6020908152604080832084845290915281205460ff161515600103610d1a57506001610d1e565b5060005b92915050565b600054610100900460ff1615808015610d445750600054600160ff909116105b80610d5e5750303b158015610d5e575060005460ff166001145b610dc15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104df565b6000805460ff191660011790558015610de4576000805461ff0019166101001790555b610dec612147565b610df4612176565b8015610e36576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016106c9565b50565b610e4161209b565b6001600160a01b039091166000908152609e6020526040902055565b8051819060005b8181101561133a57336001600160a01b0316856001600160a01b0316636352211e858481518110610e9757610e97612637565b60200260200101516040518263ffffffff1660e01b8152600401610ebd91815260200190565b602060405180830381865afa158015610eda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efe9190612689565b6001600160a01b031614610f505760405162461bcd60e51b81526020600482015260196024820152782cb7ba903237903737ba1037bbb7103a3434b9902a37b5b2b760391b60448201526064016104df565b846001600160a01b03166342842e0e3330868581518110610f7357610f73612637565b60200260200101516040518463ffffffff1660e01b8152600401610f99939291906126a6565b600060405180830381600087803b158015610fb357600080fd5b505af1158015610fc7573d6000803e3d6000fd5b5050506001600160a01b0380871660009081526097602052604090205485519116915063afb072579085908490811061100257611002612637565b60200260200101516040518263ffffffff1660e01b815260040161102891815260200190565b602060405180830381865afa158015611045573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106991906126e3565b15611106576001600160a01b0380861660009081526097602052604090205484519116906323b872dd90309033908790869081106110a9576110a9612637565b60200260200101516040518463ffffffff1660e01b81526004016110cf939291906126a6565b600060405180830381600087803b1580156110e957600080fd5b505af11580156110fd573d6000803e3d6000fd5b505050506111ab565b6001600160a01b0380861660009081526097602052604090205484519116906340c10f1990339086908590811061113f5761113f612637565b60200260200101516040518363ffffffff1660e01b81526004016111789291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801561119257600080fd5b505af11580156111a6573d6000803e3d6000fd5b505050505b6001600160a01b0385166000908152609960205260408120845182908690859081106111d9576111d9612637565b60200260200101518152602001908152602001600020541115611297576001600160a01b0385166000908152609a60205260408120845133929086908590811061122557611225612637565b6020908102919091018101518252810191909152604001600020546001600160a01b031614611297576001600160a01b03851660009081526099602052604081208451829086908590811061127c5761127c612637565b60200260200101518152602001908152602001600020819055505b6001600160a01b038516600090815260986020526040812084514292908690859081106112c6576112c6612637565b602002602001015181526020019081526020016000208190555080806001019150507feb564dbda54c69318a29599b8551d044674ca4e3c47f3c0da3f4f253c90b1702858360405161132d9291906001600160a01b03929092168252602082015260400190565b60405180910390a1610e64565b5050505050565b61134961209b565b6001600160a01b0381166000818152609f6020908152604091829020805460ff1916905590519182527f1e25ed4cabec84d314dc176241019653f237da01f2bdd3a10cb0f38b33da676391016106c9565b80516001600160a01b0383166000908152609d60205260408120548392908111156114075760405162461bcd60e51b815260206004820152601d60248201527f4c65737320617661696c61626c65207468616e2072657175657374656400000060448201526064016104df565b6001600160a01b0385166000908152609e60205260409020548111156114795760405162461bcd60e51b815260206004820152602160248201527f546f6f206d616e7920756e6c6f636b7320696e2031207472616e73616374696f6044820152603760f91b60648201526084016104df565b60005b81811015611650576001600160a01b03868116600090815260976020526040902054855133929190911690636352211e908790859081106114bf576114bf612637565b60200260200101516040518263ffffffff1660e01b81526004016114e591815260200190565b602060405180830381865afa158015611502573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115269190612689565b6001600160a01b03161461157c5760405162461bcd60e51b815260206004820181905260248201527f596f7520646f206e6f74206f776e2074686973207374616b696e67207061737360448201526064016104df565b6001600160a01b0386166000908152609b6020526040812085519091908690849081106115ab576115ab612637565b60209081029190910181015182528101919091526040016000205460ff161515600103611648576115dd600184612663565b92506000609b6000886001600160a01b03166001600160a01b03168152602001908152602001600020600086848151811061161a5761161a612637565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b60010161147c565b506001600160a01b0385166000908152609d602052604081208054849290611679908490612676565b90915550506001600160a01b0385166000908152609c6020526040812080548492906116a6908490612676565b9091555050604080516001600160a01b0387168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb4079101610662565b6001600160a01b038216600090815260986020908152604080832084845290915281205481908015611723576117208142612676565b92505b6001600160a01b03851660009081526099602090815260408083208784529091529020546117519084612663565b9150509250929050565b336000908152609f602052604090205460ff1615156001148061179757503361178c6033546001600160a01b031690565b6001600160a01b0316145b6117b35760405162461bcd60e51b81526004016104df906125f4565b8251839060005b81811015611c3757306001600160a01b0316876001600160a01b0316636352211e8584815181106117ed576117ed612637565b60200260200101516040518263ffffffff1660e01b815260040161181391815260200190565b602060405180830381865afa158015611830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118549190612689565b6001600160a01b03161461189d5760405162461bcd60e51b815260206004820152601060248201526f14d95b9908151bdad95b88119a5c9cdd60821b60448201526064016104df565b6001600160a01b03808816600090815260976020526040902054845191169063afb07257908590849081106118d4576118d4612637565b60200260200101516040518263ffffffff1660e01b81526004016118fa91815260200190565b602060405180830381865afa158015611917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193b91906126e3565b156119d8576001600160a01b0380881660009081526097602052604090205484519116906323b872dd903090889087908690811061197b5761197b612637565b60200260200101516040518463ffffffff1660e01b81526004016119a1939291906126a6565b600060405180830381600087803b1580156119bb57600080fd5b505af11580156119cf573d6000803e3d6000fd5b50505050611a7d565b6001600160a01b0380881660009081526097602052604090205484519116906340c10f19908790869085908110611a1157611a11612637565b60200260200101516040518363ffffffff1660e01b8152600401611a4a9291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b158015611a6457600080fd5b505af1158015611a78573d6000803e3d6000fd5b505050505b6001600160a01b038716600090815260996020526040812084518290869085908110611aab57611aab612637565b60200260200101518152602001908152602001600020541115611b7d57846001600160a01b0316609a6000896001600160a01b03166001600160a01b031681526020019081526020016000206000858481518110611b0b57611b0b612637565b6020908102919091018101518252810191909152604001600020546001600160a01b031614611b7d576001600160a01b038716600090815260996020526040812084518290869085908110611b6257611b62612637565b60200260200101518152602001908152602001600020819055505b831515600103611be5576001600160a01b0387166000908152609b60205260408120845160019290869085908110611bb757611bb7612637565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6001600160a01b03871660009081526098602052604081208451429290869085908110611c1457611c14612637565b6020908102919091018101518252810191909152604001600020556001016117ba565b50821515600103611cb6576001600160a01b0386166000908152609c602052604081208054839290611c6a908490612663565b9091555050604080516001600160a01b0388168152602081018390527f1ce27e6d26aa85a01a5922b7f2c2c9e41a0f13030ccc7692c5dffb5d8c7dded3910160405180910390a1611cf9565b604080516001600160a01b0388168152602081018390527feb564dbda54c69318a29599b8551d044674ca4e3c47f3c0da3f4f253c90b1702910160405180910390a15b505050505050565b611d0961209b565b60005b8151811015611e045760976000838381518110611d2b57611d2b612637565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154906001600160a01b0302191690556000609d6000848481518110611d8157611d81612637565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055506001609e6000848481518110611dc557611dc5612637565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055508080611dfc906126ca565b915050611d0c565b5050565b611e1061209b565b6001600160a01b038116611e755760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104df565b610e36816120f5565b6001600160a01b0381166000908152609f602052604081205460ff161515600103611eab57506001919050565b506000919050565b8151829060005b81811015611cf957336001600160a01b0316866001600160a01b0316636352211e858481518110611eed57611eed612637565b60200260200101516040518263ffffffff1660e01b8152600401611f1391815260200190565b602060405180830381865afa158015611f30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f549190612689565b6001600160a01b031614611fa65760405162461bcd60e51b81526020600482015260196024820152782cb7ba903237903737ba1037bbb7103a3434b9902a37b5b2b760391b60448201526064016104df565b856001600160a01b03166342842e0e3386868581518110611fc957611fc9612637565b60200260200101516040518463ffffffff1660e01b8152600401611fef939291906126a6565b600060405180830381600087803b15801561200957600080fd5b505af115801561201d573d6000803e3d6000fd5b5050505083609a6000886001600160a01b03166001600160a01b03168152602001908152602001600020600085848151811061205b5761205b612637565b602090810291909101810151825281019190915260400160002080546001600160a01b0319166001600160a01b0392909216919091179055600101611eba565b6033546001600160a01b03163314610ce05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104df565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661216e5760405162461bcd60e51b81526004016104df90612700565b610ce061219d565b600054610100900460ff16610ce05760405162461bcd60e51b81526004016104df90612700565b600054610100900460ff166121c45760405162461bcd60e51b81526004016104df90612700565b610ce0336120f5565b6001600160a01b0381168114610e3657600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612221576122216121e2565b604052919050565b600067ffffffffffffffff821115612243576122436121e2565b5060051b60200190565b600082601f83011261225e57600080fd5b8135602061227361226e83612229565b6121f8565b82815260059290921b8401810191818101908684111561229257600080fd5b8286015b848110156122ad5780358352918301918301612296565b509695505050505050565b600080604083850312156122cb57600080fd5b82356122d6816121cd565b9150602083013567ffffffffffffffff8111156122f257600080fd5b6117518582860161224d565b60006020828403121561231057600080fd5b813561231b816121cd565b9392505050565b6000806000806080858703121561233857600080fd5b8435612343816121cd565b9350602085810135612354816121cd565b935060408601359250606086013567ffffffffffffffff8082111561237857600080fd5b818801915088601f83011261238c57600080fd5b81358181111561239e5761239e6121e2565b6123b0601f8201601f191685016121f8565b915080825289848285010111156123c657600080fd5b808484018584013760008482840101525080935050505092959194509250565b600082601f8301126123f757600080fd5b8135602061240761226e83612229565b82815260059290921b8401810191818101908684111561242657600080fd5b8286015b848110156122ad57803561243d816121cd565b835291830191830161242a565b6000806040838503121561245d57600080fd5b823567ffffffffffffffff8082111561247557600080fd5b612481868387016123e6565b9350602085013591508082111561249757600080fd5b50611751858286016123e6565b600080604083850312156124b757600080fd5b82356124c2816121cd565b946020939093013593505050565b8015158114610e3657600080fd5b600080600080608085870312156124f457600080fd5b84356124ff816121cd565b9350602085013567ffffffffffffffff81111561251b57600080fd5b6125278782880161224d565b9350506040850135612538816121cd565b91506060850135612548816124d0565b939692955090935050565b60006020828403121561256557600080fd5b813567ffffffffffffffff81111561257c57600080fd5b612588848285016123e6565b949350505050565b6000806000606084860312156125a557600080fd5b83356125b0816121cd565b9250602084013567ffffffffffffffff8111156125cc57600080fd5b6125d88682870161224d565b92505060408401356125e9816121cd565b809150509250925092565b60208082526023908201527f63616c6c6572206973206e656974686572206f776e6572206e6f72206d616e6160408201526233b2b960e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610d1e57610d1e61264d565b81810381811115610d1e57610d1e61264d565b60006020828403121561269b57600080fd5b815161231b816121cd565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6000600182016126dc576126dc61264d565b5060010190565b6000602082840312156126f557600080fd5b815161231b816124d0565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220fbf0511e10b7f019a130f6d9a0b69e74762f7aa8d482ef19cf850b0e3db9d91964736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638da5cb5b116100de578063be7801af11610097578063ef8ed7bb11610071578063ef8ed7bb1461043b578063f2fde38b1461044e578063f3ae241514610461578063f9b1400c1461047457600080fd5b8063be7801af146103ed578063c0f6058714610400578063d5fc24d51461042857600080fd5b80638da5cb5b1461034d578063915722f11461035e578063952c641d14610394578063a24ecaf1146103a7578063ac18de43146103ba578063b1b3b7fb146103cd57600080fd5b8063562dac241161014b578063715018a611610125578063715018a6146102fa5780637ae1ccf9146103025780638129fc1c1461032557806389f389061461032d57600080fd5b8063562dac2414610279578063670938f01461028c57806369e3e9e7146102e757600080fd5b806304f5d8101461019357806313f09c27146101a8578063150b7a02146101db578063221fc67e146102125780632d06177a14610253578063431e9c6814610266575b600080fd5b6101a66101a13660046122b8565b610487565b005b6101c86101b63660046122fe565b609d6020526000908152604090205481565b6040519081526020015b60405180910390f35b6101f96101e9366004612322565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016101d2565b61023b6102203660046122fe565b6097602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101d2565b6101a66102613660046122fe565b610671565b6101a66102743660046122b8565b6106d4565b6101a661028736600461244a565b610b2a565b6102cc61029a3660046122fe565b6001600160a01b03166000908152609c6020908152604080832054609d835281842054609e9093529220549192909190565b604080519384526020840192909252908201526060016101d2565b6101a66102f53660046124a4565b610caa565b6101a6610cce565b6103156103103660046124a4565b610ce2565b60405190151581526020016101d2565b6101a6610d24565b6101c861033b3660046122fe565b609e6020526000908152604090205481565b6033546001600160a01b031661023b565b61023b61036c3660046124a4565b6001600160a01b039182166000908152609a6020908152604080832093835292905220541690565b6101a66103a23660046124a4565b610e39565b6101a66103b53660046122b8565b610e5d565b6101a66103c83660046122fe565b611341565b6101c86103db3660046122fe565b609c6020526000908152604090205481565b6101a66103fb3660046122b8565b61139a565b61041361040e3660046124a4565b6116ea565b604080519283526020830191909152016101d2565b6101a66104363660046124de565b61175b565b6101a6610449366004612553565b611d01565b6101a661045c3660046122fe565b611e08565b61031561046f3660046122fe565b611e7e565b6101a6610482366004612590565b611eb3565b336000908152609f602052604090205460ff161515600114806104c35750336104b86033546001600160a01b031690565b6001600160a01b0316145b6104e85760405162461bcd60e51b81526004016104df906125f4565b60405180910390fd5b805181906000805b828110156105cc576001600160a01b0386166000908152609b60205260408120855190919086908490811061052757610527612637565b60209081029190910181015182528101919091526040016000205460ff1615156001036105c457610559600183612663565b91506000609b6000886001600160a01b03166001600160a01b03168152602001908152602001600020600086848151811061059657610596612637565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6001016104f0565b506001600160a01b0385166000908152609d6020526040812080548392906105f5908490612676565b90915550506001600160a01b0385166000908152609c602052604081208054839290610622908490612676565b9091555050604080516001600160a01b0387168152602081018490527f9c688f63d0bf8da376f0ebd7673f7ac3650b88f06e68fb22651e09f08ee3931191015b60405180910390a15050505050565b61067961209b565b6001600160a01b0381166000818152609f6020908152604091829020805460ff1916600117905590519182527f3630096a7f9a158ab9fae41e86bfe31fd2202585a26a9668242672566dae028d91015b60405180910390a150565b8051819060005b81811015610ae1576001600160a01b03858116600090815260976020526040902054845133929190911690636352211e9086908590811061071e5761071e612637565b60200260200101516040518263ffffffff1660e01b815260040161074491815260200190565b602060405180830381865afa158015610761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107859190612689565b6001600160a01b0316146107db5760405162461bcd60e51b815260206004820181905260248201527f596f7520646f206e6f74206f776e2074686973207374616b696e67207061737360448201526064016104df565b6001600160a01b0385166000908152609b60205260408120845190919085908490811061080a5761080a612637565b60209081029190910181015182528101919091526040016000205460ff1615156001036108685760405162461bcd60e51b815260206004820152600c60248201526b2637b1b5b2b2102a37b5b2b760a11b60448201526064016104df565b6001600160a01b0380861660009081526097602052604090205484519116906342842e0e90339030908790869081106108a3576108a3612637565b60200260200101516040518463ffffffff1660e01b81526004016108c9939291906126a6565b600060405180830381600087803b1580156108e357600080fd5b505af11580156108f7573d6000803e3d6000fd5b50505050846001600160a01b03166323b872dd303386858151811061091e5761091e612637565b60200260200101516040518463ffffffff1660e01b8152600401610944939291906126a6565b600060405180830381600087803b15801561095e57600080fd5b505af1158015610972573d6000803e3d6000fd5b5050506001600160a01b038616600090815260986020526040812085519092508590849081106109a4576109a4612637565b6020026020010151815260200190815260200160002054426109c69190612676565b6001600160a01b038616600090815260996020526040812085519091908690859081106109f5576109f5612637565b602002602001015181526020019081526020016000206000828254610a1a9190612663565b90915550506001600160a01b038516600090815260986020526040812084518290869085908110610a4d57610a4d612637565b602002602001015181526020019081526020016000208190555033609a6000876001600160a01b03166001600160a01b031681526020019081526020016000206000858481518110610aa157610aa1612637565b602090810291909101810151825281019190915260400160002080546001600160a01b0319166001600160a01b03929092169190911790556001016106db565b50604080516001600160a01b0386168152602081018390527ff74a79d13d6fdbdf26b2c779e6a24490a43e65d60cc7e064740f8d40b2b5ea2c910160405180910390a150505050565b336000908152609f602052604090205460ff16151560011480610b66575033610b5b6033546001600160a01b031690565b6001600160a01b0316145b610b825760405162461bcd60e51b81526004016104df906125f4565b60005b8251811015610ca557818181518110610ba057610ba0612637565b602002602001015160976000858481518110610bbe57610bbe612637565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b031602179055506000609d6000858481518110610c2257610c22612637565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055506001609e6000858481518110610c6657610c66612637565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055508080610c9d906126ca565b915050610b85565b505050565b610cb261209b565b6001600160a01b039091166000908152609d6020526040902055565b610cd661209b565b610ce060006120f5565b565b6001600160a01b0382166000908152609b6020908152604080832084845290915281205460ff161515600103610d1a57506001610d1e565b5060005b92915050565b600054610100900460ff1615808015610d445750600054600160ff909116105b80610d5e5750303b158015610d5e575060005460ff166001145b610dc15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104df565b6000805460ff191660011790558015610de4576000805461ff0019166101001790555b610dec612147565b610df4612176565b8015610e36576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020016106c9565b50565b610e4161209b565b6001600160a01b039091166000908152609e6020526040902055565b8051819060005b8181101561133a57336001600160a01b0316856001600160a01b0316636352211e858481518110610e9757610e97612637565b60200260200101516040518263ffffffff1660e01b8152600401610ebd91815260200190565b602060405180830381865afa158015610eda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efe9190612689565b6001600160a01b031614610f505760405162461bcd60e51b81526020600482015260196024820152782cb7ba903237903737ba1037bbb7103a3434b9902a37b5b2b760391b60448201526064016104df565b846001600160a01b03166342842e0e3330868581518110610f7357610f73612637565b60200260200101516040518463ffffffff1660e01b8152600401610f99939291906126a6565b600060405180830381600087803b158015610fb357600080fd5b505af1158015610fc7573d6000803e3d6000fd5b5050506001600160a01b0380871660009081526097602052604090205485519116915063afb072579085908490811061100257611002612637565b60200260200101516040518263ffffffff1660e01b815260040161102891815260200190565b602060405180830381865afa158015611045573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106991906126e3565b15611106576001600160a01b0380861660009081526097602052604090205484519116906323b872dd90309033908790869081106110a9576110a9612637565b60200260200101516040518463ffffffff1660e01b81526004016110cf939291906126a6565b600060405180830381600087803b1580156110e957600080fd5b505af11580156110fd573d6000803e3d6000fd5b505050506111ab565b6001600160a01b0380861660009081526097602052604090205484519116906340c10f1990339086908590811061113f5761113f612637565b60200260200101516040518363ffffffff1660e01b81526004016111789291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b15801561119257600080fd5b505af11580156111a6573d6000803e3d6000fd5b505050505b6001600160a01b0385166000908152609960205260408120845182908690859081106111d9576111d9612637565b60200260200101518152602001908152602001600020541115611297576001600160a01b0385166000908152609a60205260408120845133929086908590811061122557611225612637565b6020908102919091018101518252810191909152604001600020546001600160a01b031614611297576001600160a01b03851660009081526099602052604081208451829086908590811061127c5761127c612637565b60200260200101518152602001908152602001600020819055505b6001600160a01b038516600090815260986020526040812084514292908690859081106112c6576112c6612637565b602002602001015181526020019081526020016000208190555080806001019150507feb564dbda54c69318a29599b8551d044674ca4e3c47f3c0da3f4f253c90b1702858360405161132d9291906001600160a01b03929092168252602082015260400190565b60405180910390a1610e64565b5050505050565b61134961209b565b6001600160a01b0381166000818152609f6020908152604091829020805460ff1916905590519182527f1e25ed4cabec84d314dc176241019653f237da01f2bdd3a10cb0f38b33da676391016106c9565b80516001600160a01b0383166000908152609d60205260408120548392908111156114075760405162461bcd60e51b815260206004820152601d60248201527f4c65737320617661696c61626c65207468616e2072657175657374656400000060448201526064016104df565b6001600160a01b0385166000908152609e60205260409020548111156114795760405162461bcd60e51b815260206004820152602160248201527f546f6f206d616e7920756e6c6f636b7320696e2031207472616e73616374696f6044820152603760f91b60648201526084016104df565b60005b81811015611650576001600160a01b03868116600090815260976020526040902054855133929190911690636352211e908790859081106114bf576114bf612637565b60200260200101516040518263ffffffff1660e01b81526004016114e591815260200190565b602060405180830381865afa158015611502573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115269190612689565b6001600160a01b03161461157c5760405162461bcd60e51b815260206004820181905260248201527f596f7520646f206e6f74206f776e2074686973207374616b696e67207061737360448201526064016104df565b6001600160a01b0386166000908152609b6020526040812085519091908690849081106115ab576115ab612637565b60209081029190910181015182528101919091526040016000205460ff161515600103611648576115dd600184612663565b92506000609b6000886001600160a01b03166001600160a01b03168152602001908152602001600020600086848151811061161a5761161a612637565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b60010161147c565b506001600160a01b0385166000908152609d602052604081208054849290611679908490612676565b90915550506001600160a01b0385166000908152609c6020526040812080548492906116a6908490612676565b9091555050604080516001600160a01b0387168152602081018390527f55aaef8fd8c07238c3618a93c8a1627194187d3b0952908e58f2ab0f944fb4079101610662565b6001600160a01b038216600090815260986020908152604080832084845290915281205481908015611723576117208142612676565b92505b6001600160a01b03851660009081526099602090815260408083208784529091529020546117519084612663565b9150509250929050565b336000908152609f602052604090205460ff1615156001148061179757503361178c6033546001600160a01b031690565b6001600160a01b0316145b6117b35760405162461bcd60e51b81526004016104df906125f4565b8251839060005b81811015611c3757306001600160a01b0316876001600160a01b0316636352211e8584815181106117ed576117ed612637565b60200260200101516040518263ffffffff1660e01b815260040161181391815260200190565b602060405180830381865afa158015611830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118549190612689565b6001600160a01b03161461189d5760405162461bcd60e51b815260206004820152601060248201526f14d95b9908151bdad95b88119a5c9cdd60821b60448201526064016104df565b6001600160a01b03808816600090815260976020526040902054845191169063afb07257908590849081106118d4576118d4612637565b60200260200101516040518263ffffffff1660e01b81526004016118fa91815260200190565b602060405180830381865afa158015611917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193b91906126e3565b156119d8576001600160a01b0380881660009081526097602052604090205484519116906323b872dd903090889087908690811061197b5761197b612637565b60200260200101516040518463ffffffff1660e01b81526004016119a1939291906126a6565b600060405180830381600087803b1580156119bb57600080fd5b505af11580156119cf573d6000803e3d6000fd5b50505050611a7d565b6001600160a01b0380881660009081526097602052604090205484519116906340c10f19908790869085908110611a1157611a11612637565b60200260200101516040518363ffffffff1660e01b8152600401611a4a9291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b158015611a6457600080fd5b505af1158015611a78573d6000803e3d6000fd5b505050505b6001600160a01b038716600090815260996020526040812084518290869085908110611aab57611aab612637565b60200260200101518152602001908152602001600020541115611b7d57846001600160a01b0316609a6000896001600160a01b03166001600160a01b031681526020019081526020016000206000858481518110611b0b57611b0b612637565b6020908102919091018101518252810191909152604001600020546001600160a01b031614611b7d576001600160a01b038716600090815260996020526040812084518290869085908110611b6257611b62612637565b60200260200101518152602001908152602001600020819055505b831515600103611be5576001600160a01b0387166000908152609b60205260408120845160019290869085908110611bb757611bb7612637565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6001600160a01b03871660009081526098602052604081208451429290869085908110611c1457611c14612637565b6020908102919091018101518252810191909152604001600020556001016117ba565b50821515600103611cb6576001600160a01b0386166000908152609c602052604081208054839290611c6a908490612663565b9091555050604080516001600160a01b0388168152602081018390527f1ce27e6d26aa85a01a5922b7f2c2c9e41a0f13030ccc7692c5dffb5d8c7dded3910160405180910390a1611cf9565b604080516001600160a01b0388168152602081018390527feb564dbda54c69318a29599b8551d044674ca4e3c47f3c0da3f4f253c90b1702910160405180910390a15b505050505050565b611d0961209b565b60005b8151811015611e045760976000838381518110611d2b57611d2b612637565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154906001600160a01b0302191690556000609d6000848481518110611d8157611d81612637565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055506001609e6000848481518110611dc557611dc5612637565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055508080611dfc906126ca565b915050611d0c565b5050565b611e1061209b565b6001600160a01b038116611e755760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104df565b610e36816120f5565b6001600160a01b0381166000908152609f602052604081205460ff161515600103611eab57506001919050565b506000919050565b8151829060005b81811015611cf957336001600160a01b0316866001600160a01b0316636352211e858481518110611eed57611eed612637565b60200260200101516040518263ffffffff1660e01b8152600401611f1391815260200190565b602060405180830381865afa158015611f30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f549190612689565b6001600160a01b031614611fa65760405162461bcd60e51b81526020600482015260196024820152782cb7ba903237903737ba1037bbb7103a3434b9902a37b5b2b760391b60448201526064016104df565b856001600160a01b03166342842e0e3386868581518110611fc957611fc9612637565b60200260200101516040518463ffffffff1660e01b8152600401611fef939291906126a6565b600060405180830381600087803b15801561200957600080fd5b505af115801561201d573d6000803e3d6000fd5b5050505083609a6000886001600160a01b03166001600160a01b03168152602001908152602001600020600085848151811061205b5761205b612637565b602090810291909101810151825281019190915260400160002080546001600160a01b0319166001600160a01b0392909216919091179055600101611eba565b6033546001600160a01b03163314610ce05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104df565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661216e5760405162461bcd60e51b81526004016104df90612700565b610ce061219d565b600054610100900460ff16610ce05760405162461bcd60e51b81526004016104df90612700565b600054610100900460ff166121c45760405162461bcd60e51b81526004016104df90612700565b610ce0336120f5565b6001600160a01b0381168114610e3657600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612221576122216121e2565b604052919050565b600067ffffffffffffffff821115612243576122436121e2565b5060051b60200190565b600082601f83011261225e57600080fd5b8135602061227361226e83612229565b6121f8565b82815260059290921b8401810191818101908684111561229257600080fd5b8286015b848110156122ad5780358352918301918301612296565b509695505050505050565b600080604083850312156122cb57600080fd5b82356122d6816121cd565b9150602083013567ffffffffffffffff8111156122f257600080fd5b6117518582860161224d565b60006020828403121561231057600080fd5b813561231b816121cd565b9392505050565b6000806000806080858703121561233857600080fd5b8435612343816121cd565b9350602085810135612354816121cd565b935060408601359250606086013567ffffffffffffffff8082111561237857600080fd5b818801915088601f83011261238c57600080fd5b81358181111561239e5761239e6121e2565b6123b0601f8201601f191685016121f8565b915080825289848285010111156123c657600080fd5b808484018584013760008482840101525080935050505092959194509250565b600082601f8301126123f757600080fd5b8135602061240761226e83612229565b82815260059290921b8401810191818101908684111561242657600080fd5b8286015b848110156122ad57803561243d816121cd565b835291830191830161242a565b6000806040838503121561245d57600080fd5b823567ffffffffffffffff8082111561247557600080fd5b612481868387016123e6565b9350602085013591508082111561249757600080fd5b50611751858286016123e6565b600080604083850312156124b757600080fd5b82356124c2816121cd565b946020939093013593505050565b8015158114610e3657600080fd5b600080600080608085870312156124f457600080fd5b84356124ff816121cd565b9350602085013567ffffffffffffffff81111561251b57600080fd5b6125278782880161224d565b9350506040850135612538816121cd565b91506060850135612548816124d0565b939692955090935050565b60006020828403121561256557600080fd5b813567ffffffffffffffff81111561257c57600080fd5b612588848285016123e6565b949350505050565b6000806000606084860312156125a557600080fd5b83356125b0816121cd565b9250602084013567ffffffffffffffff8111156125cc57600080fd5b6125d88682870161224d565b92505060408401356125e9816121cd565b809150509250925092565b60208082526023908201527f63616c6c6572206973206e656974686572206f776e6572206e6f72206d616e6160408201526233b2b960e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610d1e57610d1e61264d565b81810381811115610d1e57610d1e61264d565b60006020828403121561269b57600080fd5b815161231b816121cd565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6000600182016126dc576126dc61264d565b5060010190565b6000602082840312156126f557600080fd5b815161231b816124d0565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220fbf0511e10b7f019a130f6d9a0b69e74762f7aa8d482ef19cf850b0e3db9d91964736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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