ETH Price: $1,568.15 (-0.83%)
Gas: 0.53 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

1 address found via
Transaction Hash
Method
Block
From
To
Open Packs206494952024-08-31 15:38:23233 days ago1725118703IN
0xCFDdcdFa...9F3493d1f
0 ETH0.002116511.3091435
Open Packs201972142024-06-29 12:02:23296 days ago1719662543IN
0xCFDdcdFa...9F3493d1f
0 ETH0.000350111.49157041
Open Packs201971972024-06-29 11:58:59296 days ago1719662339IN
0xCFDdcdFa...9F3493d1f
0 ETH0.000466751.70522351
Open Packs201893772024-06-28 9:45:59297 days ago1719567959IN
0xCFDdcdFa...9F3493d1f
0 ETH0.004576235.3841873
Open Packs201810372024-06-27 5:48:59298 days ago1719467339IN
0xCFDdcdFa...9F3493d1f
0 ETH0.004263256.93341966
Open Packs201754302024-06-26 11:01:23299 days ago1719399683IN
0xCFDdcdFa...9F3493d1f
0 ETH0.001174512.71699385
Open Packs201485172024-06-22 16:44:59303 days ago1719074699IN
0xCFDdcdFa...9F3493d1f
0 ETH0.001410434.77198661
Open Packs200005182024-06-02 0:20:35323 days ago1717287635IN
0xCFDdcdFa...9F3493d1f
0 ETH0.002324344.98783173
Open Packs199247222024-05-22 10:07:23334 days ago1716372443IN
0xCFDdcdFa...9F3493d1f
0 ETH0.006797847.7346127
Open Packs199246992024-05-22 10:02:47334 days ago1716372167IN
0xCFDdcdFa...9F3493d1f
0 ETH0.002796137.58155865
Open Packs199092812024-05-20 6:14:35336 days ago1716185675IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0004253.8399476
Open Packs198668772024-05-14 7:51:11342 days ago1715673071IN
0xCFDdcdFa...9F3493d1f
0 ETH0.010042459.02042486
Open Packs198668662024-05-14 7:48:59342 days ago1715672939IN
0xCFDdcdFa...9F3493d1f
0 ETH0.007998598.07402255
Open Packs195119972024-03-25 14:09:47392 days ago1711375787IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0321904824.25571373
Open Packs195013782024-03-24 2:14:35393 days ago1711246475IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0025234715.87939166
Open Packs194913762024-03-22 16:32:35395 days ago1711125155IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0257362921.23922849
Open Packs194884372024-03-22 6:39:23395 days ago1711089563IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0036953723.60373331
Open Packs194884362024-03-22 6:39:11395 days ago1711089551IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0037782524.13126939
Open Packs194884352024-03-22 6:38:59395 days ago1711089539IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0030436821.82621311
Open Packs194884282024-03-22 6:37:35395 days ago1711089455IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0030386521.79385377
Open Packs194884282024-03-22 6:37:35395 days ago1711089455IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0025169821.79603324
Open Packs194884242024-03-22 6:36:47395 days ago1711089407IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0034714422.17170095
Open Packs194884242024-03-22 6:36:47395 days ago1711089407IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0034704622.17170095
Open Packs194884232024-03-22 6:36:35395 days ago1711089395IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0034004321.71816587
Open Packs194883592024-03-22 6:23:47395 days ago1711088627IN
0xCFDdcdFa...9F3493d1f
0 ETH0.0025527622.10361143
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
-133578012021-10-05 7:47:351294 days ago1633420055
0xCFDdcdFa...9F3493d1f
0.045 ETH
-132761712021-09-22 14:48:261307 days ago1632322106
0xCFDdcdFa...9F3493d1f
0.09 ETH
-132750152021-09-22 10:20:421307 days ago1632306042
0xCFDdcdFa...9F3493d1f
228.2349 ETH
-132749132021-09-22 9:58:131307 days ago1632304693
0xCFDdcdFa...9F3493d1f
0.0252 ETH
-132749092021-09-22 9:56:571307 days ago1632304617
0xCFDdcdFa...9F3493d1f
0.1764 ETH
-132749062021-09-22 9:56:101307 days ago1632304570
0xCFDdcdFa...9F3493d1f
0.1512 ETH
-132749052021-09-22 9:55:451307 days ago1632304545
0xCFDdcdFa...9F3493d1f
0.0378 ETH
-132745842021-09-22 8:44:161307 days ago1632300256
0xCFDdcdFa...9F3493d1f
0.0126 ETH
-132745832021-09-22 8:43:371307 days ago1632300217
0xCFDdcdFa...9F3493d1f
0.0126 ETH
-132745832021-09-22 8:43:371307 days ago1632300217
0xCFDdcdFa...9F3493d1f
0.0252 ETH
-132745832021-09-22 8:43:371307 days ago1632300217
0xCFDdcdFa...9F3493d1f
0.1512 ETH
-132745832021-09-22 8:43:371307 days ago1632300217
0xCFDdcdFa...9F3493d1f
0.063 ETH
-132745832021-09-22 8:43:371307 days ago1632300217
0xCFDdcdFa...9F3493d1f
0.0378 ETH
-132745832021-09-22 8:43:371307 days ago1632300217
0xCFDdcdFa...9F3493d1f
0.0378 ETH
-132745822021-09-22 8:43:231307 days ago1632300203
0xCFDdcdFa...9F3493d1f
0.0126 ETH
-132745822021-09-22 8:43:231307 days ago1632300203
0xCFDdcdFa...9F3493d1f
0.063 ETH
-132745532021-09-22 8:37:431307 days ago1632299863
0xCFDdcdFa...9F3493d1f
0.00005 ETH
-132745372021-09-22 8:34:121307 days ago1632299652
0xCFDdcdFa...9F3493d1f
0.00005 ETH
-132744402021-09-22 8:13:131307 days ago1632298393
0xCFDdcdFa...9F3493d1f
0.00005 ETH
-132744362021-09-22 8:12:361307 days ago1632298356
0xCFDdcdFa...9F3493d1f
0.00005 ETH
-132737572021-09-22 5:39:551307 days ago1632289195
0xCFDdcdFa...9F3493d1f
0.135 ETH
-132737572021-09-22 5:39:551307 days ago1632289195
0xCFDdcdFa...9F3493d1f
0.18 ETH
-132737432021-09-22 5:37:241307 days ago1632289044
0xCFDdcdFa...9F3493d1f
0.045 ETH
-132737432021-09-22 5:37:241307 days ago1632289044
0xCFDdcdFa...9F3493d1f
0.225 ETH
-132737402021-09-22 5:37:091307 days ago1632289029
0xCFDdcdFa...9F3493d1f
0.045 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RainiCardsFunctions

Compiler Version
v0.8.3+commit.8d00100c

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 15 : RainiCardsFunctions.sol
// "SPDX-License-Identifier: MIT"

pragma solidity ^0.8.3;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

interface IStakingPool {
  function balanceOf(address _owner) external view returns (uint256 balance);
  function burn(address _owner, uint256 _amount) external;
}

interface IRainiCardPacks is IERC721 {

  struct PackType {
    uint32 packClassId;
    uint64 costInUnicorns;
    uint64 costInRainbows;
    uint64 costInEth;
    uint16 maxMintsPerAddress;
    uint32 tokenIdStart;
    uint32 supply;
    uint32 mintTimeStart;
  }

  function packTypes(uint256 _id) external view returns (PackType memory);
  function numberOfPackMinted(uint256 _packTypeId) external view returns (uint256);
  function numberMintedByAddress(address _address, uint256 _packTypeId) external view returns (uint256);

  function mint(address _to, uint256 _packTypeId, uint256 _amount) external;
  function burn(uint256 _tokenId) external;
  function addToNumberMintedByAddress(address _address, uint256 _packTypeId, uint256 amount) external;
}

interface IRainiNft1155 is IERC1155 {
  struct CardLevel {
    uint64 conversionRate; // number of base tokens required to create
    uint32 numberMinted;
    uint128 tokenId; // ID of token if grouped, 0 if not
    uint32 maxStamina; // The initial and maxiumum stamina for a token
  }

  struct Card {
    uint64 costInUnicorns;
    uint64 costInRainbows;
    uint16 maxMintsPerAddress;
    uint32 maxSupply; // number of base tokens mintable
    uint32 allocation; // number of base tokens mintable with points on this contract
    uint32 mintTimeStart; // the timestamp from which the card can be minted
    bool locked;
    address subContract;
  }
  
  struct TokenVars {
    uint128 cardId;
    uint32 level;
    uint32 number; // to assign a numbering to NFTs
    bytes1 mintedContractChar;
  }

  function maxTokenId() external view returns (uint256);
  function contractChar() external view returns (bytes1);

  function numberMintedByAddress(address _address, uint256 _cardID) external view returns (uint256);

  function burn(address _owner, uint256 _tokenId, uint256 _amount, bool _isBridged) external;

  function getPathUri(uint256 _cardId) view external returns (string memory);

