ETH Price: $2,662.38 (+1.61%)
Gas: 0.78 Gwei

Contract

0x7b8f282003C9B17DB9abaaA114D5cf42B0727844
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Purchase144973002022-04-01 0:56:281045 days ago1648774588IN
0x7b8f2820...2B0727844
1 ETH0.0053365838.87087608
Purchase144959442022-03-31 19:54:501045 days ago1648756490IN
0x7b8f2820...2B0727844
1 ETH0.0098954665.23478559
Purchase144958602022-03-31 19:35:321045 days ago1648755332IN
0x7b8f2820...2B0727844
1 ETH0.01125574.19737993
Purchase144957282022-03-31 19:05:091045 days ago1648753509IN
0x7b8f2820...2B0727844
1 ETH0.0070160852.12934367
Purchase144956922022-03-31 18:56:541045 days ago1648753014IN
0x7b8f2820...2B0727844
1 ETH0.0088308158.21622885
Purchase144955352022-03-31 18:19:321045 days ago1648750772IN
0x7b8f2820...2B0727844
1 ETH0.0058744254.33195525
Purchase144955342022-03-31 18:19:291045 days ago1648750769IN
0x7b8f2820...2B0727844
1 ETH0.006522548.4620133
Add To Safe List144955222022-03-31 18:17:081045 days ago1648750628IN
0x7b8f2820...2B0727844
0 ETH0.0050979967.33583057
Purchase144953462022-03-31 17:35:421045 days ago1648748142IN
0x7b8f2820...2B0727844
1 ETH0.0080533653.09091726
Add To Safe List144951172022-03-31 16:44:451045 days ago1648745085IN
0x7b8f2820...2B0727844
0 ETH0.0051944168.60937411
Purchase144950252022-03-31 16:26:411045 days ago1648744001IN
0x7b8f2820...2B0727844
1 ETH0.01798898118.59043954
Purchase144950182022-03-31 16:24:111045 days ago1648743851IN
0x7b8f2820...2B0727844
1 ETH0.01518054100.07613826
Purchase144949352022-03-31 16:06:421045 days ago1648742802IN
0x7b8f2820...2B0727844
1 ETH0.0120094789.23008361
Add To Safe List144947782022-03-31 15:29:551045 days ago1648740595IN
0x7b8f2820...2B0727844
0 ETH0.006196281.84124969
Replace Safe Lis...144946702022-03-31 15:08:331045 days ago1648739313IN
0x7b8f2820...2B0727844
0 ETH0.0926039690.57729335
Purchase144946312022-03-31 14:59:251045 days ago1648738765IN
0x7b8f2820...2B0727844
1 ETH0.0115926176.42309185
Start144946242022-03-31 14:58:191045 days ago1648738699IN
0x7b8f2820...2B0727844
0 ETH0.0028478974.2896106
Purchase144942672022-03-31 13:38:331045 days ago1648733913IN
0x7b8f2820...2B0727844
1 ETH0.0069211145.62672752
Purchase144942192022-03-31 13:28:181045 days ago1648733298IN
0x7b8f2820...2B0727844
1 ETH0.0067631744.58548994
Purchase144942022022-03-31 13:23:341045 days ago1648733014IN
0x7b8f2820...2B0727844
1 ETH0.0042683139.47722779
Purchase144942002022-03-31 13:22:401045 days ago1648732960IN
0x7b8f2820...2B0727844
1 ETH0.00487432.13132818
Purchase144938822022-03-31 12:13:381045 days ago1648728818IN
0x7b8f2820...2B0727844
1 ETH0.0051813734.15767726
Purchase144938222022-03-31 11:59:161045 days ago1648727956IN
0x7b8f2820...2B0727844
1 ETH0.0054049235.63139371
Purchase144935622022-03-31 11:02:511045 days ago1648724571IN
0x7b8f2820...2B0727844
1 ETH0.0053833335.4890788
Purchase144934552022-03-31 10:38:201045 days ago1648723100IN
0x7b8f2820...2B0727844
1 ETH0.0051584434.00648385
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
144973002022-04-01 0:56:281045 days ago1648774588
0x7b8f2820...2B0727844
1 ETH
144959442022-03-31 19:54:501045 days ago1648756490
0x7b8f2820...2B0727844
1 ETH
144958602022-03-31 19:35:321045 days ago1648755332
0x7b8f2820...2B0727844
1 ETH
144957282022-03-31 19:05:091045 days ago1648753509
0x7b8f2820...2B0727844
1 ETH
144956922022-03-31 18:56:541045 days ago1648753014
0x7b8f2820...2B0727844
1 ETH
144955352022-03-31 18:19:321045 days ago1648750772
0x7b8f2820...2B0727844
1 ETH
144955342022-03-31 18:19:291045 days ago1648750769
0x7b8f2820...2B0727844
1 ETH
144953462022-03-31 17:35:421045 days ago1648748142
0x7b8f2820...2B0727844
1 ETH
144950252022-03-31 16:26:411045 days ago1648744001
0x7b8f2820...2B0727844
1 ETH
144950182022-03-31 16:24:111045 days ago1648743851
0x7b8f2820...2B0727844
1 ETH
144949352022-03-31 16:06:421045 days ago1648742802
0x7b8f2820...2B0727844
1 ETH
144946312022-03-31 14:59:251045 days ago1648738765
0x7b8f2820...2B0727844
1 ETH
144942672022-03-31 13:38:331045 days ago1648733913
0x7b8f2820...2B0727844
1 ETH
144942192022-03-31 13:28:181045 days ago1648733298
0x7b8f2820...2B0727844
1 ETH
144942022022-03-31 13:23:341045 days ago1648733014
0x7b8f2820...2B0727844
1 ETH
144942002022-03-31 13:22:401045 days ago1648732960
0x7b8f2820...2B0727844
1 ETH
144938822022-03-31 12:13:381045 days ago1648728818
0x7b8f2820...2B0727844
1 ETH
144938222022-03-31 11:59:161045 days ago1648727956
0x7b8f2820...2B0727844
1 ETH
144935622022-03-31 11:02:511045 days ago1648724571
0x7b8f2820...2B0727844
1 ETH
144934552022-03-31 10:38:201045 days ago1648723100
0x7b8f2820...2B0727844
1 ETH
144933742022-03-31 10:21:401045 days ago1648722100
0x7b8f2820...2B0727844
1 ETH
144933562022-03-31 10:18:071045 days ago1648721887
0x7b8f2820...2B0727844
1 ETH
144933382022-03-31 10:13:081045 days ago1648721588
0x7b8f2820...2B0727844
1 ETH
144933342022-03-31 10:11:561045 days ago1648721516
0x7b8f2820...2B0727844
1 ETH
144933332022-03-31 10:11:531045 days ago1648721513
0x7b8f2820...2B0727844
1 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AvantArteDraw

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 27 : AvantArteDraw.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import {SafeListErc721Holder, Props} from "../erc721/SafeListErc721Holder.sol";

/**
 * @dev AvantArteDraw is of type SafeListErc721Holder
 */
contract AvantArteDraw is SafeListErc721Holder {
    constructor(Props memory props)
        SafeListErc721Holder(props)
    // solhint-disable-next-line no-empty-blocks
    {

    }
}

File 2 of 27 : SafeListErc721Holder.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {AvantArteDrawInterface} from "../libraries/AvantArte/AvantArteDrawInterface.sol";
import {Erc721SingleAddressHolder} from "../libraries/Holders/Erc721SingleAddressHolder.sol";
import {SafeListController, Props as MSLCProps} from "../libraries/Controllers/SafeListController.sol";
import {BasicFunctionality, Props as BFProps} from "../contractsBase/BasicFunctionality.sol";
import {WithdrawSplitter, WithdrawSplit} from "../libraries/Withdraws/WithdrawSplitter.sol";
import {TimerData} from "../libraries/Timer/TimerController.sol";

struct Props {
    address proxyAddr;
    address owner;
    uint256 costInWei;
    address[] safeList;
    uint256 maxPurchaseAmount;
    WithdrawSplit[] withdrawSplits;
}

