ETH Price: $3,456.56 (-0.77%)
Gas: 3 Gwei

Contract

0x6133AeeA8BB04Dc9F9B15C9ea799c550c25eb5ED
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Mint And Approve198543372024-05-12 13:48:3550 days ago1715521715IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.000668244.33101746
Mint And Approve195952192024-04-06 7:33:3586 days ago1712388815IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0022094712.30441852
Mint And Approve192505702024-02-17 22:33:11135 days ago1708209191IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.003485217.72124465
Mint And Approve191123102024-01-29 12:53:59154 days ago1706532839IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0029430519.07460742
Mint And Approve191122602024-01-29 12:43:35154 days ago1706532215IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0026027416.86897651
Mint And Approve191122582024-01-29 12:43:11154 days ago1706532191IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0026239717.00655374
Mint And Approve191122482024-01-29 12:41:11154 days ago1706532071IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0024937316.16242591
Mint And Approve191122292024-01-29 12:37:23154 days ago1706531843IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0027722917.96784522
Mint And Approve191121802024-01-29 12:27:23154 days ago1706531243IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0028761216.01693135
Mint And Approve191121452024-01-29 12:20:23154 days ago1706530823IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0024187314.11229223
Mint And Approve188200922023-12-19 12:47:47195 days ago1702990067IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0102317552.02554103
Mint And Approve186925612023-12-01 15:49:47213 days ago1701445787IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0106394568.95659203
Mint And Approve186925402023-12-01 15:45:35213 days ago1701445535IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0093535460.62232815
Mint And Approve186924822023-12-01 15:33:47213 days ago1701444827IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0079995651.84693531
Mint And Approve186924612023-12-01 15:29:35213 days ago1701444575IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0066160142.87981977
Mint And Approve186251982023-11-22 5:27:35222 days ago1700630855IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0034461822.33549753
Mint And Approve185466382023-11-11 5:35:11233 days ago1699680911IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0033566721.75532443
Mint And Approve185075962023-11-05 18:29:59239 days ago1699208999IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0030162219.54880825
Mint And Approve184681052023-10-31 5:43:59244 days ago1698731039IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0028426118.42358423
Mint And Approve184680362023-10-31 5:30:11244 days ago1698730211IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0030857219.99926584
Mint And Approve184680172023-10-31 5:26:23244 days ago1698729983IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0035312122.88657647
Mint And Approve184190912023-10-24 9:00:59251 days ago1698138059IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.002537716.44741313
Mint And Approve184006982023-10-21 19:14:11254 days ago1697915651IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0023463713.69013198
Mint And Approve182920422023-10-06 14:25:23269 days ago1696602323IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0025741213.08870494
Mint And Approve179987682023-08-26 12:13:47310 days ago1693052027IN
0x6133AeeA...0c25eb5ED
0.1 ETH0.0020359211.87874142
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
198543372024-05-12 13:48:3550 days ago1715521715
0x6133AeeA...0c25eb5ED
0.1 ETH
195952192024-04-06 7:33:3586 days ago1712388815
0x6133AeeA...0c25eb5ED
0.1 ETH
192662212024-02-20 3:24:47133 days ago1708399487
0x6133AeeA...0c25eb5ED
0.1 ETH
192662212024-02-20 3:24:47133 days ago1708399487
0x6133AeeA...0c25eb5ED
0.1 ETH
192505702024-02-17 22:33:11135 days ago1708209191
0x6133AeeA...0c25eb5ED
0.1 ETH
191123102024-01-29 12:53:59154 days ago1706532839
0x6133AeeA...0c25eb5ED
0.1 ETH
191122602024-01-29 12:43:35154 days ago1706532215
0x6133AeeA...0c25eb5ED
0.1 ETH
191122582024-01-29 12:43:11154 days ago1706532191
0x6133AeeA...0c25eb5ED
0.1 ETH
191122482024-01-29 12:41:11154 days ago1706532071
0x6133AeeA...0c25eb5ED
0.1 ETH
191122292024-01-29 12:37:23154 days ago1706531843
0x6133AeeA...0c25eb5ED
0.1 ETH
191121802024-01-29 12:27:23154 days ago1706531243
0x6133AeeA...0c25eb5ED
0.1 ETH
191121452024-01-29 12:20:23154 days ago1706530823
0x6133AeeA...0c25eb5ED
0.1 ETH
190146462024-01-15 20:23:35168 days ago1705350215
0x6133AeeA...0c25eb5ED
0.1 ETH
190146462024-01-15 20:23:35168 days ago1705350215
0x6133AeeA...0c25eb5ED
0.1 ETH
189677062024-01-09 6:44:47174 days ago1704782687
0x6133AeeA...0c25eb5ED
0.1 ETH
189677062024-01-09 6:44:47174 days ago1704782687
0x6133AeeA...0c25eb5ED
0.1 ETH
189676542024-01-09 6:34:23174 days ago1704782063
0x6133AeeA...0c25eb5ED
0.1 ETH
189676542024-01-09 6:34:23174 days ago1704782063
0x6133AeeA...0c25eb5ED
0.1 ETH
189676312024-01-09 6:29:23174 days ago1704781763
0x6133AeeA...0c25eb5ED
0.1 ETH
189676312024-01-09 6:29:23174 days ago1704781763
0x6133AeeA...0c25eb5ED
0.1 ETH
189676242024-01-09 6:27:59174 days ago1704781679
0x6133AeeA...0c25eb5ED
0.1 ETH
189676242024-01-09 6:27:59174 days ago1704781679
0x6133AeeA...0c25eb5ED
0.1 ETH
189675112024-01-09 6:05:11174 days ago1704780311
0x6133AeeA...0c25eb5ED
0.1 ETH
189675112024-01-09 6:05:11174 days ago1704780311
0x6133AeeA...0c25eb5ED
0.1 ETH
189675052024-01-09 6:03:59174 days ago1704780239
0x6133AeeA...0c25eb5ED
0.1 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FlatPriceMinter

Compiler Version
v0.7.3+commit.9bfce1f6

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 31 : FlatPriceMinter.sol
pragma solidity ^0.7.3;
pragma experimental ABIEncoderV2;

import "../library/LibSafeMath.sol";
import "../HashV2.sol";
import "../mixin/MixinOwnable.sol";
import "../mixin/MixinPausable.sol";
import "../library/ReentrancyGuard.sol";

contract FlatPriceMinter is Ownable, MixinPausable, ReentrancyGuard {
  using LibSafeMath for uint256;

  HashV2 public hashV2;

  mapping(uint => uint) public tokenTypeToPrice;
  mapping(uint => uint) public tokenTypeToRevealBlockNum;

  address payable public treasury;

  constructor(
    address _hashV2
  ) {
    hashV2 = HashV2(_hashV2);
  }

  function pause() external onlyOwner() {
    _pause();
  } 

  function unpause() external onlyOwner() {
    _unpause();
  }  

  function setTreasury(address payable _treasury) external onlyOwner() {
    treasury = _treasury;
  }

  function setTokenTypePrice(uint256 _tokenType, uint256 _price) external onlyOwner() {
    tokenTypeToPrice[_tokenType] = _price;
  }

  function setTokenTypeRevealBlockNum(uint256 _tokenType, uint256 _blockNum) external onlyOwner() {
    tokenTypeToRevealBlockNum[_tokenType] = _blockNum;
  }

  function mintAndApprove(address to, uint tokenType, uint[] calldata txHashes, address[] calldata operators) public payable nonReentrant() whenNotPaused() {
    require(tokenTypeToRevealBlockNum[tokenType] != 0 && block.number > tokenTypeToRevealBlockNum[tokenType], "Token type minting not active yet");
    hashV2.mintAndApprove(to, tokenType, txHashes, operators);
    // verify and transfer fee
    uint256 price = tokenTypeToPrice[tokenType] * txHashes.length;
    require(price <= msg.value, "insufficient funds to pay for mint");
    treasury.call{value: price }("");
    msg.sender.call{value: msg.value.safeSub(price) }("");
  }
}

File 2 of 31 : LibSafeMath.sol
pragma solidity ^0.7.3;

import "./LibRichErrors.sol";
import "./LibSafeMathRichErrors.sol";