  function cards(uint256 _cardId) external view returns (Card memory);
  function cardLevels(uint256 _cardId, uint256 _level) external view returns (CardLevel memory);
  function tokenVars(uint256 _tokenId) external view returns (TokenVars memory);

  function mint(address _to, uint256 _cardId, uint256 _cardLevel, uint256 _amount, bytes1 _mintedContractChar, uint256 _number, uint256[] memory _data) external;
  function addToNumberMintedByAddress(address _address, uint256 _cardId, uint256 amount) external;
}

contract RainiCardsFunctions is AccessControl, ReentrancyGuard {
  
  using ECDSA for bytes32;

  address public nftStakingPoolAddress;

  uint256 public constant POINT_COST_DECIMALS = 1000000000000000000;

  uint256 public rainbowToEth;
  uint256 public unicornToEth;
  uint256 public minPointsPercentToMint;

  mapping(address => bool) public rainbowPools;
  mapping(address => bool) public unicornPools;

  uint256 public mintingFeeBasisPoints;

  address public verifier;

  IRainiNft1155 nftContract;
  IRainiCardPacks packsContact;

  constructor(address _nftContractAddress, address _packsContact, address _contractOwner, address _verifier) {
    _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
    _setupRole(DEFAULT_ADMIN_ROLE, _contractOwner);
    nftContract = IRainiNft1155(_nftContractAddress);
    packsContact = IRainiCardPacks(_packsContact);
    verifier = _verifier;
  }

  modifier onlyOwner() {
    require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()));
    _;
  }

  function getPackBalances(address _address, uint256 _start, uint256 _end) 
    external view returns (uint256[][] memory amounts) {
      uint256[][] memory _amounts = new uint256[][](_end - _start);
      uint256 count;
      for (uint256 i = _start; i <= _end; i++) {
        try packsContact.ownerOf(i) returns (address a) {
          if (a == _address) {
            _amounts[count] = new uint256[](2);
            _amounts[count][0] = i;
            _amounts[count][1] = 1;
            count++;
          }
        } catch Error(string memory /*reason*/) {
        }
      }

      uint256[][] memory _amounts2 = new uint256[][](count);
      for (uint256 i = 0; i < count; i++) {
        _amounts2[i] = new uint256[](2);
        _amounts2[i][0] = _amounts[i][0];
        _amounts2[i][1] = _amounts[i][1];
      }

      return _amounts2;
  }

  function setPacksContract(address _packsContact)
    external onlyOwner {
      packsContact = IRainiCardPacks(_packsContact);
  }

  function setNftContract(address _nftContractAddress)
    external onlyOwner {
      nftContract = IRainiNft1155(_nftContractAddress);
  }

  function addRainbowPool(address _rainbowPool) 
    external onlyOwner {
      rainbowPools[_rainbowPool] = true;
  }

  function removeRainbowPool(address _rainbowPool) 
    external onlyOwner {
      rainbowPools[_rainbowPool] = false;
  }

  function addUnicornPool(address _unicornPool) 
    external onlyOwner {
      unicornPools[_unicornPool] = true;
  }

  function removeUnicornPool(address _unicornPool) 
    external onlyOwner {
      unicornPools[_unicornPool] = false;
  }

  function setEtherValues(uint256 _unicornToEth, uint256 _rainbowToEth, uint256 _minPointsPercentToMint)
     external onlyOwner {
      unicornToEth = _unicornToEth;
      rainbowToEth = _rainbowToEth;
      minPointsPercentToMint = _minPointsPercentToMint;
   }

  function setFees(uint256 _mintingFeeBasisPoints) 
    external onlyOwner {
      mintingFeeBasisPoints =_mintingFeeBasisPoints;
  }

  function setNftStakingPoolAddress(address _nftStakingPoolAddress)
    external onlyOwner {
      nftStakingPoolAddress = (_nftStakingPoolAddress);
  }

  function setVerifierAddress(address _verifier) 
    external onlyOwner {
      verifier = _verifier;
  }
  
  function openPacks(uint256[][] memory _cardId, uint256[][] memory _amount, bytes[] memory sig, uint256[] memory _salt, uint256[] memory _packId)
    external nonReentrant {

    for (uint256 i = 0; i < _cardId.length; i++) {
      require (packsContact.ownerOf(_packId[i]) == address(_msgSender()), 'not the owner');
      bytes memory _hashingString = abi.encode(_salt[i], _packId[i]);
      for (uint256 j = 0; j < _cardId[i].length; j++) {
        _hashingString = abi.encode(_hashingString, _cardId[i][j], _amount[i][j]);
      }
      bytes32 _hash = keccak256(_hashingString);
      address signer = ECDSA.recover(_hash.toEthSignedMessageHash(), sig[i]);
      require (signer == verifier, "Invalid sig");
    }

    for (uint256 i = 0; i < _cardId.length; i++) {
      packsContact.burn(_packId[i]);
      for (uint256 j = 0; j < _cardId[i].length; j++) {
        nftContract.mint(_msgSender(), _cardId[i][j], 0, _amount[i][j], nftContract.contractChar(), 0, new uint256[](0));
      }
    }
  }

struct BuyPacksData {
    uint256 totalPriceRainbows;
    uint256 totalPriceUnicorns;
    uint256 minCostRainbows;
    uint256 minCostUnicorns;
    uint256 fee;
    uint256 amountEthToWithdraw;
    bool success;
  }
  
  
  function buyPacks(uint256[] memory _packType, uint256[] memory _amount, bool[] memory _useUnicorns, uint256[][] memory _data, address[] memory _rainbowPools, address[] memory _unicornPools)
    external payable nonReentrant {

    BuyPacksData memory _locals = BuyPacksData({
      totalPriceRainbows: 0,
      totalPriceUnicorns: 0,
      minCostRainbows: 0,
      minCostUnicorns: 0,
      fee: 0,
      amountEthToWithdraw: 0,
      success: false
    });

    bool[] memory addToMaxMints = new bool[](_packType.length);

    for (uint256 i = 0; i < _packType.length; i++) {
      IRainiCardPacks.PackType memory packType = packsContact.packTypes(_packType[i]);

      require(block.timestamp >= packType.mintTimeStart || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), 'too early');
      require(packType.maxMintsPerAddress == 0 || (packsContact.numberMintedByAddress(_msgSender(), _packType[i]) + _amount[i] <= packType.maxMintsPerAddress), "Max mints reached for address");
      addToMaxMints[i] = packType.maxMintsPerAddress > 0;

      uint256 numberMinted = packsContact.numberOfPackMinted(_packType[i]);
      if (numberMinted + _amount[i] > packType.supply) {
        _amount[i] = packType.supply - numberMinted;
      }

      if (packType.costInUnicorns > 0 || packType.costInRainbows > 0) {
        if (_useUnicorns[i]) {
          require(packType.costInUnicorns > 0, "unicorns not allowed");
          uint256 cost = packType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS;
          _locals.totalPriceUnicorns += cost;
          if (packType.costInEth > 0) {
            _locals.minCostUnicorns += cost;
          }
        } else {
          require(packType.costInRainbows > 0, "rainbows not allowed");
          uint256 cost = packType.costInRainbows * _amount[i] * POINT_COST_DECIMALS;
          _locals.totalPriceRainbows += cost;
          if (packType.costInEth > 0) {
            _locals.minCostRainbows += cost;
          }
        }

        if (packType.costInEth == 0) {
          if (packType.costInRainbows > 0) {
            _locals.fee += (packType.costInRainbows * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (rainbowToEth * 10000);
          } else {
            _locals.fee += (packType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (unicornToEth * 10000);
          }
        }
      }
      
      _locals.amountEthToWithdraw += packType.costInEth * _amount[i];
    }
    
    if (_locals.totalPriceUnicorns > 0 || _locals.totalPriceRainbows > 0 ) {
      for (uint256 n = 0; n < 2; n++) {
        bool loopTypeUnicorns = n > 0;

        uint256 totalBalance = 0;
        uint256 totalPrice = loopTypeUnicorns ? _locals.totalPriceUnicorns : _locals.totalPriceRainbows;
        uint256 remainingPrice = totalPrice;

        if (totalPrice > 0) {
          uint256 loopLength = loopTypeUnicorns ? _unicornPools.length : _rainbowPools.length;

          require(loopLength > 0, "invalid pools");

          for (uint256 i = 0; i < loopLength; i++) {
            IStakingPool pool;
            if (loopTypeUnicorns) {
              require((unicornPools[_unicornPools[i]]), "invalid unicorn pool");
              pool = IStakingPool(_unicornPools[i]);
            } else {
              require((rainbowPools[_rainbowPools[i]]), "invalid rainbow pool");
              pool = IStakingPool(_rainbowPools[i]);
            }
            uint256 _balance = pool.balanceOf(_msgSender());
            totalBalance += _balance;

            if (totalBalance >=  totalPrice) {
              pool.burn(_msgSender(), remainingPrice);
              remainingPrice = 0;
              break;
            } else {
              pool.burn(_msgSender(), _balance);
              remainingPrice -= _balance;
            }
          }

          if (remainingPrice > 0) {
            totalPrice -= loopTypeUnicorns ? _locals.minCostUnicorns : _locals.minCostRainbows;
            uint256 minPoints = (totalPrice * minPointsPercentToMint) / 100;
            require(totalPrice - remainingPrice >= minPoints, "not enough balance");
            uint256 pointsToEth = loopTypeUnicorns ? unicornToEth : rainbowToEth;
            require(msg.value * pointsToEth > remainingPrice, "not enough balance");
            _locals.amountEthToWithdraw += remainingPrice / pointsToEth;
          }
        }
      }
    }

    // Add minting fees
    _locals.amountEthToWithdraw += _locals.fee;

    require(_locals.amountEthToWithdraw <= msg.value);

    (_locals.success, ) = _msgSender().call{ value: msg.value - _locals.amountEthToWithdraw }(""); // refund excess Eth
    require(_locals.success, "transfer failed");

    bool _tokenMinted = false;
    for (uint256 i = 0; i < _packType.length; i++) {
      if (_amount[i] > 0) {
        if (addToMaxMints[i]) {
          packsContact.addToNumberMintedByAddress(_msgSender(), _packType[i], _amount[i]);
        }
        packsContact.mint(_msgSender(), _packType[i], _amount[i]);
        _tokenMinted = true;
      }
    }
    require(_tokenMinted, 'Allocation exhausted');
  }



  // Allow the owner to withdraw Ether payed into the contract
  function withdrawEth(uint256 _amount)
    external onlyOwner {
      require(_amount <= address(this).balance, "not enough balance");
      (bool success, ) = _msgSender().call{ value: _amount }("");
      require(success, "transfer failed");
  }
}