contract SafeListErc721Holder is
    ReentrancyGuard,
    Erc721SingleAddressHolder,
    SafeListController,
    BasicFunctionality,
    WithdrawSplitter,
    AvantArteDrawInterface
{
    constructor(Props memory props)
        SafeListController(MSLCProps(props.safeList, props.maxPurchaseAmount))
        Erc721SingleAddressHolder(props.proxyAddr)
        BasicFunctionality(BFProps(props.owner, props.costInWei))
        WithdrawSplitter(props.withdrawSplits)
    {
        proxyAddr = props.proxyAddr;
    }

    /// @dev allows to purchase a token
    function purchase(
        uint256 tokenId,
        string calldata productId,
        string calldata accountId
    ) external payable override onlyRunning onlyEnabled onlySafeListed {
        require(availableErc721Tokens.length > 0, "no supply");
        require(msg.value >= costInWei, "no funds");
        _incrementCount();
        _incrementAddressPurchasedCount(1);

        _splitWithdraw(msg.value);
        emit OnPurchase(msg.sender, tokenId, productId, accountId);
        _safeTransferErc721Token(tokenId, msg.sender, msg.data);
    }

    /// @dev allows admins to take the remaining tokens in the end of the draw
    function withdrawTokens(uint256[] calldata tokenIds) external onlyOwner {
        uint256 length = tokenIds.length;
        for (uint256 i = 0; i < length; i++) {
            _safeTransferErc721Token(tokenIds[i], msg.sender, msg.data);
        }
    }

    /// @dev allows admins to assign tokens manually
    function assignTokens(uint256[] calldata tokenIds) external onlyOwner {
        uint256 length = tokenIds.length;
        for (uint256 i = 0; i < length; i++) {
            availableErc721Tokens.push(tokenIds[i]);
        }
    }

    /// @dev removed mistakenly assigned tokens
    function unassignTokens(uint256[] calldata tokenIds) external onlyOwner {
        uint256 length = tokenIds.length;
        for (uint256 i = 0; i < length; i++) {
            _removeListedErc721Token(tokenIds[i]);
        }
    }

    function isActive() external view override returns (bool) {
        return isEnabled && _isTimerRunning();
    }

    function count(uint256) external view override returns (uint256) {
        return availableErc721Tokens.length;
    }

    function cost(uint256) external view override returns (uint256) {
        return costInWei;
    }

    function isAllowedToPurchase(uint256)
        external
        view
        virtual
        override
        returns (bool)
    {
        return
            isEnabled && _isTimerRunning() && _isAddressSafeListed(msg.sender);
    }

    function getAvailableTokenId()
        external
        view
        virtual
        override
        returns (uint256)
    {
        return _safeGetFirstErc721Token();
    }

    function getTimerData()
        external
        view
        virtual
        override
        returns (TimerData memory)
    {
        return _getTimerData();
    }

    function setWithdrawSplit(WithdrawSplit[] calldata _withdrawSplits)
        external
        onlyOwner
    {
        _setWithdrawSplit(_withdrawSplits);
    }
}

File 3 of 27 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 4 of 27 : AvantArteDrawInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import {TimerData} from "../Timer/TimerController.sol";

abstract contract AvantArteDrawInterface {
    /// @dev an event to call when a token is purchased - mostly used to email users of aa
    event OnPurchase(
        address walletAddress,
        uint256 tokenId,
        string productId,
        string accountId
    );

    /// @dev the cost to purchase
    function cost(uint256 tokenId) external view virtual returns (uint256);

    /// @dev tells us if the token is available
    function isActive() external view virtual returns (bool);

    /// @dev tells us if the token is available
    function isAllowedToPurchase(uint256 tokenId)
        external
        view
        virtual
        returns (bool);

    /// @dev returns the count of items that can be purchased
    function count(uint256 tokenId) external view virtual returns (uint256);

    /// @dev called to purchase a token
    function purchase(
        uint256 tokenId,
        string calldata productId,
        string calldata accountId
    ) external payable virtual;

    /// @dev called to get an available token id when using non unique tokens
    function getAvailableTokenId() external view virtual returns (uint256);

    /// @dev returns the timer data
    function getTimerData() external view virtual returns (TimerData memory);
}

File 5 of 27 : Erc721SingleAddressHolder.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

/**
 * @dev holds and manages tokens from a single address
 * in order to use, the giving contracts must call
 * function setApprovalForAll(THE_ADDRESS_OF_THIS_CONTRACT, true)
 */
contract Erc721SingleAddressHolder is IERC721Receiver {
    address public proxyAddr;
    uint256[] public availableErc721Tokens;

    constructor(address _proxyAddr) {
        proxyAddr = _proxyAddr;
    }

    function _safeGetFirstErc721Token() internal view returns (uint256) {
        return availableErc721Tokens.length > 0 ? availableErc721Tokens[0] : 0;
    }

    function _removeListedErc721Token(uint256 tokenId) internal {
        uint256 len = availableErc721Tokens.length;
        for (uint256 i = 0; i < len; i++) {
            if (availableErc721Tokens[i] == tokenId) {
                availableErc721Tokens[i] = availableErc721Tokens[len - 1];
                availableErc721Tokens.pop();
                return;
            }
        }
    }

    function onERC721Received(
        address,
        address,
        uint256 tokenId,
        bytes calldata
    ) external virtual override returns (bytes4) {
        if (msg.sender == proxyAddr) {
            availableErc721Tokens.push(tokenId);
        }
        return this.onERC721Received.selector;
    }

    function _safeTransferErc721Token(
        uint256 tokenId,
        address to,
        bytes calldata data
    ) internal {
        ERC721 nft = ERC721(proxyAddr);
        nft.safeTransferFrom(address(this), to, tokenId, data);
        _removeListedErc721Token(tokenId);
    }
}

File 6 of 27 : SafeListController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "./AdminController.sol";

/**
 * @dev SafeListItem Provides SafeList Guard functionality using onlySafeListed
 * Where safe listed wallets can purchase a set amount of tokens
 */

struct Props {
    address[] safeList;
    uint256 maxPurchaseAmount;
}

abstract contract SafeListController is AdminController {
    struct SafeListItem {
        /// @dev how many tokens the address have purchased
        uint256 purchased;
        /// @dev is the address safe listed
        bool isSafe;
    }

    /// @dev the list of addresses who are safe listed
    address[] public safeList;
    /// @dev a map of safe wallets, mapping safeAddress => (purchased, isSafe)
    mapping(address => SafeListItem) public safeListMap;
    /// @dev max amount to purchase per safe address
    uint256 public maxPurchaseAmount;

    constructor(Props memory props) {
        maxPurchaseAmount = props.maxPurchaseAmount;
        uint256 safeListLength = props.safeList.length;
        for (uint256 i = 0; i < safeListLength; i++) {
            address addr = props.safeList[i];
            safeList.push(addr);
            safeListMap[addr] = SafeListItem({isSafe: true, purchased: 0});
        }
    }

    function getSafeListLength() external view returns (uint256) {
        return safeList.length;
    }

    /// @dev set a new max purchase amount
    function setMaxPurchaseAmount(uint256 _maxPurchaseAmount)
        external
        onlyAdmin
    {
        maxPurchaseAmount = _maxPurchaseAmount;
    }

    /// @dev makes sure the user is safe listed and can purchase
    modifier onlySafeListed() {
        SafeListItem memory item = safeListMap[msg.sender];
        require(item.isSafe, "not safe listed");
        require(item.purchased < maxPurchaseAmount, "already purchased");
        _;
    }

    /// @dev checks if the current address is allowed to purchase
    function _isAddressSafeListed(address addr) internal view returns (bool) {
        SafeListItem memory item = safeListMap[addr];
        return item.isSafe && item.purchased < maxPurchaseAmount;
    }

    /// @dev add new address to the safe list
    function addToSafeList(address addr) public onlyAdmin {
        safeList.push(addr);
        safeListMap[addr] = SafeListItem(0, true);
    }

    /// @dev add new addresses to the safe list
    function addManyToSafeList(address[] calldata addrs) public onlyAdmin {
        uint256 arrayLength = addrs.length;
        for (uint256 i = 0; i < arrayLength; i++) {
            addToSafeList(addrs[i]);
        }
    }

    /// @dev remove an address from the safe list
    function removeFromSafeList(address addr) public onlyAdmin {
        delete safeListMap[addr];
        uint256 length = safeList.length;
        for (uint256 i = 0; i < length; i++) {
            if (safeList[i] == addr) {
                delete safeList[i];
                break;
            }
        }
    }

    /// @dev remove many addresses from the safe list
    function removeManyFromSafeList(address[] calldata addrs)
        external
        onlyAdmin
    {
        uint256 length = addrs.length;
        for (uint256 i = 0; i < length; i++) {
            removeFromSafeList(addrs[i]);
        }
    }

    /// @dev replaces the safe list with a new safe list
    function replaceSafeList(address[] calldata newSafeList)
        external
        onlyAdmin
    {
        uint256 length = safeList.length;
        for (uint256 i = 0; i < length; i++) {
            address addr = safeList[i];
            delete safeListMap[addr];
        }
        delete safeList;
        addManyToSafeList(newSafeList);
    }

    /// @dev increase the purchased count of the current wallet
    function _incrementAddressPurchasedCount(uint256 inc) internal virtual {
        safeListMap[msg.sender].purchased += inc;
    }
}

File 7 of 27 : BasicFunctionality.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import {Counters} from "@openzeppelin/contracts/utils/Counters.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {TimerController} from "../libraries/Timer/TimerController.sol";
import {OwnerController} from "../libraries/Controllers/OwnerController.sol";
import {AdminController} from "../libraries/Controllers/AdminController.sol";
import {BasicWithdraw} from "../libraries/Withdraws/BasicWithdraw.sol";

struct Props {
    address owner;
    uint256 costInWei;
}

/**
 * @dev SafeListBase is a base contract to create safe list and admin controlled NFT contracts,
 */
contract BasicFunctionality is
    OwnerController,
    AdminController,
    TimerController,
    ReentrancyGuard,
    BasicWithdraw
{
    /// @dev the cost of purchasing a token, in weic
    uint256 public costInWei;

    /// @dev is the contract enabled
    bool public isEnabled = false;

    /// @dev keeps track of the purchased tokens
    using Counters for Counters.Counter;
    Counters.Counter internal counter;

    constructor(Props memory props)
        ReentrancyGuard()
        OwnerController(props.owner)
    {
        costInWei = props.costInWei;
    }

    /// @dev makes sure the contract is enabled
    modifier onlyEnabled() {
        require(isEnabled, "not enabled");
        _;
    }

    /// @dev starts the contract by enabling it and starting the timer
    function start(uint256 drawLengthHours) external onlyAdmin {
        _startTimer(drawLengthHours);
        isEnabled = true;
    }

    /// @dev allows to withdraw all funds from the contract
    function withdraw(address payable to) external onlyOwner {
        _withdrawAllFunds(to);
    }

    /// @dev set a new cost
    function setCostInWei(uint256 newCostInWei) external onlyAdmin {
        costInWei = newCostInWei;
    }

    /// @dev set a new isEnabled
    function setIsEnabled(bool newIsEnabled) external onlyAdmin {
        isEnabled = newIsEnabled;
    }

    /// @dev set a new draw length in hours
    function setDrawLengthHours(uint256 timeInHours) external onlyAdmin {
        _setTimerEndsInHours(timeInHours);
    }

    function _incrementCount() internal {
        counter.increment();
    }

    /// @dev is the sender an admin
    function _isAdmin()
        internal
        view
        virtual
        override(AdminController)
        returns (bool)
    {
        return isOwner();
    }
}