library LibSafeMath {

    function safeMul(uint256 a, uint256 b)
        internal
        pure
        returns (uint256)
    {
        if (a == 0) {
            return 0;
        }
        uint256 c = a * b;
        if (c / a != b) {
            LibRichErrors.rrevert(LibSafeMathRichErrors.Uint256BinOpError(
                LibSafeMathRichErrors.BinOpErrorCodes.MULTIPLICATION_OVERFLOW,
                a,
                b
            ));
        }
        return c;
    }

    function safeDiv(uint256 a, uint256 b)
        internal
        pure
        returns (uint256)
    {
        if (b == 0) {
            LibRichErrors.rrevert(LibSafeMathRichErrors.Uint256BinOpError(
                LibSafeMathRichErrors.BinOpErrorCodes.DIVISION_BY_ZERO,
                a,
                b
            ));
        }
        uint256 c = a / b;
        return c;
    }

    function safeSub(uint256 a, uint256 b)
        internal
        pure
        returns (uint256)
    {
        if (b > a) {
            LibRichErrors.rrevert(LibSafeMathRichErrors.Uint256BinOpError(
                LibSafeMathRichErrors.BinOpErrorCodes.SUBTRACTION_UNDERFLOW,
                a,
                b
            ));
        }
        return a - b;
    }

    function safeAdd(uint256 a, uint256 b)
        internal
        pure
        returns (uint256)
    {
        uint256 c = a + b;
        if (c < a) {
            LibRichErrors.rrevert(LibSafeMathRichErrors.Uint256BinOpError(
                LibSafeMathRichErrors.BinOpErrorCodes.ADDITION_OVERFLOW,
                a,
                b
            ));
        }
        return c;
    }

    function max256(uint256 a, uint256 b)
        internal
        pure
        returns (uint256)
    {
        return a >= b ? a : b;
    }

    function min256(uint256 a, uint256 b)
        internal
        pure
        returns (uint256)
    {
        return a < b ? a : b;
    }
}

File 3 of 31 : HashV2.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

import "./ERC721.sol";
import "./mixin/MixinOwnable.sol";
import "./HashBaseV2.sol";
import "./HashRegistryV2.sol";
import "./ERC1155Mintable.sol";

contract HashV2 is HashBaseV2 {
    uint256 constant internal TYPE_MASK = uint256(uint128(~0)) << 128;
    
    HashRegistryV2 public hashRegistry;
    ERC1155Mintable public immutable originalHash;

    mapping(uint => uint) public tokenTypeToSupply;
    mapping(uint => uint) public tokenTypeToMaxSupply;
    mapping(address => bool) public minters;

    constructor (
      string memory name_,
      string memory symbol_,
      address originalHash_
    ) HashBaseV2(name_, symbol_) {
      originalHash = ERC1155Mintable(originalHash_);
    }

  modifier onlyMinter() {
    require(minters[msg.sender] == true, "msg.sender is not minter");
    _;
  }

  function _getNonFungibleBaseType(uint256 id) pure internal returns (uint256) {
    return id & TYPE_MASK;
  }

  modifier onlyUnderMaxSupply(uint tokenType, uint mintAmount) {
    require(tokenTypeToSupply[tokenType] + mintAmount <= tokenTypeToMaxSupply[tokenType], 'max supply minted');
    _;
  }

  function setHashRegistry(address _hashRegistry) public onlyOwner {
    hashRegistry = HashRegistryV2(_hashRegistry);
  }
  
  function setMinterStatus(address _minter, bool status) public onlyOwner {
    minters[_minter] = status;
  }

  function createNewSeason(uint _tokenType, uint maxSupply) public onlyOwner {
    require(tokenTypeToMaxSupply[_tokenType] == 0, "can't modify already created season");
    tokenTypeToMaxSupply[_tokenType] = maxSupply;
  }

  function mintAndApprove(address to, uint tokenType, uint[] calldata txHashes, address[] calldata operators) public onlyMinter onlyUnderMaxSupply(tokenType, txHashes.length) {
    uint256[] memory tokenIds = new uint256[](txHashes.length);
    for (uint256 i = 0; i < txHashes.length; ++i) {
      uint256 index = tokenTypeToSupply[tokenType] + 1 + i;
      uint256 tokenId  = tokenType | index;
      tokenIds[i] = tokenId;
      _safeMint(to, tokenId);
    }
    hashRegistry.writeToRegistry(tokenIds, txHashes);
    tokenTypeToSupply[tokenType] = tokenTypeToSupply[tokenType] + txHashes.length;
    for (uint i = 0; i < operators.length; ++i) {
      _setApprovalForAll(to, operators[i], true);
    }
  }

  function migrateAndApprove(address to, uint[] calldata ids, address[] calldata operators) public {
    for (uint i = 0; i < ids.length; ++i) {
      // burn original hash erc1155
      originalHash.safeTransferFrom(to, address(0xdead), ids[i], 1, "");
      _safeMint(to, ids[i]);
    }
    for (uint i = 0; i < operators.length; ++i) {
      _setApprovalForAll(to, operators[i], true);
    }
  }
}

File 4 of 31 : MixinOwnable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;

import "../utils/Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

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

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

File 5 of 31 : MixinPausable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract MixinPausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 6 of 31 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