File 2 of 15 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 3 of 15 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 4 of 15 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and 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 5 of 15 : ERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(_msgSender() != operator, "ERC1155: setting approval status for self");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

        return array;
    }
}

File 6 of 15 : IERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

File 7 of 15 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

File 8 of 15 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC1155.sol";

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

File 9 of 15 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

File 10 of 15 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 11 of 15 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

File 12 of 15 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

File 13 of 15 : ECDSA.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 14 of 15 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_nftContractAddress","type":"address"},{"internalType":"address","name":"_packsContact","type":"address"},{"internalType":"address","name":"_contractOwner","type":"address"},{"internalType":"address","name":"_verifier","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POINT_COST_DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rainbowPool","type":"address"}],"name":"addRainbowPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_unicornPool","type":"address"}],"name":"addUnicornPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_packType","type":"uint256[]"},{"internalType":"uint256[]","name":"_amount","type":"uint256[]"},{"internalType":"bool[]","name":"_useUnicorns","type":"bool[]"},{"internalType":"uint256[][]","name":"_data","type":"uint256[][]"},{"internalType":"address[]","name":"_rainbowPools","type":"address[]"},{"internalType":"address[]","name":"_unicornPools","type":"address[]"}],"name":"buyPacks","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"getPackBalances","outputs":[{"internalType":"uint256[][]","name":"amounts","type":"uint256[][]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPointsPercentToMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintingFeeBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftStakingPoolAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[][]","name":"_cardId","type":"uint256[][]"},{"internalType":"uint256[][]","name":"_amount","type":"uint256[][]"},{"internalType":"bytes[]","name":"sig","type":"bytes[]"},{"internalType":"uint256[]","name":"_salt","type":"uint256[]"},{"internalType":"uint256[]","name":"_packId","type":"uint256[]"}],"name":"openPacks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rainbowPools","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rainbowToEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rainbowPool","type":"address"}],"name":"removeRainbowPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_unicornPool","type":"address"}],"name":"removeUnicornPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_unicornToEth","type":"uint256"},{"internalType":"uint256","name":"_rainbowToEth","type":"uint256"},{"internalType":"uint256","name":"_minPointsPercentToMint","type":"uint256"}],"name":"setEtherValues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintingFeeBasisPoints","type":"uint256"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContractAddress","type":"address"}],"name":"setNftContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftStakingPoolAddress","type":"address"}],"name":"setNftStakingPoolAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_packsContact","type":"address"}],"name":"setPacksContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_verifier","type":"address"}],"name":"setVerifierAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"unicornPools","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unicornToEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifier","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawEth","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200393038038062003930833981016040819052620000349162000164565b600180556200004560003362000097565b6200005260008362000097565b600a80546001600160a01b03199081166001600160a01b0396871617909155600b805482169486169490941790935560098054909316931692909217905550620001c0565b620000a38282620000a7565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000a3576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001033390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160a01b03811681146200015f57600080fd5b919050565b600080600080608085870312156200017a578384fd5b620001858562000147565b9350620001956020860162000147565b9250620001a56040860162000147565b9150620001b56060860162000147565b905092959194509250565b61376080620001d06000396000f3fe6080604052600436106101cd5760003560e01c806354a7d0a9116100f75780639d15f5c211610095578063d096144a11610064578063d096144a14610552578063d547741f14610572578063e0e5120d14610592578063f7e177de146105b2576101cd565b80639d15f5c2146104e1578063a217fddf14610501578063ae3068c114610516578063c311d04914610532576101cd565b806390236637116100d1578063902366371461046157806391d1485414610474578063928cb148146104945780639961fc18146104b4576101cd565b806354a7d0a91461040b578063582f706f1461042b5780635a3b336c14610441576101cd565b80631d9083f31161016f5780632f2ff15d1161013e5780632f2ff15d1461038b57806336568abe146103ab5780633d18678e146103cb57806352f5ad77146103eb576101cd565b80631d9083f3146102fb578063248a9ca31461031b578063257ea0ab1461034b5780632b7ac3f31461036b576101cd565b806313f43160116101ab57806313f431601461026f57806315d21e111461029f57806317e95526146102c35780631c513339146102e5576101cd565b806301ffc9a7146101d257806308a55a6e146102075780630c02477614610237575b600080fd5b3480156101de57600080fd5b506101f26101ed366004613210565b6105c8565b60405190151581526020015b60405180910390f35b34801561021357600080fd5b506101f2610222366004612f7d565b60066020526000908152604090205460ff1681565b34801561024357600080fd5b50600254610257906001600160a01b031681565b6040516001600160a01b0390911681526020016101fe565b34801561027b57600080fd5b506101f261028a366004612f7d565b60076020526000908152604090205460ff1681565b3480156102ab57600080fd5b506102b560045481565b6040519081526020016101fe565b3480156102cf57600080fd5b506102e36102de366004612f7d565b610601565b005b3480156102f157600080fd5b506102b560035481565b34801561030757600080fd5b506102e3610316366004612f7d565b610639565b34801561032757600080fd5b506102b56103363660046131c9565b60009081526020819052604090206001015490565b34801561035757600080fd5b506102e3610366366004612f7d565b610671565b34801561037757600080fd5b50600954610257906001600160a01b031681565b34801561039757600080fd5b506102e36103a63660046131e1565b6106a8565b3480156103b757600080fd5b506102e36103c63660046131e1565b6106da565b3480156103d757600080fd5b506102e36103e63660046131c9565b61076d565b3480156103f757600080fd5b506102e3610406366004612f7d565b610788565b34801561041757600080fd5b506102e3610426366004613305565b6107c0565b34801561043757600080fd5b506102b560085481565b34801561044d57600080fd5b506102e361045c366004612f7d565b6107e4565b6102e361046f3660046130b4565b61081e565b34801561048057600080fd5b506101f261048f3660046131e1565b6118f4565b3480156104a057600080fd5b506102e36104af366004612f7d565b61191d565b3480156104c057600080fd5b506104d46104cf366004612fb5565b611957565b6040516101fe919061345d565b3480156104ed57600080fd5b506102e36104fc366004612fe9565b611dc8565b34801561050d57600080fd5b506102b5600081565b34801561052257600080fd5b506102b5670de0b6b3a764000081565b34801561053e57600080fd5b506102e361054d3660046131c9565b61245b565b34801561055e57600080fd5b506102e361056d366004612f7d565b61252d565b34801561057e57600080fd5b506102e361058d3660046131e1565b612565565b34801561059e57600080fd5b506102e36105ad366004612f7d565b61258d565b3480156105be57600080fd5b506102b560055481565b60006001600160e01b03198216637965db0b60e01b14806105f957506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b61060e600061048f6125c4565b61061757600080fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610646600061048f6125c4565b61064f57600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61067e600061048f6125c4565b61068757600080fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000828152602081905260409020600101546106cb816106c66125c4565b6125c9565b6106d5838361262d565b505050565b6106e26125c4565b6001600160a01b0316816001600160a01b03161461075f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61076982826126b2565b5050565b61077a600061048f6125c4565b61078357600080fd5b600855565b610795600061048f6125c4565b61079e57600080fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6107cd600061048f6125c4565b6107d657600080fd5b600492909255600355600555565b6107f1600061048f6125c4565b6107fa57600080fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b600260015414156108715760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610756565b600260018190555060006040518060e00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152509050600087516001600160401b038111156108e257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561090b578160200160208202803683370190505b50905060005b88518110156110da57600b5489516000916001600160a01b031690637ffae846908c908590811061095257634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b815260040161097891815260200190565b6101006040518083038186803b15801561099157600080fd5b505afa1580156109a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c99190613238565b90508060e0015163ffffffff16421015806109ec57506109ec600061048f6125c4565b610a245760405162461bcd60e51b8152602060048201526009602482015268746f6f206561726c7960b81b6044820152606401610756565b608081015161ffff161580610b375750806080015161ffff16898381518110610a5d57634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600b546001600160a01b0316630a3de451610a816125c4565b8e8781518110610aa157634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b8152600401610ada9291906001600160a01b03929092168252602082015260400190565b60206040518083038186803b158015610af257600080fd5b505afa158015610b06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2a91906132ed565b610b349190613545565b11155b610b835760405162461bcd60e51b815260206004820152601d60248201527f4d6178206d696e7473207265616368656420666f7220616464726573730000006044820152606401610756565b6000816080015161ffff1611838381518110610baf57634e487b7160e01b600052603260045260246000fd5b91151560209283029190910190910152600b548a516000916001600160a01b0316906344cf562f908d9086908110610bf757634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b8152600401610c1d91815260200190565b60206040518083038186803b158015610c3557600080fd5b505afa158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d91906132ed565b90508160c0015163ffffffff168a8481518110610c9a57634e487b7160e01b600052603260045260246000fd5b602002602001015182610cad9190613545565b1115610cf657808260c0015163ffffffff16610cc9919061359c565b8a8481518110610ce957634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600082602001516001600160401b03161180610d1f5750600082604001516001600160401b0316115b1561107057888381518110610d4457634e487b7160e01b600052603260045260246000fd5b602002602001015115610e4057600082602001516001600160401b031611610da55760405162461bcd60e51b81526020600482015260146024820152731d5b9a58dbdc9b9cc81b9bdd08185b1b1bddd95960621b6044820152606401610756565b6000670de0b6b3a76400008b8581518110610dd057634e487b7160e01b600052603260045260246000fd5b602002602001015184602001516001600160401b0316610df0919061357d565b610dfa919061357d565b90508086602001818151610e0e9190613545565b90525060608301516001600160401b031615610e3a578086606001818151610e369190613545565b9052505b50610f2b565b600082604001516001600160401b031611610e945760405162461bcd60e51b81526020600482015260146024820152731c985a5b989bdddcc81b9bdd08185b1b1bddd95960621b6044820152606401610756565b6000670de0b6b3a76400008b8581518110610ebf57634e487b7160e01b600052603260045260246000fd5b602002602001015184604001516001600160401b0316610edf919061357d565b610ee9919061357d565b90508086600001818151610efd9190613545565b90525060608301516001600160401b031615610f29578086604001818151610f259190613545565b9052505b505b60608201516001600160401b03166110705760408201516001600160401b031615610fe257600354610f5f9061271061357d565b600854670de0b6b3a76400008c8681518110610f8b57634e487b7160e01b600052603260045260246000fd5b602002602001015185604001516001600160401b0316610fab919061357d565b610fb5919061357d565b610fbf919061357d565b610fc9919061355d565b85608001818151610fda9190613545565b905250611070565b600454610ff19061271061357d565b600854670de0b6b3a76400008c868151811061101d57634e487b7160e01b600052603260045260246000fd5b602002602001015185602001516001600160401b031661103d919061357d565b611047919061357d565b611051919061357d565b61105b919061355d565b8560800181815161106c9190613545565b9052505b89838151811061109057634e487b7160e01b600052603260045260246000fd5b602002602001015182606001516001600160401b03166110b0919061357d565b8560a0018181516110c19190613545565b9052508291506110d2905081613626565b915050610911565b506000826020015111806110ee5750815115155b156115a55760005b60028110156115a35780151560008082611111578551611117565b85602001515b905080801561158c5760008461112e578951611131565b88515b9050600081116111735760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420706f6f6c7360981b6044820152606401610756565b60005b818110156114bd576000861561124357600760008c84815181106111aa57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff166112145760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081d5b9a58dbdc9b881c1bdbdb60621b6044820152606401610756565b8a828151811061123457634e487b7160e01b600052603260045260246000fd5b602002602001015190506112fc565b600660008d848151811061126757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff166112d15760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081c985a5b989bddc81c1bdbdb60621b6044820152606401610756565b8b82815181106112f157634e487b7160e01b600052603260045260246000fd5b602002602001015190505b6000816001600160a01b03166370a082316113156125c4565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561135457600080fd5b505afa158015611368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138c91906132ed565b90506113988188613545565b965085871061142357816001600160a01b0316639dc29fac6113b86125c4565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101889052604401600060405180830381600087803b15801561140057600080fd5b505af1158015611414573d6000803e3d6000fd5b505050506000945050506114bd565b816001600160a01b0316639dc29fac61143a6125c4565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561148257600080fd5b505af1158015611496573d6000803e3d6000fd5b5050505080856114a6919061359c565b9450505080806114b590613626565b915050611176565b50811561158a57846114d35787604001516114d9565b87606001515b6114e3908461359c565b925060006064600554856114f7919061357d565b611501919061355d565b90508061150e848661359c565b101561152c5760405162461bcd60e51b8152600401610756906134f6565b60008661153b5760035461153f565b6004545b90508361154c823461357d565b116115695760405162461bcd60e51b8152600401610756906134f6565b611573818561355d565b8a60a0018181516115849190613545565b90525050505b505b50505050808061159b90613626565b9150506110f6565b505b81608001518260a0018181516115bb9190613545565b90525060a08201513410156115cf57600080fd5b6115d76125c4565b6001600160a01b03168260a00151346115f0919061359c565b604051600081818185875af1925050503d806000811461162c576040519150601f19603f3d011682016040523d82523d6000602084013e611631565b606091505b5050151560c0830181905261167a5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152606401610756565b6000805b89518110156118a05760008982815181106116a957634e487b7160e01b600052603260045260246000fd5b6020026020010151111561188e578281815181106116d757634e487b7160e01b600052603260045260246000fd5b6020026020010151156117b757600b546001600160a01b031663c2fa40196116fd6125c4565b8c848151811061171d57634e487b7160e01b600052603260045260246000fd5b60200260200101518c858151811061174557634e487b7160e01b600052603260045260246000fd5b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091526044820152606401600060405180830381600087803b15801561179e57600080fd5b505af11580156117b2573d6000803e3d6000fd5b505050505b600b546001600160a01b031663156e29f66117d06125c4565b8c84815181106117f057634e487b7160e01b600052603260045260246000fd5b60200260200101518c858151811061181857634e487b7160e01b600052603260045260246000fd5b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091526044820152606401600060405180830381600087803b15801561187157600080fd5b505af1158015611885573d6000803e3d6000fd5b50505050600191505b8061189881613626565b91505061167e565b50806118e55760405162461bcd60e51b8152602060048201526014602482015273105b1b1bd8d85d1a5bdb88195e1a185d5cdd195960621b6044820152606401610756565b50506001805550505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61192a600061048f6125c4565b61193357600080fd5b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b60606000611965848461359c565b6001600160401b0381111561198a57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156119bd57816020015b60608152602001906001900390816119a85790505b5090506000845b848111611bb157600b546040516331a9108f60e11b8152600481018390526001600160a01b0390911690636352211e9060240160206040518083038186803b158015611a0f57600080fd5b505afa925050508015611a3f575060408051601f3d908101601f19168201909252611a3c91810190612f99565b60015b611a8257611a4b61366d565b806308c379a01415611a715750611a60613684565b80611a6b5750611a73565b50611a7d565b505b3d6000803e3d6000fd5b611b9f565b876001600160a01b0316816001600160a01b03161415611b9d57604080516002808252606082018352909160208301908036833701905050848481518110611ada57634e487b7160e01b600052603260045260246000fd5b602002602001018190525081848481518110611b0657634e487b7160e01b600052603260045260246000fd5b6020026020010151600081518110611b2e57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250506001848481518110611b5c57634e487b7160e01b600052603260045260246000fd5b6020026020010151600181518110611b8457634e487b7160e01b600052603260045260246000fd5b602090810291909101015282611b9981613626565b9350505b505b80611ba981613626565b9150506119c4565b506000816001600160401b03811115611bda57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611c0d57816020015b6060815260200190600190039081611bf85790505b50905060005b82811015611dbd57604080516002808252606082018352909160208301908036833701905050828281518110611c5957634e487b7160e01b600052603260045260246000fd5b6020026020010181905250838181518110611c8457634e487b7160e01b600052603260045260246000fd5b6020026020010151600081518110611cac57634e487b7160e01b600052603260045260246000fd5b6020026020010151828281518110611cd457634e487b7160e01b600052603260045260246000fd5b6020026020010151600081518110611cfc57634e487b7160e01b600052603260045260246000fd5b602002602001018181525050838181518110611d2857634e487b7160e01b600052603260045260246000fd5b6020026020010151600181518110611d5057634e487b7160e01b600052603260045260246000fd5b6020026020010151828281518110611d7857634e487b7160e01b600052603260045260246000fd5b6020026020010151600181518110611da057634e487b7160e01b600052603260045260246000fd5b602090810291909101015280611db581613626565b915050611c13565b509695505050505050565b60026001541415611e1b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610756565b600260015560005b85518110156121b757611e346125c4565b6001600160a01b0316600b60009054906101000a90046001600160a01b03166001600160a01b0316636352211e848481518110611e8157634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b8152600401611ea791815260200190565b60206040518083038186803b158015611ebf57600080fd5b505afa158015611ed3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ef79190612f99565b6001600160a01b031614611f3d5760405162461bcd60e51b815260206004820152600d60248201526c3737ba103a34329037bbb732b960991b6044820152606401610756565b6000838281518110611f5f57634e487b7160e01b600052603260045260246000fd5b6020026020010151838381518110611f8757634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001611fa9929190918252602082015260400190565b604051602081830303815290604052905060005b878381518110611fdd57634e487b7160e01b600052603260045260246000fd5b6020026020010151518110156120c2578188848151811061200e57634e487b7160e01b600052603260045260246000fd5b6020026020010151828151811061203557634e487b7160e01b600052603260045260246000fd5b602002602001015188858151811061205d57634e487b7160e01b600052603260045260246000fd5b6020026020010151838151811061208457634e487b7160e01b600052603260045260246000fd5b602002602001015160405160200161209e939291906134be565b604051602081830303815290604052915080806120ba90613626565b915050611fbd565b50805160208201206000612153612126836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b88868151811061214657634e487b7160e01b600052603260045260246000fd5b6020026020010151612735565b6009549091506001600160a01b038083169116146121a15760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642073696760a81b6044820152606401610756565b50505080806121af90613626565b915050611e23565b5060005b855181101561244f57600b5482516001600160a01b03909116906342966c68908490849081106121fb57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b815260040161222191815260200190565b600060405180830381600087803b15801561223b57600080fd5b505af115801561224f573d6000803e3d6000fd5b5050505060005b86828151811061227657634e487b7160e01b600052603260045260246000fd5b60200260200101515181101561243c57600a546001600160a01b031663a39501df61229f6125c4565b8985815181106122bf57634e487b7160e01b600052603260045260246000fd5b602002602001015184815181106122e657634e487b7160e01b600052603260045260246000fd5b602002602001015160008a878151811061231057634e487b7160e01b600052603260045260246000fd5b6020026020010151868151811061233757634e487b7160e01b600052603260045260246000fd5b6020026020010151600a60009054906101000a90046001600160a01b03166001600160a01b0316636bb2e32d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561238d57600080fd5b505afa1580156123a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123c591906131a1565b604080516000808252602082019092526040518863ffffffff1660e01b81526004016123f7979695949392919061340b565b600060405180830381600087803b15801561241157600080fd5b505af1158015612425573d6000803e3d6000fd5b50505050808061243490613626565b915050612256565b508061244781613626565b9150506121bb565b50506001805550505050565b612468600061048f6125c4565b61247157600080fd5b478111156124915760405162461bcd60e51b8152600401610756906134f6565b600061249b6125c4565b6001600160a01b03168260405160006040518083038185875af1925050503d80600081146124e5576040519150601f19603f3d011682016040523d82523d6000602084013e6124ea565b606091505b50509050806107695760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152606401610756565b61253a600061048f6125c4565b61254357600080fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260208190526040902060010154612583816106c66125c4565b6106d583836126b2565b61259a600061048f6125c4565b6125a357600080fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b335b90565b6125d382826118f4565b610769576125eb816001600160a01b03166014612759565b6125f6836020612759565b604051602001612607929190613396565b60408051601f198184030181529082905262461bcd60e51b8252610756916004016134e3565b61263782826118f4565b610769576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561266e6125c4565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6126bc82826118f4565b15610769576000828152602081815260408083206001600160a01b03851684529091529020805460ff191690556126f16125c4565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60008060006127448585612941565b91509150612751816129b1565b509392505050565b6060600061276883600261357d565b612773906002613545565b6001600160401b0381111561279857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156127c2576020820181803683370190505b509050600360fc1b816000815181106127eb57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061282857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600061284c84600261357d565b612857906001613545565b90505b60018111156128eb576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061289957634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106128bd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936128e4816135e3565b905061285a565b50831561293a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610756565b9392505050565b6000808251604114156129785760208301516040840151606085015160001a61296c87828585612bb7565b945094505050506129aa565b8251604014156129a25760208301516040840151612997868383612ca4565b9350935050506129aa565b506000905060025b9250929050565b60008160048111156129d357634e487b7160e01b600052602160045260246000fd5b14156129de57612bb4565b6001816004811115612a0057634e487b7160e01b600052602160045260246000fd5b1415612a4e5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610756565b6002816004811115612a7057634e487b7160e01b600052602160045260246000fd5b1415612abe5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610756565b6003816004811115612ae057634e487b7160e01b600052602160045260246000fd5b1415612b395760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610756565b6004816004811115612b5b57634e487b7160e01b600052602160045260246000fd5b1415612bb45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610756565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612bee5750600090506003612c9b565b8460ff16601b14158015612c0657508460ff16601c14155b15612c175750600090506004612c9b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612c6b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c9457600060019250925050612c9b565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01612cc587828885612bb7565b935093505050935093915050565b600082601f830112612ce3578081fd5b81356020612cf082613522565b604051612cfd82826135fa565b8381528281019150858301600585901b87018401881015612d1c578586fd5b855b85811015612d43578135612d3181613715565b84529284019290840190600101612d1e565b5090979650505050505050565b600082601f830112612d60578081fd5b81356020612d6d82613522565b604051612d7a82826135fa565b8381528281019150858301855b85811015612d4357612d9e898684358b0101612eeb565b84529284019290840190600101612d87565b600082601f830112612dc0578081fd5b81356020612dcd82613522565b604051612dda82826135fa565b8381528281019150858301600585901b87018401881015612df9578586fd5b855b85811015612d435781358015158114612e12578788fd5b84529284019290840190600101612dfb565b6000601f8381840112612e35578182fd5b82356020612e4282613522565b60408051612e5083826135fa565b8481528381019250878401875b86811015612edc5781358a018b603f820112612e7757898afd5b868101356001600160401b03811115612e9257612e92613657565b8551612ea6828c01601f19168a01826135fa565b8181528d87838501011115612eb9578b8cfd5b818784018a83013790810188018b90528652509385019390850190600101612e5d565b50909998505050505050505050565b600082601f830112612efb578081fd5b81356020612f0882613522565b604051612f1582826135fa565b8381528281019150858301600585901b87018401881015612f34578586fd5b855b85811015612d4357813584529284019290840190600101612f36565b805163ffffffff811681146105fc57600080fd5b80516001600160401b03811681146105fc57600080fd5b600060208284031215612f8e578081fd5b813561293a81613715565b600060208284031215612faa578081fd5b815161293a81613715565b600080600060608486031215612fc9578182fd5b8335612fd481613715565b95602085013595506040909401359392505050565b600080600080600060a08688031215613000578283fd5b85356001600160401b0380821115613016578485fd5b61302289838a01612d50565b96506020880135915080821115613037578485fd5b61304389838a01612d50565b95506040880135915080821115613058578485fd5b61306489838a01612e24565b94506060880135915080821115613079578283fd5b61308589838a01612eeb565b9350608088013591508082111561309a578283fd5b506130a788828901612eeb565b9150509295509295909350565b60008060008060008060c087890312156130cc578384fd5b86356001600160401b03808211156130e2578586fd5b6130ee8a838b01612eeb565b97506020890135915080821115613103578586fd5b61310f8a838b01612eeb565b96506040890135915080821115613124578586fd5b6131308a838b01612db0565b95506060890135915080821115613145578283fd5b6131518a838b01612d50565b94506080890135915080821115613166578283fd5b6131728a838b01612cd3565b935060a0890135915080821115613187578283fd5b5061319489828a01612cd3565b9150509295509295509295565b6000602082840312156131b2578081fd5b81516001600160f81b03198116811461293a578182fd5b6000602082840312156131da578081fd5b5035919050565b600080604083850312156131f3578182fd5b82359150602083013561320581613715565b809150509250929050565b600060208284031215613221578081fd5b81356001600160e01b03198116811461293a578182fd5b600061010080838503121561324b578182fd5b60405161325882826135fa565b61326184612f52565b815261326f60208501612f66565b602082015261328060408501612f66565b604082015261329160608501612f66565b60608201526080840151915061ffff821682146132ac578283fd5b8160808201526132be60a08501612f52565b60a08201526132cf60c08501612f52565b60c08201526132e060e08501612f52565b60e0820152949350505050565b6000602082840312156132fe578081fd5b5051919050565b600080600060608486031215613319578081fd5b505081359360208301359350604090920135919050565b6000815180845260208085019450808401835b8381101561335f57815187529582019590820190600101613343565b509495945050505050565b600081518084526133828160208601602086016135b3565b601f01601f19169290920160200192915050565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516133ce8160178501602088016135b3565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516133ff8160288401602088016135b3565b01602801949350505050565b600060018060a01b038916825287602083015286604083015285606083015260ff60f81b851660808301528360a083015260e060c083015261345060e0830184613330565b9998505050505050505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b828110156134b157603f1988860301845261349f858351613330565b94509285019290850190600101613483565b5092979650505050505050565b6000606082526134d1606083018661336a565b60208301949094525060400152919050565b60006020825261293a602083018461336a565b6020808252601290820152716e6f7420656e6f7567682062616c616e636560701b604082015260600190565b60006001600160401b0382111561353b5761353b613657565b5060051b60200190565b6000821982111561355857613558613641565b500190565b60008261357857634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561359757613597613641565b500290565b6000828210156135ae576135ae613641565b500390565b60005b838110156135ce5781810151838201526020016135b6565b838111156135dd576000848401525b50505050565b6000816135f2576135f2613641565b506000190190565b601f8201601f191681016001600160401b038111828210171561361f5761361f613657565b6040525050565b600060001982141561363a5761363a613641565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156125c657600481823e5160e01c90565b600060443d1015613694576125c6565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156136c55750505050506125c6565b82850191508151818111156136df575050505050506125c6565b843d87010160208285010111156136fb575050505050506125c6565b61370a602082860101876135fa565b509094505050505090565b6001600160a01b0381168114612bb457600080fdfea26469706673582212208f9abe26eec98bea5de992cdfbd5216b44d41da9a85a9d79138285d41242ea9264736f6c634300080300330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad628a5515a1ee56088ac188633e2aeeaae474d600000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f