File 8 of 27 : WithdrawSplitter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import {BasicWithdraw} from "./BasicWithdraw.sol";
import {OwnerController} from "../Controllers/OwnerController.sol";

struct WithdrawSplit {
    /// @dev the recipient to recieve the funds
    address recipient;
    /// @dev bps is a 00 number, so 10% is 1000
    uint256 bps;
}

abstract contract WithdrawSplitter is BasicWithdraw {
    WithdrawSplit[] public withdrawSplits;

    constructor(WithdrawSplit[] memory _withdrawSplits) {
        _setWithdrawSplit(_withdrawSplits);
    }

    /// @dev set new withdraw splits
    function _setWithdrawSplit(WithdrawSplit[] memory _withdrawSplits)
        internal
    {
        delete withdrawSplits;
        uint256 length = _withdrawSplits.length;
        for (uint256 i = 0; i < length; i++) {
            withdrawSplits.push(_withdrawSplits[i]);
        }
    }

    /// @dev allows to withdraw funds from the contract, splitted
    function _splitWithdraw(uint256 amount) internal {
        uint256 length = withdrawSplits.length;
        for (uint256 i = 0; i < length; i++) {
            WithdrawSplit memory split = withdrawSplits[i];
            _withdraw(payable(split.recipient), (amount * split.bps) / 10000);
        }
    }
}

File 9 of 27 : TimerController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./TimerLib.sol";

/**
 * @dev Timer lib provides functionality to use time easily
 * with guarding and general functionality for contracts,
 * call _startTimer(time) before calling any other method
 */

struct TimerData {
    /// the time the contract started (seconds)
    uint256 startTime;
    /// the time the contract is running from startTime (seconds)
    uint256 runningTime;
}

contract TimerController {
    using TimerLib for TimerLib.Timer;
    TimerLib.Timer private _timer;

    /// @dev makes sure the timer is running
    modifier onlyRunning() {
        require(_isTimerRunning(), "timer over");
        _;
    }

    /// @dev returns the timer data
    function _getTimerData() internal view returns (TimerData memory) {
        return TimerData(_timer.startTime, _timer.runningTime);
    }

    /// @dev checks if the timer is still running
    function _isTimerRunning() internal view returns (bool) {
        return _timer._isRunning();
    }

    /// @dev should be called in the constructor
    function _startTimer(uint256 endsInHours) internal {
        _timer._start(endsInHours * 1 hours);
    }

    /// @dev set a new end time in hours (from the given time)
    function _setTimerEndsInHours(uint256 endsInHours) internal {
        _timer._updateRunningTime(endsInHours * 1 hours);
    }
}

File 10 of 27 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) private _balances;

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

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

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

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: balance query for the zero address");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

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

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);

        _balances[id][to] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);
    }

    /**
     * @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, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

File 11 of 27 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 12 of 27 : TimerLib.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

/**
 * @dev Timer lib provides functionality to use time easily,
 * call _start(time) before calling any other method
 */

library TimerLib {
    struct Timer {
        /// @dev the time the contract started
        uint256 startTime;
        /// @dev the time the contract is running from startTime
        uint256 runningTime;
        /// @dev is the timer running
        bool isRunning;
    }

    /// @dev is the timer running - marked as running and has time remaining
    function _isRunning(Timer storage self) internal view returns (bool) {
        return
            self.isRunning &&
            // solhint-disable-next-line not-rely-on-time
            (self.startTime + self.runningTime > block.timestamp);
    }

    /// @dev starts the timer, call again to restart
    function _start(Timer storage self, uint256 runningTime) internal {
        self.isRunning = true;
        // solhint-disable-next-line not-rely-on-time
        self.startTime = block.timestamp;
        self.runningTime = runningTime;
    }

    /// @dev updates the running time
    function _updateRunningTime(Timer storage self, uint256 runningTime)
        internal
    {
        self.runningTime = runningTime;
    }
}

File 13 of 27 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 14 of 27 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
        @dev Handles the receipt of a single ERC1155 token type. This function is
        called at the end of a `safeTransferFrom` after the balance has been updated.
        To accept the transfer, this must return
        `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
        (i.e. 0xf23a6e61, or its own function selector).
        @param operator The address which initiated the transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param id The ID of the token being transferred
        @param value The amount of tokens being transferred
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
    */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
        @dev Handles the receipt of a multiple ERC1155 token types. This function
        is called at the end of a `safeBatchTransferFrom` after the balances have
        been updated. To accept the transfer(s), this must return
        `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
        (i.e. 0xbc197c81, or its own function selector).
        @param operator The address which initiated the batch transfer (i.e. msg.sender)
        @param from The address which previously owned the token
        @param ids An array containing ids of each token being transferred (order and length must match values array)
        @param values An array containing amounts of each token being transferred (order and length must match ids array)
        @param data Additional data with no specified format
        @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
    */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 15 of 27 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

File 16 of 27 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

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

        (bool success, bytes memory returndata) = target.delegatecall(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 17 of 27 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.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 ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 19 of 27 : IERC165.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 IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[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 20 of 27 : IERC721Receiver.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 IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

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

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.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 ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings 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.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).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 = ERC721.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 = ERC721.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);
    }

    /**
     * @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 = ERC721.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);
    }

    /**
     * @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(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        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);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.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 IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.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 {}
}

File 22 of 27 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, 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 23 of 27 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @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 24 of 27 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    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 25 of 27 : AdminController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

/**
 *  @dev AdminController dds functionality for admins to controll a contract, similar to Ownable but more verbose
 */
abstract contract AdminController {
    /// @dev makes sure the address is an admin
    modifier onlyAdmin() {
        require(_isAdmin(), "not admin");
        _;
    }

    /// @dev is the sender an admin
    function _isAdmin() internal view virtual returns (bool);
}

File 26 of 27 : OwnerController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

/**
 * @dev Adds functionality for admins to controll a contract, similar to Ownable but more verbose
 */

contract OwnerController {
    /// @dev Same as Ownable, the owner is the wallet who minted the contract, usually AA or the artist
    address private _owner;
    /**
     * @dev the underlying owner is not the response of "owner()"
     * but is used to allow taking actions on behalf of the owner at any given time,
     * this is usually Avant Arte's main wallet - and will never change even if ownership is transfered
     */
    address private _underlyingOwner;

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

    constructor(address _underlyingOwnerAddress) {
        _owner = msg.sender;
        _underlyingOwner = _underlyingOwnerAddress;
    }

    /// @dev makes sure the address is the contract owner
    modifier onlyOwner() {
        require(isOwner(), "not owner");
        _;
    }

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

    /// @dev renounce the ownership for the contract and leave it with no owner
    function renounceOwnership() external virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /// @dev safely transfer ownership to a new owner
    function transferOwnership(address newOwner) external virtual onlyOwner {
        require(newOwner != address(0), "new owner is zero address");
        _transferOwnership(newOwner);
    }

    /// @dev unsafe internal transfer ownership
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /// @dev checks if the sender is an owner
    function isOwner() internal view virtual returns (bool) {
        return _underlyingOwner == msg.sender || _owner == msg.sender;
    }
}

File 27 of 27 : BasicWithdraw.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";