/**
 * @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 make 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 7 of 31 : LibRichErrors.sol
pragma solidity ^0.7.3;

library LibRichErrors {

    // bytes4(keccak256("Error(string)"))
    bytes4 internal constant STANDARD_ERROR_SELECTOR =
        0x08c379a0;

    // solhint-disable func-name-mixedcase
    /// @dev ABI encode a standard, string revert error payload.
    ///      This is the same payload that would be included by a `revert(string)`
    ///      solidity statement. It has the function signature `Error(string)`.
    /// @param message The error string.
    /// @return The ABI encoded error.
    function StandardError(
        string memory message
    )
        internal
        pure
        returns (bytes memory)
    {
        return abi.encodeWithSelector(
            STANDARD_ERROR_SELECTOR,
            bytes(message)
        );
    }
    // solhint-enable func-name-mixedcase

    /// @dev Reverts an encoded rich revert reason `errorData`.
    /// @param errorData ABI encoded error data.
    function rrevert(bytes memory errorData)
        internal
        pure
    {
        assembly {
            revert(add(errorData, 0x20), mload(errorData))
        }
    }
}

File 8 of 31 : LibSafeMathRichErrors.sol
pragma solidity ^0.7.3;


library LibSafeMathRichErrors {

    // bytes4(keccak256("Uint256BinOpError(uint8,uint256,uint256)"))
    bytes4 internal constant UINT256_BINOP_ERROR_SELECTOR =
        0xe946c1bb;

    // bytes4(keccak256("Uint256DowncastError(uint8,uint256)"))
    bytes4 internal constant UINT256_DOWNCAST_ERROR_SELECTOR =
        0xc996af7b;

    enum BinOpErrorCodes {
        ADDITION_OVERFLOW,
        MULTIPLICATION_OVERFLOW,
        SUBTRACTION_UNDERFLOW,
        DIVISION_BY_ZERO
    }

    enum DowncastErrorCodes {
        VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT32,
        VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT64,
        VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT96
    }

    // solhint-disable func-name-mixedcase
    function Uint256BinOpError(
        BinOpErrorCodes errorCode,
        uint256 a,
        uint256 b
    )
        internal
        pure
        returns (bytes memory)
    {
        return abi.encodeWithSelector(
            UINT256_BINOP_ERROR_SELECTOR,
            errorCode,
            a,
            b
        );
    }

    function Uint256DowncastError(
        DowncastErrorCodes errorCode,
        uint256 a
    )
        internal
        pure
        returns (bytes memory)
    {
        return abi.encodeWithSelector(
            UINT256_DOWNCAST_ERROR_SELECTOR,
            errorCode,
            a
        );
    }
}

File 9 of 31 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

import "./interface/IERC721.sol";
import "./interface/IERC721Receiver.sol";
import "./interface/IERC721Metadata.sol";
import "./utils/Address.sol";
import "./utils/Context.sol";
import "./utils/Strings.sol";
import "./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 {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_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);
    }

    function _setApprovalForAll(address to, address operator, bool approved) internal virtual {
        _operatorApprovals[to][operator] = approved;
        emit ApprovalForAll(to, 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 10 of 31 : HashBaseV2.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

import "./ERC721.sol";
import "./WhitelistExchangesProxy.sol";
import "./mixin/MixinOwnable.sol";

contract HashBaseV2 is Ownable, ERC721 {

    string public baseMetadataURI;
    string public contractURI;

    constructor (
      string memory name_,
      string memory symbol_
    ) ERC721(name_, symbol_) {
    }

    function setBaseMetadataURI(string memory _baseMetadataURI) public onlyOwner {
      baseMetadataURI = _baseMetadataURI;
    }

    function setContractURI(string calldata newContractURI) external onlyOwner {
        contractURI = newContractURI;
    }

    function _baseURI() override internal view virtual returns (string memory) {
      return baseMetadataURI;
    }
}

File 11 of 31 : HashRegistryV2.sol
pragma solidity ^0.7.3;
pragma experimental ABIEncoderV2;

import "./library/LibSafeMath.sol";
import "./mixin/MixinOwnable.sol";
import "./ERC721.sol";
import "./mixin/MixinOwnable.sol";
import "./HashRegistry.sol";
import "./ERC1155Mintable.sol";
import "./HashV2.sol";

contract HashRegistryV2 is Ownable {
  uint256 constant internal TYPE_MASK = uint256(uint128(~0)) << 128;

  HashV2 public immutable hashV2;
  ERC1155Mintable public immutable originalHash;
  HashRegistry public immutable originalHashRegistry;

  mapping(uint256 => uint256) private tokenIdToTxHash_;
  mapping(uint256 => uint256) private txHashToTokenId_;
  mapping(address => bool) public permissedWriters;

  constructor(
    address originalHashRegistry_,
    address originalHash_,
    address hashV2_
  ) {
    originalHashRegistry = HashRegistry(originalHashRegistry_);
    originalHash = ERC1155Mintable(originalHash_);
    hashV2 = HashV2(hashV2_);
  }

  event UpdatedRegistry(
      uint256 tokenId,
      uint256 txHash
  );

  modifier onlyIfPermissed(address writer) {
    require(permissedWriters[writer] == true, "writer can't write to registry");
    _;
  }

  function updatePermissedWriterStatus(address _writer, bool status) public onlyOwner {
    permissedWriters[_writer] = status;
  }

  function writeToRegistry(uint256[] memory tokenIds, uint256[] memory txHashes) public onlyIfPermissed(msg.sender) {
    require(tokenIds.length == txHashes.length, "tokenIds and txHashes size mismatch");
    for (uint256 i = 0; i < tokenIds.length; ++i) {
      uint256 tokenId = tokenIds[i];
      uint256 txHash = txHashes[i];
      require(txHashToTokenId_[txHash] == 0, 'txHash already exists');
      require(tokenIdToTxHash_[tokenId] == 0, 'tokenId already exists');
      tokenIdToTxHash_[tokenId] = txHash;
      txHashToTokenId_[txHash] = tokenId;
      emit UpdatedRegistry(tokenId, txHash); 
    }
  }

  function tokenIdToTxHash(uint id) public view returns (uint256) {
    if (tokenIdToTxHash_[id] == 0 && originalHashRegistry.tokenIdToTxHash(id) != 0) {
      return originalHashRegistry.tokenIdToTxHash(id); 
    }
    return tokenIdToTxHash_[id]; 
  }

  function txHashToTokenId(uint txHash) public view returns (uint256) {
    if (txHashToTokenId_[txHash] == 0 && originalHashRegistry.txHashToTokenId(txHash) != 0) {
      return originalHashRegistry.txHashToTokenId(txHash); 
    }
    return txHashToTokenId_[txHash]; 
  }

  function _getNonFungibleBaseType(uint256 id) pure internal returns (uint256) {
    return id & TYPE_MASK;
  }

  function isMigrated(uint id) public view returns (bool) {
    uint tokenType = _getNonFungibleBaseType(id);
    try hashV2.ownerOf(id) returns (address owner) {
      return owner != address(0) && (originalHash.ownerOf(id) == address(0xdead));
    }
    catch (bytes memory _err) {
      return false;
    }
  }

  function ownerOf(uint id) public view returns (address) {
    uint tokenType = _getNonFungibleBaseType(id);
    address oldOwner = originalHash.ownerOf(id);
    try hashV2.ownerOf(id) returns (address owner) {
      if (owner == address(0) && oldOwner != address(0)) {
        return oldOwner;
      }
      return owner;
    }
    catch (bytes memory _err) {
      return oldOwner;
    }
  }

  function ownerOfByTxHash(uint txHash) public view returns (address) {
    uint id = txHashToTokenId(txHash);
    return ownerOf(id);
  } 
}

File 12 of 31 : ERC1155Mintable.sol
pragma solidity ^0.7.3;

import "./library/LibSafeMath.sol";
import "./library/LibAddress.sol";
import "./ERC1155.sol";
import "./interface/IERC1155Mintable.sol";
import "./mixin/MixinOwnable.sol";
import "./mixin/MixinContractURI.sol";
import "./mixin/MixinTokenURI.sol";

/// @dev Mintable form of ERC1155
/// Shows how easy it is to mint new items
contract ERC1155Mintable is
    IERC1155Mintable,
    ERC1155,
    MixinContractURI,
    MixinTokenURI
{
    using LibSafeMath for uint256;
    using LibAddress for address;

    uint256 internal nonce;

    /// mapping from token to max index
    mapping (uint256 => uint256) public maxIndex;

    mapping (uint256 => mapping(address => bool)) internal creatorApproval;

    modifier onlyCreator(uint256 _id) {
        require(creatorApproval[_id][msg.sender], "not an approved creator of id");
        _;
    }

    function setCreatorApproval(uint256 id, address creator, bool status) external onlyCreator(id) {
        creatorApproval[id][creator] = status;
    }

    /// @dev creates a new token
    /// @param isNF is non-fungible token
    /// @return type_ of token (a unique identifier)
    function create(
        bool isNF
    )
        external
        override
        onlyOwner()
        returns (uint256 type_)
    {
        // Store the type in the upper 128 bits
        type_ = (++nonce << 128);

        // Set a flag if this is an NFI.
        if (isNF) {
            type_ = type_ | TYPE_NF_BIT;
        }

        creatorApproval[type_][msg.sender] = true;

        // emit a Transfer event with Create semantic to help with discovery.
        emit TransferSingle(
            msg.sender,
            address(0x0),
            address(0x0),
            type_,
            0
        );

        emit URI(uri(type_), type_);
    }

    /// @dev creates a new token
    /// @param type_ of token
    function createWithType(
        uint256 type_
    )
        external
        onlyOwner()
    {

        creatorApproval[type_][msg.sender] = true;

        // emit a Transfer event with Create semantic to help with discovery.
        emit TransferSingle(
            msg.sender,
            address(0x0),
            address(0x0),
            type_,
            0
        );

        emit URI(uri(type_), type_);
    }

    /// @dev mints fungible tokens
    /// @param id token type
    /// @param to beneficiaries of minted tokens
    /// @param quantities amounts of minted tokens
    function mintFungible(
        uint256 id,
        address[] calldata to,
        uint256[] calldata quantities
    )
        external
        override
        onlyCreator(id)
    {
        // sanity checks
        require(
            isFungible(id),
            "TRIED_TO_MINT_FUNGIBLE_FOR_NON_FUNGIBLE_TOKEN"
        );

        // mint tokens
        for (uint256 i = 0; i < to.length; ++i) {
            // cache to reduce number of loads
            address dst = to[i];
            uint256 quantity = quantities[i];

            // Grant the items to the caller
            balances[id][dst] = quantity.safeAdd(balances[id][dst]);

            // Emit the Transfer/Mint event.
            // the 0x0 source address implies a mint
            // It will also provide the circulating supply info.
            emit TransferSingle(
                msg.sender,
                address(0x0),
                dst,
                id,
                quantity
            );

            // if `to` is a contract then trigger its callback
            if (dst.isContract()) {
                bytes4 callbackReturnValue = IERC1155Receiver(dst).onERC1155Received(
                    msg.sender,
                    msg.sender,
                    id,
                    quantity,
                    ""
                );
                require(
                    callbackReturnValue == ERC1155_RECEIVED,
                    "BAD_RECEIVER_RETURN_VALUE"
                );
            }
        }
    }

    /// @dev mints a non-fungible token
    /// @param type_ token type
    /// @param to beneficiaries of minted tokens
    function mintNonFungible(
        uint256 type_,
        address[] calldata to
    )
        external
        override
        onlyCreator(type_)
    {
        require(
            isNonFungible(type_),
            "TRIED_TO_MINT_NON_FUNGIBLE_FOR_FUNGIBLE_TOKEN"
        );

        // Index are 1-based.
        uint256 index = maxIndex[type_] + 1;

        for (uint256 i = 0; i < to.length; ++i) {
            // cache to reduce number of loads
            address dst = to[i];
            uint256 id  = type_ | index + i;

            nfOwners[id] = dst;

            // You could use base-type id to store NF type balances if you wish.
            balances[type_][dst] = balances[type_][dst].safeAdd(1);

            emit TransferSingle(msg.sender, address(0x0), dst, id, 1);

            // if `to` is a contract then trigger its callback
            if (dst.isContract()) {
                bytes4 callbackReturnValue = IERC1155Receiver(dst).onERC1155Received(
                    msg.sender,
                    msg.sender,
                    id,
                    1,
                    ""
                );
                require(
                    callbackReturnValue == ERC1155_RECEIVED,
                    "BAD_RECEIVER_RETURN_VALUE"
                );
            }
        }

        // record the `maxIndex` of this nft type
        // this allows us to mint more nft's of this type in a subsequent call.
        maxIndex[type_] = to.length.safeAdd(maxIndex[type_]);
    }
}

File 13 of 31 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

import "./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 14 of 31 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

/**
 * @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 15 of 31 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

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 16 of 31 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

/**
 * @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 31 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

/*
 * @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 _txOrigin() internal view virtual returns (address) {
        return tx.origin;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 18 of 31 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

/**
 * @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 19 of 31 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

import "./interface/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 20 of 31 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.3;

/**
 * @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 21 of 31 : WhitelistExchangesProxy.sol
pragma solidity ^0.7.3;

import "./mixin/MixinOwnable.sol";

contract WhitelistExchangesProxy is Ownable {
    mapping(address => bool) internal proxies;

    bool public paused = true;
    
    function setPaused(bool newPaused) external onlyOwner() {
        paused = newPaused;
    }

    function updateProxyAddress(address proxy, bool status) external onlyOwner() {
        proxies[proxy] = status;
    }

    function isAddressWhitelisted(address proxy) external view returns (bool) {
        if (paused) {
            return false;
        } else {
            return proxies[proxy];
        }
    }
}

File 22 of 31 : HashRegistry.sol
pragma solidity ^0.7.3;

import "./library/LibSafeMath.sol";
import "./ERC1155Mintable.sol";
import "./mixin/MixinOwnable.sol";

contract HashRegistry is Ownable {
  using LibSafeMath for uint256;

  ERC1155Mintable public mintableErc1155;

  mapping(uint256 => uint256) public tokenIdToTxHash;
  mapping(uint256 => uint256) public txHashToTokenId;
  mapping(address => bool) public permissedWriters;

  constructor(
    address _mintableErc1155
  ) {
    permissedWriters[msg.sender] = true;
    mintableErc1155 = ERC1155Mintable(_mintableErc1155);
  }

  event UpdatedRegistry(
      uint256 tokenId,
      uint256 txHash
  );

  modifier onlyIfPermissed(address writer) {
    require(permissedWriters[writer] == true, "writer can't write to registry");
    _;
  }

  function updatePermissedWriterStatus(address _writer, bool status) public onlyIfPermissed(msg.sender) {
    permissedWriters[_writer] = status;
  }

  function writeToRegistry(uint256[] memory tokenIds, uint256[] memory txHashes) public onlyIfPermissed(msg.sender) {
    require(tokenIds.length == txHashes.length, "tokenIds and txHashes size mismatch");
    for (uint256 i = 0; i < tokenIds.length; ++i) {
      uint256 tokenId = tokenIds[i];
      uint256 txHash = txHashes[i];
      require(mintableErc1155.ownerOf(tokenId) != address(0), 'token does not exist');
      require(txHashToTokenId[txHash] == 0, 'txHash already exists');
      require(tokenIdToTxHash[tokenId] == 0, 'tokenId already exists');
      tokenIdToTxHash[tokenId] = txHash;
      txHashToTokenId[txHash] = tokenId;
      emit UpdatedRegistry(tokenId, txHash); 
    }
  }
}

File 23 of 31 : LibAddress.sol
pragma solidity ^0.7.3;


/**
 * Utility library of inline functions on addresses
 */
