ETH Price: $2,628.00 (+1.66%)

Contract

0x9cb54C801e03e841445DC8B150F487243b5b8463
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040148915562022-06-02 14:35:15811 days ago1654180515IN
 Create: SoulCafeFrensV2
0 ETH0.126341534.21056815

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SoulCafeFrensV2

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 100000 runs

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

pragma solidity 0.8.13;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";

import "../interfaces/ICafeStaking.sol";
import "../interfaces/ICafeAccumulator.sol";
import "../interfaces/ISudoApprovable.sol";
import "../staking/StakingCommons.sol";
import "../utils/Errors.sol";
import "../utils/Staking.sol";
import "../utils/locker/ERC721LockerUpgradeable.sol";
import "../utils/ProxyRegistry.sol";
import "../utils/UncheckedIncrement.sol";

contract SoulCafeFrensV2 is
    Initializable,
    OwnableUpgradeable,
    ERC721Upgradeable,
    ERC721LockerUpgradeable,
    ICafeAccumulator
{
    using StringsUpgradeable for uint256;
    using AddressUpgradeable for address;
    using SafeERC20Upgradeable for IERC20Upgradeable;
    using AutoStaking for uint256;
    using AutoStaking for StakeAction;
    using AutoStaking for StakeRequest;
    using UncheckedIncrement for uint256;

    event TokenURISet(string indexed uri);
    event PriceUpdate(uint256 indexed newPrice);
    event ContractToggle(bool indexed newState);

    uint256 public constant MAX_SUPPLY = 3333;
    uint256 private constant NEXTANT_ID = MAX_SUPPLY + 1;
    uint256 public constant T1_CAP = 501;
    uint256 public constant T2_CAP = 1001;
    uint256 public constant T3_CAP = 2001;
    uint256 public constant T0_FREN_PRICE = 3000 ether;
    uint256 public constant T1_FREN_PRICE = 3500 ether;
    uint256 public constant T2_FREN_PRICE = 4000 ether;
    uint256 public constant T3_FREN_PRICE = 4800 ether;
    uint256 private constant CAFE_TEAM_SUPPLY = 100;
    address private constant CAFE_TEAM_WALLET = 0x9cD59CD50625C7E2994BA6a2cf9b70c5a775E8db;

    /* ========== STORAGE, APPEND-ONLY ========== */
    bool public paused;
    uint256 public totalSupply;
    uint256 public cafeTeamSupply;
    uint256 internal _stakingTrack;
    ICafeStaking internal _staking;
    IERC20Upgradeable public cafeToken;
    string internal _uri;

    /* ========== INITIALIZER ========== */

    function initialize(address cafeToken_) external initializer {
        if (!cafeToken_.isContract())
            revert ContractAddressExpected(cafeToken_);

        cafeToken = IERC20Upgradeable(cafeToken_);

        __ERC721_init("Soul Cafe Frens", "SCF");
        __Ownable_init();

        ERC721LockerUpgradeable.__init();
        paused = true;
    }

    /* ========== VIEWS ========== */

    function exists(uint256 tokenId) public view returns (bool) {
        return _exists(tokenId);
    }

    function tokensOfOwner(
        address account,
        uint256 page,
        uint256 records
    ) external view returns (uint256[] memory) {
        uint256 from = page * records;
        uint256 to = (from + records > totalSupply)
            ? totalSupply
            : from + records;
        uint256[] memory found = new uint256[](records);
        uint256 counter;

        for (uint256 t = from; t < to; t = t.inc()) {
            if (account == ownerOf(t)) {
                found[counter] = (t > 0) ? t : NEXTANT_ID;
                counter++;
            }
        }

        uint256[] memory tokenIds = new uint256[](counter);
        for (uint256 t = 0; t < counter; t = t.inc()) {
            if (found[t] > 0) {
                tokenIds[t] = (found[t] == NEXTANT_ID) ? 0 : found[t];
            }
        }

        return tokenIds;
    }

    function tokenURI(uint256 tokenId)
        public
        view
        override
        returns (string memory)
    {
        if (!_exists(tokenId)) revert UnknownToken();

        return string(abi.encodePacked(_uri, tokenId.toString(), ".json"));
    }

    function price() external view returns (uint256) {
        return _price();
    }

    function _price() internal view returns (uint256) {
        if (totalSupply < T1_CAP) {
            return T0_FREN_PRICE;
        } else if (totalSupply < T2_CAP) {
            return T1_FREN_PRICE;
        } else if (totalSupply < T3_CAP) {
            return T2_FREN_PRICE;
        } else {
            return T3_FREN_PRICE;
        }
    }

    /* ========== PUBLIC MUTATORS ========== */

    function mint(uint256 qt, bool autostake) external {
        _whenNotPaused();
        if (qt == 0) revert ZeroTokensRequested();

        if (totalSupply + qt > MAX_SUPPLY)
            revert MintingExceedsSupply(MAX_SUPPLY);

        uint256 cafeCost = qt * _price();

        ISudoApprovable(address(cafeToken)).sudoLimitedApprove(
            msg.sender,
            cafeCost
        );
        cafeToken.safeTransferFrom(msg.sender, address(this), cafeCost);

        _mintN(msg.sender, qt);

        if (autostake) {
            _autostake(msg.sender, qt);
        }
    }

    /* ========== ADMIN MUTATORS ========== */

    function configureStaking(address staking, uint256 trackId) external {
        _onlyOwner();
        _setLockerAdmin(staking);
        _staking = ICafeStaking(staking);
        _stakingTrack = trackId;
    }

    function setTokenURI(string memory uri_) external {
        _onlyOwner();
        emit TokenURISet(uri_);
        _uri = uri_;
    }

    function toggle() external {
        _onlyOwner();
        bool newState = !paused;
        emit ContractToggle(newState);
        paused = newState;
    }

    function mintReserve(uint256 qt) external {
        _onlyOwner();
        if (qt == 0) revert ZeroTokensRequested();
        if (cafeTeamSupply + qt > CAFE_TEAM_SUPPLY) revert MintingExceedsSupply(CAFE_TEAM_SUPPLY);
        if (totalSupply + qt > MAX_SUPPLY) revert MintingExceedsSupply(MAX_SUPPLY);
        cafeTeamSupply += qt;
        _mintN(CAFE_TEAM_WALLET, qt);
    }

    function pull(address destination) external returns (uint256) {
        _onlyLockerAdmin();
        address stakingContract = address(_staking);

        if (msg.sender != stakingContract) revert Unauthorized();

        uint256 cafeBalance = cafeToken.balanceOf(address(this));

        cafeToken.safeTransfer(destination, cafeBalance);

        return cafeBalance;
    }


    /* ========== INTERNALS/MODIFIERS ========== */

    function _mintN(address to, uint256 qt) internal {
        totalSupply += qt;

        for (uint256 t = 0; t < qt; t++) {
            _safeMint(to, totalSupply - qt + t);
        }
    }

    function _autostake(address account, uint256 tokenCount) internal {
        uint256[] memory ids = new uint256[](tokenCount);
        uint256 from = totalSupply - tokenCount;
        uint256 to = totalSupply;
        for (uint256 t = from; t < to; t++) {
            ids[t - from] = t;
        }

        uint256[] memory amounts;

        StakeRequest[] memory msr = StakeRequest(_stakingTrack, ids, amounts)
            .arrayify();

        StakeAction[][] memory actions = new StakeAction[][](1);
        actions[0] = StakeAction.Stake.arrayify();

        _staking.execute4(account, msr, actions);
    }

    function isApprovedForAll(address owner_, address operator)
        public
        view
        override(ERC721Upgradeable, IERC721Upgradeable)
        returns (bool)
    {
        ProxyRegistry proxyRegistry = ProxyRegistry(OS_PROXY_REGISTRY_ADDRESS);
        if (address(proxyRegistry.proxies(owner_)) == operator) {
            return true;
        }

        return super.isApprovedForAll(owner_, operator);
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override {
        to;
        if (from == address(0)) return;

        if (isLocked(tokenId)) revert StakingLockViolation(tokenId);
    }

    function _onlyOwner() internal view {
        if (msg.sender != owner()) revert Unauthorized();
    }

    function _whenNotPaused() internal view {
        if (paused) revert ContractPaused();
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

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

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

File 4 of 26 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC721_init_unchained(name_, symbol_);
    }

    function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
        return
            interfaceId == type(IERC721Upgradeable).interfaceId ||
            interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721Upgradeable.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721Upgradeable.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

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

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

    /**
     * @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[44] private __gap;
}

File 5 of 26 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 26 : ICafeStaking.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

import "../staking/StakingCommons.sol";

interface ICafeStaking {
    /**
     * @dev Emitted when a track is created that will distribute `rewards` $CAFE to holders of `asset`.
     */
    event TrackCreated(
        uint256 indexed id,
        address indexed asset,
        uint256 indexed rps
    );

    /**
     * @dev Emitted when a track is toggled (paused or resumed).
     */
    event TrackToggled(uint256 indexed id, bool indexed newState);

    /**
     * @dev Emitted when a track's reward balance is replenished.
     *
     */
    event TrackReplenished(
        uint256 indexed id,
        uint256 indexed amount,
        uint256 indexed newRps
    );

    /**
     * @dev Emitted when a track's reward balance is reduced.
     *
     */
    event TrackReduced(
        uint256 indexed id,
        uint256 indexed amount,
        uint256 indexed newRps
    ); 

    /**
     * @dev Emitted when an asset is staked.
     */
    event AssetStaked(address indexed asset, address account, uint256 amount);

    /**
     * @dev Emitted when an asset is unstaked.
     */
    event AssetUnstaked(address indexed asset, address account, uint256 amount);

    /**
     * @dev Emitted when `reward` tokens are claimed by `account`.
     */
    event RewardPaid(address indexed account, uint256 indexed reward);

    function createTrack(
        address asset,
        uint256 rewardsAmount,
        TrackType atype,
        uint256 start,
        uint256 end,
        uint256 lower,
        uint256 upper,
        bool transferLock
    ) external;

    function replenishTrack(uint256 trackId, uint256 amount) external;

    function toggleTrack(uint256 trackId) external;

    function execute(
        StakeRequest[] calldata msr,
        StakeAction[][] calldata actions
    ) external;

    function execute4(
        address account,
        StakeRequest[] calldata msr,
        StakeAction[][] calldata actions
    ) external;

    function rewardPerToken(uint256 trackId) external view returns (uint256);

    function earned(uint256 trackId, address account)
        external
        view
        returns (uint256);
}

File 10 of 26 : ICafeAccumulator.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

interface ICafeAccumulator {
    function pull(address) external returns (uint256);
}

File 11 of 26 : ISudoApprovable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

interface ISudoApprovable {
    function sudoLimitedApprove(address account, uint256 amount) external;
}

File 12 of 26 : StakingCommons.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

struct StakeRequest {
    uint256 trackId;
    uint256[] ids;
    uint256[] amounts;   
}

enum StakeAction {
    Stake,
    Unstake,
    Collect
}

enum TrackType {
    ERC20,
    ERC1155,
    ERC721
}

File 13 of 26 : Errors.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

error Unauthorized();

error InvalidArrayLength();

error InvalidMerkleProof();

error ZeroAddress();

error ZeroAmount();

error ZeroPrice();

error ContractAddressExpected(address contract_);

error InsufficientCAFE();

error InsufficientBalance();

error UnknownTrack();

error TokenLocked();

error TokenNotOwn();

error UnknownToken();

error TrackExpired();

error TokenNotLocked();

error NoTokensGiven();

error TokenOutOfRange();

error AmountExceedsLocked();

error StakingVolumeExceeded();

error StakingTrackNotAssigned();

error StakingLockViolation(uint256 tokenId);

error NotInStakingPeriod();

error TrackPaused(uint256 trackId);

error ContractPaused();

error VSExistsForAccount(address account);

error VSInvalidCliff();

error VSInvalidAllocation();

error VSMissing(address account);

error VSCliffNotReached();

error VSInvalidPeriodSpec();

error VSCliffNERelease();

error NothingVested();

error OnceOnly();

error MintingExceedsSupply(uint256 supply);
error MintingExceedsQuota();
error InvalidStage();

error DuplicateClaim();
error InvalidETHAmount();
error CollectionNotFound();
error CollectionPaused();
error InvalidPieceId();
error ZeroTokensRequested();
error CantCreateZeroTokens();

error InvalidTrackTiming();
error InvalidTrackStart();

error NoMorePhases();
error DuplicatePieceId();
error InvalidQuantity();
error NotEligible();
error NotInOpenSale();

File 14 of 26 : Staking.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

import "../staking/StakingCommons.sol";

library AutoStaking {
    function arrayify(uint256 value) internal pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = value;
        return array;
    }

    function arrayify(StakeAction value) internal pure returns (StakeAction[] memory) {
        StakeAction[] memory array = new StakeAction[](1);
        array[0] = value;
        return array;
    }

    function arrayify(StakeRequest memory value) internal pure returns (StakeRequest[] memory) {
        StakeRequest[] memory array = new StakeRequest[](1);
        array[0] = value;
        return array;
    }
}