abstract contract BasicWithdraw is ReentrancyGuard {
    /// @dev an event to call when funds are withdrawn
    event OnWithdraw(address addr, uint256 balance);

    /// @dev allows to withdraw all the funds from the contract
    function _withdrawAllFunds(address payable _to) internal {
        _withdraw(_to, address(this).balance);
    }

    /// @dev allows to withdraw funds from the contract
    function _withdraw(address payable _to, uint256 amount)
        internal
        nonReentrant
    {
        require(_to != address(0), "address 0");
        uint256 balance = address(this).balance;
        require(balance >= amount, "no funds");

        emit OnWithdraw(_to, amount);
        /// solhint-disable-next-line avoid-low-level-calls
        (bool success, ) = _to.call{value: amount}("");
        require(success, "failed withdraw");
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"components":[{"internalType":"address","name":"proxyAddr","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"costInWei","type":"uint256"},{"internalType":"address[]","name":"safeList","type":"address[]"},{"internalType":"uint256","name":"maxPurchaseAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"bps","type":"uint256"}],"internalType":"struct WithdrawSplit[]","name":"withdrawSplits","type":"tuple[]"}],"internalType":"struct Props","name":"props","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"walletAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"productId","type":"string"},{"indexed":false,"internalType":"string","name":"accountId","type":"string"}],"name":"OnPurchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"}],"name":"OnWithdraw","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"},{"inputs":[{"internalType":"address[]","name":"addrs","type":"address[]"}],"name":"addManyToSafeList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"addToSafeList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"assignTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"availableErc721Tokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"cost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"costInWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSafeListLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimerData","outputs":[{"components":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"runningTime","type":"uint256"}],"internalType":"struct TimerData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isAllowedToPurchase","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPurchaseAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"productId","type":"string"},{"internalType":"string","name":"accountId","type":"string"}],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"removeFromSafeList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addrs","type":"address[]"}],"name":"removeManyFromSafeList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"newSafeList","type":"address[]"}],"name":"replaceSafeList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"safeList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"safeListMap","outputs":[{"internalType":"uint256","name":"purchased","type":"uint256"},{"internalType":"bool","name":"isSafe","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newCostInWei","type":"uint256"}],"name":"setCostInWei","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timeInHours","type":"uint256"}],"name":"setDrawLengthHours","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"newIsEnabled","type":"bool"}],"name":"setIsEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxPurchaseAmount","type":"uint256"}],"name":"setMaxPurchaseAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"bps","type":"uint256"}],"internalType":"struct WithdrawSplit[]","name":"_withdrawSplits","type":"tuple[]"}],"name":"setWithdrawSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"drawLengthHours","type":"uint256"}],"name":"start","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unassignTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"withdrawSplits","outputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"bps","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052600c805460ff191690553480156200001b57600080fd5b50604051620021fc380380620021fc8339810160408190526200003e91620003fb565b60a08101516040805180820182526020808501516001600160a01b03908116835283860151828401528351808501909452606086015180855260808701519285018390528651845160008054336001600160a01b03199182161782556001805482169387169390931783556005929092556006805490921692909416919091179055600a929092559051859493915b818110156200019257600083600001518281518110620000f157620000f1620005a3565b6020908102919091018101516008805460018082019092557ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0390931692831790556040805180820182526000808252818601848152948152600990955293209251835590519101805460ff19169115159190911790555080620001898162000579565b915050620000cd565b50505060200151600b55620001a781620001cf565b5051600680546001600160a01b0319166001600160a01b0390921691909117905550620005cf565b620001dd600e600062000265565b805160005b818110156200026057600e838281518110620002025762000202620005a3565b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b0390921691909117815591015191015580620002578162000579565b915050620001e2565b505050565b50805460008255600202906000526020600020908101906200028891906200028b565b50565b5b80821115620002b35780546001600160a01b0319168155600060018201556002016200028c565b5090565b80516001600160a01b0381168114620002cf57600080fd5b919050565b600082601f830112620002e657600080fd5b81516020620002ff620002f98362000553565b62000520565b80838252828201915082860187848660051b89010111156200032057600080fd5b60005b858110156200034a576200033782620002b7565b8452928401929084019060010162000323565b5090979650505050505050565b600082601f8301126200036957600080fd5b815160206200037c620002f98362000553565b80838252828201915082860187848660061b89010111156200039d57600080fd5b6000805b86811015620003ed57604080848c031215620003bb578283fd5b620003c5620004d0565b620003d085620002b7565b8152848801518882015286529486019490920191600101620003a1565b509198975050505050505050565b6000602082840312156200040e57600080fd5b81516001600160401b03808211156200042657600080fd5b9083019060c082860312156200043b57600080fd5b62000445620004fb565b6200045083620002b7565b81526200046060208401620002b7565b6020820152604083015160408201526060830151828111156200048257600080fd5b6200049087828601620002d4565b6060830152506080830151608082015260a083015182811115620004b357600080fd5b620004c18782860162000357565b60a08301525095945050505050565b604080519081016001600160401b0381118282101715620004f557620004f5620005b9565b60405290565b60405160c081016001600160401b0381118282101715620004f557620004f5620005b9565b604051601f8201601f191681016001600160401b03811182821017156200054b576200054b620005b9565b604052919050565b60006001600160401b038211156200056f576200056f620005b9565b5060051b60200190565b60006000198214156200059c57634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b611c1d80620005df6000396000f3fe6080604052600436106102045760003560e01c80636aa633b611610118578063a03040c3116100a0578063b6f975011161006f578063b6f975011461062f578063d3044a151461064f578063ed014fe71461066f578063f2fde38b1461068f578063f952fcad146106af57600080fd5b8063a03040c3146105af578063a5548bdf146105cf578063a5fa12f0146105ef578063aa44212b1461060f57600080fd5b80638da5cb5b116100e75780638da5cb5b146105085780639097548d1461053a57806395805dad1461055c5780639898ac791461057c57806399ac3fa61461059c57600080fd5b80636aa633b614610499578063715018a6146104b35780637a763b9e146104c857806384a55bd3146104e857600080fd5b80633b3546c81161019b578063513e549d1161016a578063513e549d146103e9578063518b63ac1461040957806351cff8d91461043957806351d589de14610459578063576c89331461047957600080fd5b80633b3546c8146103455780633f357fce146103675780633f5c3504146103b3578063468f4fe3146103d357600080fd5b806322f3e2d4116101d757806322f3e2d4146102cb5780632981a40c146102f057806333ab721e1461030557806334add0c11461032557600080fd5b8063050d9298146102095780630b759cf31461024d5780630f62cf1c14610270578063150b7a0214610292575b600080fd5b34801561021557600080fd5b5061022961022436600461198d565b6106c5565b604080516001600160a01b0390931683526020830191909152015b60405180910390f35b34801561025957600080fd5b506102626106fd565b604051908152602001610244565b34801561027c57600080fd5b5061029061028b36600461184e565b61070c565b005b34801561029e57600080fd5b506102b26102ad3660046117db565b610782565b6040516001600160e01b03199091168152602001610244565b3480156102d757600080fd5b506102e06107e0565b6040519015158152602001610244565b3480156102fc57600080fd5b50600854610262565b34801561031157600080fd5b5061029061032036600461184e565b6107f8565b34801561033157600080fd5b5061029061034036600461198d565b610870565b34801561035157600080fd5b5061026261036036600461198d565b5060075490565b34801561037357600080fd5b5061039e6103823660046117be565b6009602052600090815260409020805460019091015460ff1682565b60408051928352901515602083015201610244565b3480156103bf57600080fd5b506102906103ce36600461184e565b6108a0565b3480156103df57600080fd5b50610262600b5481565b3480156103f557600080fd5b5061029061040436600461184e565b610945565b34801561041557600080fd5b5061041e6109b1565b60408051825181526020928301519281019290925201610244565b34801561044557600080fd5b506102906104543660046117be565b6109f3565b34801561046557600080fd5b506102e061047436600461198d565b610a20565b34801561048557600080fd5b5061029061049436600461184e565b610a4e565b3480156104a557600080fd5b50600c546102e09060ff1681565b3480156104bf57600080fd5b50610290610aba565b3480156104d457600080fd5b506102906104e33660046117be565b610aea565b3480156104f457600080fd5b5061029061050336600461184e565b610bbc565b34801561051457600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610244565b34801561054657600080fd5b5061026261055536600461198d565b50600b5490565b34801561056857600080fd5b5061029061057736600461198d565b610c1f565b34801561058857600080fd5b5061052261059736600461198d565b610c5c565b6102906105aa3660046119a6565b610c86565b3480156105bb57600080fd5b50600654610522906001600160a01b031681565b3480156105db57600080fd5b506102906105ea3660046117be565b610ea2565b3480156105fb57600080fd5b5061029061060a36600461198d565b610f4b565b34801561061b57600080fd5b5061026261062a36600461198d565b610f74565b34801561063b57600080fd5b5061029061064a366004611905565b610f95565b34801561065b57600080fd5b5061029061066a366004611890565b610fcc565b34801561067b57600080fd5b5061029061068a36600461198d565b61104f565b34801561069b57600080fd5b506102906106aa3660046117be565b611078565b3480156106bb57600080fd5b50610262600a5481565b600e81815481106106d557600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b60006107076110fb565b905090565b61071461112f565b6107395760405162461bcd60e51b815260040161073090611ae2565b60405180910390fd5b8060005b8181101561077c5761076a84848381811061075a5761075a611bbc565b9050602002013533600036611159565b8061077481611b75565b91505061073d565b50505050565b6006546000906001600160a01b03163314156107ce57600780546001810182556000919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688018490555b50630a85bd0160e11b95945050505050565b600c5460009060ff16801561070757506107076111d5565b61080061112f565b61081c5760405162461bcd60e51b815260040161073090611ae2565b8060005b8181101561077c57600784848381811061083c5761083c611bbc565b835460018101855560009485526020948590209190940292909201359190920155508061086881611b75565b915050610820565b6108786111e1565b6108945760405162461bcd60e51b815260040161073090611abf565b61089d816111eb565b50565b6108a86111e1565b6108c45760405162461bcd60e51b815260040161073090611abf565b60085460005b81811015610929576000600882815481106108e7576108e7611bbc565b60009182526020808320909101546001600160a01b031682526009905260408120908155600101805460ff19169055508061092181611b75565b9150506108ca565b50610936600860006116b2565b6109408383610a4e565b505050565b61094d6111e1565b6109695760405162461bcd60e51b815260040161073090611abf565b8060005b8181101561077c5761099f84848381811061098a5761098a611bbc565b90506020020160208101906104e391906117be565b806109a981611b75565b91505061096d565b60408051808201909152600080825260208201526107076040805180820182526000808252602091820152815180830190925260025482526003549082015290565b6109fb61112f565b610a175760405162461bcd60e51b815260040161073090611ae2565b61089d816111ff565b600c5460009060ff168015610a385750610a386111d5565b8015610a485750610a4833611209565b92915050565b610a566111e1565b610a725760405162461bcd60e51b815260040161073090611abf565b8060005b8181101561077c57610aa8848483818110610a9357610a93611bbc565b90506020020160208101906105ea91906117be565b80610ab281611b75565b915050610a76565b610ac261112f565b610ade5760405162461bcd60e51b815260040161073090611ae2565b610ae86000611256565b565b610af26111e1565b610b0e5760405162461bcd60e51b815260040161073090611abf565b6001600160a01b0381166000908152600960205260408120818155600101805460ff19169055600854905b8181101561094057826001600160a01b031660088281548110610b5e57610b5e611bbc565b6000918252602090912001546001600160a01b03161415610baa5760088181548110610b8c57610b8c611bbc565b600091825260209091200180546001600160a01b0319169055505050565b80610bb481611b75565b915050610b39565b610bc461112f565b610be05760405162461bcd60e51b815260040161073090611ae2565b8060005b8181101561077c57610c0d848483818110610c0157610c01611bbc565b905060200201356112a6565b80610c1781611b75565b915050610be4565b610c276111e1565b610c435760405162461bcd60e51b815260040161073090611abf565b610c4c8161135e565b50600c805460ff19166001179055565b60088181548110610c6c57600080fd5b6000918252602090912001546001600160a01b0316905081565b610c8e6111d5565b610cc75760405162461bcd60e51b815260206004820152600a6024820152693a34b6b2b91037bb32b960b11b6044820152606401610730565b600c5460ff16610d075760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08195b98589b195960aa1b6044820152606401610730565b336000908152600960209081526040918290208251808401909352805483526001015460ff161515908201819052610d735760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081cd85999481b1a5cdd1959608a1b6044820152606401610730565b600a54815110610db95760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e481c1d5c98da185cd959607a1b6044820152606401610730565b600754610df45760405162461bcd60e51b81526020600482015260096024820152686e6f20737570706c7960b81b6044820152606401610730565b600b54341015610e315760405162461bcd60e51b81526020600482015260086024820152676e6f2066756e647360c01b6044820152606401610730565b610e39611383565b610e436001611391565b610e4c346113b8565b7fe0bdee53b954a6ee67f4c8be61b205ba865443ea3be217f333c11841ac5abd1d338787878787604051610e8596959493929190611a77565b60405180910390a1610e9a8633600036611159565b505050505050565b610eaa6111e1565b610ec65760405162461bcd60e51b815260040161073090611abf565b6008805460018082019092557ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b039390931692831790556040805180820182526000808252602080830185815295825260099052919091209051815591519101805460ff1916911515919091179055565b610f536111e1565b610f6f5760405162461bcd60e51b815260040161073090611abf565b600a55565b60078181548110610f8457600080fd5b600091825260209091200154905081565b610f9d6111e1565b610fb95760405162461bcd60e51b815260040161073090611abf565b600c805460ff1916911515919091179055565b610fd461112f565b610ff05760405162461bcd60e51b815260040161073090611ae2565b61104b8282808060200260200160405190810160405280939291908181526020016000905b828210156110415761103260408302860136819003810190611927565b81526020019060010190611015565b5050505050611447565b5050565b6110576111e1565b6110735760405162461bcd60e51b815260040161073090611abf565b600b55565b61108061112f565b61109c5760405162461bcd60e51b815260040161073090611ae2565b6001600160a01b0381166110f25760405162461bcd60e51b815260206004820152601960248201527f6e6577206f776e6572206973207a65726f2061646472657373000000000000006044820152606401610730565b61089d81611256565b60075460009061110b5750600090565b600760008154811061111f5761111f611bbc565b9060005260206000200154905090565b6001546000906001600160a01b031633148061070757506000546001600160a01b03163314905090565b600654604051635c46a7ef60e11b81526001600160a01b0390911690819063b88d4fde9061119390309088908a9089908990600401611a38565b600060405180830381600087803b1580156111ad57600080fd5b505af11580156111c1573d6000803e3d6000fd5b505050506111ce856112a6565b5050505050565b600061070760026114cf565b600061070761112f565b61089d6111fa82610e10611b3f565b600355565b61089d81476114fa565b6001600160a01b03811660009081526009602090815260408083208151808301909252805482526001015460ff1615801592820183905290919061124f5750600a548151105b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60075460005b818110156109405782600782815481106112c8576112c8611bbc565b9060005260206000200154141561134c5760076112e6600184611b5e565b815481106112f6576112f6611bbc565b90600052602060002001546007828154811061131457611314611bbc565b600091825260209091200155600780548061133157611331611ba6565b60019003818190600052602060002001600090559055505050565b8061135681611b75565b9150506112ac565b61089d61136d82610e10611b3f565b6004805460ff1916600117905542600255600355565b610ae8600d80546001019055565b33600090815260096020526040812080548392906113b0908490611b05565b909155505050565b600e5460005b81811015610940576000600e82815481106113db576113db611bbc565b60009182526020918290206040805180820190915260029092020180546001600160a01b031680835260019091015492820183905290925061143491612710906114259088611b3f565b61142f9190611b1d565b6114fa565b508061143f81611b75565b9150506113be565b611453600e60006116d0565b805160005b8181101561094057600e83828151811061147457611474611bbc565b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b03909216919091178155910151910155806114c781611b75565b915050611458565b600281015460009060ff168015610a4857506001820154825442916114f391611b05565b1192915050565b6002600554141561154d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610730565b60026005556001600160a01b0382166115945760405162461bcd60e51b815260206004820152600960248201526806164647265737320360bc1b6044820152606401610730565b47818110156115d05760405162461bcd60e51b81526020600482015260086024820152676e6f2066756e647360c01b6044820152606401610730565b604080516001600160a01b0385168152602081018490527fbace9fd79d5ea02ed8b43fa96af07e4e8f859a2f71ff878c748f5c22c5780284910160405180910390a16000836001600160a01b03168360405160006040518083038185875af1925050503d806000811461165f576040519150601f19603f3d011682016040523d82523d6000602084013e611664565b606091505b50509050806116a75760405162461bcd60e51b815260206004820152600f60248201526e6661696c656420776974686472617760881b6044820152606401610730565b505060016005555050565b508054600082559060005260206000209081019061089d91906116f1565b508054600082556002029060005260206000209081019061089d919061170a565b5b8082111561170657600081556001016116f2565b5090565b5b808211156117065780546001600160a01b03191681556000600182015560020161170b565b60008083601f84011261174257600080fd5b50813567ffffffffffffffff81111561175a57600080fd5b6020830191508360208260051b850101111561177557600080fd5b9250929050565b60008083601f84011261178e57600080fd5b50813567ffffffffffffffff8111156117a657600080fd5b60208301915083602082850101111561177557600080fd5b6000602082840312156117d057600080fd5b813561124f81611bd2565b6000806000806000608086880312156117f357600080fd5b85356117fe81611bd2565b9450602086013561180e81611bd2565b935060408601359250606086013567ffffffffffffffff81111561183157600080fd5b61183d8882890161177c565b969995985093965092949392505050565b6000806020838503121561186157600080fd5b823567ffffffffffffffff81111561187857600080fd5b61188485828601611730565b90969095509350505050565b600080602083850312156118a357600080fd5b823567ffffffffffffffff808211156118bb57600080fd5b818501915085601f8301126118cf57600080fd5b8135818111156118de57600080fd5b8660208260061b85010111156118f357600080fd5b60209290920196919550909350505050565b60006020828403121561191757600080fd5b8135801515811461124f57600080fd5b60006040828403121561193957600080fd5b6040516040810181811067ffffffffffffffff8211171561196a57634e487b7160e01b600052604160045260246000fd5b604052823561197881611bd2565b81526020928301359281019290925250919050565b60006020828403121561199f57600080fd5b5035919050565b6000806000806000606086880312156119be57600080fd5b85359450602086013567ffffffffffffffff808211156119dd57600080fd5b6119e989838a0161177c565b90965094506040880135915080821115611a0257600080fd5b5061183d8882890161177c565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0386811682528516602082015260408101849052608060608201819052600090611a6c9083018486611a0f565b979650505050505050565b60018060a01b0387168152856020820152608060408201526000611a9f608083018688611a0f565b8281036060840152611ab2818587611a0f565b9998505050505050505050565b6020808252600990820152683737ba1030b236b4b760b91b604082015260600190565b6020808252600990820152683737ba1037bbb732b960b91b604082015260600190565b60008219821115611b1857611b18611b90565b500190565b600082611b3a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b5957611b59611b90565b500290565b600082821015611b7057611b70611b90565b500390565b6000600019821415611b8957611b89611b90565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461089d57600080fdfea2646970667358221220ed5f74600c89fdec6775ab6126e298cc30be0329d9e7b6023799f2c0ab3a82c264736f6c634300080700330000000000000000000000000000000000000000000000000000000000000020000000000000000000000000fc4c87cabfb6bf4d00e0d26d9e64b2343419db42000000000000000000000000c1d77b0a3d049b6266bc747f70fe12ae776469800000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000031000000000000000000000000155f6bb5fc06deaa5c4a1dd590fb9af39641e2e8000000000000000000000000d61c66607c0ba44172bd5c5f5b7c0fd79d64c6c80000000000000000000000000925d347f811d264879271d2905f54309eaccb93000000000000000000000000a4a6bd0a0b3eedc6bc0a89da68e0bd78c7d3fb8e000000000000000000000000cf04c33bfea64cf5dd6ea97e2d5620f825b03b490000000000000000000000001d28a703ab06bcef8666e4692fe63188b6fcbca20000000000000000000000006d905b1a82afec95bf81de27223839304880f7570000000000000000000000000bf8897ee519fbfc60e70300c1eb51dd439ba5a5000000000000000000000000e1d29d0a39962a9a8d2a297ebe82e166f8b8ec18000000000000000000000000f598aadf12a2fc4709b5db0c4c169715efaf203800000000000000000000000012ad5707401114453020a92a7384f267c9c559f20000000000000000000000009ca60477a65b05d8b494cddcbcc739edb92dc551000000000000000000000000eee5eb24e7a0ea53b75a1b9ad72e7d20562f42830000000000000000000000004b20ccfa9416da26f70106c9314bff8a5d12f99f0000000000000000000000000a2542a170aa02b96b588aa3af8b09ab22a9d7ac00000000000000000000000057115f7d04c16f3983802b7c5a2d5089a188d76a0000000000000000000000000fe61de274aed1803e66ba1b863d966079cb91160000000000000000000000003d4714e10f17a17bc4d2de4c5ee0cbdf07de351d000000000000000000000000556767936449afa8ae6d7ac9104cd8b614eef769000000000000000000000000da1a941f2256469411f18170794bfc770078171b000000000000000000000000e91cbc483a8fda6bc377ad8b8c717f386a93d349000000000000000000000000863c9aade08c7e024a4c7a2884c6024711ccb11a0000000000000000000000006d02482eacf2e9f5d97160231291c26ebca8de190000000000000000000000006403cab8ca6ff97023395cdf006972ac272a4630000000000000000000000000b9eaa53e766f461546f6fc6e7c8383622adb57010000000000000000000000007fdda177cc70b317d90d6259e6d919f9ae60ab48000000000000000000000000c991fd20ffd2ee620a73ea7dadd051fe86d39b15000000000000000000000000f1e1c701b49b1dc2405a9e8ef40f9f88802b80fa000000000000000000000000e22e9db25c68f96072fa29a485f195ac09355af6000000000000000000000000c63a5ad9e61b64f18492cb1619c9c1941b4df3e30000000000000000000000009f8534b8d266c136d52428ec0647fa0f02ebf377000000000000000000000000409c9f9dc413d7b026c677512aae81323b2c76a9000000000000000000000000189d0ffcb68afa51af4975cd5ffa35feff44b09e000000000000000000000000d213ccf49ee73ab237d0810196217b1cfccfc697000000000000000000000000cf3b555729822b93ab8f05c9124b10243cd3748f0000000000000000000000009ce04dffae9dd97ec6324f91d46caf167339b610000000000000000000000000d96fe34cd20a17d1628f4876939e90aca284e9cd00000000000000000000000043b31a62ada9bd2f1c617a021dc9dd0f81cb868100000000000000000000000012709eba6f4db2df2faf25bae08a2fb1de01be6d0000000000000000000000004aa9b281a0c22338d8af5e4b700bd788fd3b607d000000000000000000000000071489b287c20c413f28a17729b1c954bc01d5b80000000000000000000000001c3c71d24f340f818cea63b2bfe06ee759b2e0c6000000000000000000000000608a070ee28659b8549db85364632b93aac63c82000000000000000000000000ca177d4b3e6d4c2778912b47e6aae49b7c429819000000000000000000000000057931155d0c6355b1bd108b0fbfe9bc77d59ef0000000000000000000000000720a4fab08cb746fc90e88d1924a98104c0822cf000000000000000000000000d30586c41239ad8165ce8705916a8649f96ab7a0000000000000000000000000f8c75c5e9ec6875c57c0dbc30b59934b37908c4e000000000000000000000000ad45458a42a4eb7313a18e6b62aa8ee80161c81200000000000000000000000000000000000000000000000000000000000000010000000000000000000000002a56821a29aa4d855eae5dfd3e118034aefd20290000000000000000000000000000000000000000000000000000000000002710