library LibAddress {

    /**
     * Returns whether the target address is a contract
     * @dev This function will return false if invoked during the constructor of a contract,
     * as the code is not actually created until after the constructor finishes.
     * @param account address of the account to check
     * @return whether the target address is a contract
     */
    function isContract(address account) internal view returns (bool) {
        uint256 size;
        // XXX Currently there is no better way to check if there is a contract in an address
        // than to check the size of the code at that address.
        // See https://ethereum.stackexchange.com/a/14016/36603
        // for more details about how this works.
        // TODO Check this again before the Serenity release, because all addresses will be
        // contracts then.
        // solium-disable-next-line security/no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

}

File 24 of 31 : ERC1155.sol
pragma solidity ^0.7.3;

import "./library/LibSafeMath.sol";
import "./library/LibAddress.sol";
import "./interface/IERC1155.sol";
import "./interface/IERC1155Receiver.sol";
import "./mixin/MixinNonFungibleToken.sol";
import "./mixin/MixinOwnable.sol";
import "./WhitelistExchangesProxy.sol";

contract ERC1155 is
    IERC1155,
    MixinNonFungibleToken,
    Ownable
{
    using LibAddress for address;
    using LibSafeMath for uint256;

    // selectors for receiver callbacks
    bytes4 constant public ERC1155_RECEIVED       = 0xf23a6e61;
    bytes4 constant public ERC1155_BATCH_RECEIVED = 0xbc197c81;

    // id => (owner => balance)
    mapping (uint256 => mapping(address => uint256)) internal balances;

    // owner => (operator => approved)
    mapping (address => mapping(address => bool)) internal operatorApproval;

    address public exchangesRegistry;

    function setExchangesRegistry(address newExchangesRegistry) external onlyOwner() {
        exchangesRegistry = newExchangesRegistry;
    }

    /// @notice Transfers value amount of an _id from the _from address to the _to address specified.
    /// @dev MUST emit TransferSingle event on success.
    /// Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
    /// MUST throw if `_to` is the zero address.
    /// MUST throw if balance of sender for token `_id` is lower than the `_value` sent.
    /// MUST throw on any other error.
    /// When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0).
    /// If so, it MUST call `onERC1155Received` on `_to` and revert if the return value
    /// is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`.
    /// @param from    Source address
    /// @param to      Target address
    /// @param id      ID of the token type
    /// @param value   Transfer amount
    /// @param data    Additional data with no specified format, sent in call to `_to`
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 value,
        bytes calldata data
    )
        override
        external
    {
        // sanity checks
        require(
            to != address(0x0),
            "CANNOT_TRANSFER_TO_ADDRESS_ZERO"
        );
        require(
            from == msg.sender || isApprovedForAll(from, msg.sender),
            "INSUFFICIENT_ALLOWANCE"
        );

        // perform transfer
        if (isNonFungible(id)) {
            require(
                    value == 1,
                    "AMOUNT_EQUAL_TO_ONE_REQUIRED"
            );
            require(
                nfOwners[id] == from,
                "NFT_NOT_OWNED_BY_FROM_ADDRESS"
            );
            nfOwners[id] = to;
            // You could keep balance of NF type in base type id like so:
            // uint256 baseType = getNonFungibleBaseType(_id);
            // balances[baseType][_from] = balances[baseType][_from].safeSub(_value);
            // balances[baseType][_to]   = balances[baseType][_to].safeAdd(_value);
        } else {
            balances[id][from] = balances[id][from].safeSub(value);
            balances[id][to] = balances[id][to].safeAdd(value);
        }
        emit TransferSingle(msg.sender, from, to, id, value);

        // if `to` is a contract then trigger its callback
        if (to.isContract()) {
            bytes4 callbackReturnValue = IERC1155Receiver(to).onERC1155Received(
                msg.sender,
                from,
                id,
                value,
                data
            );
            require(
                callbackReturnValue == ERC1155_RECEIVED,
                "BAD_RECEIVER_RETURN_VALUE"
            );
        }
    }

    /// @notice Send multiple types of Tokens from a 3rd party in one transfer (with safety call).
    /// @dev MUST emit TransferBatch event on success.
    /// Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
    /// MUST throw if `_to` is the zero address.
    /// MUST throw if length of `_ids` is not the same as length of `_values`.
    ///  MUST throw if any of the balance of sender for token `_ids` is lower than the respective `_values` sent.
    /// MUST throw on any other error.
    /// When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0).
    /// If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return value
    /// is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`.
    /// @param from    Source addresses
    /// @param to      Target addresses
    /// @param ids     IDs of each token type
    /// @param values  Transfer amounts per token type
    /// @param data    Additional data with no specified format, sent in call to `_to`
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    )
        override
        external
    {
        // sanity checks
        require(
            to != address(0x0),
            "CANNOT_TRANSFER_TO_ADDRESS_ZERO"
        );
        require(
            ids.length == values.length,
            "TOKEN_AND_VALUES_LENGTH_MISMATCH"
        );

        // Only supporting a global operator approval allows us to do
        // only 1 check and not to touch storage to handle allowances.
        require(
            from == msg.sender || isApprovedForAll(from, msg.sender),
            "INSUFFICIENT_ALLOWANCE"
        );

        // perform transfers
        for (uint256 i = 0; i < ids.length; ++i) {
            // Cache value to local variable to reduce read costs.
            uint256 id = ids[i];
            uint256 value = values[i];

            if (isNonFungible(id)) {
                require(
                    value == 1,
                    "AMOUNT_EQUAL_TO_ONE_REQUIRED"
                );
                require(
                    nfOwners[id] == from,
                    "NFT_NOT_OWNED_BY_FROM_ADDRESS"
                );
                nfOwners[id] = to;
            } else {
                balances[id][from] = balances[id][from].safeSub(value);
                balances[id][to] = balances[id][to].safeAdd(value);
            }
        }
        emit TransferBatch(msg.sender, from, to, ids, values);

        // if `to` is a contract then trigger its callback
        if (to.isContract()) {
            bytes4 callbackReturnValue = IERC1155Receiver(to).onERC1155BatchReceived(
                msg.sender,
                from,
                ids,
                values,
                data
            );
            require(
                callbackReturnValue == ERC1155_BATCH_RECEIVED,
                "BAD_RECEIVER_RETURN_VALUE"
            );
        }
    }

    /// @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
    /// @dev MUST emit the ApprovalForAll event on success.
    /// @param operator  Address to add to the set of authorized operators
    /// @param approved  True if the operator is approved, false to revoke approval
    function setApprovalForAll(address operator, bool approved) external override {
        operatorApproval[msg.sender][operator] = approved;
        emit ApprovalForAll(msg.sender, operator, approved);
    }

    /// @notice Queries the approval status of an operator for a given owner.
    /// @param owner     The owner of the Tokens
    /// @param operator  Address of authorized operator
    /// @return           True if the operator is approved, false if not
    function isApprovedForAll(address owner, address operator) public override view returns (bool) {
        bool approved = operatorApproval[owner][operator];
        if (!approved && exchangesRegistry != address(0)) {
            return WhitelistExchangesProxy(exchangesRegistry).isAddressWhitelisted(operator) == true;
        }
        return approved;
    }

    /// @notice Get the balance of an account's Tokens.
    /// @param owner  The address of the token holder
    /// @param id     ID of the Token
    /// @return        The _owner's balance of the Token type requested
    function balanceOf(address owner, uint256 id) external override view returns (uint256) {
        if (isNonFungibleItem(id)) {
            return nfOwners[id] == owner ? 1 : 0;
        }
        return balances[id][owner];
    }

    /// @notice Get the balance of multiple account/token pairs
    /// @param owners The addresses of the token holders
    /// @param ids    ID of the Tokens
    /// @return balances_       The _owner's balance of the Token types requested
    function balanceOfBatch(address[] calldata owners, uint256[] calldata ids) external override view returns (uint256[] memory balances_) {
        // sanity check
        require(
            owners.length == ids.length,
            "OWNERS_AND_IDS_MUST_HAVE_SAME_LENGTH"
        );

        // get balances
        balances_ = new uint256[](owners.length);
        for (uint256 i = 0; i < owners.length; ++i) {
            uint256 id = ids[i];
            if (isNonFungibleItem(id)) {
                balances_[i] = nfOwners[id] == owners[i] ? 1 : 0;
            } else {
                balances_[i] = balances[id][owners[i]];
            }
        }

        return balances_;
    }

    bytes4 constant private INTERFACE_SIGNATURE_ERC165 = 0x01ffc9a7;
    bytes4 constant private INTERFACE_SIGNATURE_ERC1155 = 0xd9b67a26;

    function supportsInterface(bytes4 _interfaceID) external view returns (bool) {
        if (_interfaceID == INTERFACE_SIGNATURE_ERC165 ||
            _interfaceID == INTERFACE_SIGNATURE_ERC1155) {
        return true;
        }
        return false;
    }
}