File 15 of 26 : ERC721LockerUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "../../interfaces/IERC721StakingLocker.sol";
import "../../interfaces/IERC721x.sol";
import "./LockerAdmin.sol";
import "../Errors.sol";

abstract contract ERC721LockerUpgradeable is LockerAdmin, IERC721StakingLocker {
    mapping(uint256 => uint256) private _locked;
    IERC721Upgradeable private _parent;
    IERC721x private _parentx;

    function __init() internal {
        _parent = IERC721Upgradeable(address(this));
        _parentx = IERC721x(address(this));
    }

    function lock(address account, uint256[] calldata ids) external {
        _onlyLockerAdmin();
        for (uint256 t = 0; t < ids.length; t++) {
            uint256 tokenId = ids[t];

            if (isLocked(tokenId)) revert TokenLocked();

            if (!_parentx.exists(tokenId)) revert UnknownToken();

            if (_parent.ownerOf(tokenId) != account) revert TokenNotOwn();

            _lock(tokenId);
        }
    }

    function unlock(address account, uint256[] calldata ids) external {
        _onlyLockerAdmin();
        for (uint256 t = 0; t < ids.length; t++) {
            uint256 tokenId = ids[t];

            if (!isLocked(tokenId)) revert TokenNotLocked();

            if (!_parentx.exists(tokenId)) revert UnknownToken();

            if (_parent.ownerOf(tokenId) != account) revert TokenNotOwn();

            _unlock(tokenId);
        }
    }

    function isLocked(uint256 tokenId) public view returns (bool) {
        uint256 lockedWordIndex = tokenId / 256;
        uint256 lockedBitIndex = tokenId % 256;
        uint256 lockedWord = _locked[lockedWordIndex];
        uint256 mask = (1 << lockedBitIndex);
        return lockedWord & mask == mask;
    }

    function _lock(uint256 tokenId) private {
        uint256 lockedWordIndex = tokenId / 256;
        uint256 lockedBitIndex = tokenId % 256;
        _locked[lockedWordIndex] =
            _locked[lockedWordIndex] |
            (1 << lockedBitIndex);
    }
    
    function _unlock(uint256 tokenId) private {
        uint256 lockedWordIndex = tokenId / 256;
        uint256 lockedBitIndex = tokenId % 256;
        _locked[lockedWordIndex] =
            _locked[lockedWordIndex] &
            ~(1 << lockedBitIndex);
    }

    /**
     * @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 16 of 26 : ProxyRegistry.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

contract OwnableDelegateProxy {}

contract ProxyRegistry {
    mapping(address => OwnableDelegateProxy) public proxies;
}

address constant OS_PROXY_REGISTRY_ADDRESS = 0xa5409ec958C83C3f309868babACA7c86DCB077c1;

File 17 of 26 : UncheckedIncrement.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

library UncheckedIncrement {
    function inc(uint256 i) internal pure returns (uint256) {
        unchecked { return  i + 1; }
    }
}

File 18 of 26 : 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 19 of 26 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

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

File 20 of 26 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 21 of 26 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 22 of 26 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @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 23 of 26 : 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 24 of 26 : IERC721StakingLocker.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";

interface IERC721StakingLocker is IERC721Upgradeable {
    function lock(address, uint256[] memory) external;

    function unlock(address, uint256[] memory) external;

    function isLocked(uint256) external view returns (bool);
}

File 25 of 26 : IERC721x.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

interface IERC721x {
    function exists(uint256) external view returns (bool);
}

File 26 of 26 : LockerAdmin.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;

import "../Errors.sol";

abstract contract LockerAdmin {
    event LockerAdminSet(address indexed asset, address indexed account);

    address private _admin;

    /**
     * Return the address of the account that is allowed to lock/unlock amounts.
     */
    function getLockerAdmin() external view returns (address) {
        return _admin;
    }

    /**
     * Set the address of the account that is allowed to lock/unlock amounts.
     *
     * @param admin The address of the deployed Staking contract.
     */
    function _setLockerAdmin(address admin) internal {
        emit LockerAdminSet(address(this), admin);
        _admin = admin;
    }

    function _onlyLockerAdmin() internal view {
        if (msg.sender != _admin) revert Unauthorized();
    }

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"contract_","type":"address"}],"name":"ContractAddressExpected","type":"error"},{"inputs":[],"name":"ContractPaused","type":"error"},{"inputs":[{"internalType":"uint256","name":"supply","type":"uint256"}],"name":"MintingExceedsSupply","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"StakingLockViolation","type":"error"},{"inputs":[],"name":"TokenLocked","type":"error"},{"inputs":[],"name":"TokenNotLocked","type":"error"},{"inputs":[],"name":"TokenNotOwn","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UnknownToken","type":"error"},{"inputs":[],"name":"ZeroTokensRequested","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"newState","type":"bool"}],"name":"ContractToggle","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"LockerAdminSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"PriceUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"uri","type":"string"}],"name":"TokenURISet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"T0_FREN_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"T1_CAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"T1_FREN_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"T2_CAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"T2_FREN_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"T3_CAP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"T3_FREN_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cafeTeamSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cafeToken","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staking","type":"address"},{"internalType":"uint256","name":"trackId","type":"uint256"}],"name":"configureStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLockerAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"cafeToken_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"qt","type":"uint256"},{"internalType":"bool","name":"autostake","type":"bool"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"qt","type":"uint256"}],"name":"mintReserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"destination","type":"address"}],"name":"pull","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"page","type":"uint256"},{"internalType":"uint256","name":"records","type":"uint256"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061426c806100206000396000f3fe608060405234801561001057600080fd5b50600436106102de5760003560e01c80638b6a373911610186578063c839fe94116100e3578063e985e9c511610097578063f69ef7dc11610071578063f69ef7dc146105cf578063f6aacfb1146105e2578063f906751b146105f557600080fd5b8063e985e9c5146105a0578063edb64b9d146105b3578063f2fde38b146105bc57600080fd5b8063d93db8e2116100c8578063d93db8e214610565578063e0df5b6f14610583578063e7fd8c5e1461059657600080fd5b8063c839fe9414610532578063c87b56dd1461055257600080fd5b8063a22cb4651161013a578063bfa4400b1161011f578063bfa4400b146104fc578063c1406ce41461050f578063c4d66de81461051f57600080fd5b8063a22cb465146104d6578063b88d4fde146104e957600080fd5b80638e47f63f1161016b5780638e47f63f146104b357806395d89b41146104c6578063a035b1fe146104ce57600080fd5b80638b6a3739146104745780638da5cb5b1461049557600080fd5b80634f558e791161023f57806367f68fac116101f3578063715018a6116101cd578063715018a6146104535780637fbb11d91461045b57806383f2a3fd1461046457600080fd5b806367f68fac1461041d5780636ff44a561461043057806370a082311461044057600080fd5b806358c84fcc1161022457806358c84fcc146103eb5780635c975abb146103fc5780636352211e1461040a57600080fd5b80634f558e79146103c557806352d11238146103d857600080fd5b806323b872dd1161029657806332cb6b0c1161027b57806332cb6b0c146103a157806340a3d246146103aa57806342842e0e146103b257600080fd5b806323b872dd146103855780632a073f081461039857600080fd5b8063081812fc116102c7578063081812fc14610320578063095ea7b31461035857806318160ddd1461036d57600080fd5b806301ffc9a7146102e357806306fdde031461030b575b600080fd5b6102f66102f136600461383e565b610608565b60405190151581526020015b60405180910390f35b6103136106ed565b60405161030291906138d1565b61033361032e3660046138e4565b61077f565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610302565b61036b61036636600461391f565b61085e565b005b6103776101305481565b604051908152602001610302565b61036b61039336600461394b565b6109ea565b6103776103e981565b610377610d0581565b61036b610a8b565b61036b6103c036600461394b565b610afb565b6102f66103d33660046138e4565b610b16565b6103776103e636600461398c565b610b42565b6103776901043561a8829300000081565b61012f546102f69060ff1681565b6103336104183660046138e4565b610c62565b61036b61042b3660046139b7565b610d14565b61037768a2a15d09519be0000081565b61037761044e36600461398c565b610e85565b61036b610f53565b6103776101f581565b61037768d8d726b7177a80000081565b610134546103339073ffffffffffffffffffffffffffffffffffffffff1681565b60335473ffffffffffffffffffffffffffffffffffffffff16610333565b61036b6104c13660046139e7565b610fe0565b61031361121d565b61037761122c565b61036b6104e4366004613a6f565b61123b565b61036b6104f7366004613b60565b61124a565b61036b61050a3660046139e7565b6112ec565b61037768bdbc41e0348b30000081565b61036b61052d36600461398c565b611522565b610545610540366004613be0565b6117c4565b6040516103029190613c50565b6103136105603660046138e4565b6119d5565b60655473ffffffffffffffffffffffffffffffffffffffff16610333565b61036b610591366004613c63565b611a66565b6103776101315481565b6102f66105ae366004613cac565b611ac0565b6103776107d181565b61036b6105ca36600461398c565b611bcf565b61036b6105dd36600461391f565b611cff565b6102f66105f03660046138e4565b611d5d565b61036b6106033660046138e4565b611d9e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061069b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806106e757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b606060c980546106fc90613cda565b80601f016020809104026020016040519081016040528092919081815260200182805461072890613cda565b80156107755780601f1061074a57610100808354040283529160200191610775565b820191906000526020600020905b81548152906001019060200180831161075857829003601f168201915b5050505050905090565b600081815260cb602052604081205473ffffffffffffffffffffffffffffffffffffffff16610835576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b50600090815260cd602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600061086982610c62565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f7200000000000000000000000000000000000000000000000000000000000000606482015260840161082c565b3373ffffffffffffffffffffffffffffffffffffffff8216148061094f575061094f8133611ac0565b6109db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161082c565b6109e58383611eb1565b505050565b6109f43382611f51565b610a80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161082c565b6109e583838361208c565b610a936122fe565b61012f5460405160ff909116159081907fe7188a3ff322128844d42b1d33903c1f5d02e1b42dc39ac55c17ac3eae2b60c290600090a261012f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b6109e58383836040518060200160405280600081525061124a565b600081815260cb602052604081205473ffffffffffffffffffffffffffffffffffffffff1615156106e7565b6000610b4c61234f565b6101335473ffffffffffffffffffffffffffffffffffffffff16338114610b9f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610134546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610c0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c339190613d2d565b61013454909150610c5b9073ffffffffffffffffffffffffffffffffffffffff1685836123a0565b9392505050565b600081815260cb602052604081205473ffffffffffffffffffffffffffffffffffffffff16806106e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e0000000000000000000000000000000000000000000000606482015260840161082c565b610d1c612474565b81600003610d56576040517f245a116a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d058261013054610d689190613d75565b1115610da4576040517f89611fd0000000000000000000000000000000000000000000000000000000008152610d05600482015260240161082c565b6000610dae6124b2565b610db89084613d8d565b610134546040517ffeeaba1e0000000000000000000000000000000000000000000000000000000081523360048201526024810183905291925073ffffffffffffffffffffffffffffffffffffffff169063feeaba1e90604401600060405180830381600087803b158015610e2c57600080fd5b505af1158015610e40573d6000803e3d6000fd5b505061013454610e6b925073ffffffffffffffffffffffffffffffffffffffff169050333084612514565b610e753384612572565b81156109e5576109e533846125cb565b600073ffffffffffffffffffffffffffffffffffffffff8216610f2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f206164647265737300000000000000000000000000000000000000000000606482015260840161082c565b5073ffffffffffffffffffffffffffffffffffffffff16600090815260cc602052604090205490565b60335473ffffffffffffffffffffffffffffffffffffffff163314610fd4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082c565b610fde6000612789565b565b610fe861234f565b60005b8181101561121757600083838381811061100757611007613dca565b90506020020135905061101981611d5d565b15611050576040517f5a8181f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fd546040517f4f558e790000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff90911690634f558e7990602401602060405180830381865afa1580156110bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e39190613df9565b611119576040517f8698bf3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff878116921690636352211e90602401602060405180830381865afa15801561118a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ae9190613e16565b73ffffffffffffffffffffffffffffffffffffffff16146111fb576040517f4d0a7e8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61120481612800565b508061120f81613e33565b915050610feb565b50505050565b606060ca80546106fc90613cda565b60006112366124b2565b905090565b61124633838361283e565b5050565b6112543383611f51565b6112e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161082c565b6112178484848461296b565b6112f461234f565b60005b8181101561121757600083838381811061131357611313613dca565b90506020020135905061132581611d5d565b61135b576040517f5b166a3000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fd546040517f4f558e790000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff90911690634f558e7990602401602060405180830381865afa1580156113ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ee9190613df9565b611424576040517f8698bf3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff878116921690636352211e90602401602060405180830381865afa158015611495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b99190613e16565b73ffffffffffffffffffffffffffffffffffffffff1614611506576040517f4d0a7e8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61150f81612a0e565b508061151a81613e33565b9150506112f7565b600054610100900460ff1661153d5760005460ff1615611541565b303b155b6115cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161082c565b600054610100900460ff1615801561160c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b73ffffffffffffffffffffffffffffffffffffffff82163b611672576040517faceed76b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8316600482015260240161082c565b61013480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416179055604080518082018252600f81527f536f756c2043616665204672656e7300000000000000000000000000000000006020808301919091528251808401909352600383527f53434600000000000000000000000000000000000000000000000000000000009083015261172491612a4d565b61172c612aee565b60fc8054307fffffffffffffffffffffffff0000000000000000000000000000000000000000918216811790925560fd8054909116909117905561012f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561124657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555050565b606060006117d28385613d8d565b905060006101305484836117e69190613d75565b116117fa576117f58483613d75565b6117ff565b610130545b905060008467ffffffffffffffff81111561181c5761181c613a9d565b604051908082528060200260200182016040528015611845578160200160208202803683370190505b5090506000835b838110156118de5761185d81610c62565b73ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16036118d657600081116118a9576118a4610d056001613d75565b6118ab565b805b8383815181106118bd576118bd613dca565b6020908102919091010152816118d281613e33565b9250505b60010161184c565b5060008167ffffffffffffffff8111156118fa576118fa613a9d565b604051908082528060200260200182016040528015611923578160200160208202803683370190505b50905060005b828110156119c857600084828151811061194557611945613dca565b602002602001015111156119c057611960610d056001613d75565b84828151811061197257611972613dca565b60200260200101511461199e5783818151811061199157611991613dca565b60200260200101516119a1565b60005b8282815181106119b3576119b3613dca565b6020026020010181815250505b600101611929565b5098975050505050505050565b600081815260cb602052604090205460609073ffffffffffffffffffffffffffffffffffffffff16611a33576040517f8698bf3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610135611a3f83612b8d565b604051602001611a50929190613e87565b6040516020818303038152906040529050919050565b611a6e6122fe565b80604051611a7c9190613f90565b604051908190038120907f5bb111c9b2ad41c6cc1754cdbee2cc303b7becb89d29d2d5f91165fcc0b0a49d90600090a2805161124690610135906020840190613777565b6040517fc455279100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009173a5409ec958c83c3f309868babaca7c86dcb077c191841690829063c455279190602401602060405180830381865afa158015611b47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6b9190613e16565b73ffffffffffffffffffffffffffffffffffffffff1603611b905760019150506106e7565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260ce602090815260408083209387168352929052205460ff165b949350505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314611c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082c565b73ffffffffffffffffffffffffffffffffffffffff8116611cf3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161082c565b611cfc81612789565b50565b611d076122fe565b611d1082612cc2565b61013380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff939093169290921790915561013255565b600080611d6c61010084613fdb565b90506000611d7c61010085613fef565b600092835260fb602052604090922054600190921b9182169091149392505050565b611da66122fe565b80600003611de0576040517f245a116a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60648161013154611df19190613d75565b1115611e2c576040517f89611fd00000000000000000000000000000000000000000000000000000000081526064600482015260240161082c565b610d058161013054611e3e9190613d75565b1115611e7a576040517f89611fd0000000000000000000000000000000000000000000000000000000008152610d05600482015260240161082c565b806101316000828254611e8d9190613d75565b90915550611cfc9050739cd59cd50625c7e2994ba6a2cf9b70c5a775e8db82612572565b600081815260cd6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091558190611f0b82610c62565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081815260cb602052604081205473ffffffffffffffffffffffffffffffffffffffff16612002576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e0000000000000000000000000000000000000000606482015260840161082c565b600061200d83610c62565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061207c57508373ffffffffffffffffffffffffffffffffffffffff166120648461077f565b73ffffffffffffffffffffffffffffffffffffffff16145b80611bc75750611bc78185611ac0565b8273ffffffffffffffffffffffffffffffffffffffff166120ac82610c62565b73ffffffffffffffffffffffffffffffffffffffff161461214f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e6572000000000000000000000000000000000000000000000000000000606482015260840161082c565b73ffffffffffffffffffffffffffffffffffffffff82166121f1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161082c565b6121fc838383612d4c565b612207600082611eb1565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260cc6020526040812080546001929061223d908490614003565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260cc60205260408120805460019290612278908490613d75565b9091555050600081815260cb602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610fde576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60655473ffffffffffffffffffffffffffffffffffffffff163314610fde576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526109e59084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612daf565b61012f5460ff1615610fde576040517fab35696f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006101f56101305410156124cf575068a2a15d09519be0000090565b6103e96101305410156124ea575068bdbc41e0348b30000090565b6107d1610130541015612505575068d8d726b7177a80000090565b506901043561a8829300000090565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526112179085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016123f2565b8061013060008282546125859190613d75565b90915550600090505b818110156109e5576125b9838284610130546125aa9190614003565b6125b49190613d75565b612ebb565b806125c381613e33565b91505061258e565b60008167ffffffffffffffff8111156125e6576125e6613a9d565b60405190808252806020026020018201604052801561260f578160200160208202803683370190505b509050600082610130546126239190614003565b61013054909150815b8181101561266d5780846126408583614003565b8151811061265057612650613dca565b60209081029190910101528061266581613e33565b91505061262c565b5060606000612698604051806060016040528061013254815260200187815260200184815250612ed5565b60408051600180825281830190925291925060009190816020015b60608152602001906001900390816126b35790505090506126d46000612f4e565b816000815181106126e7576126e7613dca565b6020908102919091010152610133546040517f6a4d214e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690636a4d214e9061274d908b90869086906004016140fb565b600060405180830381600087803b15801561276757600080fd5b505af115801561277b573d6000803e3d6000fd5b505050505050505050505050565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061280e61010083613fdb565b9050600061281e61010084613fef565b600092835260fb60205260409092208054600190931b9092179091555050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036128d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161082c565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260ce602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61297684848461208c565b61298284848484612fbd565b611217576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161082c565b6000612a1c61010083613fdb565b90506000612a2c61010084613fef565b600092835260fb60205260409092208054600190931b199092169091555050565b600054610100900460ff16612ae4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161082c565b61124682826131b0565b600054610100900460ff16612b85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161082c565b610fde61326e565b606081600003612bd057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612bfa5780612be481613e33565b9150612bf39050600a83613fdb565b9150612bd4565b60008167ffffffffffffffff811115612c1557612c15613a9d565b6040519080825280601f01601f191660200182016040528015612c3f576020820181803683370190505b5090505b8415611bc757612c54600183614003565b9150612c61600a86613fef565b612c6c906030613d75565b60f81b818381518110612c8157612c81613dca565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612cbb600a86613fdb565b9450612c43565b60405173ffffffffffffffffffffffffffffffffffffffff82169030907fe2cf98aa40f3126c9b94d4e85f566d839d415f49d22005cff72d2745c48adbdf90600090a3606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff8316612d6c57505050565b612d7581611d5d565b156109e5576040517fff875c6f0000000000000000000000000000000000000000000000000000000081526004810182905260240161082c565b6000612e11826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661330e9092919063ffffffff16565b8051909150156109e55780806020019051810190612e2f9190613df9565b6109e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161082c565b61124682826040518060200160405280600081525061331d565b60408051600180825281830190925260609160009190816020015b612f1460405180606001604052806000815260200160608152602001606081525090565b815260200190600190039081612ef05790505090508281600081518110612f3d57612f3d613dca565b602090810291909101015292915050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612f8857612f88613dca565b60200260200101906002811115612fa157612fa161401a565b90816002811115612fb457612fb461401a565b90525092915050565b600073ffffffffffffffffffffffffffffffffffffffff84163b156131a5576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a02906130349033908990889088906004016141d0565b6020604051808303816000875af192505050801561308d575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261308a91810190614219565b60015b61315a573d8080156130bb576040519150601f19603f3d011682016040523d82523d6000602084013e6130c0565b606091505b508051600003613152576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161082c565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050611bc7565b506001949350505050565b600054610100900460ff16613247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161082c565b815161325a9060c9906020850190613777565b5080516109e59060ca906020840190613777565b600054610100900460ff16613305576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161082c565b610fde33612789565b6060611bc784846000856133c0565b6133278383613556565b6133346000848484612fbd565b6109e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161082c565b606082471015613452576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161082c565b73ffffffffffffffffffffffffffffffffffffffff85163b6134d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161082c565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516134f99190613f90565b60006040518083038185875af1925050503d8060008114613536576040519150601f19603f3d011682016040523d82523d6000602084013e61353b565b606091505b509150915061354b828286613724565b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff82166135d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161082c565b600081815260cb602052604090205473ffffffffffffffffffffffffffffffffffffffff161561365f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161082c565b61366b60008383612d4c565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260cc602052604081208054600192906136a1908490613d75565b9091555050600081815260cb602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60608315613733575081610c5b565b8251156137435782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082c91906138d1565b82805461378390613cda565b90600052602060002090601f0160209004810192826137a557600085556137eb565b82601f106137be57805160ff19168380011785556137eb565b828001600101855582156137eb579182015b828111156137eb5782518255916020019190600101906137d0565b506137f79291506137fb565b5090565b5b808211156137f757600081556001016137fc565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611cfc57600080fd5b60006020828403121561385057600080fd5b8135610c5b81613810565b60005b8381101561387657818101518382015260200161385e565b838111156112175750506000910152565b6000815180845261389f81602086016020860161385b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c5b6020830184613887565b6000602082840312156138f657600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114611cfc57600080fd5b6000806040838503121561393257600080fd5b823561393d816138fd565b946020939093013593505050565b60008060006060848603121561396057600080fd5b833561396b816138fd565b9250602084013561397b816138fd565b929592945050506040919091013590565b60006020828403121561399e57600080fd5b8135610c5b816138fd565b8015158114611cfc57600080fd5b600080604083850312156139ca57600080fd5b8235915060208301356139dc816139a9565b809150509250929050565b6000806000604084860312156139fc57600080fd5b8335613a07816138fd565b9250602084013567ffffffffffffffff80821115613a2457600080fd5b818601915086601f830112613a3857600080fd5b813581811115613a4757600080fd5b8760208260051b8501011115613a5c57600080fd5b6020830194508093505050509250925092565b60008060408385031215613a8257600080fd5b8235613a8d816138fd565b915060208301356139dc816139a9565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff80841115613ae757613ae7613a9d565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715613b2d57613b2d613a9d565b81604052809350858152868686011115613b4657600080fd5b858560208301376000602087830101525050509392505050565b60008060008060808587031215613b7657600080fd5b8435613b81816138fd565b93506020850135613b91816138fd565b925060408501359150606085013567ffffffffffffffff811115613bb457600080fd5b8501601f81018713613bc557600080fd5b613bd487823560208401613acc565b91505092959194509250565b600080600060608486031215613bf557600080fd5b8335613c00816138fd565b95602085013595506040909401359392505050565b600081518084526020808501945080840160005b83811015613c4557815187529582019590820190600101613c29565b509495945050505050565b602081526000610c5b6020830184613c15565b600060208284031215613c7557600080fd5b813567ffffffffffffffff811115613c8c57600080fd5b8201601f81018413613c9d57600080fd5b611bc784823560208401613acc565b60008060408385031215613cbf57600080fd5b8235613cca816138fd565b915060208301356139dc816138fd565b600181811c90821680613cee57607f821691505b602082108103613d27577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600060208284031215613d3f57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115613d8857613d88613d46565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613dc557613dc5613d46565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613e0b57600080fd5b8151610c5b816139a9565b600060208284031215613e2857600080fd5b8151610c5b816138fd565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613e6457613e64613d46565b5060010190565b60008151613e7d81856020860161385b565b9290920192915050565b600080845481600182811c915080831680613ea357607f831692505b60208084108203613edb577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b818015613eef5760018114613f1e57613f4b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00861689528489019650613f4b565b60008b81526020902060005b86811015613f435781548b820152908501908301613f2a565b505084890196505b505050505050613f87613f5e8286613e6b565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050190565b95945050505050565b60008251613fa281846020870161385b565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613fea57613fea613fac565b500490565b600082613ffe57613ffe613fac565b500690565b60008282101561401557614015613d46565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600081518084526020808501808196508360051b8101915082860160005b858110156140ee57828403895281518051808652908601908686019060005b818110156140d9578351600381106140c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b83529288019291880191600101614086565b50509986019994505090840190600101614067565b5091979650505050505050565b6000606080830173ffffffffffffffffffffffffffffffffffffffff871684526020828186015281875180845260808701915060808160051b880101935082890160005b828110156141b9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8089870301845281518051875285810151888789015261418989890182613c15565b90506040808301519250888203818a0152506141a58183613c15565b97505050928401929084019060010161413f565b5050505050838103604085015261354b8186614049565b600073ffffffffffffffffffffffffffffffffffffffff80871683528086166020840152508360408301526080606083015261420f6080830184613887565b9695505050505050565b60006020828403121561422b57600080fd5b8151610c5b8161381056fea264697066735822122033261bf0cc7bef20bda58763b49168d28514c3755e35ac76039f28e8e3df5de764736f6c634300080d0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102de5760003560e01c80638b6a373911610186578063c839fe94116100e3578063e985e9c511610097578063f69ef7dc11610071578063f69ef7dc146105cf578063f6aacfb1146105e2578063f906751b146105f557600080fd5b8063e985e9c5146105a0578063edb64b9d146105b3578063f2fde38b146105bc57600080fd5b8063d93db8e2116100c8578063d93db8e214610565578063e0df5b6f14610583578063e7fd8c5e1461059657600080fd5b8063c839fe9414610532578063c87b56dd1461055257600080fd5b8063a22cb4651161013a578063bfa4400b1161011f578063bfa4400b146104fc578063c1406ce41461050f578063c4d66de81461051f57600080fd5b8063a22cb465146104d6578063b88d4fde146104e957600080fd5b80638e47f63f1161016b5780638e47f63f146104b357806395d89b41146104c6578063a035b1fe146104ce57600080fd5b80638b6a3739146104745780638da5cb5b1461049557600080fd5b80634f558e791161023f57806367f68fac116101f3578063715018a6116101cd578063715018a6146104535780637fbb11d91461045b57806383f2a3fd1461046457600080fd5b806367f68fac1461041d5780636ff44a561461043057806370a082311461044057600080fd5b806358c84fcc1161022457806358c84fcc146103eb5780635c975abb146103fc5780636352211e1461040a57600080fd5b80634f558e79146103c557806352d11238146103d857600080fd5b806323b872dd1161029657806332cb6b0c1161027b57806332cb6b0c146103a157806340a3d246146103aa57806342842e0e146103b257600080fd5b806323b872dd146103855780632a073f081461039857600080fd5b8063081812fc116102c7578063081812fc14610320578063095ea7b31461035857806318160ddd1461036d57600080fd5b806301ffc9a7146102e357806306fdde031461030b575b600080fd5b6102f66102f136600461383e565b610608565b60405190151581526020015b60405180910390f35b6103136106ed565b60405161030291906138d1565b61033361032e3660046138e4565b61077f565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610302565b61036b61036636600461391f565b61085e565b005b6103776101305481565b604051908152602001610302565b61036b61039336600461394b565b6109ea565b6103776103e981565b610377610d0581565b61036b610a8b565b61036b6103c036600461394b565b610afb565b6102f66103d33660046138e4565b610b16565b6103776103e636600461398c565b610b42565b6103776901043561a8829300000081565b61012f546102f69060ff1681565b6103336104183660046138e4565b610c62565b61036b61042b3660046139b7565b610d14565b61037768a2a15d09519be0000081565b61037761044e36600461398c565b610e85565b61036b610f53565b6103776101f581565b61037768d8d726b7177a80000081565b610134546103339073ffffffffffffffffffffffffffffffffffffffff1681565b60335473ffffffffffffffffffffffffffffffffffffffff16610333565b61036b6104c13660046139e7565b610fe0565b61031361121d565b61037761122c565b61036b6104e4366004613a6f565b61123b565b61036b6104f7366004613b60565b61124a565b61036b61050a3660046139e7565b6112ec565b61037768bdbc41e0348b30000081565b61036b61052d36600461398c565b611522565b610545610540366004613be0565b6117c4565b6040516103029190613c50565b6103136105603660046138e4565b6119d5565b60655473ffffffffffffffffffffffffffffffffffffffff16610333565b61036b610591366004613c63565b611a66565b6103776101315481565b6102f66105ae366004613cac565b611ac0565b6103776107d181565b61036b6105ca36600461398c565b611bcf565b61036b6105dd36600461391f565b611cff565b6102f66105f03660046138e4565b611d5d565b61036b6106033660046138e4565b611d9e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061069b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806106e757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b606060c980546106fc90613cda565b80601f016020809104026020016040519081016040528092919081815260200182805461072890613cda565b80156107755780601f1061074a57610100808354040283529160200191610775565b820191906000526020600020905b81548152906001019060200180831161075857829003601f168201915b5050505050905090565b600081815260cb602052604081205473ffffffffffffffffffffffffffffffffffffffff16610835576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b50600090815260cd602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600061086982610c62565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f7200000000000000000000000000000000000000000000000000000000000000606482015260840161082c565b3373ffffffffffffffffffffffffffffffffffffffff8216148061094f575061094f8133611ac0565b6109db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161082c565b6109e58383611eb1565b505050565b6109f43382611f51565b610a80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161082c565b6109e583838361208c565b610a936122fe565b61012f5460405160ff909116159081907fe7188a3ff322128844d42b1d33903c1f5d02e1b42dc39ac55c17ac3eae2b60c290600090a261012f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b6109e58383836040518060200160405280600081525061124a565b600081815260cb602052604081205473ffffffffffffffffffffffffffffffffffffffff1615156106e7565b6000610b4c61234f565b6101335473ffffffffffffffffffffffffffffffffffffffff16338114610b9f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610134546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610c0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c339190613d2d565b61013454909150610c5b9073ffffffffffffffffffffffffffffffffffffffff1685836123a0565b9392505050565b600081815260cb602052604081205473ffffffffffffffffffffffffffffffffffffffff16806106e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e0000000000000000000000000000000000000000000000606482015260840161082c565b610d1c612474565b81600003610d56576040517f245a116a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d058261013054610d689190613d75565b1115610da4576040517f89611fd0000000000000000000000000000000000000000000000000000000008152610d05600482015260240161082c565b6000610dae6124b2565b610db89084613d8d565b610134546040517ffeeaba1e0000000000000000000000000000000000000000000000000000000081523360048201526024810183905291925073ffffffffffffffffffffffffffffffffffffffff169063feeaba1e90604401600060405180830381600087803b158015610e2c57600080fd5b505af1158015610e40573d6000803e3d6000fd5b505061013454610e6b925073ffffffffffffffffffffffffffffffffffffffff169050333084612514565b610e753384612572565b81156109e5576109e533846125cb565b600073ffffffffffffffffffffffffffffffffffffffff8216610f2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f206164647265737300000000000000000000000000000000000000000000606482015260840161082c565b5073ffffffffffffffffffffffffffffffffffffffff16600090815260cc602052604090205490565b60335473ffffffffffffffffffffffffffffffffffffffff163314610fd4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082c565b610fde6000612789565b565b610fe861234f565b60005b8181101561121757600083838381811061100757611007613dca565b90506020020135905061101981611d5d565b15611050576040517f5a8181f700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fd546040517f4f558e790000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff90911690634f558e7990602401602060405180830381865afa1580156110bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e39190613df9565b611119576040517f8698bf3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff878116921690636352211e90602401602060405180830381865afa15801561118a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ae9190613e16565b73ffffffffffffffffffffffffffffffffffffffff16146111fb576040517f4d0a7e8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61120481612800565b508061120f81613e33565b915050610feb565b50505050565b606060ca80546106fc90613cda565b60006112366124b2565b905090565b61124633838361283e565b5050565b6112543383611f51565b6112e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161082c565b6112178484848461296b565b6112f461234f565b60005b8181101561121757600083838381811061131357611313613dca565b90506020020135905061132581611d5d565b61135b576040517f5b166a3000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fd546040517f4f558e790000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff90911690634f558e7990602401602060405180830381865afa1580156113ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ee9190613df9565b611424576040517f8698bf3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff878116921690636352211e90602401602060405180830381865afa158015611495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b99190613e16565b73ffffffffffffffffffffffffffffffffffffffff1614611506576040517f4d0a7e8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61150f81612a0e565b508061151a81613e33565b9150506112f7565b600054610100900460ff1661153d5760005460ff1615611541565b303b155b6115cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161082c565b600054610100900460ff1615801561160c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b73ffffffffffffffffffffffffffffffffffffffff82163b611672576040517faceed76b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8316600482015260240161082c565b61013480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416179055604080518082018252600f81527f536f756c2043616665204672656e7300000000000000000000000000000000006020808301919091528251808401909352600383527f53434600000000000000000000000000000000000000000000000000000000009083015261172491612a4d565b61172c612aee565b60fc8054307fffffffffffffffffffffffff0000000000000000000000000000000000000000918216811790925560fd8054909116909117905561012f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561124657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555050565b606060006117d28385613d8d565b905060006101305484836117e69190613d75565b116117fa576117f58483613d75565b6117ff565b610130545b905060008467ffffffffffffffff81111561181c5761181c613a9d565b604051908082528060200260200182016040528015611845578160200160208202803683370190505b5090506000835b838110156118de5761185d81610c62565b73ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16036118d657600081116118a9576118a4610d056001613d75565b6118ab565b805b8383815181106118bd576118bd613dca565b6020908102919091010152816118d281613e33565b9250505b60010161184c565b5060008167ffffffffffffffff8111156118fa576118fa613a9d565b604051908082528060200260200182016040528015611923578160200160208202803683370190505b50905060005b828110156119c857600084828151811061194557611945613dca565b602002602001015111156119c057611960610d056001613d75565b84828151811061197257611972613dca565b60200260200101511461199e5783818151811061199157611991613dca565b60200260200101516119a1565b60005b8282815181106119b3576119b3613dca565b6020026020010181815250505b600101611929565b5098975050505050505050565b600081815260cb602052604090205460609073ffffffffffffffffffffffffffffffffffffffff16611a33576040517f8698bf3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610135611a3f83612b8d565b604051602001611a50929190613e87565b6040516020818303038152906040529050919050565b611a6e6122fe565b80604051611a7c9190613f90565b604051908190038120907f5bb111c9b2ad41c6cc1754cdbee2cc303b7becb89d29d2d5f91165fcc0b0a49d90600090a2805161124690610135906020840190613777565b6040517fc455279100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015260009173a5409ec958c83c3f309868babaca7c86dcb077c191841690829063c455279190602401602060405180830381865afa158015611b47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6b9190613e16565b73ffffffffffffffffffffffffffffffffffffffff1603611b905760019150506106e7565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260ce602090815260408083209387168352929052205460ff165b949350505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314611c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161082c565b73ffffffffffffffffffffffffffffffffffffffff8116611cf3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161082c565b611cfc81612789565b50565b611d076122fe565b611d1082612cc2565b61013380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff939093169290921790915561013255565b600080611d6c61010084613fdb565b90506000611d7c61010085613fef565b600092835260fb602052604090922054600190921b9182169091149392505050565b611da66122fe565b80600003611de0576040517f245a116a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60648161013154611df19190613d75565b1115611e2c576040517f89611fd00000000000000000000000000000000000000000000000000000000081526064600482015260240161082c565b610d058161013054611e3e9190613d75565b1115611e7a576040517f89611fd0000000000000000000000000000000000000000000000000000000008152610d05600482015260240161082c565b806101316000828254611e8d9190613d75565b90915550611cfc9050739cd59cd50625c7e2994ba6a2cf9b70c5a775e8db82612572565b600081815260cd6020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091558190611f0b82610c62565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081815260cb602052604081205473ffffffffffffffffffffffffffffffffffffffff16612002576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e0000000000000000000000000000000000000000606482015260840161082c565b600061200d83610c62565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061207c57508373ffffffffffffffffffffffffffffffffffffffff166120648461077f565b73ffffffffffffffffffffffffffffffffffffffff16145b80611bc75750611bc78185611ac0565b8273ffffffffffffffffffffffffffffffffffffffff166120ac82610c62565b73ffffffffffffffffffffffffffffffffffffffff161461214f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e6572000000000000000000000000000000000000000000000000000000606482015260840161082c565b73ffffffffffffffffffffffffffffffffffffffff82166121f1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161082c565b6121fc838383612d4c565b612207600082611eb1565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260cc6020526040812080546001929061223d908490614003565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260cc60205260408120805460019290612278908490613d75565b9091555050600081815260cb602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610fde576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60655473ffffffffffffffffffffffffffffffffffffffff163314610fde576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526109e59084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612daf565b61012f5460ff1615610fde576040517fab35696f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006101f56101305410156124cf575068a2a15d09519be0000090565b6103e96101305410156124ea575068bdbc41e0348b30000090565b6107d1610130541015612505575068d8d726b7177a80000090565b506901043561a8829300000090565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526112179085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016123f2565b8061013060008282546125859190613d75565b90915550600090505b818110156109e5576125b9838284610130546125aa9190614003565b6125b49190613d75565b612ebb565b806125c381613e33565b91505061258e565b60008167ffffffffffffffff8111156125e6576125e6613a9d565b60405190808252806020026020018201604052801561260f578160200160208202803683370190505b509050600082610130546126239190614003565b61013054909150815b8181101561266d5780846126408583614003565b8151811061265057612650613dca565b60209081029190910101528061266581613e33565b91505061262c565b5060606000612698604051806060016040528061013254815260200187815260200184815250612ed5565b60408051600180825281830190925291925060009190816020015b60608152602001906001900390816126b35790505090506126d46000612f4e565b816000815181106126e7576126e7613dca565b6020908102919091010152610133546040517f6a4d214e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690636a4d214e9061274d908b90869086906004016140fb565b600060405180830381600087803b15801561276757600080fd5b505af115801561277b573d6000803e3d6000fd5b505050505050505050505050565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061280e61010083613fdb565b9050600061281e61010084613fef565b600092835260fb60205260409092208054600190931b9092179091555050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036128d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161082c565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260ce602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61297684848461208c565b61298284848484612fbd565b611217576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161082c565b6000612a1c61010083613fdb565b90506000612a2c61010084613fef565b600092835260fb60205260409092208054600190931b199092169091555050565b600054610100900460ff16612ae4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161082c565b61124682826131b0565b600054610100900460ff16612b85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161082c565b610fde61326e565b606081600003612bd057505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612bfa5780612be481613e33565b9150612bf39050600a83613fdb565b9150612bd4565b60008167ffffffffffffffff811115612c1557612c15613a9d565b6040519080825280601f01601f191660200182016040528015612c3f576020820181803683370190505b5090505b8415611bc757612c54600183614003565b9150612c61600a86613fef565b612c6c906030613d75565b60f81b818381518110612c8157612c81613dca565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612cbb600a86613fdb565b9450612c43565b60405173ffffffffffffffffffffffffffffffffffffffff82169030907fe2cf98aa40f3126c9b94d4e85f566d839d415f49d22005cff72d2745c48adbdf90600090a3606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff8316612d6c57505050565b612d7581611d5d565b156109e5576040517fff875c6f0000000000000000000000000000000000000000000000000000000081526004810182905260240161082c565b6000612e11826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661330e9092919063ffffffff16565b8051909150156109e55780806020019051810190612e2f9190613df9565b6109e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161082c565b61124682826040518060200160405280600081525061331d565b60408051600180825281830190925260609160009190816020015b612f1460405180606001604052806000815260200160608152602001606081525090565b815260200190600190039081612ef05790505090508281600081518110612f3d57612f3d613dca565b602090810291909101015292915050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612f8857612f88613dca565b60200260200101906002811115612fa157612fa161401a565b90816002811115612fb457612fb461401a565b90525092915050565b600073ffffffffffffffffffffffffffffffffffffffff84163b156131a5576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a02906130349033908990889088906004016141d0565b6020604051808303816000875af192505050801561308d575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261308a91810190614219565b60015b61315a573d8080156130bb576040519150601f19603f3d011682016040523d82523d6000602084013e6130c0565b606091505b508051600003613152576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161082c565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050611bc7565b506001949350505050565b600054610100900460ff16613247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161082c565b815161325a9060c9906020850190613777565b5080516109e59060ca906020840190613777565b600054610100900460ff16613305576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161082c565b610fde33612789565b6060611bc784846000856133c0565b6133278383613556565b6133346000848484612fbd565b6109e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161082c565b606082471015613452576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161082c565b73ffffffffffffffffffffffffffffffffffffffff85163b6134d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161082c565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516134f99190613f90565b60006040518083038185875af1925050503d8060008114613536576040519150601f19603f3d011682016040523d82523d6000602084013e61353b565b606091505b509150915061354b828286613724565b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff82166135d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161082c565b600081815260cb602052604090205473ffffffffffffffffffffffffffffffffffffffff161561365f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161082c565b61366b60008383612d4c565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260cc602052604081208054600192906136a1908490613d75565b9091555050600081815260cb602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60608315613733575081610c5b565b8251156137435782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082c91906138d1565b82805461378390613cda565b90600052602060002090601f0160209004810192826137a557600085556137eb565b82601f106137be57805160ff19168380011785556137eb565b828001600101855582156137eb579182015b828111156137eb5782518255916020019190600101906137d0565b506137f79291506137fb565b5090565b5b808211156137f757600081556001016137fc565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611cfc57600080fd5b60006020828403121561385057600080fd5b8135610c5b81613810565b60005b8381101561387657818101518382015260200161385e565b838111156112175750506000910152565b6000815180845261389f81602086016020860161385b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c5b6020830184613887565b6000602082840312156138f657600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114611cfc57600080fd5b6000806040838503121561393257600080fd5b823561393d816138fd565b946020939093013593505050565b60008060006060848603121561396057600080fd5b833561396b816138fd565b9250602084013561397b816138fd565b929592945050506040919091013590565b60006020828403121561399e57600080fd5b8135610c5b816138fd565b8015158114611cfc57600080fd5b600080604083850312156139ca57600080fd5b8235915060208301356139dc816139a9565b809150509250929050565b6000806000604084860312156139fc57600080fd5b8335613a07816138fd565b9250602084013567ffffffffffffffff80821115613a2457600080fd5b818601915086601f830112613a3857600080fd5b813581811115613a4757600080fd5b8760208260051b8501011115613a5c57600080fd5b6020830194508093505050509250925092565b60008060408385031215613a8257600080fd5b8235613a8d816138fd565b915060208301356139dc816139a9565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff80841115613ae757613ae7613a9d565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715613b2d57613b2d613a9d565b81604052809350858152868686011115613b4657600080fd5b858560208301376000602087830101525050509392505050565b60008060008060808587031215613b7657600080fd5b8435613b81816138fd565b93506020850135613b91816138fd565b925060408501359150606085013567ffffffffffffffff811115613bb457600080fd5b8501601f81018713613bc557600080fd5b613bd487823560208401613acc565b91505092959194509250565b600080600060608486031215613bf557600080fd5b8335613c00816138fd565b95602085013595506040909401359392505050565b600081518084526020808501945080840160005b83811015613c4557815187529582019590820190600101613c29565b509495945050505050565b602081526000610c5b6020830184613c15565b600060208284031215613c7557600080fd5b813567ffffffffffffffff811115613c8c57600080fd5b8201601f81018413613c9d57600080fd5b611bc784823560208401613acc565b60008060408385031215613cbf57600080fd5b8235613cca816138fd565b915060208301356139dc816138fd565b600181811c90821680613cee57607f821691505b602082108103613d27577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600060208284031215613d3f57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115613d8857613d88613d46565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613dc557613dc5613d46565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613e0b57600080fd5b8151610c5b816139a9565b600060208284031215613e2857600080fd5b8151610c5b816138fd565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613e6457613e64613d46565b5060010190565b60008151613e7d81856020860161385b565b9290920192915050565b600080845481600182811c915080831680613ea357607f831692505b60208084108203613edb577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b818015613eef5760018114613f1e57613f4b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00861689528489019650613f4b565b60008b81526020902060005b86811015613f435781548b820152908501908301613f2a565b505084890196505b505050505050613f87613f5e8286613e6b565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050190565b95945050505050565b60008251613fa281846020870161385b565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613fea57613fea613fac565b500490565b600082613ffe57613ffe613fac565b500690565b60008282101561401557614015613d46565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600081518084526020808501808196508360051b8101915082860160005b858110156140ee57828403895281518051808652908601908686019060005b818110156140d9578351600381106140c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b83529288019291880191600101614086565b50509986019994505090840190600101614067565b5091979650505050505050565b6000606080830173ffffffffffffffffffffffffffffffffffffffff871684526020828186015281875180845260808701915060808160051b880101935082890160005b828110156141b9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8089870301845281518051875285810151888789015261418989890182613c15565b90506040808301519250888203818a0152506141a58183613c15565b97505050928401929084019060010161413f565b5050505050838103604085015261354b8186614049565b600073ffffffffffffffffffffffffffffffffffffffff80871683528086166020840152508360408301526080606083015261420f6080830184613887565b9695505050505050565b60006020828403121561422b57600080fd5b8151610c5b8161381056fea264697066735822122033261bf0cc7bef20bda58763b49168d28514c3755e35ac76039f28e8e3df5de764736f6c634300080d0033

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.