Deployed Bytecode

0x6080604052600436106102045760003560e01c80636aa633b611610118578063a03040c3116100a0578063b6f975011161006f578063b6f975011461062f578063d3044a151461064f578063ed014fe71461066f578063f2fde38b1461068f578063f952fcad146106af57600080fd5b8063a03040c3146105af578063a5548bdf146105cf578063a5fa12f0146105ef578063aa44212b1461060f57600080fd5b80638da5cb5b116100e75780638da5cb5b146105085780639097548d1461053a57806395805dad1461055c5780639898ac791461057c57806399ac3fa61461059c57600080fd5b80636aa633b614610499578063715018a6146104b35780637a763b9e146104c857806384a55bd3146104e857600080fd5b80633b3546c81161019b578063513e549d1161016a578063513e549d146103e9578063518b63ac1461040957806351cff8d91461043957806351d589de14610459578063576c89331461047957600080fd5b80633b3546c8146103455780633f357fce146103675780633f5c3504146103b3578063468f4fe3146103d357600080fd5b806322f3e2d4116101d757806322f3e2d4146102cb5780632981a40c146102f057806333ab721e1461030557806334add0c11461032557600080fd5b8063050d9298146102095780630b759cf31461024d5780630f62cf1c14610270578063150b7a0214610292575b600080fd5b34801561021557600080fd5b5061022961022436600461198d565b6106c5565b604080516001600160a01b0390931683526020830191909152015b60405180910390f35b34801561025957600080fd5b506102626106fd565b604051908152602001610244565b34801561027c57600080fd5b5061029061028b36600461184e565b61070c565b005b34801561029e57600080fd5b506102b26102ad3660046117db565b610782565b6040516001600160e01b03199091168152602001610244565b3480156102d757600080fd5b506102e06107e0565b6040519015158152602001610244565b3480156102fc57600080fd5b50600854610262565b34801561031157600080fd5b5061029061032036600461184e565b6107f8565b34801561033157600080fd5b5061029061034036600461198d565b610870565b34801561035157600080fd5b5061026261036036600461198d565b5060075490565b34801561037357600080fd5b5061039e6103823660046117be565b6009602052600090815260409020805460019091015460ff1682565b60408051928352901515602083015201610244565b3480156103bf57600080fd5b506102906103ce36600461184e565b6108a0565b3480156103df57600080fd5b50610262600b5481565b3480156103f557600080fd5b5061029061040436600461184e565b610945565b34801561041557600080fd5b5061041e6109b1565b60408051825181526020928301519281019290925201610244565b34801561044557600080fd5b506102906104543660046117be565b6109f3565b34801561046557600080fd5b506102e061047436600461198d565b610a20565b34801561048557600080fd5b5061029061049436600461184e565b610a4e565b3480156104a557600080fd5b50600c546102e09060ff1681565b3480156104bf57600080fd5b50610290610aba565b3480156104d457600080fd5b506102906104e33660046117be565b610aea565b3480156104f457600080fd5b5061029061050336600461184e565b610bbc565b34801561051457600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610244565b34801561054657600080fd5b5061026261055536600461198d565b50600b5490565b34801561056857600080fd5b5061029061057736600461198d565b610c1f565b34801561058857600080fd5b5061052261059736600461198d565b610c5c565b6102906105aa3660046119a6565b610c86565b3480156105bb57600080fd5b50600654610522906001600160a01b031681565b3480156105db57600080fd5b506102906105ea3660046117be565b610ea2565b3480156105fb57600080fd5b5061029061060a36600461198d565b610f4b565b34801561061b57600080fd5b5061026261062a36600461198d565b610f74565b34801561063b57600080fd5b5061029061064a366004611905565b610f95565b34801561065b57600080fd5b5061029061066a366004611890565b610fcc565b34801561067b57600080fd5b5061029061068a36600461198d565b61104f565b34801561069b57600080fd5b506102906106aa3660046117be565b611078565b3480156106bb57600080fd5b50610262600a5481565b600e81815481106106d557600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b60006107076110fb565b905090565b61071461112f565b6107395760405162461bcd60e51b815260040161073090611ae2565b60405180910390fd5b8060005b8181101561077c5761076a84848381811061075a5761075a611bbc565b9050602002013533600036611159565b8061077481611b75565b91505061073d565b50505050565b6006546000906001600160a01b03163314156107ce57600780546001810182556000919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688018490555b50630a85bd0160e11b95945050505050565b600c5460009060ff16801561070757506107076111d5565b61080061112f565b61081c5760405162461bcd60e51b815260040161073090611ae2565b8060005b8181101561077c57600784848381811061083c5761083c611bbc565b835460018101855560009485526020948590209190940292909201359190920155508061086881611b75565b915050610820565b6108786111e1565b6108945760405162461bcd60e51b815260040161073090611abf565b61089d816111eb565b50565b6108a86111e1565b6108c45760405162461bcd60e51b815260040161073090611abf565b60085460005b81811015610929576000600882815481106108e7576108e7611bbc565b60009182526020808320909101546001600160a01b031682526009905260408120908155600101805460ff19169055508061092181611b75565b9150506108ca565b50610936600860006116b2565b6109408383610a4e565b505050565b61094d6111e1565b6109695760405162461bcd60e51b815260040161073090611abf565b8060005b8181101561077c5761099f84848381811061098a5761098a611bbc565b90506020020160208101906104e391906117be565b806109a981611b75565b91505061096d565b60408051808201909152600080825260208201526107076040805180820182526000808252602091820152815180830190925260025482526003549082015290565b6109fb61112f565b610a175760405162461bcd60e51b815260040161073090611ae2565b61089d816111ff565b600c5460009060ff168015610a385750610a386111d5565b8015610a485750610a4833611209565b92915050565b610a566111e1565b610a725760405162461bcd60e51b815260040161073090611abf565b8060005b8181101561077c57610aa8848483818110610a9357610a93611bbc565b90506020020160208101906105ea91906117be565b80610ab281611b75565b915050610a76565b610ac261112f565b610ade5760405162461bcd60e51b815260040161073090611ae2565b610ae86000611256565b565b610af26111e1565b610b0e5760405162461bcd60e51b815260040161073090611abf565b6001600160a01b0381166000908152600960205260408120818155600101805460ff19169055600854905b8181101561094057826001600160a01b031660088281548110610b5e57610b5e611bbc565b6000918252602090912001546001600160a01b03161415610baa5760088181548110610b8c57610b8c611bbc565b600091825260209091200180546001600160a01b0319169055505050565b80610bb481611b75565b915050610b39565b610bc461112f565b610be05760405162461bcd60e51b815260040161073090611ae2565b8060005b8181101561077c57610c0d848483818110610c0157610c01611bbc565b905060200201356112a6565b80610c1781611b75565b915050610be4565b610c276111e1565b610c435760405162461bcd60e51b815260040161073090611abf565b610c4c8161135e565b50600c805460ff19166001179055565b60088181548110610c6c57600080fd5b6000918252602090912001546001600160a01b0316905081565b610c8e6111d5565b610cc75760405162461bcd60e51b815260206004820152600a6024820152693a34b6b2b91037bb32b960b11b6044820152606401610730565b600c5460ff16610d075760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08195b98589b195960aa1b6044820152606401610730565b336000908152600960209081526040918290208251808401909352805483526001015460ff161515908201819052610d735760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081cd85999481b1a5cdd1959608a1b6044820152606401610730565b600a54815110610db95760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e481c1d5c98da185cd959607a1b6044820152606401610730565b600754610df45760405162461bcd60e51b81526020600482015260096024820152686e6f20737570706c7960b81b6044820152606401610730565b600b54341015610e315760405162461bcd60e51b81526020600482015260086024820152676e6f2066756e647360c01b6044820152606401610730565b610e39611383565b610e436001611391565b610e4c346113b8565b7fe0bdee53b954a6ee67f4c8be61b205ba865443ea3be217f333c11841ac5abd1d338787878787604051610e8596959493929190611a77565b60405180910390a1610e9a8633600036611159565b505050505050565b610eaa6111e1565b610ec65760405162461bcd60e51b815260040161073090611abf565b6008805460018082019092557ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b039390931692831790556040805180820182526000808252602080830185815295825260099052919091209051815591519101805460ff1916911515919091179055565b610f536111e1565b610f6f5760405162461bcd60e51b815260040161073090611abf565b600a55565b60078181548110610f8457600080fd5b600091825260209091200154905081565b610f9d6111e1565b610fb95760405162461bcd60e51b815260040161073090611abf565b600c805460ff1916911515919091179055565b610fd461112f565b610ff05760405162461bcd60e51b815260040161073090611ae2565b61104b8282808060200260200160405190810160405280939291908181526020016000905b828210156110415761103260408302860136819003810190611927565b81526020019060010190611015565b5050505050611447565b5050565b6110576111e1565b6110735760405162461bcd60e51b815260040161073090611abf565b600b55565b61108061112f565b61109c5760405162461bcd60e51b815260040161073090611ae2565b6001600160a01b0381166110f25760405162461bcd60e51b815260206004820152601960248201527f6e6577206f776e6572206973207a65726f2061646472657373000000000000006044820152606401610730565b61089d81611256565b60075460009061110b5750600090565b600760008154811061111f5761111f611bbc565b9060005260206000200154905090565b6001546000906001600160a01b031633148061070757506000546001600160a01b03163314905090565b600654604051635c46a7ef60e11b81526001600160a01b0390911690819063b88d4fde9061119390309088908a9089908990600401611a38565b600060405180830381600087803b1580156111ad57600080fd5b505af11580156111c1573d6000803e3d6000fd5b505050506111ce856112a6565b5050505050565b600061070760026114cf565b600061070761112f565b61089d6111fa82610e10611b3f565b600355565b61089d81476114fa565b6001600160a01b03811660009081526009602090815260408083208151808301909252805482526001015460ff1615801592820183905290919061124f5750600a548151105b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60075460005b818110156109405782600782815481106112c8576112c8611bbc565b9060005260206000200154141561134c5760076112e6600184611b5e565b815481106112f6576112f6611bbc565b90600052602060002001546007828154811061131457611314611bbc565b600091825260209091200155600780548061133157611331611ba6565b60019003818190600052602060002001600090559055505050565b8061135681611b75565b9150506112ac565b61089d61136d82610e10611b3f565b6004805460ff1916600117905542600255600355565b610ae8600d80546001019055565b33600090815260096020526040812080548392906113b0908490611b05565b909155505050565b600e5460005b81811015610940576000600e82815481106113db576113db611bbc565b60009182526020918290206040805180820190915260029092020180546001600160a01b031680835260019091015492820183905290925061143491612710906114259088611b3f565b61142f9190611b1d565b6114fa565b508061143f81611b75565b9150506113be565b611453600e60006116d0565b805160005b8181101561094057600e83828151811061147457611474611bbc565b602090810291909101810151825460018082018555600094855293839020825160029092020180546001600160a01b0319166001600160a01b03909216919091178155910151910155806114c781611b75565b915050611458565b600281015460009060ff168015610a4857506001820154825442916114f391611b05565b1192915050565b6002600554141561154d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610730565b60026005556001600160a01b0382166115945760405162461bcd60e51b815260206004820152600960248201526806164647265737320360bc1b6044820152606401610730565b47818110156115d05760405162461bcd60e51b81526020600482015260086024820152676e6f2066756e647360c01b6044820152606401610730565b604080516001600160a01b0385168152602081018490527fbace9fd79d5ea02ed8b43fa96af07e4e8f859a2f71ff878c748f5c22c5780284910160405180910390a16000836001600160a01b03168360405160006040518083038185875af1925050503d806000811461165f576040519150601f19603f3d011682016040523d82523d6000602084013e611664565b606091505b50509050806116a75760405162461bcd60e51b815260206004820152600f60248201526e6661696c656420776974686472617760881b6044820152606401610730565b505060016005555050565b508054600082559060005260206000209081019061089d91906116f1565b508054600082556002029060005260206000209081019061089d919061170a565b5b8082111561170657600081556001016116f2565b5090565b5b808211156117065780546001600160a01b03191681556000600182015560020161170b565b60008083601f84011261174257600080fd5b50813567ffffffffffffffff81111561175a57600080fd5b6020830191508360208260051b850101111561177557600080fd5b9250929050565b60008083601f84011261178e57600080fd5b50813567ffffffffffffffff8111156117a657600080fd5b60208301915083602082850101111561177557600080fd5b6000602082840312156117d057600080fd5b813561124f81611bd2565b6000806000806000608086880312156117f357600080fd5b85356117fe81611bd2565b9450602086013561180e81611bd2565b935060408601359250606086013567ffffffffffffffff81111561183157600080fd5b61183d8882890161177c565b969995985093965092949392505050565b6000806020838503121561186157600080fd5b823567ffffffffffffffff81111561187857600080fd5b61188485828601611730565b90969095509350505050565b600080602083850312156118a357600080fd5b823567ffffffffffffffff808211156118bb57600080fd5b818501915085601f8301126118cf57600080fd5b8135818111156118de57600080fd5b8660208260061b85010111156118f357600080fd5b60209290920196919550909350505050565b60006020828403121561191757600080fd5b8135801515811461124f57600080fd5b60006040828403121561193957600080fd5b6040516040810181811067ffffffffffffffff8211171561196a57634e487b7160e01b600052604160045260246000fd5b604052823561197881611bd2565b81526020928301359281019290925250919050565b60006020828403121561199f57600080fd5b5035919050565b6000806000806000606086880312156119be57600080fd5b85359450602086013567ffffffffffffffff808211156119dd57600080fd5b6119e989838a0161177c565b90965094506040880135915080821115611a0257600080fd5b5061183d8882890161177c565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0386811682528516602082015260408101849052608060608201819052600090611a6c9083018486611a0f565b979650505050505050565b60018060a01b0387168152856020820152608060408201526000611a9f608083018688611a0f565b8281036060840152611ab2818587611a0f565b9998505050505050505050565b6020808252600990820152683737ba1030b236b4b760b91b604082015260600190565b6020808252600990820152683737ba1037bbb732b960b91b604082015260600190565b60008219821115611b1857611b18611b90565b500190565b600082611b3a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b5957611b59611b90565b500290565b600082821015611b7057611b70611b90565b500390565b6000600019821415611b8957611b89611b90565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461089d57600080fdfea2646970667358221220ed5f74600c89fdec6775ab6126e298cc30be0329d9e7b6023799f2c0ab3a82c264736f6c63430008070033

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