File 25 of 31 : IERC1155Mintable.sol
/*

  Copyright 2019 ZeroEx Intl.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

*/

pragma solidity ^0.7.3;

import "./IERC1155.sol";


/// @dev Mintable form of ERC1155
/// Shows how easy it is to mint new items
interface IERC1155Mintable is
    IERC1155
{

    /// @dev creates a new token
    /// @param isNF is non-fungible token
    /// @return type_ of token (a unique identifier)
    function create(
        bool isNF
    )
        external
        returns (uint256 type_);

    /// @dev mints fungible tokens
    /// @param id token type
    /// @param to beneficiaries of minted tokens
    /// @param quantities amounts of minted tokens
    function mintFungible(
        uint256 id,
        address[] calldata to,
        uint256[] calldata quantities
    )
        external;

    /// @dev mints a non-fungible token
    /// @param type_ token type
    /// @param to beneficiaries of minted tokens
    function mintNonFungible(
        uint256 type_,
        address[] calldata to
    )
        external;
}

File 26 of 31 : MixinContractURI.sol
pragma solidity ^0.7.3;

import "./MixinOwnable.sol";

contract MixinContractURI is Ownable {
    string public contractURI;

    function setContractURI(string calldata newContractURI) external onlyOwner() {
        contractURI = newContractURI;
    }
}

File 27 of 31 : MixinTokenURI.sol
pragma solidity ^0.7.3;

import "./MixinOwnable.sol";
import "../library/LibString.sol";

contract MixinTokenURI is Ownable {
    using LibString for string;

    string public baseMetadataURI = "";

    function setBaseMetadataURI(string memory newBaseMetadataURI) public onlyOwner() {
        baseMetadataURI = newBaseMetadataURI;
    }

    function uri(uint256 _id) public view returns (string memory) {
        return LibString.strConcat(
        baseMetadataURI,
        LibString.uint2hexstr(_id)
        );
    }
}

File 28 of 31 : IERC1155.sol
/*

  Copyright 2019 ZeroEx Intl.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

*/

pragma solidity ^0.7.3;

/// @title ERC-1155 Multi Token Standard
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md
/// Note: The ERC-165 identifier for this interface is 0xd9b67a26.
interface IERC1155 {

    /// @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred,
    ///      including zero value transfers as well as minting or burning.
    /// Operator will always be msg.sender.
    /// Either event from address `0x0` signifies a minting operation.
    /// An event to address `0x0` signifies a burning or melting operation.
    /// The total value transferred from address 0x0 minus the total value transferred to 0x0 may
    /// be used by clients and exchanges to be added to the "circulating supply" for a given token ID.
    /// To define a token ID with no initial balance, the contract SHOULD emit the TransferSingle event
    /// from `0x0` to `0x0`, with the token creator as `_operator`.
    event TransferSingle(
        address indexed _operator,
        address indexed _from,
        address indexed _to,
        uint256 _id,
        uint256 _value
    );

    /// @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred,
    ///      including zero value transfers as well as minting or burning.
    ///Operator will always be msg.sender.
    /// Either event from address `0x0` signifies a minting operation.
    /// An event to address `0x0` signifies a burning or melting operation.
    /// The total value transferred from address 0x0 minus the total value transferred to 0x0 may
    /// be used by clients and exchanges to be added to the "circulating supply" for a given token ID.
    /// To define multiple token IDs with no initial balance, this SHOULD emit the TransferBatch event
    /// from `0x0` to `0x0`, with the token creator as `_operator`.
    event TransferBatch(
        address indexed _operator,
        address indexed _from,
        address indexed _to,
        uint256[] _ids,
        uint256[] _values
    );

    /// @dev MUST emit when an approval is updated.
    event ApprovalForAll(
        address indexed _owner,
        address indexed _operator,
        bool _approved
    );

    /// @dev MUST emit when the URI is updated for a token ID.
    /// URIs are defined in RFC 3986.
    /// The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata JSON Schema".
    event URI(
        string _value,
        uint256 indexed _id
    );

