Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,208 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Mint | 14279866 | 881 days ago | IN | 0.01 ETH | 0.00328918 | ||||
Mint | 14279849 | 881 days ago | IN | 0.08 ETH | 0.00213436 | ||||
Mint | 14025485 | 920 days ago | IN | 0.08 ETH | 0.01930425 | ||||
Mint | 14022219 | 921 days ago | IN | 0.02 ETH | 0.01721502 | ||||
Mint | 14022160 | 921 days ago | IN | 0.01 ETH | 0.01806507 | ||||
Mint | 14019408 | 921 days ago | IN | 0.01 ETH | 0.02474861 | ||||
Mint | 14019105 | 921 days ago | IN | 0.4 ETH | 0.01673225 | ||||
Mint | 14019105 | 921 days ago | IN | 0.48 ETH | 0.01673225 | ||||
Mint | 14019066 | 921 days ago | IN | 0.08 ETH | 0.01192315 | ||||
Mint | 14019066 | 921 days ago | IN | 0.08 ETH | 0.01211436 | ||||
Mint | 14019016 | 921 days ago | IN | 0.03 ETH | 0.03923453 | ||||
Mint | 14019008 | 921 days ago | IN | 0.08 ETH | 0.0169588 | ||||
Mint | 14019008 | 921 days ago | IN | 0.08 ETH | 0.01724736 | ||||
Mint | 14019002 | 921 days ago | IN | 0.16 ETH | 0.01435809 | ||||
Mint | 14019000 | 921 days ago | IN | 0.8 ETH | 0.01292442 | ||||
Mint | 14019000 | 921 days ago | IN | 0.08 ETH | 0.00372933 | ||||
Mint | 14018992 | 921 days ago | IN | 0.08 ETH | 0.01451704 | ||||
Mint | 14018981 | 921 days ago | IN | 0.08 ETH | 0.02218601 | ||||
Mint | 14018975 | 921 days ago | IN | 0.08 ETH | 0.02470326 | ||||
Mint | 14018971 | 921 days ago | IN | 0.24 ETH | 0.03684771 | ||||
Mint | 14018962 | 921 days ago | IN | 0.8 ETH | 0.02256057 | ||||
Mint | 14018961 | 921 days ago | IN | 0.08 ETH | 0.02019973 | ||||
Mint | 14018960 | 921 days ago | IN | 0.16 ETH | 0.01486028 | ||||
Mint | 14018960 | 921 days ago | IN | 0.16 ETH | 0.01799371 | ||||
Mint | 14018960 | 921 days ago | IN | 0.08 ETH | 0.01799371 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
14279866 | 881 days ago | 0.01 ETH | ||||
14279849 | 881 days ago | 0.08 ETH | ||||
14025485 | 920 days ago | 0.08 ETH | ||||
14022219 | 921 days ago | 0.02 ETH | ||||
14022160 | 921 days ago | 0.01 ETH | ||||
14019408 | 921 days ago | 0.01 ETH | ||||
14019105 | 921 days ago | 0.4 ETH | ||||
14019105 | 921 days ago | 0.48 ETH | ||||
14019066 | 921 days ago | 0.08 ETH | ||||
14019066 | 921 days ago | 0.08 ETH | ||||
14019016 | 921 days ago | 0.03 ETH | ||||
14019008 | 921 days ago | 0.08 ETH | ||||
14019008 | 921 days ago | 0.08 ETH | ||||
14019002 | 921 days ago | 0.16 ETH | ||||
14019000 | 921 days ago | 0.8 ETH | ||||
14018992 | 921 days ago | 0.08 ETH | ||||
14018981 | 921 days ago | 0.08 ETH | ||||
14018975 | 921 days ago | 0.08 ETH | ||||
14018971 | 921 days ago | 0.24 ETH | ||||
14018962 | 921 days ago | 0.8 ETH | ||||
14018961 | 921 days ago | 0.08 ETH | ||||
14018960 | 921 days ago | 0.16 ETH | ||||
14018960 | 921 days ago | 0.16 ETH | ||||
14018960 | 921 days ago | 0.08 ETH | ||||
14018960 | 921 days ago | 0.08 ETH |
Loading...
Loading
Contract Name:
Raini721FunctionsV3
Compiler Version
v0.8.3+commit.8d00100c
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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 IStandaloneNft721 is IERC721 { function totalSupply() external view returns (uint256); function numberMintedByAddress(address _address) external view returns (uint256); function mintNext(address _to, uint256 _amount) external; function addToNumberMintedByAddress(address _address, uint256 amount) external; } contract Raini721FunctionsV3 is AccessControl, ReentrancyGuard { using ECDSA for bytes32; struct PoolType { uint64 costInUnicorns; uint64 costInRainbows; uint64 costInEth; uint16 maxMintsPerAddress; uint32 supply; uint32 mintTimeStart; // the timestamp from which the pack can be minted bool requiresWhitelist; } mapping (uint256 => PoolType) public poolTypes; uint256 public constant POINT_COST_DECIMALS = 1000000000000000000; uint256 public rainbowToEth; uint256 public unicornToEth; uint256 public minPointsPercentToMint; uint256 public maxMintsPerTx; mapping(address => bool) public rainbowPools; mapping(address => bool) public unicornPools; mapping(address => mapping(uint256 => uint256)) public numberMintedByAddress; mapping (uint256 => uint) public numberOfPoolMinted; uint256 public mintingFeeBasisPoints; address public verifier; address public contractOwner; address payable public ethRecipient; address payable public feeRecipient; IStandaloneNft721 public nftContract; constructor(address _nftContractAddress, uint256 _maxMintsPerTx, address payable _ethRecipient, address payable _feeRecipient, address _contractOwner, address _verifier) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(DEFAULT_ADMIN_ROLE, _contractOwner); nftContract = IStandaloneNft721(_nftContractAddress); contractOwner = _contractOwner; ethRecipient = _ethRecipient; feeRecipient = _feeRecipient; maxMintsPerTx = _maxMintsPerTx; verifier = _verifier; } modifier onlyOwner() { require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender())); _; } function setMaxMintsPerTx(uint256 _maxMintsPerTx) external onlyOwner { maxMintsPerTx = _maxMintsPerTx; } function setNftContract(address _nftContract) external onlyOwner { nftContract = IStandaloneNft721(_nftContract); } 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 setVerifierAddress(address _verifier) external onlyOwner { verifier = _verifier; } function setFeeRecipient(address payable _feeRecipient) external onlyOwner { feeRecipient = _feeRecipient; } function setEthRecipient(address payable _ethRecipient) external onlyOwner { ethRecipient = _ethRecipient; } function getTotalBalance(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 nftContract.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 initPools( uint256[] memory _poolId, uint256[] memory _supply, uint256[] memory _costInUnicorns, uint256[] memory _costInRainbows, uint256[] memory _costInEth, uint256[] memory _maxMintsPerAddress, uint32[] memory _mintTimeStart, bool[] memory _requiresWhitelist ) external onlyOwner { for (uint256 i; i < _poolId.length; i++) { poolTypes[_poolId[i]] = PoolType({ costInUnicorns: uint64(_costInUnicorns[i]), costInRainbows: uint64(_costInRainbows[i]), costInEth: uint64(_costInEth[i]), maxMintsPerAddress: uint16(_maxMintsPerAddress[i]), mintTimeStart: uint32(_mintTimeStart[i]), supply: uint32(_supply[i]), requiresWhitelist: _requiresWhitelist[i] }); } } struct MintData { uint256 totalPriceRainbows; uint256 totalPriceUnicorns; uint256 minCostRainbows; uint256 minCostUnicorns; uint256 fee; uint256 amountEthToWithdraw; uint256 maxMints; uint256 totalToMint; bool success; } function checkSigniture(address msgSender, bytes memory sig, uint256 maxMints) public view returns (bool _success) { bytes32 _hash = keccak256(abi.encode('Raini721Functions|mint|', msgSender, maxMints)); address signer = ECDSA.recover(_hash.toEthSignedMessageHash(), sig); return signer == verifier; } function mint( uint256[] memory _poolType, uint256[] memory _amount, bool[] memory _useUnicorns, address[] memory _rainbowPools, address[] memory _unicornPools, bytes memory sig, uint256 maxMints ) external payable nonReentrant { require(maxMints == 0 || checkSigniture(_msgSender(), sig, maxMints), 'invalid sig'); MintData memory _locals = MintData({ totalPriceRainbows: 0, totalPriceUnicorns: 0, minCostRainbows: 0, minCostUnicorns: 0, fee: 0, amountEthToWithdraw: 0, maxMints: 0, totalToMint: 0, success: false }); for (uint256 i = 0; i < _poolType.length; i++) { PoolType memory poolType = poolTypes[_poolType[i]]; _locals.maxMints = poolType.maxMintsPerAddress == 0 ? 10 ** 10 : poolType.maxMintsPerAddress; if (poolType.requiresWhitelist && (maxMints < _locals.maxMints)) { _locals.maxMints = maxMints; } require(block.timestamp >= poolType.mintTimeStart || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), 'too early'); require(numberMintedByAddress[_msgSender()][_poolType[i]] + _amount[i] <= _locals.maxMints, "Max mints reached for address"); uint256 numberMinted = numberOfPoolMinted[_poolType[i]]; if (numberMinted + _amount[i] > poolType.supply) { _amount[i] = poolType.supply - numberMinted; } _locals.totalToMint += _amount[i]; if (poolType.maxMintsPerAddress > 0) { numberMintedByAddress[_msgSender()][_poolType[i]] += _amount[i]; numberOfPoolMinted[_poolType[i]] += _amount[i]; } if (poolType.costInUnicorns > 0 || poolType.costInRainbows > 0) { if (_useUnicorns[i]) { require(poolType.costInUnicorns > 0, "unicorns not allowed"); uint256 cost = poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceUnicorns += cost; if (poolType.costInEth > 0) { _locals.minCostUnicorns += cost; } } else { require(poolType.costInRainbows > 0, "rainbows not allowed"); uint256 cost = poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceRainbows += cost; if (poolType.costInEth > 0) { _locals.minCostRainbows += cost; } } if (poolType.costInEth == 0) { if (poolType.costInRainbows > 0) { _locals.fee += (poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (rainbowToEth * 10000); } else { _locals.fee += (poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (unicornToEth * 10000); } } } _locals.amountEthToWithdraw += poolType.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.fee += remainingPrice / pointsToEth; } } } } require(_locals.amountEthToWithdraw + _locals.fee <= msg.value, "not enough eth"); (_locals.success, ) = _msgSender().call{ value: msg.value - (_locals.amountEthToWithdraw + _locals.fee)}(""); // refund excess Eth require(_locals.success, "transfer failed"); (_locals.success, ) = feeRecipient.call{ value: _locals.fee }(""); // pay fees require(_locals.success, "fee transfer failed"); (_locals.success, ) = ethRecipient.call{ value: _locals.amountEthToWithdraw }(""); // pay eth recipient require(_locals.success, "transfer failed"); require(_locals.totalToMint > 0, 'Allocation exhausted'); require(_locals.totalToMint <= maxMintsPerTx, '_amount over max'); nftContract.mintNext(_msgSender(), _locals.totalToMint); } // Allow the owner to withdraw Ether payed into the contract function withdrawEth(uint256 _amount) external onlyOwner { require(_msgSender() == contractOwner); require(_amount <= address(this).balance, "not enough balance"); (bool success, ) = _msgSender().call{ value: _amount }(""); require(success, "transfer failed"); } }
// 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); }
// 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; } }
// 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)); } }
// 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); } }
// 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; } }
// 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); } } } }
// 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; }
// 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); }
// 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); }
// 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; }
// 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; } }
// 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; } }
// 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; }
// 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()); } } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_nftContractAddress","type":"address"},{"internalType":"uint256","name":"_maxMintsPerTx","type":"uint256"},{"internalType":"address payable","name":"_ethRecipient","type":"address"},{"internalType":"address payable","name":"_feeRecipient","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":"address","name":"msgSender","type":"address"},{"internalType":"bytes","name":"sig","type":"bytes"},{"internalType":"uint256","name":"maxMints","type":"uint256"}],"name":"checkSigniture","outputs":[{"internalType":"bool","name":"_success","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethRecipient","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRecipient","outputs":[{"internalType":"address payable","name":"","type":"address"}],"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":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"getTotalBalance","outputs":[{"internalType":"uint256[][]","name":"amounts","type":"uint256[][]"}],"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":[{"internalType":"uint256[]","name":"_poolId","type":"uint256[]"},{"internalType":"uint256[]","name":"_supply","type":"uint256[]"},{"internalType":"uint256[]","name":"_costInUnicorns","type":"uint256[]"},{"internalType":"uint256[]","name":"_costInRainbows","type":"uint256[]"},{"internalType":"uint256[]","name":"_costInEth","type":"uint256[]"},{"internalType":"uint256[]","name":"_maxMintsPerAddress","type":"uint256[]"},{"internalType":"uint32[]","name":"_mintTimeStart","type":"uint32[]"},{"internalType":"bool[]","name":"_requiresWhitelist","type":"bool[]"}],"name":"initPools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxMintsPerTx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPointsPercentToMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_poolType","type":"uint256[]"},{"internalType":"uint256[]","name":"_amount","type":"uint256[]"},{"internalType":"bool[]","name":"_useUnicorns","type":"bool[]"},{"internalType":"address[]","name":"_rainbowPools","type":"address[]"},{"internalType":"address[]","name":"_unicornPools","type":"address[]"},{"internalType":"bytes","name":"sig","type":"bytes"},{"internalType":"uint256","name":"maxMints","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintingFeeBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftContract","outputs":[{"internalType":"contract IStandaloneNft721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"numberMintedByAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"numberOfPoolMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolTypes","outputs":[{"internalType":"uint64","name":"costInUnicorns","type":"uint64"},{"internalType":"uint64","name":"costInRainbows","type":"uint64"},{"internalType":"uint64","name":"costInEth","type":"uint64"},{"internalType":"uint16","name":"maxMintsPerAddress","type":"uint16"},{"internalType":"uint32","name":"supply","type":"uint32"},{"internalType":"uint32","name":"mintTimeStart","type":"uint32"},{"internalType":"bool","name":"requiresWhitelist","type":"bool"}],"stateMutability":"view","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":"address payable","name":"_ethRecipient","type":"address"}],"name":"setEthRecipient","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":"address payable","name":"_feeRecipient","type":"address"}],"name":"setFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintingFeeBasisPoints","type":"uint256"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxMintsPerTx","type":"uint256"}],"name":"setMaxMintsPerTx","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"}],"name":"setNftContract","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"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620038c8380380620038c883398101604081905262000034916200016c565b6001805562000045600033620000bc565b62000052600083620000bc565b601080546001600160a01b03199081166001600160a01b0398891617909155600d8054821693881693909317909255600e8054831694871694909417909355600f8054821692861692909217909155600692909255600c805490921692169190911790556200020c565b620000c88282620000cc565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000c8576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001283390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008060008060008060c0878903121562000185578182fd5b86516200019281620001f3565b602088015160408901519197509550620001ac81620001f3565b6060880151909450620001bf81620001f3565b6080880151909350620001d281620001f3565b60a0880151909250620001e581620001f3565b809150509295509295509295565b6001600160a01b03811681146200020957600080fd5b50565b6136ac806200021c6000396000f3fe6080604052600436106102305760003560e01c8063581379fd1161012e578063c311d049116100ab578063dc30158b1161006f578063dc30158b1461079a578063e0e5120d146107b0578063e74b981b146107d0578063ee46d946146107f0578063f7e177de1461080357610230565b8063c311d049146106ed578063cbe09c991461070d578063ce606ee01461073a578063d547741f1461075a578063d56d229d1461077a57610230565b806395df8944116100f257806395df89441461064f578063a217fddf1461066f578063ab59157014610684578063ae3068c1146106a4578063bed6a4c9146106c057610230565b8063581379fd146105b9578063582f706f146105d95780635a3b336c146105ef57806391d148541461060f578063928cb1481461062f57610230565b80631c513339116101bc57806336568abe1161018057806336568abe146105195780633d18678e14610539578063469048401461055957806352f5ad771461057957806354a7d0a91461059957610230565b80631c5133391461045b578063248a9ca314610471578063257ea0ab146104a15780632b7ac3f3146104c15780632f2ff15d146104f957610230565b806313f431601161020357806313f431601461030257806315d21e1114610332578063174da4a21461034857806317e95526146103685780631b95a0101461038857610230565b806301ffc9a71461023557806308a55a6e1461026a5780630a3de4511461029a5780630ac8f007146102e0575b600080fd5b34801561024157600080fd5b5061025561025036600461327f565b610819565b60405190151581526020015b60405180910390f35b34801561027657600080fd5b50610255610285366004612f1d565b60076020526000908152604090205460ff1681565b3480156102a657600080fd5b506102d26102b5366004612fab565b600960209081526000928352604080842090915290825290205481565b604051908152602001610261565b3480156102ec57600080fd5b506103006102fb366004613102565b610850565b005b34801561030e57600080fd5b5061025561031d366004612f1d565b60086020526000908152604090205460ff1681565b34801561033e57600080fd5b506102d260045481565b34801561035457600080fd5b50610300610363366004613238565b610b0f565b34801561037457600080fd5b50610300610383366004612f1d565b610b2a565b34801561039457600080fd5b506104086103a3366004613238565b600260205260009081526040902080546001909101546001600160401b0380831692600160401b8104821692600160801b820490921691600160c01b820461ffff1691600160d01b900463ffffffff9081169190811690640100000000900460ff1687565b604080516001600160401b0398891681529688166020880152949096169385019390935261ffff91909116606084015263ffffffff90811660808401521660a082015290151560c082015260e001610261565b34801561046757600080fd5b506102d260035481565b34801561047d57600080fd5b506102d261048c366004613238565b60009081526020819052604090206001015490565b3480156104ad57600080fd5b506103006104bc366004612f1d565b610b62565b3480156104cd57600080fd5b50600c546104e1906001600160a01b031681565b6040516001600160a01b039091168152602001610261565b34801561050557600080fd5b50610300610514366004613250565b610b99565b34801561052557600080fd5b50610300610534366004613250565b610bcb565b34801561054557600080fd5b50610300610554366004613238565b610c5e565b34801561056557600080fd5b50600f546104e1906001600160a01b031681565b34801561058557600080fd5b50610300610594366004612f1d565b610c79565b3480156105a557600080fd5b506103006105b43660046132bf565b610cb1565b3480156105c557600080fd5b50600e546104e1906001600160a01b031681565b3480156105e557600080fd5b506102d2600b5481565b3480156105fb57600080fd5b5061030061060a366004612f1d565b610cd5565b34801561061b57600080fd5b5061025561062a366004613250565b610d0f565b34801561063b57600080fd5b5061030061064a366004612f1d565b610d38565b34801561065b57600080fd5b5061030061066a366004612f1d565b610d72565b34801561067b57600080fd5b506102d2600081565b34801561069057600080fd5b5061025561069f366004612f55565b610daa565b3480156106b057600080fd5b506102d2670de0b6b3a764000081565b3480156106cc57600080fd5b506106e06106db366004612fd6565b610e9d565b604051610261919061335f565b3480156106f957600080fd5b50610300610708366004613238565b61130e565b34801561071957600080fd5b506102d2610728366004613238565b600a6020526000908152604090205481565b34801561074657600080fd5b50600d546104e1906001600160a01b031681565b34801561076657600080fd5b50610300610775366004613250565b6113e5565b34801561078657600080fd5b506010546104e1906001600160a01b031681565b3480156107a657600080fd5b506102d260065481565b3480156107bc57600080fd5b506103006107cb366004612f1d565b61140d565b3480156107dc57600080fd5b506103006107eb366004612f1d565b611444565b6103006107fe36600461300a565b61147c565b34801561080f57600080fd5b506102d260055481565b60006001600160e01b03198216637965db0b60e01b148061084a57506301ffc9a760e01b6001600160e01b03198316145b92915050565b61085d600061062a6125d0565b61086657600080fd5b60005b8851811015610b04576040518060e0016040528088838151811061089d57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160401b031681526020018783815181106108d357634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160401b0316815260200186838151811061090957634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160401b0316815260200185838151811061093f57634e487b7160e01b600052603260045260246000fd5b602002602001015161ffff16815260200189838151811061097057634e487b7160e01b600052603260045260246000fd5b602002602001015163ffffffff1681526020018483815181106109a357634e487b7160e01b600052603260045260246000fd5b602002602001015163ffffffff1681526020018383815181106109d657634e487b7160e01b600052603260045260246000fd5b60200260200101511515815250600260008b8481518110610a0757634e487b7160e01b600052603260045260246000fd5b60209081029190910181015182528181019290925260409081016000208351815493850151928501516060860151608087015163ffffffff908116600160d01b0263ffffffff60d01b1961ffff909316600160c01b0261ffff60c01b196001600160401b03958616600160801b021669ffffffffffffffffffff60801b19988616600160401b026fffffffffffffffffffffffffffffffff19909a169590961694909417979097179590951692909217171692909217825560a08301516001909201805460c09094015115156401000000000264ffffffffff19909416929091169190911791909117905580610afc81613572565b915050610869565b505050505050505050565b610b1c600061062a6125d0565b610b2557600080fd5b600655565b610b37600061062a6125d0565b610b4057600080fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b610b6f600061062a6125d0565b610b7857600080fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600082815260208190526040902060010154610bbc81610bb76125d0565b6125d5565b610bc68383612639565b505050565b610bd36125d0565b6001600160a01b0316816001600160a01b031614610c505760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610c5a82826126be565b5050565b610c6b600061062a6125d0565b610c7457600080fd5b600b55565b610c86600061062a6125d0565b610c8f57600080fd5b601080546001600160a01b0319166001600160a01b0392909216919091179055565b610cbe600061062a6125d0565b610cc757600080fd5b600492909255600355600555565b610ce2600061062a6125d0565b610ceb57600080fd5b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610d45600061062a6125d0565b610d4e57600080fd5b6001600160a01b03166000908152600860205260409020805460ff19166001179055565b610d7f600061062a6125d0565b610d8857600080fd5b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6000808483604051602001610e0892919060608082526017908201527f5261696e6937323146756e6374696f6e737c6d696e747c00000000000000000060808201526001600160a01b03929092166020830152604082015260a00190565b6040516020818303038152906040528051906020012090506000610e82610e7c836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b86612741565b600c546001600160a01b039081169116149695505050505050565b60606000610eab84846134e8565b6001600160401b03811115610ed057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610f0357816020015b6060815260200190600190039081610eee5790505b5090506000845b8481116110f7576010546040516331a9108f60e11b8152600481018390526001600160a01b0390911690636352211e9060240160206040518083038186803b158015610f5557600080fd5b505afa925050508015610f85575060408051601f3d908101601f19168201909252610f8291810190612f39565b60015b610fc857610f916135b9565b806308c379a01415610fb75750610fa66135d0565b80610fb15750610fb9565b50610fc3565b505b3d6000803e3d6000fd5b6110e5565b876001600160a01b0316816001600160a01b031614156110e35760408051600280825260608201835290916020830190803683370190505084848151811061102057634e487b7160e01b600052603260045260246000fd5b60200260200101819052508184848151811061104c57634e487b7160e01b600052603260045260246000fd5b602002602001015160008151811061107457634e487b7160e01b600052603260045260246000fd5b60200260200101818152505060018484815181106110a257634e487b7160e01b600052603260045260246000fd5b60200260200101516001815181106110ca57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152826110df81613572565b9350505b505b806110ef81613572565b915050610f0a565b506000816001600160401b0381111561112057634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561115357816020015b606081526020019060019003908161113e5790505b50905060005b828110156113035760408051600280825260608201835290916020830190803683370190505082828151811061119f57634e487b7160e01b600052603260045260246000fd5b60200260200101819052508381815181106111ca57634e487b7160e01b600052603260045260246000fd5b60200260200101516000815181106111f257634e487b7160e01b600052603260045260246000fd5b602002602001015182828151811061121a57634e487b7160e01b600052603260045260246000fd5b602002602001015160008151811061124257634e487b7160e01b600052603260045260246000fd5b60200260200101818152505083818151811061126e57634e487b7160e01b600052603260045260246000fd5b602002602001015160018151811061129657634e487b7160e01b600052603260045260246000fd5b60200260200101518282815181106112be57634e487b7160e01b600052603260045260246000fd5b60200260200101516001815181106112e657634e487b7160e01b600052603260045260246000fd5b6020908102919091010152806112fb81613572565b915050611159565b509695505050505050565b61131b600061062a6125d0565b61132457600080fd5b600d546001600160a01b03166113386125d0565b6001600160a01b03161461134b57600080fd5b4781111561136b5760405162461bcd60e51b8152600401610c4790613419565b60006113756125d0565b6001600160a01b03168260405160006040518083038185875af1925050503d80600081146113bf576040519150601f19603f3d011682016040523d82523d6000602084013e6113c4565b606091505b5050905080610c5a5760405162461bcd60e51b8152600401610c4790613445565b60008281526020819052604090206001015461140381610bb76125d0565b610bc683836126be565b61141a600061062a6125d0565b61142357600080fd5b6001600160a01b03166000908152600860205260409020805460ff19169055565b611451600061062a6125d0565b61145a57600080fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b600260015414156114cf5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c47565b60026001558015806114ee57506114ee6114e76125d0565b8383610daa565b6115285760405162461bcd60e51b815260206004820152600b60248201526a696e76616c69642073696760a81b6044820152606401610c47565b6000604051806101200160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815250905060005b8851811015611dd6576000600260008b84815181106115a957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101518252818101929092526040908101600020815160e08101835281546001600160401b038082168352600160401b8204811695830195909552600160801b810490941692810192909252600160c01b830461ffff1660608301819052600160d01b90930463ffffffff908116608084015260019091015490811660a0830152640100000000900460ff16151560c082015291501561165a57806060015161ffff16611661565b6402540be4005b64ffffffffff1660c080850191909152810151801561168357508260c0015184105b156116905760c083018490525b8060a0015163ffffffff16421015806116b157506116b1600061062a6125d0565b6116e95760405162461bcd60e51b8152602060048201526009602482015268746f6f206561726c7960b81b6044820152606401610c47565b8260c0015189838151811061170e57634e487b7160e01b600052603260045260246000fd5b6020026020010151600960006117226125d0565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008d868151811061176457634e487b7160e01b600052603260045260246000fd5b60200260200101518152602001908152602001600020546117859190613491565b11156117d35760405162461bcd60e51b815260206004820152601d60248201527f4d6178206d696e7473207265616368656420666f7220616464726573730000006044820152606401610c47565b6000600a60008c85815181106117f957634e487b7160e01b600052603260045260246000fd5b60200260200101518152602001908152602001600020549050816080015163ffffffff168a848151811061183d57634e487b7160e01b600052603260045260246000fd5b6020026020010151826118509190613491565b11156118995780826080015163ffffffff1661186c91906134e8565b8a848151811061188c57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b8983815181106118b957634e487b7160e01b600052603260045260246000fd5b60200260200101518460e0018181516118d29190613491565b905250606082015161ffff16156119fc5789838151811061190357634e487b7160e01b600052603260045260246000fd5b6020026020010151600960006119176125d0565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008d868151811061195957634e487b7160e01b600052603260045260246000fd5b60200260200101518152602001908152602001600020600082825461197e9190613491565b925050819055508983815181106119a557634e487b7160e01b600052603260045260246000fd5b6020026020010151600a60008d86815181106119d157634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060008282546119f69190613491565b90915550505b81516001600160401b0316151580611a215750600082602001516001600160401b0316115b15611d6c57888381518110611a4657634e487b7160e01b600052603260045260246000fd5b602002602001015115611b3c5781516001600160401b0316611aa15760405162461bcd60e51b81526020600482015260146024820152731d5b9a58dbdc9b9cc81b9bdd08185b1b1bddd95960621b6044820152606401610c47565b6000670de0b6b3a76400008b8581518110611acc57634e487b7160e01b600052603260045260246000fd5b602002602001015184600001516001600160401b0316611aec91906134c9565b611af691906134c9565b90508085602001818151611b0a9190613491565b90525060408301516001600160401b031615611b36578085606001818151611b329190613491565b9052505b50611c27565b600082602001516001600160401b031611611b905760405162461bcd60e51b81526020600482015260146024820152731c985a5b989bdddcc81b9bdd08185b1b1bddd95960621b6044820152606401610c47565b6000670de0b6b3a76400008b8581518110611bbb57634e487b7160e01b600052603260045260246000fd5b602002602001015184602001516001600160401b0316611bdb91906134c9565b611be591906134c9565b90508085600001818151611bf99190613491565b90525060408301516001600160401b031615611c25578085604001818151611c219190613491565b9052505b505b60408201516001600160401b0316611d6c5760208201516001600160401b031615611cde57600354611c5b906127106134c9565b600b54670de0b6b3a76400008c8681518110611c8757634e487b7160e01b600052603260045260246000fd5b602002602001015185602001516001600160401b0316611ca791906134c9565b611cb191906134c9565b611cbb91906134c9565b611cc591906134a9565b84608001818151611cd69190613491565b905250611d6c565b600454611ced906127106134c9565b600b54670de0b6b3a76400008c8681518110611d1957634e487b7160e01b600052603260045260246000fd5b602002602001015185600001516001600160401b0316611d3991906134c9565b611d4391906134c9565b611d4d91906134c9565b611d5791906134a9565b84608001818151611d689190613491565b9052505b898381518110611d8c57634e487b7160e01b600052603260045260246000fd5b602002602001015182604001516001600160401b0316611dac91906134c9565b8460a001818151611dbd9190613491565b905250829150611dce905081613572565b91505061157a565b50600081602001511180611dea5750805115155b156122a15760005b600281101561229f5780151560008082611e0d578451611e13565b84602001515b905080801561228857600084611e2a578a51611e2d565b89515b905060008111611e6f5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420706f6f6c7360981b6044820152606401610c47565b60005b818110156121b95760008615611f3f57600860008d8481518110611ea657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16611f105760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081d5b9a58dbdc9b881c1bdbdb60621b6044820152606401610c47565b8b8281518110611f3057634e487b7160e01b600052603260045260246000fd5b60200260200101519050611ff8565b600760008e8481518110611f6357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16611fcd5760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081c985a5b989bddc81c1bdbdb60621b6044820152606401610c47565b8c8281518110611fed57634e487b7160e01b600052603260045260246000fd5b602002602001015190505b6000816001600160a01b03166370a082316120116125d0565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561205057600080fd5b505afa158015612064573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208891906132a7565b90506120948188613491565b965085871061211f57816001600160a01b0316639dc29fac6120b46125d0565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101889052604401600060405180830381600087803b1580156120fc57600080fd5b505af1158015612110573d6000803e3d6000fd5b505050506000945050506121b9565b816001600160a01b0316639dc29fac6121366125d0565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561217e57600080fd5b505af1158015612192573d6000803e3d6000fd5b5050505080856121a291906134e8565b9450505080806121b190613572565b915050611e72565b50811561228657846121cf5786604001516121d5565b86606001515b6121df90846134e8565b925060006064600554856121f391906134c9565b6121fd91906134a9565b90508061220a84866134e8565b10156122285760405162461bcd60e51b8152600401610c4790613419565b6000866122375760035461223b565b6004545b90508361224882346134c9565b116122655760405162461bcd60e51b8152600401610c4790613419565b61226f81856134a9565b896080018181516122809190613491565b90525050505b505b50505050808061229790613572565b915050611df2565b505b3481608001518260a001516122b69190613491565b11156122f55760405162461bcd60e51b815260206004820152600e60248201526d0dcdee840cadcdeeaced040cae8d60931b6044820152606401610c47565b6122fd6125d0565b6001600160a01b031681608001518260a0015161231a9190613491565b61232490346134e8565b604051600081818185875af1925050503d8060008114612360576040519150601f19603f3d011682016040523d82523d6000602084013e612365565b606091505b50501515610100820181905261238d5760405162461bcd60e51b8152600401610c4790613445565b600f5460808201516040516001600160a01b0390921691600081818185875af1925050503d80600081146123dd576040519150601f19603f3d011682016040523d82523d6000602084013e6123e2565b606091505b5050151561010082018190526124305760405162461bcd60e51b8152602060048201526013602482015272199959481d1c985b9cd9995c8819985a5b1959606a1b6044820152606401610c47565b600e5460a08201516040516001600160a01b0390921691600081818185875af1925050503d8060008114612480576040519150601f19603f3d011682016040523d82523d6000602084013e612485565b606091505b5050151561010082018190526124ad5760405162461bcd60e51b8152600401610c4790613445565b60008160e00151116124f85760405162461bcd60e51b8152602060048201526014602482015273105b1b1bd8d85d1a5bdb88195e1a185d5cdd195960621b6044820152606401610c47565b6006548160e0015111156125415760405162461bcd60e51b815260206004820152601060248201526f0bec2dadeeadce840deeccae440dac2f60831b6044820152606401610c47565b6010546001600160a01b03166397d017b661255a6125d0565b8360e001516040518363ffffffff1660e01b81526004016125909291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b1580156125aa57600080fd5b505af11580156125be573d6000803e3d6000fd5b50506001805550505050505050505050565b335b90565b6125df8282610d0f565b610c5a576125f7816001600160a01b03166014612765565b612602836020612765565b6040516020016126139291906132ea565b60408051601f198184030181529082905262461bcd60e51b8252610c47916004016133e6565b6126438282610d0f565b610c5a576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561267a6125d0565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6126c88282610d0f565b15610c5a576000828152602081815260408083206001600160a01b03851684529091529020805460ff191690556126fd6125d0565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000806000612750858561294d565b9150915061275d816129bd565b509392505050565b606060006127748360026134c9565b61277f906002613491565b6001600160401b038111156127a457634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156127ce576020820181803683370190505b509050600360fc1b816000815181106127f757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061283457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006128588460026134c9565b612863906001613491565b90505b60018111156128f7576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106128a557634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106128c957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936128f08161352f565b9050612866565b5083156129465760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c47565b9392505050565b6000808251604114156129845760208301516040840151606085015160001a61297887828585612bc3565b945094505050506129b6565b8251604014156129ae57602083015160408401516129a3868383612cb0565b9350935050506129b6565b506000905060025b9250929050565b60008160048111156129df57634e487b7160e01b600052602160045260246000fd5b14156129ea57612bc0565b6001816004811115612a0c57634e487b7160e01b600052602160045260246000fd5b1415612a5a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c47565b6002816004811115612a7c57634e487b7160e01b600052602160045260246000fd5b1415612aca5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c47565b6003816004811115612aec57634e487b7160e01b600052602160045260246000fd5b1415612b455760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c47565b6004816004811115612b6757634e487b7160e01b600052602160045260246000fd5b1415612bc05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610c47565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612bfa5750600090506003612ca7565b8460ff16601b14158015612c1257508460ff16601c14155b15612c235750600090506004612ca7565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612c77573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612ca057600060019250925050612ca7565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01612cd187828885612bc3565b935093505050935093915050565b600082601f830112612cef578081fd5b81356020612cfc8261346e565b604051612d098282613546565b8381528281019150858301600585901b87018401881015612d28578586fd5b855b85811015612d4f578135612d3d81613661565b84529284019290840190600101612d2a565b5090979650505050505050565b600082601f830112612d6c578081fd5b81356020612d798261346e565b604051612d868282613546565b8381528281019150858301600585901b87018401881015612da5578586fd5b855b85811015612d4f5781358015158114612dbe578788fd5b84529284019290840190600101612da7565b600082601f830112612de0578081fd5b81356020612ded8261346e565b604051612dfa8282613546565b8381528281019150858301600585901b87018401881015612e19578586fd5b855b85811015612d4f57813584529284019290840190600101612e1b565b600082601f830112612e47578081fd5b81356020612e548261346e565b604051612e618282613546565b8381528281019150858301600585901b87018401881015612e80578586fd5b855b85811015612d4f57813563ffffffff81168114612e9d578788fd5b84529284019290840190600101612e82565b600082601f830112612ebf578081fd5b81356001600160401b03811115612ed857612ed86135a3565b604051612eef601f8301601f191660200182613546565b818152846020838601011115612f03578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215612f2e578081fd5b813561294681613661565b600060208284031215612f4a578081fd5b815161294681613661565b600080600060608486031215612f69578182fd5b8335612f7481613661565b925060208401356001600160401b03811115612f8e578283fd5b612f9a86828701612eaf565b925050604084013590509250925092565b60008060408385031215612fbd578182fd5b8235612fc881613661565b946020939093013593505050565b600080600060608486031215612fea578081fd5b8335612ff581613661565b95602085013595506040909401359392505050565b600080600080600080600060e0888a031215613024578485fd5b87356001600160401b038082111561303a578687fd5b6130468b838c01612dd0565b985060208a013591508082111561305b578687fd5b6130678b838c01612dd0565b975060408a013591508082111561307c578687fd5b6130888b838c01612d5c565b965060608a013591508082111561309d578485fd5b6130a98b838c01612cdf565b955060808a01359150808211156130be578485fd5b6130ca8b838c01612cdf565b945060a08a01359150808211156130df578384fd5b506130ec8a828b01612eaf565b92505060c0880135905092959891949750929550565b600080600080600080600080610100898b03121561311e578182fd5b88356001600160401b0380821115613134578384fd5b6131408c838d01612dd0565b995060208b0135915080821115613155578384fd5b6131618c838d01612dd0565b985060408b0135915080821115613176578384fd5b6131828c838d01612dd0565b975060608b0135915080821115613197578384fd5b6131a38c838d01612dd0565b965060808b01359150808211156131b8578384fd5b6131c48c838d01612dd0565b955060a08b01359150808211156131d9578384fd5b6131e58c838d01612dd0565b945060c08b01359150808211156131fa578384fd5b6132068c838d01612e37565b935060e08b013591508082111561321b578283fd5b506132288b828c01612d5c565b9150509295985092959890939650565b600060208284031215613249578081fd5b5035919050565b60008060408385031215613262578182fd5b82359150602083013561327481613661565b809150509250929050565b600060208284031215613290578081fd5b81356001600160e01b031981168114612946578182fd5b6000602082840312156132b8578081fd5b5051919050565b6000806000606084860312156132d3578081fd5b505081359360208301359350604090920135919050565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516133228160178501602088016134ff565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516133538160288401602088016134ff565b01602801949350505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b828110156133d957878503603f19018452815180518087529087019087870190895b818110156133c3578351835292890192918901916001016133a7565b5090965050509285019290850190600101613385565b5092979650505050505050565b60006020825282518060208401526134058160408501602087016134ff565b601f01601f19169190910160400192915050565b6020808252601290820152716e6f7420656e6f7567682062616c616e636560701b604082015260600190565b6020808252600f908201526e1d1c985b9cd9995c8819985a5b1959608a1b604082015260600190565b60006001600160401b03821115613487576134876135a3565b5060051b60200190565b600082198211156134a4576134a461358d565b500190565b6000826134c457634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156134e3576134e361358d565b500290565b6000828210156134fa576134fa61358d565b500390565b60005b8381101561351a578181015183820152602001613502565b83811115613529576000848401525b50505050565b60008161353e5761353e61358d565b506000190190565b601f8201601f191681016001600160401b038111828210171561356b5761356b6135a3565b6040525050565b60006000198214156135865761358661358d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156125d257600481823e5160e01c90565b600060443d10156135e0576125d2565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156136115750505050506125d2565b828501915081518181111561362b575050505050506125d2565b843d8701016020828501011115613647575050505050506125d2565b61365660208286010187613546565b509094505050505090565b6001600160a01b0381168114612bc057600080fdfea26469706673582212206ba1db34f1ede7192722a883ffa9b32a8041aaf88ccc73641b26947c347eceda64736f6c6343000803003300000000000000000000000053b217e1f76925b3afd4a0d3ce0dd8e11a822846000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f000000000000000000000000c50256c57445776054d3780286b650e83157f0ce
Deployed Bytecode
0x6080604052600436106102305760003560e01c8063581379fd1161012e578063c311d049116100ab578063dc30158b1161006f578063dc30158b1461079a578063e0e5120d146107b0578063e74b981b146107d0578063ee46d946146107f0578063f7e177de1461080357610230565b8063c311d049146106ed578063cbe09c991461070d578063ce606ee01461073a578063d547741f1461075a578063d56d229d1461077a57610230565b806395df8944116100f257806395df89441461064f578063a217fddf1461066f578063ab59157014610684578063ae3068c1146106a4578063bed6a4c9146106c057610230565b8063581379fd146105b9578063582f706f146105d95780635a3b336c146105ef57806391d148541461060f578063928cb1481461062f57610230565b80631c513339116101bc57806336568abe1161018057806336568abe146105195780633d18678e14610539578063469048401461055957806352f5ad771461057957806354a7d0a91461059957610230565b80631c5133391461045b578063248a9ca314610471578063257ea0ab146104a15780632b7ac3f3146104c15780632f2ff15d146104f957610230565b806313f431601161020357806313f431601461030257806315d21e1114610332578063174da4a21461034857806317e95526146103685780631b95a0101461038857610230565b806301ffc9a71461023557806308a55a6e1461026a5780630a3de4511461029a5780630ac8f007146102e0575b600080fd5b34801561024157600080fd5b5061025561025036600461327f565b610819565b60405190151581526020015b60405180910390f35b34801561027657600080fd5b50610255610285366004612f1d565b60076020526000908152604090205460ff1681565b3480156102a657600080fd5b506102d26102b5366004612fab565b600960209081526000928352604080842090915290825290205481565b604051908152602001610261565b3480156102ec57600080fd5b506103006102fb366004613102565b610850565b005b34801561030e57600080fd5b5061025561031d366004612f1d565b60086020526000908152604090205460ff1681565b34801561033e57600080fd5b506102d260045481565b34801561035457600080fd5b50610300610363366004613238565b610b0f565b34801561037457600080fd5b50610300610383366004612f1d565b610b2a565b34801561039457600080fd5b506104086103a3366004613238565b600260205260009081526040902080546001909101546001600160401b0380831692600160401b8104821692600160801b820490921691600160c01b820461ffff1691600160d01b900463ffffffff9081169190811690640100000000900460ff1687565b604080516001600160401b0398891681529688166020880152949096169385019390935261ffff91909116606084015263ffffffff90811660808401521660a082015290151560c082015260e001610261565b34801561046757600080fd5b506102d260035481565b34801561047d57600080fd5b506102d261048c366004613238565b60009081526020819052604090206001015490565b3480156104ad57600080fd5b506103006104bc366004612f1d565b610b62565b3480156104cd57600080fd5b50600c546104e1906001600160a01b031681565b6040516001600160a01b039091168152602001610261565b34801561050557600080fd5b50610300610514366004613250565b610b99565b34801561052557600080fd5b50610300610534366004613250565b610bcb565b34801561054557600080fd5b50610300610554366004613238565b610c5e565b34801561056557600080fd5b50600f546104e1906001600160a01b031681565b34801561058557600080fd5b50610300610594366004612f1d565b610c79565b3480156105a557600080fd5b506103006105b43660046132bf565b610cb1565b3480156105c557600080fd5b50600e546104e1906001600160a01b031681565b3480156105e557600080fd5b506102d2600b5481565b3480156105fb57600080fd5b5061030061060a366004612f1d565b610cd5565b34801561061b57600080fd5b5061025561062a366004613250565b610d0f565b34801561063b57600080fd5b5061030061064a366004612f1d565b610d38565b34801561065b57600080fd5b5061030061066a366004612f1d565b610d72565b34801561067b57600080fd5b506102d2600081565b34801561069057600080fd5b5061025561069f366004612f55565b610daa565b3480156106b057600080fd5b506102d2670de0b6b3a764000081565b3480156106cc57600080fd5b506106e06106db366004612fd6565b610e9d565b604051610261919061335f565b3480156106f957600080fd5b50610300610708366004613238565b61130e565b34801561071957600080fd5b506102d2610728366004613238565b600a6020526000908152604090205481565b34801561074657600080fd5b50600d546104e1906001600160a01b031681565b34801561076657600080fd5b50610300610775366004613250565b6113e5565b34801561078657600080fd5b506010546104e1906001600160a01b031681565b3480156107a657600080fd5b506102d260065481565b3480156107bc57600080fd5b506103006107cb366004612f1d565b61140d565b3480156107dc57600080fd5b506103006107eb366004612f1d565b611444565b6103006107fe36600461300a565b61147c565b34801561080f57600080fd5b506102d260055481565b60006001600160e01b03198216637965db0b60e01b148061084a57506301ffc9a760e01b6001600160e01b03198316145b92915050565b61085d600061062a6125d0565b61086657600080fd5b60005b8851811015610b04576040518060e0016040528088838151811061089d57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160401b031681526020018783815181106108d357634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160401b0316815260200186838151811061090957634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160401b0316815260200185838151811061093f57634e487b7160e01b600052603260045260246000fd5b602002602001015161ffff16815260200189838151811061097057634e487b7160e01b600052603260045260246000fd5b602002602001015163ffffffff1681526020018483815181106109a357634e487b7160e01b600052603260045260246000fd5b602002602001015163ffffffff1681526020018383815181106109d657634e487b7160e01b600052603260045260246000fd5b60200260200101511515815250600260008b8481518110610a0757634e487b7160e01b600052603260045260246000fd5b60209081029190910181015182528181019290925260409081016000208351815493850151928501516060860151608087015163ffffffff908116600160d01b0263ffffffff60d01b1961ffff909316600160c01b0261ffff60c01b196001600160401b03958616600160801b021669ffffffffffffffffffff60801b19988616600160401b026fffffffffffffffffffffffffffffffff19909a169590961694909417979097179590951692909217171692909217825560a08301516001909201805460c09094015115156401000000000264ffffffffff19909416929091169190911791909117905580610afc81613572565b915050610869565b505050505050505050565b610b1c600061062a6125d0565b610b2557600080fd5b600655565b610b37600061062a6125d0565b610b4057600080fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b610b6f600061062a6125d0565b610b7857600080fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600082815260208190526040902060010154610bbc81610bb76125d0565b6125d5565b610bc68383612639565b505050565b610bd36125d0565b6001600160a01b0316816001600160a01b031614610c505760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610c5a82826126be565b5050565b610c6b600061062a6125d0565b610c7457600080fd5b600b55565b610c86600061062a6125d0565b610c8f57600080fd5b601080546001600160a01b0319166001600160a01b0392909216919091179055565b610cbe600061062a6125d0565b610cc757600080fd5b600492909255600355600555565b610ce2600061062a6125d0565b610ceb57600080fd5b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610d45600061062a6125d0565b610d4e57600080fd5b6001600160a01b03166000908152600860205260409020805460ff19166001179055565b610d7f600061062a6125d0565b610d8857600080fd5b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6000808483604051602001610e0892919060608082526017908201527f5261696e6937323146756e6374696f6e737c6d696e747c00000000000000000060808201526001600160a01b03929092166020830152604082015260a00190565b6040516020818303038152906040528051906020012090506000610e82610e7c836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b86612741565b600c546001600160a01b039081169116149695505050505050565b60606000610eab84846134e8565b6001600160401b03811115610ed057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610f0357816020015b6060815260200190600190039081610eee5790505b5090506000845b8481116110f7576010546040516331a9108f60e11b8152600481018390526001600160a01b0390911690636352211e9060240160206040518083038186803b158015610f5557600080fd5b505afa925050508015610f85575060408051601f3d908101601f19168201909252610f8291810190612f39565b60015b610fc857610f916135b9565b806308c379a01415610fb75750610fa66135d0565b80610fb15750610fb9565b50610fc3565b505b3d6000803e3d6000fd5b6110e5565b876001600160a01b0316816001600160a01b031614156110e35760408051600280825260608201835290916020830190803683370190505084848151811061102057634e487b7160e01b600052603260045260246000fd5b60200260200101819052508184848151811061104c57634e487b7160e01b600052603260045260246000fd5b602002602001015160008151811061107457634e487b7160e01b600052603260045260246000fd5b60200260200101818152505060018484815181106110a257634e487b7160e01b600052603260045260246000fd5b60200260200101516001815181106110ca57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152826110df81613572565b9350505b505b806110ef81613572565b915050610f0a565b506000816001600160401b0381111561112057634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561115357816020015b606081526020019060019003908161113e5790505b50905060005b828110156113035760408051600280825260608201835290916020830190803683370190505082828151811061119f57634e487b7160e01b600052603260045260246000fd5b60200260200101819052508381815181106111ca57634e487b7160e01b600052603260045260246000fd5b60200260200101516000815181106111f257634e487b7160e01b600052603260045260246000fd5b602002602001015182828151811061121a57634e487b7160e01b600052603260045260246000fd5b602002602001015160008151811061124257634e487b7160e01b600052603260045260246000fd5b60200260200101818152505083818151811061126e57634e487b7160e01b600052603260045260246000fd5b602002602001015160018151811061129657634e487b7160e01b600052603260045260246000fd5b60200260200101518282815181106112be57634e487b7160e01b600052603260045260246000fd5b60200260200101516001815181106112e657634e487b7160e01b600052603260045260246000fd5b6020908102919091010152806112fb81613572565b915050611159565b509695505050505050565b61131b600061062a6125d0565b61132457600080fd5b600d546001600160a01b03166113386125d0565b6001600160a01b03161461134b57600080fd5b4781111561136b5760405162461bcd60e51b8152600401610c4790613419565b60006113756125d0565b6001600160a01b03168260405160006040518083038185875af1925050503d80600081146113bf576040519150601f19603f3d011682016040523d82523d6000602084013e6113c4565b606091505b5050905080610c5a5760405162461bcd60e51b8152600401610c4790613445565b60008281526020819052604090206001015461140381610bb76125d0565b610bc683836126be565b61141a600061062a6125d0565b61142357600080fd5b6001600160a01b03166000908152600860205260409020805460ff19169055565b611451600061062a6125d0565b61145a57600080fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b600260015414156114cf5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c47565b60026001558015806114ee57506114ee6114e76125d0565b8383610daa565b6115285760405162461bcd60e51b815260206004820152600b60248201526a696e76616c69642073696760a81b6044820152606401610c47565b6000604051806101200160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815250905060005b8851811015611dd6576000600260008b84815181106115a957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101518252818101929092526040908101600020815160e08101835281546001600160401b038082168352600160401b8204811695830195909552600160801b810490941692810192909252600160c01b830461ffff1660608301819052600160d01b90930463ffffffff908116608084015260019091015490811660a0830152640100000000900460ff16151560c082015291501561165a57806060015161ffff16611661565b6402540be4005b64ffffffffff1660c080850191909152810151801561168357508260c0015184105b156116905760c083018490525b8060a0015163ffffffff16421015806116b157506116b1600061062a6125d0565b6116e95760405162461bcd60e51b8152602060048201526009602482015268746f6f206561726c7960b81b6044820152606401610c47565b8260c0015189838151811061170e57634e487b7160e01b600052603260045260246000fd5b6020026020010151600960006117226125d0565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008d868151811061176457634e487b7160e01b600052603260045260246000fd5b60200260200101518152602001908152602001600020546117859190613491565b11156117d35760405162461bcd60e51b815260206004820152601d60248201527f4d6178206d696e7473207265616368656420666f7220616464726573730000006044820152606401610c47565b6000600a60008c85815181106117f957634e487b7160e01b600052603260045260246000fd5b60200260200101518152602001908152602001600020549050816080015163ffffffff168a848151811061183d57634e487b7160e01b600052603260045260246000fd5b6020026020010151826118509190613491565b11156118995780826080015163ffffffff1661186c91906134e8565b8a848151811061188c57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b8983815181106118b957634e487b7160e01b600052603260045260246000fd5b60200260200101518460e0018181516118d29190613491565b905250606082015161ffff16156119fc5789838151811061190357634e487b7160e01b600052603260045260246000fd5b6020026020010151600960006119176125d0565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008d868151811061195957634e487b7160e01b600052603260045260246000fd5b60200260200101518152602001908152602001600020600082825461197e9190613491565b925050819055508983815181106119a557634e487b7160e01b600052603260045260246000fd5b6020026020010151600a60008d86815181106119d157634e487b7160e01b600052603260045260246000fd5b6020026020010151815260200190815260200160002060008282546119f69190613491565b90915550505b81516001600160401b0316151580611a215750600082602001516001600160401b0316115b15611d6c57888381518110611a4657634e487b7160e01b600052603260045260246000fd5b602002602001015115611b3c5781516001600160401b0316611aa15760405162461bcd60e51b81526020600482015260146024820152731d5b9a58dbdc9b9cc81b9bdd08185b1b1bddd95960621b6044820152606401610c47565b6000670de0b6b3a76400008b8581518110611acc57634e487b7160e01b600052603260045260246000fd5b602002602001015184600001516001600160401b0316611aec91906134c9565b611af691906134c9565b90508085602001818151611b0a9190613491565b90525060408301516001600160401b031615611b36578085606001818151611b329190613491565b9052505b50611c27565b600082602001516001600160401b031611611b905760405162461bcd60e51b81526020600482015260146024820152731c985a5b989bdddcc81b9bdd08185b1b1bddd95960621b6044820152606401610c47565b6000670de0b6b3a76400008b8581518110611bbb57634e487b7160e01b600052603260045260246000fd5b602002602001015184602001516001600160401b0316611bdb91906134c9565b611be591906134c9565b90508085600001818151611bf99190613491565b90525060408301516001600160401b031615611c25578085604001818151611c219190613491565b9052505b505b60408201516001600160401b0316611d6c5760208201516001600160401b031615611cde57600354611c5b906127106134c9565b600b54670de0b6b3a76400008c8681518110611c8757634e487b7160e01b600052603260045260246000fd5b602002602001015185602001516001600160401b0316611ca791906134c9565b611cb191906134c9565b611cbb91906134c9565b611cc591906134a9565b84608001818151611cd69190613491565b905250611d6c565b600454611ced906127106134c9565b600b54670de0b6b3a76400008c8681518110611d1957634e487b7160e01b600052603260045260246000fd5b602002602001015185600001516001600160401b0316611d3991906134c9565b611d4391906134c9565b611d4d91906134c9565b611d5791906134a9565b84608001818151611d689190613491565b9052505b898381518110611d8c57634e487b7160e01b600052603260045260246000fd5b602002602001015182604001516001600160401b0316611dac91906134c9565b8460a001818151611dbd9190613491565b905250829150611dce905081613572565b91505061157a565b50600081602001511180611dea5750805115155b156122a15760005b600281101561229f5780151560008082611e0d578451611e13565b84602001515b905080801561228857600084611e2a578a51611e2d565b89515b905060008111611e6f5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420706f6f6c7360981b6044820152606401610c47565b60005b818110156121b95760008615611f3f57600860008d8481518110611ea657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16611f105760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081d5b9a58dbdc9b881c1bdbdb60621b6044820152606401610c47565b8b8281518110611f3057634e487b7160e01b600052603260045260246000fd5b60200260200101519050611ff8565b600760008e8481518110611f6357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff16611fcd5760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081c985a5b989bddc81c1bdbdb60621b6044820152606401610c47565b8c8281518110611fed57634e487b7160e01b600052603260045260246000fd5b602002602001015190505b6000816001600160a01b03166370a082316120116125d0565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561205057600080fd5b505afa158015612064573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208891906132a7565b90506120948188613491565b965085871061211f57816001600160a01b0316639dc29fac6120b46125d0565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101889052604401600060405180830381600087803b1580156120fc57600080fd5b505af1158015612110573d6000803e3d6000fd5b505050506000945050506121b9565b816001600160a01b0316639dc29fac6121366125d0565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561217e57600080fd5b505af1158015612192573d6000803e3d6000fd5b5050505080856121a291906134e8565b9450505080806121b190613572565b915050611e72565b50811561228657846121cf5786604001516121d5565b86606001515b6121df90846134e8565b925060006064600554856121f391906134c9565b6121fd91906134a9565b90508061220a84866134e8565b10156122285760405162461bcd60e51b8152600401610c4790613419565b6000866122375760035461223b565b6004545b90508361224882346134c9565b116122655760405162461bcd60e51b8152600401610c4790613419565b61226f81856134a9565b896080018181516122809190613491565b90525050505b505b50505050808061229790613572565b915050611df2565b505b3481608001518260a001516122b69190613491565b11156122f55760405162461bcd60e51b815260206004820152600e60248201526d0dcdee840cadcdeeaced040cae8d60931b6044820152606401610c47565b6122fd6125d0565b6001600160a01b031681608001518260a0015161231a9190613491565b61232490346134e8565b604051600081818185875af1925050503d8060008114612360576040519150601f19603f3d011682016040523d82523d6000602084013e612365565b606091505b50501515610100820181905261238d5760405162461bcd60e51b8152600401610c4790613445565b600f5460808201516040516001600160a01b0390921691600081818185875af1925050503d80600081146123dd576040519150601f19603f3d011682016040523d82523d6000602084013e6123e2565b606091505b5050151561010082018190526124305760405162461bcd60e51b8152602060048201526013602482015272199959481d1c985b9cd9995c8819985a5b1959606a1b6044820152606401610c47565b600e5460a08201516040516001600160a01b0390921691600081818185875af1925050503d8060008114612480576040519150601f19603f3d011682016040523d82523d6000602084013e612485565b606091505b5050151561010082018190526124ad5760405162461bcd60e51b8152600401610c4790613445565b60008160e00151116124f85760405162461bcd60e51b8152602060048201526014602482015273105b1b1bd8d85d1a5bdb88195e1a185d5cdd195960621b6044820152606401610c47565b6006548160e0015111156125415760405162461bcd60e51b815260206004820152601060248201526f0bec2dadeeadce840deeccae440dac2f60831b6044820152606401610c47565b6010546001600160a01b03166397d017b661255a6125d0565b8360e001516040518363ffffffff1660e01b81526004016125909291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b1580156125aa57600080fd5b505af11580156125be573d6000803e3d6000fd5b50506001805550505050505050505050565b335b90565b6125df8282610d0f565b610c5a576125f7816001600160a01b03166014612765565b612602836020612765565b6040516020016126139291906132ea565b60408051601f198184030181529082905262461bcd60e51b8252610c47916004016133e6565b6126438282610d0f565b610c5a576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561267a6125d0565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6126c88282610d0f565b15610c5a576000828152602081815260408083206001600160a01b03851684529091529020805460ff191690556126fd6125d0565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000806000612750858561294d565b9150915061275d816129bd565b509392505050565b606060006127748360026134c9565b61277f906002613491565b6001600160401b038111156127a457634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156127ce576020820181803683370190505b509050600360fc1b816000815181106127f757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061283457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006128588460026134c9565b612863906001613491565b90505b60018111156128f7576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106128a557634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106128c957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936128f08161352f565b9050612866565b5083156129465760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c47565b9392505050565b6000808251604114156129845760208301516040840151606085015160001a61297887828585612bc3565b945094505050506129b6565b8251604014156129ae57602083015160408401516129a3868383612cb0565b9350935050506129b6565b506000905060025b9250929050565b60008160048111156129df57634e487b7160e01b600052602160045260246000fd5b14156129ea57612bc0565b6001816004811115612a0c57634e487b7160e01b600052602160045260246000fd5b1415612a5a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c47565b6002816004811115612a7c57634e487b7160e01b600052602160045260246000fd5b1415612aca5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c47565b6003816004811115612aec57634e487b7160e01b600052602160045260246000fd5b1415612b455760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c47565b6004816004811115612b6757634e487b7160e01b600052602160045260246000fd5b1415612bc05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610c47565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612bfa5750600090506003612ca7565b8460ff16601b14158015612c1257508460ff16601c14155b15612c235750600090506004612ca7565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612c77573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612ca057600060019250925050612ca7565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01612cd187828885612bc3565b935093505050935093915050565b600082601f830112612cef578081fd5b81356020612cfc8261346e565b604051612d098282613546565b8381528281019150858301600585901b87018401881015612d28578586fd5b855b85811015612d4f578135612d3d81613661565b84529284019290840190600101612d2a565b5090979650505050505050565b600082601f830112612d6c578081fd5b81356020612d798261346e565b604051612d868282613546565b8381528281019150858301600585901b87018401881015612da5578586fd5b855b85811015612d4f5781358015158114612dbe578788fd5b84529284019290840190600101612da7565b600082601f830112612de0578081fd5b81356020612ded8261346e565b604051612dfa8282613546565b8381528281019150858301600585901b87018401881015612e19578586fd5b855b85811015612d4f57813584529284019290840190600101612e1b565b600082601f830112612e47578081fd5b81356020612e548261346e565b604051612e618282613546565b8381528281019150858301600585901b87018401881015612e80578586fd5b855b85811015612d4f57813563ffffffff81168114612e9d578788fd5b84529284019290840190600101612e82565b600082601f830112612ebf578081fd5b81356001600160401b03811115612ed857612ed86135a3565b604051612eef601f8301601f191660200182613546565b818152846020838601011115612f03578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215612f2e578081fd5b813561294681613661565b600060208284031215612f4a578081fd5b815161294681613661565b600080600060608486031215612f69578182fd5b8335612f7481613661565b925060208401356001600160401b03811115612f8e578283fd5b612f9a86828701612eaf565b925050604084013590509250925092565b60008060408385031215612fbd578182fd5b8235612fc881613661565b946020939093013593505050565b600080600060608486031215612fea578081fd5b8335612ff581613661565b95602085013595506040909401359392505050565b600080600080600080600060e0888a031215613024578485fd5b87356001600160401b038082111561303a578687fd5b6130468b838c01612dd0565b985060208a013591508082111561305b578687fd5b6130678b838c01612dd0565b975060408a013591508082111561307c578687fd5b6130888b838c01612d5c565b965060608a013591508082111561309d578485fd5b6130a98b838c01612cdf565b955060808a01359150808211156130be578485fd5b6130ca8b838c01612cdf565b945060a08a01359150808211156130df578384fd5b506130ec8a828b01612eaf565b92505060c0880135905092959891949750929550565b600080600080600080600080610100898b03121561311e578182fd5b88356001600160401b0380821115613134578384fd5b6131408c838d01612dd0565b995060208b0135915080821115613155578384fd5b6131618c838d01612dd0565b985060408b0135915080821115613176578384fd5b6131828c838d01612dd0565b975060608b0135915080821115613197578384fd5b6131a38c838d01612dd0565b965060808b01359150808211156131b8578384fd5b6131c48c838d01612dd0565b955060a08b01359150808211156131d9578384fd5b6131e58c838d01612dd0565b945060c08b01359150808211156131fa578384fd5b6132068c838d01612e37565b935060e08b013591508082111561321b578283fd5b506132288b828c01612d5c565b9150509295985092959890939650565b600060208284031215613249578081fd5b5035919050565b60008060408385031215613262578182fd5b82359150602083013561327481613661565b809150509250929050565b600060208284031215613290578081fd5b81356001600160e01b031981168114612946578182fd5b6000602082840312156132b8578081fd5b5051919050565b6000806000606084860312156132d3578081fd5b505081359360208301359350604090920135919050565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516133228160178501602088016134ff565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516133538160288401602088016134ff565b01602801949350505050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b828110156133d957878503603f19018452815180518087529087019087870190895b818110156133c3578351835292890192918901916001016133a7565b5090965050509285019290850190600101613385565b5092979650505050505050565b60006020825282518060208401526134058160408501602087016134ff565b601f01601f19169190910160400192915050565b6020808252601290820152716e6f7420656e6f7567682062616c616e636560701b604082015260600190565b6020808252600f908201526e1d1c985b9cd9995c8819985a5b1959608a1b604082015260600190565b60006001600160401b03821115613487576134876135a3565b5060051b60200190565b600082198211156134a4576134a461358d565b500190565b6000826134c457634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156134e3576134e361358d565b500290565b6000828210156134fa576134fa61358d565b500390565b60005b8381101561351a578181015183820152602001613502565b83811115613529576000848401525b50505050565b60008161353e5761353e61358d565b506000190190565b601f8201601f191681016001600160401b038111828210171561356b5761356b6135a3565b6040525050565b60006000198214156135865761358661358d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156125d257600481823e5160e01c90565b600060443d10156135e0576125d2565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156136115750505050506125d2565b828501915081518181111561362b575050505050506125d2565b843d8701016020828501011115613647575050505050506125d2565b61365660208286010187613546565b509094505050505090565b6001600160a01b0381168114612bc057600080fdfea26469706673582212206ba1db34f1ede7192722a883ffa9b32a8041aaf88ccc73641b26947c347eceda64736f6c63430008030033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000053b217e1f76925b3afd4a0d3ce0dd8e11a822846000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f000000000000000000000000c50256c57445776054d3780286b650e83157f0ce
-----Decoded View---------------
Arg [0] : _nftContractAddress (address): 0x53b217E1f76925b3AFD4A0d3cE0dD8e11A822846
Arg [1] : _maxMintsPerTx (uint256): 10
Arg [2] : _ethRecipient (address): 0x82F9d5FE6C46990f3C2536e83b2B4e1c0a91F27f
Arg [3] : _feeRecipient (address): 0x82F9d5FE6C46990f3C2536e83b2B4e1c0a91F27f
Arg [4] : _contractOwner (address): 0x82F9d5FE6C46990f3C2536e83b2B4e1c0a91F27f
Arg [5] : _verifier (address): 0xC50256c57445776054d3780286B650E83157f0Ce
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 00000000000000000000000053b217e1f76925b3afd4a0d3ce0dd8e11a822846
Arg [1] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [2] : 00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f
Arg [3] : 00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f
Arg [4] : 00000000000000000000000082f9d5fe6c46990f3c2536e83b2b4e1c0a91f27f
Arg [5] : 000000000000000000000000c50256c57445776054d3780286b650e83157f0ce
Loading...
Loading
Loading...
Loading
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.