Deployed Bytecode

0x6080604052600436106101cd5760003560e01c806354a7d0a9116100f75780639d15f5c211610095578063d096144a11610064578063d096144a14610552578063d547741f14610572578063e0e5120d14610592578063f7e177de146105b2576101cd565b80639d15f5c2146104e1578063a217fddf14610501578063ae3068c114610516578063c311d04914610532576101cd565b806390236637116100d1578063902366371461046157806391d1485414610474578063928cb148146104945780639961fc18146104b4576101cd565b806354a7d0a91461040b578063582f706f1461042b5780635a3b336c14610441576101cd565b80631d9083f31161016f5780632f2ff15d1161013e5780632f2ff15d1461038b57806336568abe146103ab5780633d18678e146103cb57806352f5ad77146103eb576101cd565b80631d9083f3146102fb578063248a9ca31461031b578063257ea0ab1461034b5780632b7ac3f31461036b576101cd565b806313f43160116101ab57806313f431601461026f57806315d21e111461029f57806317e95526146102c35780631c513339146102e5576101cd565b806301ffc9a7146101d257806308a55a6e146102075780630c02477614610237575b600080fd5b3480156101de57600080fd5b506101f26101ed366004613210565b6105c8565b60405190151581526020015b60405180910390f35b34801561021357600080fd5b506101f2610222366004612f7d565b60066020526000908152604090205460ff1681565b34801561024357600080fd5b50600254610257906001600160a01b031681565b6040516001600160a01b0390911681526020016101fe565b34801561027b57600080fd5b506101f261028a366004612f7d565b60076020526000908152604090205460ff1681565b3480156102ab57600080fd5b506102b560045481565b6040519081526020016101fe565b3480156102cf57600080fd5b506102e36102de366004612f7d565b610601565b005b3480156102f157600080fd5b506102b560035481565b34801561030757600080fd5b506102e3610316366004612f7d565b610639565b34801561032757600080fd5b506102b56103363660046131c9565b60009081526020819052604090206001015490565b34801561035757600080fd5b506102e3610366366004612f7d565b610671565b34801561037757600080fd5b50600954610257906001600160a01b031681565b34801561039757600080fd5b506102e36103a63660046131e1565b6106a8565b3480156103b757600080fd5b506102e36103c63660046131e1565b6106da565b3480156103d757600080fd5b506102e36103e63660046131c9565b61076d565b3480156103f757600080fd5b506102e3610406366004612f7d565b610788565b34801561041757600080fd5b506102e3610426366004613305565b6107c0565b34801561043757600080fd5b506102b560085481565b34801561044d57600080fd5b506102e361045c366004612f7d565b6107e4565b6102e361046f3660046130b4565b61081e565b34801561048057600080fd5b506101f261048f3660046131e1565b6118f4565b3480156104a057600080fd5b506102e36104af366004612f7d565b61191d565b3480156104c057600080fd5b506104d46104cf366004612fb5565b611957565b6040516101fe919061345d565b3480156104ed57600080fd5b506102e36104fc366004612fe9565b611dc8565b34801561050d57600080fd5b506102b5600081565b34801561052257600080fd5b506102b5670de0b6b3a764000081565b34801561053e57600080fd5b506102e361054d3660046131c9565b61245b565b34801561055e57600080fd5b506102e361056d366004612f7d565b61252d565b34801561057e57600080fd5b506102e361058d3660046131e1565b612565565b34801561059e57600080fd5b506102e36105ad366004612f7d565b61258d565b3480156105be57600080fd5b506102b560055481565b60006001600160e01b03198216637965db0b60e01b14806105f957506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b61060e600061048f6125c4565b61061757600080fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610646600061048f6125c4565b61064f57600080fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61067e600061048f6125c4565b61068757600080fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000828152602081905260409020600101546106cb816106c66125c4565b6125c9565b6106d5838361262d565b505050565b6106e26125c4565b6001600160a01b0316816001600160a01b03161461075f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61076982826126b2565b5050565b61077a600061048f6125c4565b61078357600080fd5b600855565b610795600061048f6125c4565b61079e57600080fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b6107cd600061048f6125c4565b6107d657600080fd5b600492909255600355600555565b6107f1600061048f6125c4565b6107fa57600080fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b600260015414156108715760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610756565b600260018190555060006040518060e00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152509050600087516001600160401b038111156108e257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561090b578160200160208202803683370190505b50905060005b88518110156110da57600b5489516000916001600160a01b031690637ffae846908c908590811061095257634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b815260040161097891815260200190565b6101006040518083038186803b15801561099157600080fd5b505afa1580156109a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c99190613238565b90508060e0015163ffffffff16421015806109ec57506109ec600061048f6125c4565b610a245760405162461bcd60e51b8152602060048201526009602482015268746f6f206561726c7960b81b6044820152606401610756565b608081015161ffff161580610b375750806080015161ffff16898381518110610a5d57634e487b7160e01b600052603260045260246000fd5b6020908102919091010151600b546001600160a01b0316630a3de451610a816125c4565b8e8781518110610aa157634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b8152600401610ada9291906001600160a01b03929092168252602082015260400190565b60206040518083038186803b158015610af257600080fd5b505afa158015610b06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2a91906132ed565b610b349190613545565b11155b610b835760405162461bcd60e51b815260206004820152601d60248201527f4d6178206d696e7473207265616368656420666f7220616464726573730000006044820152606401610756565b6000816080015161ffff1611838381518110610baf57634e487b7160e01b600052603260045260246000fd5b91151560209283029190910190910152600b548a516000916001600160a01b0316906344cf562f908d9086908110610bf757634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b8152600401610c1d91815260200190565b60206040518083038186803b158015610c3557600080fd5b505afa158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d91906132ed565b90508160c0015163ffffffff168a8481518110610c9a57634e487b7160e01b600052603260045260246000fd5b602002602001015182610cad9190613545565b1115610cf657808260c0015163ffffffff16610cc9919061359c565b8a8481518110610ce957634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600082602001516001600160401b03161180610d1f5750600082604001516001600160401b0316115b1561107057888381518110610d4457634e487b7160e01b600052603260045260246000fd5b602002602001015115610e4057600082602001516001600160401b031611610da55760405162461bcd60e51b81526020600482015260146024820152731d5b9a58dbdc9b9cc81b9bdd08185b1b1bddd95960621b6044820152606401610756565b6000670de0b6b3a76400008b8581518110610dd057634e487b7160e01b600052603260045260246000fd5b602002602001015184602001516001600160401b0316610df0919061357d565b610dfa919061357d565b90508086602001818151610e0e9190613545565b90525060608301516001600160401b031615610e3a578086606001818151610e369190613545565b9052505b50610f2b565b600082604001516001600160401b031611610e945760405162461bcd60e51b81526020600482015260146024820152731c985a5b989bdddcc81b9bdd08185b1b1bddd95960621b6044820152606401610756565b6000670de0b6b3a76400008b8581518110610ebf57634e487b7160e01b600052603260045260246000fd5b602002602001015184604001516001600160401b0316610edf919061357d565b610ee9919061357d565b90508086600001818151610efd9190613545565b90525060608301516001600160401b031615610f29578086604001818151610f259190613545565b9052505b505b60608201516001600160401b03166110705760408201516001600160401b031615610fe257600354610f5f9061271061357d565b600854670de0b6b3a76400008c8681518110610f8b57634e487b7160e01b600052603260045260246000fd5b602002602001015185604001516001600160401b0316610fab919061357d565b610fb5919061357d565b610fbf919061357d565b610fc9919061355d565b85608001818151610fda9190613545565b905250611070565b600454610ff19061271061357d565b600854670de0b6b3a76400008c868151811061101d57634e487b7160e01b600052603260045260246000fd5b602002602001015185602001516001600160401b031661103d919061357d565b611047919061357d565b611051919061357d565b61105b919061355d565b8560800181815161106c9190613545565b9052505b89838151811061109057634e487b7160e01b600052603260045260246000fd5b602002602001015182606001516001600160401b03166110b0919061357d565b8560a0018181516110c19190613545565b9052508291506110d2905081613626565b915050610911565b506000826020015111806110ee5750815115155b156115a55760005b60028110156115a35780151560008082611111578551611117565b85602001515b905080801561158c5760008461112e578951611131565b88515b9050600081116111735760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420706f6f6c7360981b6044820152606401610756565b60005b818110156114bd576000861561124357600760008c84815181106111aa57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff166112145760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081d5b9a58dbdc9b881c1bdbdb60621b6044820152606401610756565b8a828151811061123457634e487b7160e01b600052603260045260246000fd5b602002602001015190506112fc565b600660008d848151811061126757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff166112d15760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081c985a5b989bddc81c1bdbdb60621b6044820152606401610756565b8b82815181106112f157634e487b7160e01b600052603260045260246000fd5b602002602001015190505b6000816001600160a01b03166370a082316113156125c4565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561135457600080fd5b505afa158015611368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138c91906132ed565b90506113988188613545565b965085871061142357816001600160a01b0316639dc29fac6113b86125c4565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101889052604401600060405180830381600087803b15801561140057600080fd5b505af1158015611414573d6000803e3d6000fd5b505050506000945050506114bd565b816001600160a01b0316639dc29fac61143a6125c4565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561148257600080fd5b505af1158015611496573d6000803e3d6000fd5b5050505080856114a6919061359c565b9450505080806114b590613626565b915050611176565b50811561158a57846114d35787604001516114d9565b87606001515b6114e3908461359c565b925060006064600554856114f7919061357d565b611501919061355d565b90508061150e848661359c565b101561152c5760405162461bcd60e51b8152600401610756906134f6565b60008661153b5760035461153f565b6004545b90508361154c823461357d565b116115695760405162461bcd60e51b8152600401610756906134f6565b611573818561355d565b8a60a0018181516115849190613545565b90525050505b505b50505050808061159b90613626565b9150506110f6565b505b81608001518260a0018181516115bb9190613545565b90525060a08201513410156115cf57600080fd5b6115d76125c4565b6001600160a01b03168260a00151346115f0919061359c565b604051600081818185875af1925050503d806000811461162c576040519150601f19603f3d011682016040523d82523d6000602084013e611631565b606091505b5050151560c0830181905261167a5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152606401610756565b6000805b89518110156118a05760008982815181106116a957634e487b7160e01b600052603260045260246000fd5b6020026020010151111561188e578281815181106116d757634e487b7160e01b600052603260045260246000fd5b6020026020010151156117b757600b546001600160a01b031663c2fa40196116fd6125c4565b8c848151811061171d57634e487b7160e01b600052603260045260246000fd5b60200260200101518c858151811061174557634e487b7160e01b600052603260045260246000fd5b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091526044820152606401600060405180830381600087803b15801561179e57600080fd5b505af11580156117b2573d6000803e3d6000fd5b505050505b600b546001600160a01b031663156e29f66117d06125c4565b8c84815181106117f057634e487b7160e01b600052603260045260246000fd5b60200260200101518c858151811061181857634e487b7160e01b600052603260045260246000fd5b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091526044820152606401600060405180830381600087803b15801561187157600080fd5b505af1158015611885573d6000803e3d6000fd5b50505050600191505b8061189881613626565b91505061167e565b50806118e55760405162461bcd60e51b8152602060048201526014602482015273105b1b1bd8d85d1a5bdb88195e1a185d5cdd195960621b6044820152606401610756565b50506001805550505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61192a600061048f6125c4565b61193357600080fd5b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b60606000611965848461359c565b6001600160401b0381111561198a57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156119bd57816020015b60608152602001906001900390816119a85790505b5090506000845b848111611bb157600b546040516331a9108f60e11b8152600481018390526001600160a01b0390911690636352211e9060240160206040518083038186803b158015611a0f57600080fd5b505afa925050508015611a3f575060408051601f3d908101601f19168201909252611a3c91810190612f99565b60015b611a8257611a4b61366d565b806308c379a01415611a715750611a60613684565b80611a6b5750611a73565b50611a7d565b505b3d6000803e3d6000fd5b611b9f565b876001600160a01b0316816001600160a01b03161415611b9d57604080516002808252606082018352909160208301908036833701905050848481518110611ada57634e487b7160e01b600052603260045260246000fd5b602002602001018190525081848481518110611b0657634e487b7160e01b600052603260045260246000fd5b6020026020010151600081518110611b2e57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250506001848481518110611b5c57634e487b7160e01b600052603260045260246000fd5b6020026020010151600181518110611b8457634e487b7160e01b600052603260045260246000fd5b602090810291909101015282611b9981613626565b9350505b505b80611ba981613626565b9150506119c4565b506000816001600160401b03811115611bda57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611c0d57816020015b6060815260200190600190039081611bf85790505b50905060005b82811015611dbd57604080516002808252606082018352909160208301908036833701905050828281518110611c5957634e487b7160e01b600052603260045260246000fd5b6020026020010181905250838181518110611c8457634e487b7160e01b600052603260045260246000fd5b6020026020010151600081518110611cac57634e487b7160e01b600052603260045260246000fd5b6020026020010151828281518110611cd457634e487b7160e01b600052603260045260246000fd5b6020026020010151600081518110611cfc57634e487b7160e01b600052603260045260246000fd5b602002602001018181525050838181518110611d2857634e487b7160e01b600052603260045260246000fd5b6020026020010151600181518110611d5057634e487b7160e01b600052603260045260246000fd5b6020026020010151828281518110611d7857634e487b7160e01b600052603260045260246000fd5b6020026020010151600181518110611da057634e487b7160e01b600052603260045260246000fd5b602090810291909101015280611db581613626565b915050611c13565b509695505050505050565b60026001541415611e1b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610756565b600260015560005b85518110156121b757611e346125c4565b6001600160a01b0316600b60009054906101000a90046001600160a01b03166001600160a01b0316636352211e848481518110611e8157634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b8152600401611ea791815260200190565b60206040518083038186803b158015611ebf57600080fd5b505afa158015611ed3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ef79190612f99565b6001600160a01b031614611f3d5760405162461bcd60e51b815260206004820152600d60248201526c3737ba103a34329037bbb732b960991b6044820152606401610756565b6000838281518110611f5f57634e487b7160e01b600052603260045260246000fd5b6020026020010151838381518110611f8757634e487b7160e01b600052603260045260246000fd5b6020026020010151604051602001611fa9929190918252602082015260400190565b604051602081830303815290604052905060005b878381518110611fdd57634e487b7160e01b600052603260045260246000fd5b6020026020010151518110156120c2578188848151811061200e57634e487b7160e01b600052603260045260246000fd5b6020026020010151828151811061203557634e487b7160e01b600052603260045260246000fd5b602002602001015188858151811061205d57634e487b7160e01b600052603260045260246000fd5b6020026020010151838151811061208457634e487b7160e01b600052603260045260246000fd5b602002602001015160405160200161209e939291906134be565b604051602081830303815290604052915080806120ba90613626565b915050611fbd565b50805160208201206000612153612126836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b88868151811061214657634e487b7160e01b600052603260045260246000fd5b6020026020010151612735565b6009549091506001600160a01b038083169116146121a15760405162461bcd60e51b815260206004820152600b60248201526a496e76616c69642073696760a81b6044820152606401610756565b50505080806121af90613626565b915050611e23565b5060005b855181101561244f57600b5482516001600160a01b03909116906342966c68908490849081106121fb57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b815260040161222191815260200190565b600060405180830381600087803b15801561223b57600080fd5b505af115801561224f573d6000803e3d6000fd5b5050505060005b86828151811061227657634e487b7160e01b600052603260045260246000fd5b60200260200101515181101561243c57600a546001600160a01b031663a39501df61229f6125c4565b8985815181106122bf57634e487b7160e01b600052603260045260246000fd5b602002602001015184815181106122e657634e487b7160e01b600052603260045260246000fd5b602002602001015160008a878151811061231057634e487b7160e01b600052603260045260246000fd5b6020026020010151868151811061233757634e487b7160e01b600052603260045260246000fd5b6020026020010151600a60009054906101000a90046001600160a01b03166001600160a01b0316636bb2e32d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561238d57600080fd5b505afa1580156123a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123c591906131a1565b604080516000808252602082019092526040518863ffffffff1660e01b81526004016123f7979695949392919061340b565b600060405180830381600087803b15801561241157600080fd5b505af1158015612425573d6000803e3d6000fd5b50505050808061243490613626565b915050612256565b508061244781613626565b9150506121bb565b50506001805550505050565b612468600061048f6125c4565b61247157600080fd5b478111156124915760405162461bcd60e51b8152600401610756906134f6565b600061249b6125c4565b6001600160a01b03168260405160006040518083038185875af1925050503d80600081146124e5576040519150601f19603f3d011682016040523d82523d6000602084013e6124ea565b606091505b50509050806107695760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b6044820152606401610756565b61253a600061048f6125c4565b61254357600080fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260208190526040902060010154612583816106c66125c4565b6106d583836126b2565b61259a600061048f6125c4565b6125a357600080fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b335b90565b6125d382826118f4565b610769576125eb816001600160a01b03166014612759565b6125f6836020612759565b604051602001612607929190613396565b60408051601f198184030181529082905262461bcd60e51b8252610756916004016134e3565b61263782826118f4565b610769576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561266e6125c4565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6126bc82826118f4565b15610769576000828152602081815260408083206001600160a01b03851684529091529020805460ff191690556126f16125c4565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60008060006127448585612941565b91509150612751816129b1565b509392505050565b6060600061276883600261357d565b612773906002613545565b6001600160401b0381111561279857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156127c2576020820181803683370190505b509050600360fc1b816000815181106127eb57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061282857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600061284c84600261357d565b612857906001613545565b90505b60018111156128eb576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061289957634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106128bd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936128e4816135e3565b905061285a565b50831561293a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610756565b9392505050565b6000808251604114156129785760208301516040840151606085015160001a61296c87828585612bb7565b945094505050506129aa565b8251604014156129a25760208301516040840151612997868383612ca4565b9350935050506129aa565b506000905060025b9250929050565b60008160048111156129d357634e487b7160e01b600052602160045260246000fd5b14156129de57612bb4565b6001816004811115612a0057634e487b7160e01b600052602160045260246000fd5b1415612a4e5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610756565b6002816004811115612a7057634e487b7160e01b600052602160045260246000fd5b1415612abe5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610756565b6003816004811115612ae057634e487b7160e01b600052602160045260246000fd5b1415612b395760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610756565b6004816004811115612b5b57634e487b7160e01b600052602160045260246000fd5b1415612bb45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610756565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612bee5750600090506003612c9b565b8460ff16601b14158015612c0657508460ff16601c14155b15612c175750600090506004612c9b565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612c6b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612c9457600060019250925050612c9b565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01612cc587828885612bb7565b935093505050935093915050565b600082601f830112612ce3578081fd5b81356020612cf082613522565b604051612cfd82826135fa565b8381528281019150858301600585901b87018401881015612d1c578586fd5b855b85811015612d43578135612d3181613715565b84529284019290840190600101612d1e565b5090979650505050505050565b600082601f830112612d60578081fd5b81356020612d6d82613522565b604051612d7a82826135fa565b8381528281019150858301855b85811015612d4357612d9e898684358b0101612eeb565b84529284019290840190600101612d87565b600082601f830112612dc0578081fd5b81356020612dcd82613522565b604051612dda82826135fa565b8381528281019150858301600585901b87018401881015612df9578586fd5b855b85811015612d435781358015158114612e12578788fd5b84529284019290840190600101612dfb565b6000601f8381840112612e35578182fd5b82356020612e4282613522565b60408051612e5083826135fa565b8481528381019250878401875b86811015612edc5781358a018b603f820112612e7757898afd5b868101356001600160401b03811115612e9257612e92613657565b8551612ea6828c01601f19168a01826135fa565b8181528d87838501011115612eb9578b8cfd5b818784018a83013790810188018b90528652509385019390850190600101612e5d565b50909998505050505050505050565b600082601f830112612efb578081fd5b81356020612f0882613522565b604051612f1582826135fa565b8381528281019150858301600585901b87018401881015612f34578586fd5b855b85811015612d4357813584529284019290840190600101612f36565b805163ffffffff811681146105fc57600080fd5b80516001600160401b03811681146105fc57600080fd5b600060208284031215612f8e578081fd5b813561293a81613715565b600060208284031215612faa578081fd5b815161293a81613715565b600080600060608486031215612fc9578182fd5b8335612fd481613715565b95602085013595506040909401359392505050565b600080600080600060a08688031215613000578283fd5b85356001600160401b0380821115613016578485fd5b61302289838a01612d50565b96506020880135915080821115613037578485fd5b61304389838a01612d50565b95506040880135915080821115613058578485fd5b61306489838a01612e24565b94506060880135915080821115613079578283fd5b61308589838a01612eeb565b9350608088013591508082111561309a578283fd5b506130a788828901612eeb565b9150509295509295909350565b60008060008060008060c087890312156130cc578384fd5b86356001600160401b03808211156130e2578586fd5b6130ee8a838b01612eeb565b97506020890135915080821115613103578586fd5b61310f8a838b01612eeb565b96506040890135915080821115613124578586fd5b6131308a838b01612db0565b95506060890135915080821115613145578283fd5b6131518a838b01612d50565b94506080890135915080821115613166578283fd5b6131728a838b01612cd3565b935060a0890135915080821115613187578283fd5b5061319489828a01612cd3565b9150509295509295509295565b6000602082840312156131b2578081fd5b81516001600160f81b03198116811461293a578182fd5b6000602082840312156131da578081fd5b5035919050565b600080604083850312156131f3578182fd5b82359150602083013561320581613715565b809150509250929050565b600060208284031215613221578081fd5b81356001600160e01b03198116811461293a578182fd5b600061010080838503121561324b578182fd5b60405161325882826135fa565b61326184612f52565b815261326f60208501612f66565b602082015261328060408501612f66565b604082015261329160608501612f66565b60608201526080840151915061ffff821682146132ac578283fd5b8160808201526132be60a08501612f52565b60a08201526132cf60c08501612f52565b60c08201526132e060e08501612f52565b60e0820152949350505050565b6000602082840312156132fe578081fd5b5051919050565b600080600060608486031215613319578081fd5b505081359360208301359350604090920135919050565b6000815180845260208085019450808401835b8381101561335f57815187529582019590820190600101613343565b509495945050505050565b600081518084526133828160208601602086016135b3565b601f01601f19169290920160200192915050565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516133ce8160178501602088016135b3565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516133ff8160288401602088016135b3565b01602801949350505050565b600060018060a01b038916825287602083015286604083015285606083015260ff60f81b851660808301528360a083015260e060c083015261345060e0830184613330565b9998505050505050505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b828110156134b157603f1988860301845261349f858351613330565b94509285019290850190600101613483565b5092979650505050505050565b6000606082526134d1606083018661336a565b60208301949094525060400152919050565b60006020825261293a602083018461336a565b6020808252601290820152716e6f7420656e6f7567682062616c616e636560701b604082015260600190565b60006001600160401b0382111561353b5761353b613657565b5060051b60200190565b6000821982111561355857613558613641565b500190565b60008261357857634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561359757613597613641565b500290565b6000828210156135ae576135ae613641565b500390565b60005b838110156135ce5781810151838201526020016135b6565b838111156135dd576000848401525b50505050565b6000816135f2576135f2613641565b506000190190565b601f8201601f191681016001600160401b038111828210171561361f5761361f613657565b6040525050565b600060001982141561363a5761363a613641565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156125c657600481823e5160e01c90565b600060443d1015613694576125c6565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156136c55750505050506125c6565b82850191508151818111156136df575050505050506125c6565b843d87010160208285010111156136fb575050505050506125c6565b61370a602082860101876135fa565b509094505050505090565b6001600160a01b0381168114612bb457600080fdfea26469706673582212208f9abe26eec98bea5de992cdfbd5216b44d41da9a85a9d79138285d41242ea9264736f6c63430008030033

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

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad628a5515a1ee56088ac188633e2aeeaae474d600000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f

-----Decoded View---------------
Arg [0] : _nftContractAddress (address): 0x0000000000000000000000000000000000000000
Arg [1] : _packsContact (address): 0xad628A5515A1eE56088aC188633E2AEEaAe474d6
Arg [2] : _contractOwner (address): 0x82F9d5FE6C46990f3C2536e83b2B4e1c0a91F27f
Arg [3] : _verifier (address): 0x82F9d5FE6C46990f3C2536e83b2B4e1c0a91F27f

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 000000000000000000000000ad628a5515a1ee56088ac188633e2aeeaae474d6
Arg [2] : 00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f
Arg [3] : 00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f


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.