    /// @notice Transfers value amount of an _id from the _from address to the _to address specified.
    /// @dev MUST emit TransferSingle event on success.
    /// Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
    /// MUST throw if `_to` is the zero address.
    /// MUST throw if balance of sender for token `_id` is lower than the `_value` sent.
    /// MUST throw on any other error.
    /// When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0).
    /// If so, it MUST call `onERC1155Received` on `_to` and revert if the return value
    /// is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`.
    /// @param from    Source address
    /// @param to      Target address
    /// @param id      ID of the token type
    /// @param value   Transfer amount
    /// @param data    Additional data with no specified format, sent in call to `_to`
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 value,
        bytes calldata data
    )
        external;

    /// @notice Send multiple types of Tokens from a 3rd party in one transfer (with safety call).
    /// @dev MUST emit TransferBatch event on success.
    /// Caller must be approved to manage the _from account's tokens (see isApprovedForAll).
    /// MUST throw if `_to` is the zero address.
    /// MUST throw if length of `_ids` is not the same as length of `_values`.
    ///  MUST throw if any of the balance of sender for token `_ids` is lower than the respective `_values` sent.
    /// MUST throw on any other error.
    /// When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0).
    /// If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return value
    /// is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`.
    /// @param from    Source addresses
    /// @param to      Target addresses
    /// @param ids     IDs of each token type
    /// @param values  Transfer amounts per token type
    /// @param data    Additional data with no specified format, sent in call to `_to`
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    )
        external;

    /// @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
    /// @dev MUST emit the ApprovalForAll event on success.
    /// @param operator  Address to add to the set of authorized operators
    /// @param approved  True if the operator is approved, false to revoke approval
    function setApprovalForAll(address operator, bool approved) external;

    /// @notice Queries the approval status of an operator for a given owner.
    /// @param owner     The owner of the Tokens
    /// @param operator  Address of authorized operator
    /// @return           True if the operator is approved, false if not
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /// @notice Get the balance of an account's Tokens.
    /// @param owner  The address of the token holder
    /// @param id     ID of the Token
    /// @return        The _owner's balance of the Token type requested
    function balanceOf(address owner, uint256 id) external view returns (uint256);

    /// @notice Get the balance of multiple account/token pairs
    /// @param owners The addresses of the token holders
    /// @param ids    ID of the Tokens
    /// @return balances_ The _owner's balance of the Token types requested
    function balanceOfBatch(
        address[] calldata owners,
        uint256[] calldata ids
    )
        external
        view
        returns (uint256[] memory balances_);
}

File 29 of 31 : IERC1155Receiver.sol
/*

  Copyright 2019 ZeroEx Intl.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

*/

pragma solidity ^0.7.3;


interface IERC1155Receiver {

    /// @notice Handle the receipt of a single ERC1155 token type
    /// @dev The smart contract calls this function on the recipient
    /// after a `safeTransferFrom`. This function MAY throw to revert and reject the
    /// transfer. Return of other than the magic value MUST result in the
    ///transaction being reverted
    /// Note: the contract address is always the message sender
    /// @param operator  The address which called `safeTransferFrom` function
    /// @param from      The address which previously owned the token
    /// @param id        An array containing the ids of the token being transferred
    /// @param value     An array containing the amount of tokens being transferred
    /// @param data      Additional data with no specified format
    /// @return          `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    )
        external
        returns(bytes4);

    /// @notice Handle the receipt of multiple ERC1155 token types
    /// @dev The smart contract calls this function on the recipient
    /// after a `safeTransferFrom`. This function MAY throw to revert and reject the
    /// transfer. Return of other than the magic value MUST result in the
    /// transaction being reverted
    /// Note: the contract address is always the message sender
    /// @param operator  The address which called `safeTransferFrom` function
    /// @param from      The address which previously owned the token
    /// @param ids       An array containing ids of each token being transferred
    /// @param values    An array containing amounts of each token being transferred
    /// @param data      Additional data with no specified format
    /// @return           `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    )
        external
        returns(bytes4);
}

File 30 of 31 : MixinNonFungibleToken.sol
pragma solidity ^0.7.3;


contract MixinNonFungibleToken {
    uint256 constant internal TYPE_MASK = uint256(uint128(~0)) << 128;

    uint256 constant internal NF_INDEX_MASK = uint128(~0);

    uint256 constant internal TYPE_NF_BIT = 1 << 255;

    mapping (uint256 => address) internal nfOwners;

    /// @dev Returns true if token is non-fungible
    function isNonFungible(uint256 id) public pure returns(bool) {
        return id & TYPE_NF_BIT == TYPE_NF_BIT;
    }

    /// @dev Returns true if token is fungible
    function isFungible(uint256 id) public pure returns(bool) {
        return id & TYPE_NF_BIT == 0;
    }

    /// @dev Returns index of non-fungible token
    function getNonFungibleIndex(uint256 id) public pure returns(uint256) {
        return id & NF_INDEX_MASK;
    }

    /// @dev Returns base type of non-fungible token
    function getNonFungibleBaseType(uint256 id) public pure returns(uint256) {
        return id & TYPE_MASK;
    }

    /// @dev Returns true if input is base-type of a non-fungible token
    function isNonFungibleBaseType(uint256 id) public pure returns(bool) {
        // A base type has the NF bit but does not have an index.
        return (id & TYPE_NF_BIT == TYPE_NF_BIT) && (id & NF_INDEX_MASK == 0);
    }

    /// @dev Returns true if input is a non-fungible token
    function isNonFungibleItem(uint256 id) public pure returns(bool) {
        // A base type has the NF bit but does has an index.
        return (id & TYPE_NF_BIT == TYPE_NF_BIT) && (id & NF_INDEX_MASK != 0);
    }

    /// @dev returns owner of a non-fungible token
    function ownerOf(uint256 id) public view returns (address) {
        return nfOwners[id];
    }
}

File 31 of 31 : LibString.sol
pragma solidity ^0.7.3;