0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000fc4c87cabfb6bf4d00e0d26d9e64b2343419db42000000000000000000000000c1d77b0a3d049b6266bc747f70fe12ae776469800000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000031000000000000000000000000155f6bb5fc06deaa5c4a1dd590fb9af39641e2e8000000000000000000000000d61c66607c0ba44172bd5c5f5b7c0fd79d64c6c80000000000000000000000000925d347f811d264879271d2905f54309eaccb93000000000000000000000000a4a6bd0a0b3eedc6bc0a89da68e0bd78c7d3fb8e000000000000000000000000cf04c33bfea64cf5dd6ea97e2d5620f825b03b490000000000000000000000001d28a703ab06bcef8666e4692fe63188b6fcbca20000000000000000000000006d905b1a82afec95bf81de27223839304880f7570000000000000000000000000bf8897ee519fbfc60e70300c1eb51dd439ba5a5000000000000000000000000e1d29d0a39962a9a8d2a297ebe82e166f8b8ec18000000000000000000000000f598aadf12a2fc4709b5db0c4c169715efaf203800000000000000000000000012ad5707401114453020a92a7384f267c9c559f20000000000000000000000009ca60477a65b05d8b494cddcbcc739edb92dc551000000000000000000000000eee5eb24e7a0ea53b75a1b9ad72e7d20562f42830000000000000000000000004b20ccfa9416da26f70106c9314bff8a5d12f99f0000000000000000000000000a2542a170aa02b96b588aa3af8b09ab22a9d7ac00000000000000000000000057115f7d04c16f3983802b7c5a2d5089a188d76a0000000000000000000000000fe61de274aed1803e66ba1b863d966079cb91160000000000000000000000003d4714e10f17a17bc4d2de4c5ee0cbdf07de351d000000000000000000000000556767936449afa8ae6d7ac9104cd8b614eef769000000000000000000000000da1a941f2256469411f18170794bfc770078171b000000000000000000000000e91cbc483a8fda6bc377ad8b8c717f386a93d349000000000000000000000000863c9aade08c7e024a4c7a2884c6024711ccb11a0000000000000000000000006d02482eacf2e9f5d97160231291c26ebca8de190000000000000000000000006403cab8ca6ff97023395cdf006972ac272a4630000000000000000000000000b9eaa53e766f461546f6fc6e7c8383622adb57010000000000000000000000007fdda177cc70b317d90d6259e6d919f9ae60ab48000000000000000000000000c991fd20ffd2ee620a73ea7dadd051fe86d39b15000000000000000000000000f1e1c701b49b1dc2405a9e8ef40f9f88802b80fa000000000000000000000000e22e9db25c68f96072fa29a485f195ac09355af6000000000000000000000000c63a5ad9e61b64f18492cb1619c9c1941b4df3e30000000000000000000000009f8534b8d266c136d52428ec0647fa0f02ebf377000000000000000000000000409c9f9dc413d7b026c677512aae81323b2c76a9000000000000000000000000189d0ffcb68afa51af4975cd5ffa35feff44b09e000000000000000000000000d213ccf49ee73ab237d0810196217b1cfccfc697000000000000000000000000cf3b555729822b93ab8f05c9124b10243cd3748f0000000000000000000000009ce04dffae9dd97ec6324f91d46caf167339b610000000000000000000000000d96fe34cd20a17d1628f4876939e90aca284e9cd00000000000000000000000043b31a62ada9bd2f1c617a021dc9dd0f81cb868100000000000000000000000012709eba6f4db2df2faf25bae08a2fb1de01be6d0000000000000000000000004aa9b281a0c22338d8af5e4b700bd788fd3b607d000000000000000000000000071489b287c20c413f28a17729b1c954bc01d5b80000000000000000000000001c3c71d24f340f818cea63b2bfe06ee759b2e0c6000000000000000000000000608a070ee28659b8549db85364632b93aac63c82000000000000000000000000ca177d4b3e6d4c2778912b47e6aae49b7c429819000000000000000000000000057931155d0c6355b1bd108b0fbfe9bc77d59ef0000000000000000000000000720a4fab08cb746fc90e88d1924a98104c0822cf000000000000000000000000d30586c41239ad8165ce8705916a8649f96ab7a0000000000000000000000000f8c75c5e9ec6875c57c0dbc30b59934b37908c4e000000000000000000000000ad45458a42a4eb7313a18e6b62aa8ee80161c81200000000000000000000000000000000000000000000000000000000000000010000000000000000000000002a56821a29aa4d855eae5dfd3e118034aefd20290000000000000000000000000000000000000000000000000000000000002710