library LibString {
  // via https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.5.sol
  function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory) {
      bytes memory _ba = bytes(_a);
      bytes memory _bb = bytes(_b);
      bytes memory _bc = bytes(_c);
      bytes memory _bd = bytes(_d);
      bytes memory _be = bytes(_e);
      string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length);
      bytes memory babcde = bytes(abcde);
      uint k = 0;
      for (uint i = 0; i < _ba.length; i++) babcde[k++] = _ba[i];
      for (uint i = 0; i < _bb.length; i++) babcde[k++] = _bb[i];
      for (uint i = 0; i < _bc.length; i++) babcde[k++] = _bc[i];
      for (uint i = 0; i < _bd.length; i++) babcde[k++] = _bd[i];
      for (uint i = 0; i < _be.length; i++) babcde[k++] = _be[i];
      return string(babcde);
    }

    function strConcat(string memory _a, string memory _b, string memory _c, string memory _d) internal pure returns (string memory) {
        return strConcat(_a, _b, _c, _d, "");
    }

    function strConcat(string memory _a, string memory _b, string memory _c) internal pure returns (string memory) {
        return strConcat(_a, _b, _c, "", "");
    }

    function strConcat(string memory _a, string memory _b) internal pure returns (string memory) {
        return strConcat(_a, _b, "", "", "");
    }

    function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
        if (_i == 0) {
            return "0";
        }
        uint j = _i;
        uint len;
        while (j != 0) {
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint k = len - 1;
        while (_i != 0) {
            bstr[k--] = byte(uint8(48 + _i % 10));
            _i /= 10;
        }
        return string(bstr);
    }

    function uint2hexstr(uint i) internal pure returns (string memory) {
        if (i == 0) {
            return "0";
        }
        uint j = i;
        uint len;
        while (j != 0) {
            len++;
            j = j >> 4;
        }
        uint mask = 15;
        bytes memory bstr = new bytes(len);
        uint k = len - 1;
        while (i != 0){
            uint curr = (i & mask);
            bstr[k--] = curr > 9 ? byte(uint8(55 + curr)) : byte(uint8(48 + curr));
            i = i >> 4;
        }
        return string(bstr);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_hashV2","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"hashV2","outputs":[{"internalType":"contract HashV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenType","type":"uint256"},{"internalType":"uint256[]","name":"txHashes","type":"uint256[]"},{"internalType":"address[]","name":"operators","type":"address[]"}],"name":"mintAndApprove","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenType","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setTokenTypePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenType","type":"uint256"},{"internalType":"uint256","name":"_blockNum","type":"uint256"}],"name":"setTokenTypeRevealBlockNum","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenTypeToPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenTypeToRevealBlockNum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162001aca38038062001aca83398181016040528101906200003791906200016f565b6000620000496200015060201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35060008060146101000a81548160ff0219169083151502179055506001808190555080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050620001e9565b600033905090565b6000815190506200016981620001cf565b92915050565b6000602082840312156200018257600080fd5b6000620001928482850162000158565b91505092915050565b6000620001a882620001af565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b620001da816200019b565b8114620001e657600080fd5b50565b6118d180620001f96000396000f3fe6080604052600436106100dd5760003560e01c80638456cb591161007f578063f0f4426011610059578063f0f4426014610274578063f110bb961461029d578063f2fde38b146102c8578063fc0035b8146102f1576100dd565b80638456cb59146102095780638da5cb5b14610220578063c32a88641461024b576100dd565b806340f3dcf4116100bb57806340f3dcf41461015f5780635c975abb1461019c57806361d027b3146101c7578063715018a6146101f2576100dd565b8063127de17b146100e25780632a571ada1461011f5780633f4ba83a14610148575b600080fd5b3480156100ee57600080fd5b5061010960048036038101906101049190611131565b61030d565b6040516101169190611707565b60405180910390f35b34801561012b57600080fd5b506101466004803603810190610141919061115a565b610325565b005b34801561015457600080fd5b5061015d6103d6565b005b34801561016b57600080fd5b5061018660048036038101906101819190611131565b610475565b6040516101939190611707565b60405180910390f35b3480156101a857600080fd5b506101b161048d565b6040516101be91906115ba565b60405180910390f35b3480156101d357600080fd5b506101dc6104a3565b6040516101e99190611548565b60405180910390f35b3480156101fe57600080fd5b506102076104c9565b005b34801561021557600080fd5b5061021e61061c565b005b34801561022c57600080fd5b506102356106bb565b604051610242919061152d565b60405180910390f35b34801561025757600080fd5b50610272600480360381019061026d919061115a565b6106e4565b005b34801561028057600080fd5b5061029b6004803603810190610296919061106d565b610795565b005b3480156102a957600080fd5b506102b261086e565b6040516102bf91906115d5565b60405180910390f35b3480156102d457600080fd5b506102ef60048036038101906102ea9190611044565b610894565b005b61030b60048036038101906103069190611096565b610a56565b005b60036020528060005260406000206000915090505481565b61032d610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103b1906116c7565b60405180910390fd5b8060046000848152602001908152602001600020819055505050565b6103de610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461046b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610462906116c7565b60405180910390fd5b610473610d76565b565b60046020528060005260406000206000915090505481565b60008060149054906101000a900460ff16905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104d1610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461055e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610555906116c7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610624610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a8906116c7565b60405180910390fd5b6106b9610e17565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6106ec610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610779576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610770906116c7565b60405180910390fd5b8060036000848152602001908152602001600020819055505050565b61079d610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610821906116c7565b60405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61089c610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610929576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610920906116c7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610999576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099090611647565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60026001541415610a9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a93906116e7565b60405180910390fd5b6002600181905550610aac61048d565b15610aec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae3906116a7565b60405180910390fd5b6000600460008781526020019081526020016000205414158015610b225750600460008681526020019081526020016000205443115b610b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5890611687565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc0035b88787878787876040518763ffffffff1660e01b8152600401610bc696959493929190611563565b600060405180830381600087803b158015610be057600080fd5b505af1158015610bf4573d6000803e3d6000fd5b50505050600084849050600360008881526020019081526020016000205402905034811115610c58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4f90611667565b60405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681604051610c9e90611518565b60006040518083038185875af1925050503d8060008114610cdb576040519150601f19603f3d011682016040523d82523d6000602084013e610ce0565b606091505b5050503373ffffffffffffffffffffffffffffffffffffffff16610d0d8234610eba90919063ffffffff16565b604051610d1990611518565b60006040518083038185875af1925050503d8060008114610d56576040519150601f19603f3d011682016040523d82523d6000602084013e610d5b565b606091505b5050505060018081905550505050505050565b600033905090565b610d7e61048d565b610dbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db490611627565b60405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610e00610d6e565b604051610e0d919061152d565b60405180910390a1565b610e1f61048d565b15610e5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e56906116a7565b60405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610ea3610d6e565b604051610eb0919061152d565b60405180910390a1565b600082821115610ed957610ed8610ed360028585610ee4565b610f69565b5b818303905092915050565b606063e946c1bb60e01b848484604051602401610f03939291906115f0565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090509392505050565b805160208201fd5b600081359050610f8081611856565b92915050565b600081359050610f958161186d565b92915050565b60008083601f840112610fad57600080fd5b8235905067ffffffffffffffff811115610fc657600080fd5b602083019150836020820283011115610fde57600080fd5b9250929050565b60008083601f840112610ff757600080fd5b8235905067ffffffffffffffff81111561101057600080fd5b60208301915083602082028301111561102857600080fd5b9250929050565b60008135905061103e81611884565b92915050565b60006020828403121561105657600080fd5b600061106484828501610f71565b91505092915050565b60006020828403121561107f57600080fd5b600061108d84828501610f86565b91505092915050565b600080600080600080608087890312156110af57600080fd5b60006110bd89828a01610f71565b96505060206110ce89828a0161102f565b955050604087013567ffffffffffffffff8111156110eb57600080fd5b6110f789828a01610fe5565b9450945050606087013567ffffffffffffffff81111561111657600080fd5b61112289828a01610f9b565b92509250509295509295509295565b60006020828403121561114357600080fd5b60006111518482850161102f565b91505092915050565b6000806040838503121561116d57600080fd5b600061117b8582860161102f565b925050602061118c8582860161102f565b9150509250929050565b60006111a283836111bd565b60208301905092915050565b6111b7816117a0565b82525050565b6111c68161178e565b82525050565b6111d58161178e565b82525050565b60006111e78385611739565b93506111f282611722565b8060005b8581101561122b576112088284611777565b6112128882611196565b975061121d8361172c565b9250506001810190506111f6565b5085925050509392505050565b6000611244838561174a565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561127357600080fd5b602083029250611284838584611831565b82840190509392505050565b611299816117b2565b82525050565b6112a8816117fb565b82525050565b6112b78161181f565b82525050565b60006112ca601483611766565b91507f5061757361626c653a206e6f74207061757365640000000000000000000000006000830152602082019050919050565b600061130a602683611766565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611370602283611766565b91507f696e73756666696369656e742066756e647320746f2070617920666f72206d6960008301527f6e740000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006113d6602183611766565b91507f546f6b656e2074797065206d696e74696e67206e6f742061637469766520796560008301527f74000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061143c601083611766565b91507f5061757361626c653a20706175736564000000000000000000000000000000006000830152602082019050919050565b600061147c602083611766565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006114bc60008361175b565b9150600082019050919050565b60006114d6601f83611766565b91507f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006000830152602082019050919050565b611512816117f1565b82525050565b6000611523826114af565b9150819050919050565b600060208201905061154260008301846111cc565b92915050565b600060208201905061155d60008301846111ae565b92915050565b600060808201905061157860008301896111cc565b6115856020830188611509565b8181036040830152611598818688611238565b905081810360608301526115ad8184866111db565b9050979650505050505050565b60006020820190506115cf6000830184611290565b92915050565b60006020820190506115ea600083018461129f565b92915050565b600060608201905061160560008301866112ae565b6116126020830185611509565b61161f6040830184611509565b949350505050565b60006020820190508181036000830152611640816112bd565b9050919050565b60006020820190508181036000830152611660816112fd565b9050919050565b6000602082019050818103600083015261168081611363565b9050919050565b600060208201905081810360008301526116a0816113c9565b9050919050565b600060208201905081810360008301526116c08161142f565b9050919050565b600060208201905081810360008301526116e08161146f565b9050919050565b60006020820190508181036000830152611700816114c9565b9050919050565b600060208201905061171c6000830184611509565b92915050565b6000819050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b60006117866020840184610f71565b905092915050565b6000611799826117d1565b9050919050565b60006117ab826117d1565b9050919050565b60008115159050919050565b60008190506117cc82611842565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006118068261180d565b9050919050565b6000611818826117d1565b9050919050565b600061182a826117be565b9050919050565b82818337600083830152505050565bfe5b6004811061185357611852611840565b5b50565b61185f8161178e565b811461186a57600080fd5b50565b611876816117a0565b811461188157600080fd5b50565b61188d816117f1565b811461189857600080fd5b5056fea2646970667358221220054f54c1f7a49ea85b2b9ab9909cdcede329c06992ddb485b008a0ff04544dcf64736f6c634300070300330000000000000000000000003c01051673c2a7e7acbbc28ac2bcdfb6a78fffdc

Deployed Bytecode