-----Decoded View---------------
Arg [0] : props (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
60 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 000000000000000000000000fc4c87cabfb6bf4d00e0d26d9e64b2343419db42
Arg [2] : 000000000000000000000000c1d77b0a3d049b6266bc747f70fe12ae77646980
Arg [3] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000700
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000031
Arg [8] : 000000000000000000000000155f6bb5fc06deaa5c4a1dd590fb9af39641e2e8
Arg [9] : 000000000000000000000000d61c66607c0ba44172bd5c5f5b7c0fd79d64c6c8
Arg [10] : 0000000000000000000000000925d347f811d264879271d2905f54309eaccb93
Arg [11] : 000000000000000000000000a4a6bd0a0b3eedc6bc0a89da68e0bd78c7d3fb8e
Arg [12] : 000000000000000000000000cf04c33bfea64cf5dd6ea97e2d5620f825b03b49
Arg [13] : 0000000000000000000000001d28a703ab06bcef8666e4692fe63188b6fcbca2
Arg [14] : 0000000000000000000000006d905b1a82afec95bf81de27223839304880f757
Arg [15] : 0000000000000000000000000bf8897ee519fbfc60e70300c1eb51dd439ba5a5
Arg [16] : 000000000000000000000000e1d29d0a39962a9a8d2a297ebe82e166f8b8ec18
Arg [17] : 000000000000000000000000f598aadf12a2fc4709b5db0c4c169715efaf2038
Arg [18] : 00000000000000000000000012ad5707401114453020a92a7384f267c9c559f2
Arg [19] : 0000000000000000000000009ca60477a65b05d8b494cddcbcc739edb92dc551
Arg [20] : 000000000000000000000000eee5eb24e7a0ea53b75a1b9ad72e7d20562f4283
Arg [21] : 0000000000000000000000004b20ccfa9416da26f70106c9314bff8a5d12f99f
Arg [22] : 0000000000000000000000000a2542a170aa02b96b588aa3af8b09ab22a9d7ac
Arg [23] : 00000000000000000000000057115f7d04c16f3983802b7c5a2d5089a188d76a
Arg [24] : 0000000000000000000000000fe61de274aed1803e66ba1b863d966079cb9116
Arg [25] : 0000000000000000000000003d4714e10f17a17bc4d2de4c5ee0cbdf07de351d
Arg [26] : 000000000000000000000000556767936449afa8ae6d7ac9104cd8b614eef769
Arg [27] : 000000000000000000000000da1a941f2256469411f18170794bfc770078171b
Arg [28] : 000000000000000000000000e91cbc483a8fda6bc377ad8b8c717f386a93d349
Arg [29] : 000000000000000000000000863c9aade08c7e024a4c7a2884c6024711ccb11a
Arg [30] : 0000000000000000000000006d02482eacf2e9f5d97160231291c26ebca8de19
Arg [31] : 0000000000000000000000006403cab8ca6ff97023395cdf006972ac272a4630
Arg [32] : 000000000000000000000000b9eaa53e766f461546f6fc6e7c8383622adb5701
Arg [33] : 0000000000000000000000007fdda177cc70b317d90d6259e6d919f9ae60ab48
Arg [34] : 000000000000000000000000c991fd20ffd2ee620a73ea7dadd051fe86d39b15
Arg [35] : 000000000000000000000000f1e1c701b49b1dc2405a9e8ef40f9f88802b80fa
Arg [36] : 000000000000000000000000e22e9db25c68f96072fa29a485f195ac09355af6
Arg [37] : 000000000000000000000000c63a5ad9e61b64f18492cb1619c9c1941b4df3e3
Arg [38] : 0000000000000000000000009f8534b8d266c136d52428ec0647fa0f02ebf377
Arg [39] : 000000000000000000000000409c9f9dc413d7b026c677512aae81323b2c76a9
Arg [40] : 000000000000000000000000189d0ffcb68afa51af4975cd5ffa35feff44b09e
Arg [41] : 000000000000000000000000d213ccf49ee73ab237d0810196217b1cfccfc697
Arg [42] : 000000000000000000000000cf3b555729822b93ab8f05c9124b10243cd3748f
Arg [43] : 0000000000000000000000009ce04dffae9dd97ec6324f91d46caf167339b610
Arg [44] : 000000000000000000000000d96fe34cd20a17d1628f4876939e90aca284e9cd
Arg [45] : 00000000000000000000000043b31a62ada9bd2f1c617a021dc9dd0f81cb8681
Arg [46] : 00000000000000000000000012709eba6f4db2df2faf25bae08a2fb1de01be6d
Arg [47] : 0000000000000000000000004aa9b281a0c22338d8af5e4b700bd788fd3b607d
Arg [48] : 000000000000000000000000071489b287c20c413f28a17729b1c954bc01d5b8
Arg [49] : 0000000000000000000000001c3c71d24f340f818cea63b2bfe06ee759b2e0c6
Arg [50] : 000000000000000000000000608a070ee28659b8549db85364632b93aac63c82
Arg [51] : 000000000000000000000000ca177d4b3e6d4c2778912b47e6aae49b7c429819
Arg [52] : 000000000000000000000000057931155d0c6355b1bd108b0fbfe9bc77d59ef0
Arg [53] : 000000000000000000000000720a4fab08cb746fc90e88d1924a98104c0822cf
Arg [54] : 000000000000000000000000d30586c41239ad8165ce8705916a8649f96ab7a0
Arg [55] : 000000000000000000000000f8c75c5e9ec6875c57c0dbc30b59934b37908c4e
Arg [56] : 000000000000000000000000ad45458a42a4eb7313a18e6b62aa8ee80161c812
Arg [57] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [58] : 0000000000000000000000002a56821a29aa4d855eae5dfd3e118034aefd2029
Arg [59] : 0000000000000000000000000000000000000000000000000000000000002710


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  ]
[ 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.