0x6080604052600436106100dd5760003560e01c80638456cb591161007f578063f0f4426011610059578063f0f4426014610274578063f110bb961461029d578063f2fde38b146102c8578063fc0035b8146102f1576100dd565b80638456cb59146102095780638da5cb5b14610220578063c32a88641461024b576100dd565b806340f3dcf4116100bb57806340f3dcf41461015f5780635c975abb1461019c57806361d027b3146101c7578063715018a6146101f2576100dd565b8063127de17b146100e25780632a571ada1461011f5780633f4ba83a14610148575b600080fd5b3480156100ee57600080fd5b5061010960048036038101906101049190611131565b61030d565b6040516101169190611707565b60405180910390f35b34801561012b57600080fd5b506101466004803603810190610141919061115a565b610325565b005b34801561015457600080fd5b5061015d6103d6565b005b34801561016b57600080fd5b5061018660048036038101906101819190611131565b610475565b6040516101939190611707565b60405180910390f35b3480156101a857600080fd5b506101b161048d565b6040516101be91906115ba565b60405180910390f35b3480156101d357600080fd5b506101dc6104a3565b6040516101e99190611548565b60405180910390f35b3480156101fe57600080fd5b506102076104c9565b005b34801561021557600080fd5b5061021e61061c565b005b34801561022c57600080fd5b506102356106bb565b604051610242919061152d565b60405180910390f35b34801561025757600080fd5b50610272600480360381019061026d919061115a565b6106e4565b005b34801561028057600080fd5b5061029b6004803603810190610296919061106d565b610795565b005b3480156102a957600080fd5b506102b261086e565b6040516102bf91906115d5565b60405180910390f35b3480156102d457600080fd5b506102ef60048036038101906102ea9190611044565b610894565b005b61030b60048036038101906103069190611096565b610a56565b005b60036020528060005260406000206000915090505481565b61032d610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103b1906116c7565b60405180910390fd5b8060046000848152602001908152602001600020819055505050565b6103de610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461046b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610462906116c7565b60405180910390fd5b610473610d76565b565b60046020528060005260406000206000915090505481565b60008060149054906101000a900460ff16905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104d1610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461055e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610555906116c7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610624610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a8906116c7565b60405180910390fd5b6106b9610e17565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6106ec610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610779576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610770906116c7565b60405180910390fd5b8060036000848152602001908152602001600020819055505050565b61079d610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610821906116c7565b60405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61089c610d6e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610929576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610920906116c7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610999576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099090611647565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60026001541415610a9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a93906116e7565b60405180910390fd5b6002600181905550610aac61048d565b15610aec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae3906116a7565b60405180910390fd5b6000600460008781526020019081526020016000205414158015610b225750600460008681526020019081526020016000205443115b610b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5890611687565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc0035b88787878787876040518763ffffffff1660e01b8152600401610bc696959493929190611563565b600060405180830381600087803b158015610be057600080fd5b505af1158015610bf4573d6000803e3d6000fd5b50505050600084849050600360008881526020019081526020016000205402905034811115610c58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4f90611667565b60405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681604051610c9e90611518565b60006040518083038185875af1925050503d8060008114610cdb576040519150601f19603f3d011682016040523d82523d6000602084013e610ce0565b606091505b5050503373ffffffffffffffffffffffffffffffffffffffff16610d0d8234610eba90919063ffffffff16565b604051610d1990611518565b60006040518083038185875af1925050503d8060008114610d56576040519150601f19603f3d011682016040523d82523d6000602084013e610d5b565b606091505b5050505060018081905550505050505050565b600033905090565b610d7e61048d565b610dbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db490611627565b60405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610e00610d6e565b604051610e0d919061152d565b60405180910390a1565b610e1f61048d565b15610e5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e56906116a7565b60405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610ea3610d6e565b604051610eb0919061152d565b60405180910390a1565b600082821115610ed957610ed8610ed360028585610ee4565b610f69565b5b818303905092915050565b606063e946c1bb60e01b848484604051602401610f03939291906115f0565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090509392505050565b805160208201fd5b600081359050610f8081611856565b92915050565b600081359050610f958161186d565b92915050565b60008083601f840112610fad57600080fd5b8235905067ffffffffffffffff811115610fc657600080fd5b602083019150836020820283011115610fde57600080fd5b9250929050565b60008083601f840112610ff757600080fd5b8235905067ffffffffffffffff81111561101057600080fd5b60208301915083602082028301111561102857600080fd5b9250929050565b60008135905061103e81611884565b92915050565b60006020828403121561105657600080fd5b600061106484828501610f71565b91505092915050565b60006020828403121561107f57600080fd5b600061108d84828501610f86565b91505092915050565b600080600080600080608087890312156110af57600080fd5b60006110bd89828a01610f71565b96505060206110ce89828a0161102f565b955050604087013567ffffffffffffffff8111156110eb57600080fd5b6110f789828a01610fe5565b9450945050606087013567ffffffffffffffff81111561111657600080fd5b61112289828a01610f9b565b92509250509295509295509295565b60006020828403121561114357600080fd5b60006111518482850161102f565b91505092915050565b6000806040838503121561116d57600080fd5b600061117b8582860161102f565b925050602061118c8582860161102f565b9150509250929050565b60006111a283836111bd565b60208301905092915050565b6111b7816117a0565b82525050565b6111c68161178e565b82525050565b6111d58161178e565b82525050565b60006111e78385611739565b93506111f282611722565b8060005b8581101561122b576112088284611777565b6112128882611196565b975061121d8361172c565b9250506001810190506111f6565b5085925050509392505050565b6000611244838561174a565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561127357600080fd5b602083029250611284838584611831565b82840190509392505050565b611299816117b2565b82525050565b6112a8816117fb565b82525050565b6112b78161181f565b82525050565b60006112ca601483611766565b91507f5061757361626c653a206e6f74207061757365640000000000000000000000006000830152602082019050919050565b600061130a602683611766565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611370602283611766565b91507f696e73756666696369656e742066756e647320746f2070617920666f72206d6960008301527f6e740000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006113d6602183611766565b91507f546f6b656e2074797065206d696e74696e67206e6f742061637469766520796560008301527f74000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061143c601083611766565b91507f5061757361626c653a20706175736564000000000000000000000000000000006000830152602082019050919050565b600061147c602083611766565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006114bc60008361175b565b9150600082019050919050565b60006114d6601f83611766565b91507f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006000830152602082019050919050565b611512816117f1565b82525050565b6000611523826114af565b9150819050919050565b600060208201905061154260008301846111cc565b92915050565b600060208201905061155d60008301846111ae565b92915050565b600060808201905061157860008301896111cc565b6115856020830188611509565b8181036040830152611598818688611238565b905081810360608301526115ad8184866111db565b9050979650505050505050565b60006020820190506115cf6000830184611290565b92915050565b60006020820190506115ea600083018461129f565b92915050565b600060608201905061160560008301866112ae565b6116126020830185611509565b61161f6040830184611509565b949350505050565b60006020820190508181036000830152611640816112bd565b9050919050565b60006020820190508181036000830152611660816112fd565b9050919050565b6000602082019050818103600083015261168081611363565b9050919050565b600060208201905081810360008301526116a0816113c9565b9050919050565b600060208201905081810360008301526116c08161142f565b9050919050565b600060208201905081810360008301526116e08161146f565b9050919050565b60006020820190508181036000830152611700816114c9565b9050919050565b600060208201905061171c6000830184611509565b92915050565b6000819050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b60006117866020840184610f71565b905092915050565b6000611799826117d1565b9050919050565b60006117ab826117d1565b9050919050565b60008115159050919050565b60008190506117cc82611842565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006118068261180d565b9050919050565b6000611818826117d1565b9050919050565b600061182a826117be565b9050919050565b82818337600083830152505050565bfe5b6004811061185357611852611840565b5b50565b61185f8161178e565b811461186a57600080fd5b50565b611876816117a0565b811461188157600080fd5b50565b61188d816117f1565b811461189857600080fd5b5056fea2646970667358221220054f54c1f7a49ea85b2b9ab9909cdcede329c06992ddb485b008a0ff04544dcf64736f6c63430007030033

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

0000000000000000000000003c01051673c2a7e7acbbc28ac2bcdfb6a78fffdc

-----Decoded View---------------
Arg [0] : _hashV2 (address): 0x3c01051673c2A7e7acbbc28aC2bcdfb6a78fFFdC

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000003c01051673c2a7e7acbbc28ac2bcdfb6a78fffdc


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.