Feature Tip: Add private address tag to any address under My Name Tag !
ERC-1155
Overview
Max Total Supply
1,112 MANUSCRIPT
Holders
1,009
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Manuscript
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 500 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // Developed by Thanic® Tech Labs pragma solidity ^0.8.9; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "../KahiruMK.sol"; import "./KahiruStaking.sol"; import "./AbstractERC1155Factory.sol"; contract Manuscript is AbstractERC1155Factory{ NFTStaking staking; KahiruF NFT; uint256 constant MAX_SUPPLY = 7222; uint8 maxPerWallet = 1; uint8 maxPerTx = 1; mapping(address => bool) wlcontrollers; mapping(address => bool) controllers; mapping(address => uint256) public purchaseTxs; event Purchased(uint256 indexed index, address indexed account, uint256 amount); constructor( string memory _name, string memory _symbol, string memory _uri, KahiruF _nft, NFTStaking _staking ) ERC1155(_uri){ name_ = _name; symbol_ = _symbol; staking = _staking; NFT = _nft; } function purchase(uint256 tokenId) external payable whenNotPaused { require(purchaseTxs[msg.sender] < maxPerWallet , "max wallet amount exceeded"); address owner1 = NFT.ownerDetails(tokenId).addr; uint64 timeHold = NFT.ownerDetails(tokenId).startTimestamp; (, uint48 timeStake , , address owner2, ) = staking.vault(tokenId); require(owner1 == msg.sender || owner2 == msg.sender, "You are not the owner"); uint256 dif1 = block.timestamp - timeHold; uint256 dif2 = block.timestamp - timeStake; if(timeStake != 0){ if (dif1 > 2592000 || dif2 > 2592000){ _purchase(1); } else{ uint256 restante = 0; if(dif1 > dif2){ restante = 2592000 - dif1; revert("You dont hold or stake for more than 30 days"); } else{ restante = 2592000 - dif2; revert("You dont hold or stake for more than 30 days"); } } } if(timeStake == 0){ if(timeHold != 0){ if (dif1 > 2592000){ _purchase(1); } else{ uint256 restante = 0; restante = 2592000 - dif1; revert("You dont hold or stake for more than 30 days"); } } else{ uint256 restante = 0; if(dif1 > dif2){ restante = 2592000 - dif1; revert("You dont hold or stake for more than 30 days"); } else{ restante = 2592000 - dif2; revert("You dont hold or stake for more than 30 days"); } } } } function purchaseController(uint256 _ammount) external payable whenNotPaused { require(controllers[msg.sender], "Only controllers can call this function"); _purchase(_ammount); } function purchaseExcepts() external payable whenNotPaused { require(wlcontrollers[msg.sender], "Only controllers can call this function"); _purchase(1); wlcontrollers[msg.sender] = false; } function earningInfo(uint256 tokenId) external view returns (uint256 total, bool permission) { address owner1 = NFT.ownerDetails(tokenId).addr; uint64 timeHold = NFT.ownerDetails(tokenId).startTimestamp; (, uint48 timeStake , , address owner2, ) = staking.vault(tokenId); uint256 dif1 = block.timestamp - timeHold; uint256 dif2 = block.timestamp - timeStake; if(timeStake != 0){ if (dif1 > 2592000 || dif2 > 2592000){ return(0, true); } else{ uint256 restante = 0; if(dif1 > dif2){ restante = 2592000 - dif1; return(restante, false); } else{ restante = 2592000 - dif2; return(restante, false); } } } if(timeStake == 0){ if(timeHold != 0){ if (dif1 > 2592000){ return(0, true); } else{ uint256 restante = 0; restante = 2592000 - dif1; return(restante, false); } } else{ uint256 restante = 0; if(dif1 > dif2){ restante = 2592000 - dif1; return(restante, false); } else{ restante = 2592000 - dif2; return(restante, false); } } } } function Stakedinfo(uint256 tokenId) external view returns (uint256 total1, uint256 total2, bool permission) { address owner1 = NFT.ownerDetails(tokenId).addr; uint64 timeHold = NFT.ownerDetails(tokenId).startTimestamp; (, uint48 timeStake , , address owner2, ) = staking.vault(tokenId); uint256 dif1 = block.timestamp - timeHold; uint256 dif2 = block.timestamp - timeStake; return(dif1, dif2, true); } function _purchase(uint256 amount) private { require(totalSupply(0) + amount <= MAX_SUPPLY, "Purchase: Max supply reached"); purchaseTxs[msg.sender] += 1; _mint(msg.sender, 0, amount, ""); emit Purchased(0, msg.sender, amount); } function burn( address account, uint256 id, uint256 value ) public virtual override { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual override { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burnBatch(account, ids, values); } function uri(uint256 _id) public view override returns (string memory) { require(exists(_id), "URI: nonexistent token"); return string(abi.encodePacked(super.uri(_id), Strings.toString(_id))); } function addController(address controller) external onlyOwner { controllers[controller] = true; } function removeController(address controller) external onlyOwner { controllers[controller] = false; } function addWlController(address controller) external onlyOwner { wlcontrollers[controller] = true; } function removeWlController(address controller) external onlyOwner { wlcontrollers[controller] = false; } // ROYALTIES // function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount) { return (address(this), (salePrice * 650) / 10000); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol'; abstract contract AbstractERC1155Factory is Pausable, ERC1155Supply, ERC1155Burnable, Ownable { string name_; string symbol_; function pause() external onlyOwner { _pause(); } function unpause() external onlyOwner { _unpause(); } function setURI(string memory baseURI) external onlyOwner { _setURI(baseURI); } function name() public view returns (string memory) { return name_; } function symbol() public view returns (string memory) { return symbol_; } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override(ERC1155, ERC1155Supply) { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); } }
// SPDX-License-Identifier: MIT LICENSE // Developed by Thanic® Tech Labs pragma solidity 0.8.9; import "./StoneParticles.sol"; import "../KahiruMK.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract NFTStaking is Ownable, IERC721Receiver { uint256 public totalStaked; struct Stake { uint24 tokenId; uint48 timestamp; uint256 cycles; address owner; uint8 rarity; } event NFTStaked(address owner, uint256 tokenId, uint256 value); event NFTUnstaked(address owner, uint256 tokenId, uint256 value); event Claimed(address owner, uint256 amount); KahiruF nft; StoneParticles token; mapping(uint256 => Stake) public vault; mapping(bytes => bool) public signatureUsed; constructor(KahiruF _nft, StoneParticles _token) { nft = _nft; token = _token; } function stake(uint256[] calldata tokenIds,uint8[] calldata rarity, bytes32 hash, bytes memory signature) external { require(recoverSigner(hash, signature), "Sign not valid"); require(!signatureUsed[signature], "Signature has already been used."); uint256 tokenId; totalStaked += tokenIds.length; for (uint i = 0; i < tokenIds.length; i++) { tokenId = tokenIds[i]; require(nft.ownerOf(tokenId) == msg.sender, "not your token"); require(vault[tokenId].tokenId == 0, 'already staked'); nft.transferFrom(msg.sender, address(this), tokenId); emit NFTStaked(msg.sender, tokenId, block.timestamp); vault[tokenId] = Stake({ owner: msg.sender, tokenId: uint24(tokenId), cycles: 0, timestamp: uint48(block.timestamp), rarity: rarity[i] }); } signatureUsed[signature] = true; } function _unstakeMany(address account, uint256[] calldata tokenIds) internal { uint256 tokenId; totalStaked -= tokenIds.length; for (uint i = 0; i < tokenIds.length; i++) { tokenId = tokenIds[i]; Stake memory staked = vault[tokenId]; require(staked.owner == msg.sender, "not an owner"); delete vault[tokenId]; emit NFTUnstaked(account, tokenId, block.timestamp); nft.transferFrom(address(this), account, tokenId); } } function claim(uint256[] calldata tokenIds) external { _claim(msg.sender, tokenIds, false); } function claimForAddress(address account, uint256[] calldata tokenIds) external { _claim(account, tokenIds, false); } function unstake(uint256[] calldata tokenIds) external { _claim(msg.sender, tokenIds, true); } function _claim(address account, uint256[] calldata tokenIds, bool _unstake) internal{ uint256 tokenId; uint256 earned = 0; uint256 withdraw = 0; uint256 _cycles = 0; uint256 bonus = 0; uint256 ammount = 0; uint256 rarityrewards = 0; for (uint i = 0; i < tokenIds.length; i++) { tokenId = tokenIds[i]; Stake memory staked = vault[tokenId]; require(staked.owner == account, "not an owner"); uint256 stakedAt = staked.timestamp; _cycles = ((block.timestamp - stakedAt) / 86400); staked.cycles = _cycles; ammount = 7 * _cycles; rarityrewards = _cycles/7; if (staked.rarity == 0){ bonus = 2 * rarityrewards; } if (staked.rarity == 1){ bonus = 5 * rarityrewards; } if (staked.rarity == 2){ bonus = 15 * rarityrewards; } withdraw = withdraw + ammount + bonus; } earned = withdraw * (1 ether); if (earned > 0) { token.mint(account, earned); } if (_unstake) { _unstakeMany(account, tokenIds); } emit Claimed(account, earned); } function earningInfo(address account, uint256[] calldata tokenIds) external view returns (uint256[1] memory info, uint256 cycles, uint256 total) { uint256 tokenId; uint256 earned = 0; uint256 withdraw = 0; uint256 _cycles = 0; uint256 bonus = 0; uint256 ammount = 0; uint256 rarityrewards = 0; for (uint i = 0; i < tokenIds.length; i++) { tokenId = tokenIds[i]; Stake memory staked = vault[tokenId]; require(staked.owner == account, "not an owner"); uint256 stakedAt = staked.timestamp; _cycles = ((block.timestamp - stakedAt) / 86400); staked.cycles = _cycles; ammount = 7 * _cycles; rarityrewards = _cycles/7; if (staked.rarity == 0){ bonus = 2 * rarityrewards; } if (staked.rarity == 1){ bonus = 5 * rarityrewards; } if (staked.rarity == 2){ bonus = 15 * rarityrewards; } withdraw = withdraw + ammount + bonus; } earned = withdraw * (1 ether); if (earned > 0) { return ([earned],_cycles, bonus); } } function balanceOf(address account) public view returns (uint256) { uint256 balance = 0; uint256 supply = nft.totalSupply(); for(uint i = 0; i <= supply; i++) { if (vault[i].owner == account) { balance += 1; } } return balance; } function tokensOfOwner(address account) public view returns (uint256[] memory ownerTokens) { uint256 supply = nft.totalSupply(); uint256[] memory tmp = new uint256[](supply); uint256 index = 0; for(uint tokenId = 0; tokenId <= supply; tokenId++) { if (vault[tokenId].owner == account) { tmp[index] = vault[tokenId].tokenId; index +=1; } } uint256[] memory tokens = new uint256[](index); for(uint i = 0; i < index; i++) { tokens[i] = tmp[i]; } return tokens; } function recoverSigner(bytes32 hash, bytes memory signature) private pure returns (bool) { bytes32 messageDigest = keccak256( abi.encodePacked( "\x19Ethereum Signed Message:\n32", hash ) ); if (ECDSA.recover(messageDigest, signature) == 0x0aC6119362e892aeA0025BF00182CaD3673A9c79){ return true; } else{ return false; } } function divide(uint256 uno) public pure returns (uint256) { uint division = uno / 20; return division; } function onERC721Received( address, address from, uint256, bytes calldata ) external pure override returns (bytes4) { require(from == address(0x0), "Cannot send nfts to Vault directly"); return IERC721Receiver.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/utils/Counters.sol'; import 'erc721a/contracts/ERC721A.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol'; contract KahiruF is ERC721A, ReentrancyGuard, Ownable { using Counters for Counters.Counter; using Address for address; using ECDSA for bytes32; // Starting and stopping sale // Empezar y parar etapas bool public saleActive = false; bool public whitelistActive = false; bool public raffleActive = false; // Reserved for the team, customs, giveaways, collabs and so on // Reservado para equipo y otros uint256 public reserved = 222; // Price of each token // Precio inicial mint uint256 public Wl_price = 0.12 ether; // Price of Whitelisted Mints uint256 public Raffle_price = 0.14 ether; // Price of Raffled Mints // Public Sale Key // Key para verificación extra string publicKey; // Will change to hash instead of int // Maximum limit of tokens that can ever exist // Número de Tokens mapping(address => uint256) private mintCountMap; mapping(address => uint256) private allowedMintCountMap; uint256 public constant MAX_SUPPLY = 7222; uint256 public constant MAX_WL_SUPPLY = 5000; uint256 public constant MINT_LIMIT_PER_WALLET = 1; function max(uint256 a, uint256 b) private pure returns (uint256) { return a >= b ? a : b; } function allowedMintCount(address minter) public view returns (uint256) { if (saleActive || whitelistActive || raffleActive) { return ( max(allowedMintCountMap[minter], MINT_LIMIT_PER_WALLET) - mintCountMap[minter] ); } return allowedMintCountMap[minter] - mintCountMap[minter]; } function updateMintCount(address minter, uint256 count) private { mintCountMap[minter] += count; } // The base link that leads to the image / video of the token // URL del arte-metadata //string public baseTokenURI = "https://api.kahiru.io/"; string public baseTokenURI = "https://www.721.so/api/example/metadata/"; // Team addresses for withdrawals // Carteras de retirada de balance address public a1; // List of addresses that have a number of reserved tokens for whitelist // Lista de direcciones para Whitelist y Raffle bytes32 private _whitelistMerkleRoot = 0xa55ed0edb0fc32171feb79ad2dc5b1551a4765612ce344057f1166c7ddcb7111; bytes32 private _whitelistNeutralMerkleRoot = 0x52551a51441048412a12edf749d65363e41af37ba1969a62caba0e45e39792bf; bytes32 private _raffleMerkleRoot = 0x420041bc817938d28f6ec183b5057d7189de1a99a5b6d3f6b33980a92b153d06; constructor () ERC721A ("Kahiru", "KAHIRU") { } // Override so the openzeppelin tokenURI() method will use this method to create the full tokenURI instead // Reemplazar URI function _baseURI() internal view virtual override returns (string memory) { return baseTokenURI; } // Exclusive whitelist minting // Función mint con Whitelist Counters.Counter private supplyCounter; function mintWhitelist(bytes32[] memory proof, string memory _pass) public payable nonReentrant { uint256 quantity = 1; uint256 supply = totalSupply(); require( whitelistActive, "Whitelist isn't active" ); require( MerkleProof.verify( proof, _whitelistMerkleRoot, keccak256(abi.encodePacked(msg.sender)) ), "Whitelist validation failed" ); require( keccak256(abi.encodePacked(publicKey)) == keccak256(abi.encodePacked(_pass)), "Key error"); // Key verifying web3 call // Key que "Verifica" la llamada al contract desde la web3 require( supply + quantity <= MAX_WL_SUPPLY, "Can't mint more than WL supply" ); require( supply + quantity <= MAX_SUPPLY, "Can't mint more than max supply" ); require( msg.value == Wl_price * quantity, "Wrong amount of ETH sent" ); if (allowedMintCount(msg.sender) >= 1) { updateMintCount(msg.sender, 1); } else { revert("Minting limit exceeded"); } _safeMint( msg.sender, quantity); } // Exclusive Neutral whitelist minting // Función mint con Neutral Whitelist function mintNeutralWhitelist(bytes32[] memory proof, uint256 quantity, string memory _pass) public payable nonReentrant { uint256 supply = totalSupply(); require( whitelistActive, "Whitelist isn't active" ); require( MerkleProof.verify( proof, _whitelistNeutralMerkleRoot, keccak256(abi.encodePacked(msg.sender)) ), "Neutral Whitelist validation failed" ); require( keccak256(abi.encodePacked(publicKey)) == keccak256(abi.encodePacked(_pass)), "Key error"); // Key verifying web3 call // Key que "Verifica" la llamada al contract desde la web3 require( quantity > 0, "Can't mint less than one" ); require( quantity <= 2, "Can't mint more than reserved" ); require( supply + quantity <= MAX_WL_SUPPLY, "Can't mint more than WL supply" ); require( supply + quantity <= MAX_SUPPLY, "Can't mint more than max supply" ); require( msg.value == Wl_price * quantity, "Wrong amount of ETH sent" ); if (allowedMintCount(msg.sender) >= 1) { updateMintCount(msg.sender, 1); } else { revert("Minting limit exceeded"); } _safeMint( msg.sender, quantity); } // Exclusive raffle minting // Función mint con Whitelist function mintRafflelist(bytes32[] memory proof, string memory _pass) public payable nonReentrant { uint256 quantity = 1; uint256 supply = totalSupply(); require( raffleActive, "Raffle isn't active" ); require( MerkleProof.verify( proof, _raffleMerkleRoot, keccak256(abi.encodePacked(msg.sender)) ), "Raffle validation failed" ); require( keccak256(abi.encodePacked(publicKey)) == keccak256(abi.encodePacked(_pass)), "Key error"); // Key verifying web3 call // Key que "Verifica" la llamada al contract desde la web3 require( supply + quantity <= MAX_SUPPLY-reserved, "Can't mint more than max supply" ); require( msg.value == Raffle_price * quantity, "Wrong amount of ETH sent" ); if (allowedMintCount(msg.sender) >= 1) { updateMintCount(msg.sender, 1); } else { revert("Minting limit exceeded"); } _safeMint( msg.sender, quantity); } // Standard mint function // Mint normal sin restricción de dirección function mintToken() public payable nonReentrant { uint256 supply = totalSupply(); require( saleActive, "Sale isn't active" ); require( msg.value >= Raffle_price, "Wrong amount of ETH sent" ); require( supply + 1 <= MAX_SUPPLY, "Can't mint more than max supply" ); _safeMint( msg.sender, 1 ); } // Admin minting function to reserve tokens for the team, collabs, customs and giveaways // Función de minteo de los admins function mintReserved(uint256 quantity) public onlyOwner { // Limited to a publicly set amount uint256 supply = totalSupply(); require( quantity <= reserved, "Can't reserve more than set amount" ); require( supply + quantity <= MAX_SUPPLY, "Can't mint more than max supply" ); reserved -= quantity; _safeMint( msg.sender, quantity ); } function setMerkleRaffle(bytes32 root1) public onlyOwner { _raffleMerkleRoot = root1; } function setMerkleWL(bytes32 root2) public onlyOwner { _whitelistMerkleRoot = root2; } function setMerkleWN(bytes32 root3) public onlyOwner { _whitelistNeutralMerkleRoot = root3; } // Start and stop whitelist // Función que activa y desactiva el minteo por Whitelist function setWhitelistActive(bool val) public onlyOwner { whitelistActive = val; } // Start and stop raffle // Función que activa y desactiva el minteo por Raffle function setRaffleActive(bool val) public onlyOwner { raffleActive = val; } // Start and stop sale // Función que activa y desactiva el minteo por venta genérica function setSaleActive(bool val) public onlyOwner { saleActive = val; } // Set new baseURI // Función para setear baseURI function setBaseURI(string memory baseURI) public onlyOwner { baseTokenURI = baseURI; } // Set public key // Función para cambio de key publica function setPublicKey(string memory newKey) public onlyOwner { publicKey = newKey; } function setWithdrawAdress(address ledger) external onlyOwner nonReentrant { a1 = ledger; } function withdrawMoney() external onlyOwner nonReentrant { (bool success, ) = a1.call{value: address(this).balance}(""); require(success, "Transfer failed."); } function ownerDetails(uint256 tokenId) external view returns (TokenOwnership memory) { return _ownerships[tokenId]; } // ROYALTIES // function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount) { return (address(this), (salePrice * 600) / 10000); } } // Developed by Thanic® Tech Labs
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = _efficientHash(computedHash, proofElement); } else { // Hash(current element of the proof + current computed hash) computedHash = _efficientHash(proofElement, computedHash); } } return computedHash; } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * 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; /** * @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 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 the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @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 = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 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 Message, created from `s`. 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(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @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 LICENSE // Developed by Thanic® Tech Labs pragma solidity 0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; contract StoneParticles is ERC20, ERC20Burnable, Ownable { mapping(address => bool) controllers; constructor() ERC20("Stone Particles", "SP") { } function mint(address to, uint256 amount) external { require(controllers[msg.sender], "Only controllers can mint"); _mint(to, amount); } function burnFrom(address account, uint256 amount) public override { if (controllers[msg.sender]) { _burn(account, amount); } else { super.burnFrom(account, amount); } } function addController(address controller) external onlyOwner { controllers[controller] = true; } function transfer(address to, uint tokens) onlyOwner public override returns (bool success) { require(controllers[msg.sender], "Only controllers can transfer"); emit Transfer(msg.sender, to, tokens); return true; } function transferFrom(address from, address to, uint tokens) onlyOwner public override returns (bool success) { require(controllers[msg.sender], "Only controllers can transfer"); emit Transfer(from, to, tokens); return true; } function removeController(address controller) external onlyOwner { controllers[controller] = false; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155Supply.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of ERC1155 that adds tracking of total supply per id. * * Useful for scenarios where Fungible and Non-fungible tokens have to be * clearly identified. Note: While a totalSupply of 1 might mean the * corresponding is an NFT, there is no guarantees that no other token with the * same id are not going to be minted. */ abstract contract ERC1155Supply is ERC1155 { mapping(uint256 => uint256) private _totalSupply; /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Indicates whether any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return ERC1155Supply.totalSupply(id) > 0; } /** * @dev See {ERC1155-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); if (from == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; } } if (to == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 supply = _totalSupply[id]; require(supply >= amount, "ERC1155: burn amount exceeds totalSupply"); unchecked { _totalSupply[id] = supply - amount; } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155Burnable is ERC1155 { function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burnBatch(account, ids, values); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library 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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev 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 // Creator: Chiru Labs pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/utils/Context.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/utils/introspection/ERC165.sol'; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerQueryForNonexistentToken(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error URIQueryForNonexistentToken(); /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } // The tokenId of the next token to be minted. uint256 internal _currentIndex; // The number of tokens burned. uint256 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens. */ function totalSupply() public view returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex - _startTokenId() times unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to _startTokenId() unchecked { return _currentIndex - _startTokenId(); } } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberMinted); } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberBurned); } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return _addressData[owner].aux; } /** * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal { _addressData[owner].aux = aux; } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr && curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _ownershipOf(tokenId).addr; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ERC721A.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSender()) revert ApproveToCaller(); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { _transfer(from, to, tokenId); if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; } function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { _mint(to, quantity, _data, true); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (safe && to.isContract()) { do { emit Transfer(address(0), to, updatedIndex); if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex != end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex != end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = to; currSlot.startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev This is equivalent to _burn(tokenId, false) */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); address from = prevOwnership.addr; if (approvalCheck) { bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { AddressData storage addressData = _addressData[from]; addressData.balance -= 1; addressData.numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = from; currSlot.startTimestamp = uint64(block.timestamp); currSlot.burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol) pragma solidity ^0.8.0; import "../ERC20.sol"; import "../../../utils/Context.sol"; /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { _spendAllowance(account, _msgSender(), amount); _burn(account, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, 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); _afterTokenTransfer(operator, from, to, ids, amounts, data); _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); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after 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 _afterTokenTransfer( 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 // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: 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. * * NOTE: 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); }
{ "optimizer": { "enabled": true, "runs": 500 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"contract KahiruF","name":"_nft","type":"address"},{"internalType":"contract NFTStaking","name":"_staking","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Purchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Stakedinfo","outputs":[{"internalType":"uint256","name":"total1","type":"uint256"},{"internalType":"uint256","name":"total2","type":"uint256"},{"internalType":"bool","name":"permission","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"addController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"addWlController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"earningInfo","outputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"bool","name":"permission","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ammount","type":"uint256"}],"name":"purchaseController","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"purchaseExcepts","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"purchaseTxs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"removeController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"removeWlController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526009805461ffff60a01b191661010160a01b1790553480156200002657600080fd5b5060405162003b4638038062003b468339810160408190526200004991620002c7565b6000805460ff19169055826200005f81620000d0565b506200006b33620000e9565b8451620000809060069060208801906200013b565b508351620000969060079060208701906200013b565b50600880546001600160a01b039283166001600160a01b0319918216179091556009805493909216921691909117905550620003c2915050565b8051620000e59060039060208401906200013b565b5050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001499062000385565b90600052602060002090601f0160209004810192826200016d5760008555620001b8565b82601f106200018857805160ff1916838001178555620001b8565b82800160010185558215620001b8579182015b82811115620001b85782518255916020019190600101906200019b565b50620001c6929150620001ca565b5090565b5b80821115620001c65760008155600101620001cb565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200020957600080fd5b81516001600160401b0380821115620002265762000226620001e1565b604051601f8301601f19908116603f01168101908282118183101715620002515762000251620001e1565b816040528381526020925086838588010111156200026e57600080fd5b600091505b8382101562000292578582018301518183018401529082019062000273565b83821115620002a45760008385830101525b9695505050505050565b6001600160a01b0381168114620002c457600080fd5b50565b600080600080600060a08688031215620002e057600080fd5b85516001600160401b0380821115620002f857600080fd5b6200030689838a01620001f7565b965060208801519150808211156200031d57600080fd5b6200032b89838a01620001f7565b955060408801519150808211156200034257600080fd5b506200035188828901620001f7565b93505060608601516200036481620002ae565b60808701519092506200037781620002ae565b809150509295509295909350565b600181811c908216806200039a57607f821691505b60208210811415620003bc57634e487b7160e01b600052602260045260246000fd5b50919050565b61377480620003d26000396000f3fe6080604052600436106101e25760003560e01c80638da5cb5b11610102578063e4048fc611610095578063f2fde38b11610064578063f2fde38b146105d3578063f5298aca146105f3578063f6a74ed714610613578063f86850301461063357600080fd5b8063e4048fc61461054f578063e985e9c514610557578063efef39a1146105a0578063f242432a146105b357600080fd5b8063a7fc7a07116100d1578063a7fc7a07146104a5578063b57a9d36146104c5578063bd85b03914610502578063d4feeebd1461052f57600080fd5b80638da5cb5b1461041357806395d89b411461043b578063987e659514610450578063a22cb4651461048557600080fd5b80633f4ba83a1161017a5780636b20c454116101495780636b20c454146103a9578063715018a6146103c95780637f034b5c146103de5780638456cb59146103fe57600080fd5b80633f4ba83a146103205780634e1273f4146103355780634f558e79146103625780635c975abb1461039157600080fd5b80630e89341c116101b65780630e89341c1461028e5780632152ac10146102ae5780632a55205a146102c15780632eb2c2d61461030057600080fd5b8062fdd58e146101e757806301ffc9a71461021a57806302fe53051461024a57806306fdde031461026c575b600080fd5b3480156101f357600080fd5b50610207610202366004612d33565b610660565b6040519081526020015b60405180910390f35b34801561022657600080fd5b5061023a610235366004612d75565b6106f9565b6040519015158152602001610211565b34801561025657600080fd5b5061026a610265366004612e3a565b61074b565b005b34801561027857600080fd5b5061028161079f565b6040516102119190612edb565b34801561029a57600080fd5b506102816102a9366004612eee565b610831565b61026a6102bc366004612eee565b6108c8565b3480156102cd57600080fd5b506102e16102dc366004612f07565b610986565b604080516001600160a01b039093168352602083019190915201610211565b34801561030c57600080fd5b5061026a61031b366004612fde565b6109ae565b34801561032c57600080fd5b5061026a610a50565b34801561034157600080fd5b5061035561035036600461308c565b610aa2565b6040516102119190613194565b34801561036e57600080fd5b5061023a61037d366004612eee565b600090815260046020526040902054151590565b34801561039d57600080fd5b5060005460ff1661023a565b3480156103b557600080fd5b5061026a6103c43660046131a7565b610bcc565b3480156103d557600080fd5b5061026a610c56565b3480156103ea57600080fd5b5061026a6103f936600461321d565b610ca8565b34801561040a57600080fd5b5061026a610d11565b34801561041f57600080fd5b506005546040516001600160a01b039091168152602001610211565b34801561044757600080fd5b50610281610d61565b34801561045c57600080fd5b5061047061046b366004612eee565b610d70565b60408051928352901515602083015201610211565b34801561049157600080fd5b5061026a6104a0366004613248565b610ff2565b3480156104b157600080fd5b5061026a6104c036600461321d565b611001565b3480156104d157600080fd5b506104e56104e0366004612eee565b61106d565b604080519384526020840192909252151590820152606001610211565b34801561050e57600080fd5b5061020761051d366004612eee565b60009081526004602052604090205490565b34801561053b57600080fd5b5061026a61054a36600461321d565b611244565b61026a6112b0565b34801561056357600080fd5b5061023a610572366004613281565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b61026a6105ae366004612eee565b611388565b3480156105bf57600080fd5b5061026a6105ce3660046132af565b611770565b3480156105df57600080fd5b5061026a6105ee36600461321d565b6117f7565b3480156105ff57600080fd5b5061026a61060e366004613318565b6118ad565b34801561061f57600080fd5b5061026a61062e36600461321d565b611932565b34801561063f57600080fd5b5061020761064e36600461321d565b600c6020526000908152604090205481565b60006001600160a01b0383166106d15760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060009081526001602090815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061072a57506001600160e01b031982166303a24d0760e21b145b8061074557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6005546001600160a01b031633146107935760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b61079c8161199b565b50565b6060600680546107ae9061334d565b80601f01602080910402602001604051908101604052809291908181526020018280546107da9061334d565b80156108275780601f106107fc57610100808354040283529160200191610827565b820191906000526020600020905b81548152906001019060200180831161080a57829003601f168201915b5050505050905090565b60008181526004602052604090205460609061088f5760405162461bcd60e51b815260206004820152601660248201527f5552493a206e6f6e6578697374656e7420746f6b656e0000000000000000000060448201526064016106c8565b610898826119ae565b6108a183611a42565b6040516020016108b2929190613388565b6040516020818303038152906040529050919050565b60005460ff161561090e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106c8565b336000908152600b602052604090205460ff1661097d5760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920636f6e74726f6c6c6572732063616e2063616c6c207468697320666044820152663ab731ba34b7b760c91b60648201526084016106c8565b61079c81611b60565b600080306127106109998561028a6133cd565b6109a39190613402565b915091509250929050565b6001600160a01b0385163314806109ca57506109ca8533610572565b610a3c5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f766564000000000000000000000000000060648201526084016106c8565b610a498585858585611c66565b5050505050565b6005546001600160a01b03163314610a985760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b610aa0611ed5565b565b60608151835114610b075760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016106c8565b6000835167ffffffffffffffff811115610b2357610b23612d99565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060005b8451811015610bc457610b97858281518110610b7057610b70613416565b6020026020010151858381518110610b8a57610b8a613416565b6020026020010151610660565b828281518110610ba957610ba9613416565b6020908102919091010152610bbd8161342c565b9050610b52565b509392505050565b6001600160a01b038316331480610be85750610be88333610572565b610c465760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016106c8565b610c51838383611f71565b505050565b6005546001600160a01b03163314610c9e5760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b610aa060006121cb565b6005546001600160a01b03163314610cf05760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6005546001600160a01b03163314610d595760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b610aa061222a565b6060600780546107ae9061334d565b600954604051633e4f418960e11b815260048101839052600091829182916001600160a01b031690637c9e83129060240160606040518083038186803b158015610db957600080fd5b505afa158015610dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df19190613447565b51600954604051633e4f418960e11b8152600481018790529192506000916001600160a01b0390911690637c9e83129060240160606040518083038186803b158015610e3c57600080fd5b505afa158015610e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e749190613447565b602001516008546040516340d1b7db60e11b81526004810188905291925060009182916001600160a01b0316906381a36fb69060240160a06040518083038186803b158015610ec257600080fd5b505afa158015610ed6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efa91906134c5565b5093505092505060008367ffffffffffffffff1642610f199190613549565b90506000610f2f65ffffffffffff851642613549565b905065ffffffffffff841615610f9e5762278d00821180610f52575062278d0081115b15610f695750600098600198509650505050505050565b600081831115610f9157610f808362278d00613549565b9a60009a5098505050505050505050565b610f808262278d00613549565b65ffffffffffff8416610fe75767ffffffffffffffff851615610f695762278d00821115610fd85750600098600198509650505050505050565b6000610f808362278d00613549565b505050505050915091565b610ffd3383836122a5565b5050565b6005546001600160a01b031633146110495760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b6001600160a01b03166000908152600b60205260409020805460ff19166001179055565b600954604051633e4f418960e11b8152600481018390526000918291829182916001600160a01b0390911690637c9e83129060240160606040518083038186803b1580156110ba57600080fd5b505afa1580156110ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f29190613447565b51600954604051633e4f418960e11b8152600481018890529192506000916001600160a01b0390911690637c9e83129060240160606040518083038186803b15801561113d57600080fd5b505afa158015611151573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111759190613447565b602001516008546040516340d1b7db60e11b81526004810189905291925060009182916001600160a01b0316906381a36fb69060240160a06040518083038186803b1580156111c357600080fd5b505afa1580156111d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111fb91906134c5565b5093505092505060008367ffffffffffffffff164261121a9190613549565b9050600061123065ffffffffffff851642613549565b919a91995060019850909650505050505050565b6005546001600160a01b0316331461128c5760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b6001600160a01b03166000908152600a60205260409020805460ff19166001179055565b60005460ff16156112f65760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106c8565b336000908152600a602052604090205460ff166113655760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920636f6e74726f6c6c6572732063616e2063616c6c207468697320666044820152663ab731ba34b7b760c91b60648201526084016106c8565b61136f6001611b60565b336000908152600a60205260409020805460ff19169055565b60005460ff16156113ce5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106c8565b600954336000908152600c6020526040902054600160a01b90910460ff16116114395760405162461bcd60e51b815260206004820152601a60248201527f6d61782077616c6c657420616d6f756e7420657863656564656400000000000060448201526064016106c8565b600954604051633e4f418960e11b8152600481018390526000916001600160a01b031690637c9e83129060240160606040518083038186803b15801561147e57600080fd5b505afa158015611492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b69190613447565b51600954604051633e4f418960e11b8152600481018590529192506000916001600160a01b0390911690637c9e83129060240160606040518083038186803b15801561150157600080fd5b505afa158015611515573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115399190613447565b602001516008546040516340d1b7db60e11b81526004810186905291925060009182916001600160a01b0316906381a36fb69060240160a06040518083038186803b15801561158757600080fd5b505afa15801561159b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bf91906134c5565b50935050925050336001600160a01b0316846001600160a01b031614806115ee57506001600160a01b03811633145b61163a5760405162461bcd60e51b815260206004820152601560248201527f596f7520617265206e6f7420746865206f776e6572000000000000000000000060448201526064016106c8565b600061165067ffffffffffffffff851642613549565b9050600061166665ffffffffffff851642613549565b905065ffffffffffff8416156117215762278d00821180611689575062278d0081115b1561169d576116986001611b60565b611721565b600081831115611714576116b48362278d00613549565b60405162461bcd60e51b815260206004820152602c60248201527f596f7520646f6e7420686f6c64206f72207374616b6520666f72206d6f72652060448201526b7468616e203330206461797360a01b60648201529091506084016106c8565b6116b48262278d00613549565b65ffffffffffff84166117675767ffffffffffffffff85161561169d5762278d00821115611758576117536001611b60565b611767565b60006116b48362278d00613549565b50505050505050565b6001600160a01b03851633148061178c575061178c8533610572565b6117ea5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016106c8565b610a498585858585612386565b6005546001600160a01b0316331461183f5760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b6001600160a01b0381166118a45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106c8565b61079c816121cb565b6001600160a01b0383163314806118c957506118c98333610572565b6119275760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016106c8565b610c51838383612543565b6005546001600160a01b0316331461197a5760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b6001600160a01b03166000908152600b60205260409020805460ff19169055565b8051610ffd906003906020840190612c85565b6060600380546119bd9061334d565b80601f01602080910402602001604051908101604052809291908181526020018280546119e99061334d565b8015611a365780601f10611a0b57610100808354040283529160200191611a36565b820191906000526020600020905b815481529060010190602001808311611a1957829003601f168201915b50505050509050919050565b606081611a665750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611a905780611a7a8161342c565b9150611a899050600a83613402565b9150611a6a565b60008167ffffffffffffffff811115611aab57611aab612d99565b6040519080825280601f01601f191660200182016040528015611ad5576020820181803683370190505b5090505b8415611b5857611aea600183613549565b9150611af7600a86613560565b611b02906030613574565b60f81b818381518110611b1757611b17613416565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611b51600a86613402565b9450611ad9565b949350505050565b6000805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec54611c3690611b9a908390613574565b1115611be85760405162461bcd60e51b815260206004820152601c60248201527f50757263686173653a204d617820737570706c7920726561636865640000000060448201526064016106c8565b336000908152600c60205260408120805460019290611c08908490613574565b92505081905550611c2b33600083604051806020016040528060008152506126d7565b60405181815233906000907ffd51b2c9f55c42d2b72ac683526519563be02fc0107f034ff430c05185ff1b669060200160405180910390a350565b8151835114611cc85760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016106c8565b6001600160a01b038416611d2c5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016106c8565b33611d3b8187878787876127f3565b60005b8451811015611e67576000858281518110611d5b57611d5b613416565b602002602001015190506000858381518110611d7957611d79613416565b60209081029190910181015160008481526001835260408082206001600160a01b038e168352909352919091205490915081811015611e0d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016106c8565b60008381526001602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611e4c908490613574565b9250508190555050505080611e609061342c565b9050611d3e565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611eb792919061358c565b60405180910390a4611ecd818787878787612801565b505050505050565b60005460ff16611f275760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016106c8565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038316611fd35760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016106c8565b80518251146120355760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016106c8565b6000339050612058818560008686604051806020016040528060008152506127f3565b60005b835181101561215c57600084828151811061207857612078613416565b60200260200101519050600084838151811061209657612096613416565b60209081029190910181015160008481526001835260408082206001600160a01b038c1683529093529190912054909150818110156121235760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016106c8565b60009283526001602090815260408085206001600160a01b038b16865290915290922091039055806121548161342c565b91505061205b565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516121ad92919061358c565b60405180910390a46040805160208101909152600090525b50505050565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005460ff16156122705760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106c8565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f543390565b816001600160a01b0316836001600160a01b031614156123195760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016106c8565b6001600160a01b03838116600081815260026020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166123ea5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016106c8565b3360006123f6856129b6565b90506000612403856129b6565b90506124138389898585896127f3565b60008681526001602090815260408083206001600160a01b038c168452909152902054858110156124995760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016106c8565b60008781526001602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906124d8908490613574565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612538848a8a8a8a8a612a01565b505050505050505050565b6001600160a01b0383166125a55760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016106c8565b3360006125b1846129b6565b905060006125be846129b6565b90506125de838760008585604051806020016040528060008152506127f3565b60008581526001602090815260408083206001600160a01b038a1684529091529020548481101561265d5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016106c8565b60008681526001602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052611767565b6001600160a01b0384166127375760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016106c8565b336000612743856129b6565b90506000612750856129b6565b9050612761836000898585896127f3565b60008681526001602090815260408083206001600160a01b038b16845290915281208054879290612793908490613574565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461176783600089898989612a01565b611ecd868686868686612b0c565b6001600160a01b0384163b15611ecd5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061284590899089908890889088906004016135ba565b602060405180830381600087803b15801561285f57600080fd5b505af192505050801561288f575060408051601f3d908101601f1916820190925261288c91810190613618565b60015b6129455761289b613635565b806308c379a014156128d557506128b0613651565b806128bb57506128d7565b8060405162461bcd60e51b81526004016106c89190612edb565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016106c8565b6001600160e01b0319811663bc197c8160e01b146117675760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016106c8565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106129f0576129f0613416565b602090810291909101015292915050565b6001600160a01b0384163b15611ecd5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612a4590899089908890889088906004016136db565b602060405180830381600087803b158015612a5f57600080fd5b505af1925050508015612a8f575060408051601f3d908101601f19168201909252612a8c91810190613618565b60015b612a9b5761289b613635565b6001600160e01b0319811663f23a6e6160e01b146117675760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016106c8565b6001600160a01b038516612b935760005b8351811015612b9157828181518110612b3857612b38613416565b602002602001015160046000868481518110612b5657612b56613416565b602002602001015181526020019081526020016000206000828254612b7b9190613574565b90915550612b8a90508161342c565b9050612b1d565b505b6001600160a01b038416611ecd5760005b8351811015611767576000848281518110612bc157612bc1613416565b602002602001015190506000848381518110612bdf57612bdf613416565b6020026020010151905060006004600084815260200190815260200160002054905081811015612c625760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b60648201526084016106c8565b60009283526004602052604090922091039055612c7e8161342c565b9050612ba4565b828054612c919061334d565b90600052602060002090601f016020900481019282612cb35760008555612cf9565b82601f10612ccc57805160ff1916838001178555612cf9565b82800160010185558215612cf9579182015b82811115612cf9578251825591602001919060010190612cde565b50612d05929150612d09565b5090565b5b80821115612d055760008155600101612d0a565b6001600160a01b038116811461079c57600080fd5b60008060408385031215612d4657600080fd5b8235612d5181612d1e565b946020939093013593505050565b6001600160e01b03198116811461079c57600080fd5b600060208284031215612d8757600080fd5b8135612d9281612d5f565b9392505050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff81118282101715612dd557612dd5612d99565b6040525050565b600067ffffffffffffffff831115612df657612df6612d99565b604051612e0d601f8501601f191660200182612daf565b809150838152848484011115612e2257600080fd5b83836020830137600060208583010152509392505050565b600060208284031215612e4c57600080fd5b813567ffffffffffffffff811115612e6357600080fd5b8201601f81018413612e7457600080fd5b611b5884823560208401612ddc565b60005b83811015612e9e578181015183820152602001612e86565b838111156121c55750506000910152565b60008151808452612ec7816020860160208601612e83565b601f01601f19169290920160200192915050565b602081526000612d926020830184612eaf565b600060208284031215612f0057600080fd5b5035919050565b60008060408385031215612f1a57600080fd5b50508035926020909101359150565b600067ffffffffffffffff821115612f4357612f43612d99565b5060051b60200190565b600082601f830112612f5e57600080fd5b81356020612f6b82612f29565b604051612f788282612daf565b83815260059390931b8501820192828101915086841115612f9857600080fd5b8286015b84811015612fb35780358352918301918301612f9c565b509695505050505050565b600082601f830112612fcf57600080fd5b612d9283833560208501612ddc565b600080600080600060a08688031215612ff657600080fd5b853561300181612d1e565b9450602086013561301181612d1e565b9350604086013567ffffffffffffffff8082111561302e57600080fd5b61303a89838a01612f4d565b9450606088013591508082111561305057600080fd5b61305c89838a01612f4d565b9350608088013591508082111561307257600080fd5b5061307f88828901612fbe565b9150509295509295909350565b6000806040838503121561309f57600080fd5b823567ffffffffffffffff808211156130b757600080fd5b818501915085601f8301126130cb57600080fd5b813560206130d882612f29565b6040516130e58282612daf565b83815260059390931b850182019282810191508984111561310557600080fd5b948201945b8386101561312c57853561311d81612d1e565b8252948201949082019061310a565b9650508601359250508082111561314257600080fd5b5061314f85828601612f4d565b9150509250929050565b600081518084526020808501945080840160005b838110156131895781518752958201959082019060010161316d565b509495945050505050565b602081526000612d926020830184613159565b6000806000606084860312156131bc57600080fd5b83356131c781612d1e565b9250602084013567ffffffffffffffff808211156131e457600080fd5b6131f087838801612f4d565b9350604086013591508082111561320657600080fd5b5061321386828701612f4d565b9150509250925092565b60006020828403121561322f57600080fd5b8135612d9281612d1e565b801515811461079c57600080fd5b6000806040838503121561325b57600080fd5b823561326681612d1e565b915060208301356132768161323a565b809150509250929050565b6000806040838503121561329457600080fd5b823561329f81612d1e565b9150602083013561327681612d1e565b600080600080600060a086880312156132c757600080fd5b85356132d281612d1e565b945060208601356132e281612d1e565b93506040860135925060608601359150608086013567ffffffffffffffff81111561330c57600080fd5b61307f88828901612fbe565b60008060006060848603121561332d57600080fd5b833561333881612d1e565b95602085013595506040909401359392505050565b600181811c9082168061336157607f821691505b6020821081141561338257634e487b7160e01b600052602260045260246000fd5b50919050565b6000835161339a818460208801612e83565b8351908301906133ae818360208801612e83565b01949350505050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156133e7576133e76133b7565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613411576134116133ec565b500490565b634e487b7160e01b600052603260045260246000fd5b6000600019821415613440576134406133b7565b5060010190565b60006060828403121561345957600080fd5b6040516060810167ffffffffffffffff828210818311171561347d5761347d612d99565b816040528451915061348e82612d1e565b90825260208401519080821682146134a557600080fd5b50602082015260408301516134b98161323a565b60408201529392505050565b600080600080600060a086880312156134dd57600080fd5b855162ffffff811681146134f057600080fd5b602087015190955065ffffffffffff8116811461350c57600080fd5b60408701516060880151919550935061352481612d1e565b608087015190925060ff8116811461353b57600080fd5b809150509295509295909350565b60008282101561355b5761355b6133b7565b500390565b60008261356f5761356f6133ec565b500690565b60008219821115613587576135876133b7565b500190565b60408152600061359f6040830185613159565b82810360208401526135b18185613159565b95945050505050565b60006001600160a01b03808816835280871660208401525060a060408301526135e660a0830186613159565b82810360608401526135f88186613159565b9050828103608084015261360c8185612eaf565b98975050505050505050565b60006020828403121561362a57600080fd5b8151612d9281612d5f565b600060033d111561364e5760046000803e5060005160e01c5b90565b600060443d101561365f5790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561368f57505050505090565b82850191508151818111156136a75750505050505090565b843d87010160208285010111156136c15750505050505090565b6136d060208286010187612daf565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261371360a0830184612eaf565b97965050505050505056fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212202db533a417855a09772f246e1da0de44a507ac856776a32cc85c8fbbfb66fc8664736f6c6343000809003300000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000326b0688d9869a19388312df6805d1d72aab7bc0000000000000000000000006dffb6415c96ec393bf018fb824934d7b5b637a0000000000000000000000000000000000000000000000000000000000000000a4d616e7573637269707400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a4d414e5553435249505400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005268747470733a2f2f6b61686972752e6d7970696e6174612e636c6f75642f697066732f516d585a375146663970325764544a42577a69645974596534694b6f476a7263764736735a6f4e36346f576133672f0000000000000000000000000000
Deployed Bytecode
0x6080604052600436106101e25760003560e01c80638da5cb5b11610102578063e4048fc611610095578063f2fde38b11610064578063f2fde38b146105d3578063f5298aca146105f3578063f6a74ed714610613578063f86850301461063357600080fd5b8063e4048fc61461054f578063e985e9c514610557578063efef39a1146105a0578063f242432a146105b357600080fd5b8063a7fc7a07116100d1578063a7fc7a07146104a5578063b57a9d36146104c5578063bd85b03914610502578063d4feeebd1461052f57600080fd5b80638da5cb5b1461041357806395d89b411461043b578063987e659514610450578063a22cb4651461048557600080fd5b80633f4ba83a1161017a5780636b20c454116101495780636b20c454146103a9578063715018a6146103c95780637f034b5c146103de5780638456cb59146103fe57600080fd5b80633f4ba83a146103205780634e1273f4146103355780634f558e79146103625780635c975abb1461039157600080fd5b80630e89341c116101b65780630e89341c1461028e5780632152ac10146102ae5780632a55205a146102c15780632eb2c2d61461030057600080fd5b8062fdd58e146101e757806301ffc9a71461021a57806302fe53051461024a57806306fdde031461026c575b600080fd5b3480156101f357600080fd5b50610207610202366004612d33565b610660565b6040519081526020015b60405180910390f35b34801561022657600080fd5b5061023a610235366004612d75565b6106f9565b6040519015158152602001610211565b34801561025657600080fd5b5061026a610265366004612e3a565b61074b565b005b34801561027857600080fd5b5061028161079f565b6040516102119190612edb565b34801561029a57600080fd5b506102816102a9366004612eee565b610831565b61026a6102bc366004612eee565b6108c8565b3480156102cd57600080fd5b506102e16102dc366004612f07565b610986565b604080516001600160a01b039093168352602083019190915201610211565b34801561030c57600080fd5b5061026a61031b366004612fde565b6109ae565b34801561032c57600080fd5b5061026a610a50565b34801561034157600080fd5b5061035561035036600461308c565b610aa2565b6040516102119190613194565b34801561036e57600080fd5b5061023a61037d366004612eee565b600090815260046020526040902054151590565b34801561039d57600080fd5b5060005460ff1661023a565b3480156103b557600080fd5b5061026a6103c43660046131a7565b610bcc565b3480156103d557600080fd5b5061026a610c56565b3480156103ea57600080fd5b5061026a6103f936600461321d565b610ca8565b34801561040a57600080fd5b5061026a610d11565b34801561041f57600080fd5b506005546040516001600160a01b039091168152602001610211565b34801561044757600080fd5b50610281610d61565b34801561045c57600080fd5b5061047061046b366004612eee565b610d70565b60408051928352901515602083015201610211565b34801561049157600080fd5b5061026a6104a0366004613248565b610ff2565b3480156104b157600080fd5b5061026a6104c036600461321d565b611001565b3480156104d157600080fd5b506104e56104e0366004612eee565b61106d565b604080519384526020840192909252151590820152606001610211565b34801561050e57600080fd5b5061020761051d366004612eee565b60009081526004602052604090205490565b34801561053b57600080fd5b5061026a61054a36600461321d565b611244565b61026a6112b0565b34801561056357600080fd5b5061023a610572366004613281565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b61026a6105ae366004612eee565b611388565b3480156105bf57600080fd5b5061026a6105ce3660046132af565b611770565b3480156105df57600080fd5b5061026a6105ee36600461321d565b6117f7565b3480156105ff57600080fd5b5061026a61060e366004613318565b6118ad565b34801561061f57600080fd5b5061026a61062e36600461321d565b611932565b34801561063f57600080fd5b5061020761064e36600461321d565b600c6020526000908152604090205481565b60006001600160a01b0383166106d15760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060009081526001602090815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061072a57506001600160e01b031982166303a24d0760e21b145b8061074557506301ffc9a760e01b6001600160e01b03198316145b92915050565b6005546001600160a01b031633146107935760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b61079c8161199b565b50565b6060600680546107ae9061334d565b80601f01602080910402602001604051908101604052809291908181526020018280546107da9061334d565b80156108275780601f106107fc57610100808354040283529160200191610827565b820191906000526020600020905b81548152906001019060200180831161080a57829003601f168201915b5050505050905090565b60008181526004602052604090205460609061088f5760405162461bcd60e51b815260206004820152601660248201527f5552493a206e6f6e6578697374656e7420746f6b656e0000000000000000000060448201526064016106c8565b610898826119ae565b6108a183611a42565b6040516020016108b2929190613388565b6040516020818303038152906040529050919050565b60005460ff161561090e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106c8565b336000908152600b602052604090205460ff1661097d5760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920636f6e74726f6c6c6572732063616e2063616c6c207468697320666044820152663ab731ba34b7b760c91b60648201526084016106c8565b61079c81611b60565b600080306127106109998561028a6133cd565b6109a39190613402565b915091509250929050565b6001600160a01b0385163314806109ca57506109ca8533610572565b610a3c5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f766564000000000000000000000000000060648201526084016106c8565b610a498585858585611c66565b5050505050565b6005546001600160a01b03163314610a985760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b610aa0611ed5565b565b60608151835114610b075760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016106c8565b6000835167ffffffffffffffff811115610b2357610b23612d99565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060005b8451811015610bc457610b97858281518110610b7057610b70613416565b6020026020010151858381518110610b8a57610b8a613416565b6020026020010151610660565b828281518110610ba957610ba9613416565b6020908102919091010152610bbd8161342c565b9050610b52565b509392505050565b6001600160a01b038316331480610be85750610be88333610572565b610c465760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016106c8565b610c51838383611f71565b505050565b6005546001600160a01b03163314610c9e5760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b610aa060006121cb565b6005546001600160a01b03163314610cf05760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6005546001600160a01b03163314610d595760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b610aa061222a565b6060600780546107ae9061334d565b600954604051633e4f418960e11b815260048101839052600091829182916001600160a01b031690637c9e83129060240160606040518083038186803b158015610db957600080fd5b505afa158015610dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df19190613447565b51600954604051633e4f418960e11b8152600481018790529192506000916001600160a01b0390911690637c9e83129060240160606040518083038186803b158015610e3c57600080fd5b505afa158015610e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e749190613447565b602001516008546040516340d1b7db60e11b81526004810188905291925060009182916001600160a01b0316906381a36fb69060240160a06040518083038186803b158015610ec257600080fd5b505afa158015610ed6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efa91906134c5565b5093505092505060008367ffffffffffffffff1642610f199190613549565b90506000610f2f65ffffffffffff851642613549565b905065ffffffffffff841615610f9e5762278d00821180610f52575062278d0081115b15610f695750600098600198509650505050505050565b600081831115610f9157610f808362278d00613549565b9a60009a5098505050505050505050565b610f808262278d00613549565b65ffffffffffff8416610fe75767ffffffffffffffff851615610f695762278d00821115610fd85750600098600198509650505050505050565b6000610f808362278d00613549565b505050505050915091565b610ffd3383836122a5565b5050565b6005546001600160a01b031633146110495760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b6001600160a01b03166000908152600b60205260409020805460ff19166001179055565b600954604051633e4f418960e11b8152600481018390526000918291829182916001600160a01b0390911690637c9e83129060240160606040518083038186803b1580156110ba57600080fd5b505afa1580156110ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f29190613447565b51600954604051633e4f418960e11b8152600481018890529192506000916001600160a01b0390911690637c9e83129060240160606040518083038186803b15801561113d57600080fd5b505afa158015611151573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111759190613447565b602001516008546040516340d1b7db60e11b81526004810189905291925060009182916001600160a01b0316906381a36fb69060240160a06040518083038186803b1580156111c357600080fd5b505afa1580156111d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111fb91906134c5565b5093505092505060008367ffffffffffffffff164261121a9190613549565b9050600061123065ffffffffffff851642613549565b919a91995060019850909650505050505050565b6005546001600160a01b0316331461128c5760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b6001600160a01b03166000908152600a60205260409020805460ff19166001179055565b60005460ff16156112f65760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106c8565b336000908152600a602052604090205460ff166113655760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920636f6e74726f6c6c6572732063616e2063616c6c207468697320666044820152663ab731ba34b7b760c91b60648201526084016106c8565b61136f6001611b60565b336000908152600a60205260409020805460ff19169055565b60005460ff16156113ce5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106c8565b600954336000908152600c6020526040902054600160a01b90910460ff16116114395760405162461bcd60e51b815260206004820152601a60248201527f6d61782077616c6c657420616d6f756e7420657863656564656400000000000060448201526064016106c8565b600954604051633e4f418960e11b8152600481018390526000916001600160a01b031690637c9e83129060240160606040518083038186803b15801561147e57600080fd5b505afa158015611492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b69190613447565b51600954604051633e4f418960e11b8152600481018590529192506000916001600160a01b0390911690637c9e83129060240160606040518083038186803b15801561150157600080fd5b505afa158015611515573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115399190613447565b602001516008546040516340d1b7db60e11b81526004810186905291925060009182916001600160a01b0316906381a36fb69060240160a06040518083038186803b15801561158757600080fd5b505afa15801561159b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115bf91906134c5565b50935050925050336001600160a01b0316846001600160a01b031614806115ee57506001600160a01b03811633145b61163a5760405162461bcd60e51b815260206004820152601560248201527f596f7520617265206e6f7420746865206f776e6572000000000000000000000060448201526064016106c8565b600061165067ffffffffffffffff851642613549565b9050600061166665ffffffffffff851642613549565b905065ffffffffffff8416156117215762278d00821180611689575062278d0081115b1561169d576116986001611b60565b611721565b600081831115611714576116b48362278d00613549565b60405162461bcd60e51b815260206004820152602c60248201527f596f7520646f6e7420686f6c64206f72207374616b6520666f72206d6f72652060448201526b7468616e203330206461797360a01b60648201529091506084016106c8565b6116b48262278d00613549565b65ffffffffffff84166117675767ffffffffffffffff85161561169d5762278d00821115611758576117536001611b60565b611767565b60006116b48362278d00613549565b50505050505050565b6001600160a01b03851633148061178c575061178c8533610572565b6117ea5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016106c8565b610a498585858585612386565b6005546001600160a01b0316331461183f5760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b6001600160a01b0381166118a45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106c8565b61079c816121cb565b6001600160a01b0383163314806118c957506118c98333610572565b6119275760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016106c8565b610c51838383612543565b6005546001600160a01b0316331461197a5760405162461bcd60e51b8152602060048201819052602482015260008051602061371f83398151915260448201526064016106c8565b6001600160a01b03166000908152600b60205260409020805460ff19169055565b8051610ffd906003906020840190612c85565b6060600380546119bd9061334d565b80601f01602080910402602001604051908101604052809291908181526020018280546119e99061334d565b8015611a365780601f10611a0b57610100808354040283529160200191611a36565b820191906000526020600020905b815481529060010190602001808311611a1957829003601f168201915b50505050509050919050565b606081611a665750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611a905780611a7a8161342c565b9150611a899050600a83613402565b9150611a6a565b60008167ffffffffffffffff811115611aab57611aab612d99565b6040519080825280601f01601f191660200182016040528015611ad5576020820181803683370190505b5090505b8415611b5857611aea600183613549565b9150611af7600a86613560565b611b02906030613574565b60f81b818381518110611b1757611b17613416565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611b51600a86613402565b9450611ad9565b949350505050565b6000805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec54611c3690611b9a908390613574565b1115611be85760405162461bcd60e51b815260206004820152601c60248201527f50757263686173653a204d617820737570706c7920726561636865640000000060448201526064016106c8565b336000908152600c60205260408120805460019290611c08908490613574565b92505081905550611c2b33600083604051806020016040528060008152506126d7565b60405181815233906000907ffd51b2c9f55c42d2b72ac683526519563be02fc0107f034ff430c05185ff1b669060200160405180910390a350565b8151835114611cc85760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016106c8565b6001600160a01b038416611d2c5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016106c8565b33611d3b8187878787876127f3565b60005b8451811015611e67576000858281518110611d5b57611d5b613416565b602002602001015190506000858381518110611d7957611d79613416565b60209081029190910181015160008481526001835260408082206001600160a01b038e168352909352919091205490915081811015611e0d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016106c8565b60008381526001602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611e4c908490613574565b9250508190555050505080611e609061342c565b9050611d3e565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611eb792919061358c565b60405180910390a4611ecd818787878787612801565b505050505050565b60005460ff16611f275760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016106c8565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038316611fd35760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016106c8565b80518251146120355760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016106c8565b6000339050612058818560008686604051806020016040528060008152506127f3565b60005b835181101561215c57600084828151811061207857612078613416565b60200260200101519050600084838151811061209657612096613416565b60209081029190910181015160008481526001835260408082206001600160a01b038c1683529093529190912054909150818110156121235760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016106c8565b60009283526001602090815260408085206001600160a01b038b16865290915290922091039055806121548161342c565b91505061205b565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516121ad92919061358c565b60405180910390a46040805160208101909152600090525b50505050565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005460ff16156122705760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106c8565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f543390565b816001600160a01b0316836001600160a01b031614156123195760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016106c8565b6001600160a01b03838116600081815260026020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166123ea5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016106c8565b3360006123f6856129b6565b90506000612403856129b6565b90506124138389898585896127f3565b60008681526001602090815260408083206001600160a01b038c168452909152902054858110156124995760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016106c8565b60008781526001602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906124d8908490613574565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612538848a8a8a8a8a612a01565b505050505050505050565b6001600160a01b0383166125a55760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016106c8565b3360006125b1846129b6565b905060006125be846129b6565b90506125de838760008585604051806020016040528060008152506127f3565b60008581526001602090815260408083206001600160a01b038a1684529091529020548481101561265d5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016106c8565b60008681526001602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052611767565b6001600160a01b0384166127375760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016106c8565b336000612743856129b6565b90506000612750856129b6565b9050612761836000898585896127f3565b60008681526001602090815260408083206001600160a01b038b16845290915281208054879290612793908490613574565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461176783600089898989612a01565b611ecd868686868686612b0c565b6001600160a01b0384163b15611ecd5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061284590899089908890889088906004016135ba565b602060405180830381600087803b15801561285f57600080fd5b505af192505050801561288f575060408051601f3d908101601f1916820190925261288c91810190613618565b60015b6129455761289b613635565b806308c379a014156128d557506128b0613651565b806128bb57506128d7565b8060405162461bcd60e51b81526004016106c89190612edb565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016106c8565b6001600160e01b0319811663bc197c8160e01b146117675760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016106c8565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106129f0576129f0613416565b602090810291909101015292915050565b6001600160a01b0384163b15611ecd5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612a4590899089908890889088906004016136db565b602060405180830381600087803b158015612a5f57600080fd5b505af1925050508015612a8f575060408051601f3d908101601f19168201909252612a8c91810190613618565b60015b612a9b5761289b613635565b6001600160e01b0319811663f23a6e6160e01b146117675760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016106c8565b6001600160a01b038516612b935760005b8351811015612b9157828181518110612b3857612b38613416565b602002602001015160046000868481518110612b5657612b56613416565b602002602001015181526020019081526020016000206000828254612b7b9190613574565b90915550612b8a90508161342c565b9050612b1d565b505b6001600160a01b038416611ecd5760005b8351811015611767576000848281518110612bc157612bc1613416565b602002602001015190506000848381518110612bdf57612bdf613416565b6020026020010151905060006004600084815260200190815260200160002054905081811015612c625760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b60648201526084016106c8565b60009283526004602052604090922091039055612c7e8161342c565b9050612ba4565b828054612c919061334d565b90600052602060002090601f016020900481019282612cb35760008555612cf9565b82601f10612ccc57805160ff1916838001178555612cf9565b82800160010185558215612cf9579182015b82811115612cf9578251825591602001919060010190612cde565b50612d05929150612d09565b5090565b5b80821115612d055760008155600101612d0a565b6001600160a01b038116811461079c57600080fd5b60008060408385031215612d4657600080fd5b8235612d5181612d1e565b946020939093013593505050565b6001600160e01b03198116811461079c57600080fd5b600060208284031215612d8757600080fd5b8135612d9281612d5f565b9392505050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff81118282101715612dd557612dd5612d99565b6040525050565b600067ffffffffffffffff831115612df657612df6612d99565b604051612e0d601f8501601f191660200182612daf565b809150838152848484011115612e2257600080fd5b83836020830137600060208583010152509392505050565b600060208284031215612e4c57600080fd5b813567ffffffffffffffff811115612e6357600080fd5b8201601f81018413612e7457600080fd5b611b5884823560208401612ddc565b60005b83811015612e9e578181015183820152602001612e86565b838111156121c55750506000910152565b60008151808452612ec7816020860160208601612e83565b601f01601f19169290920160200192915050565b602081526000612d926020830184612eaf565b600060208284031215612f0057600080fd5b5035919050565b60008060408385031215612f1a57600080fd5b50508035926020909101359150565b600067ffffffffffffffff821115612f4357612f43612d99565b5060051b60200190565b600082601f830112612f5e57600080fd5b81356020612f6b82612f29565b604051612f788282612daf565b83815260059390931b8501820192828101915086841115612f9857600080fd5b8286015b84811015612fb35780358352918301918301612f9c565b509695505050505050565b600082601f830112612fcf57600080fd5b612d9283833560208501612ddc565b600080600080600060a08688031215612ff657600080fd5b853561300181612d1e565b9450602086013561301181612d1e565b9350604086013567ffffffffffffffff8082111561302e57600080fd5b61303a89838a01612f4d565b9450606088013591508082111561305057600080fd5b61305c89838a01612f4d565b9350608088013591508082111561307257600080fd5b5061307f88828901612fbe565b9150509295509295909350565b6000806040838503121561309f57600080fd5b823567ffffffffffffffff808211156130b757600080fd5b818501915085601f8301126130cb57600080fd5b813560206130d882612f29565b6040516130e58282612daf565b83815260059390931b850182019282810191508984111561310557600080fd5b948201945b8386101561312c57853561311d81612d1e565b8252948201949082019061310a565b9650508601359250508082111561314257600080fd5b5061314f85828601612f4d565b9150509250929050565b600081518084526020808501945080840160005b838110156131895781518752958201959082019060010161316d565b509495945050505050565b602081526000612d926020830184613159565b6000806000606084860312156131bc57600080fd5b83356131c781612d1e565b9250602084013567ffffffffffffffff808211156131e457600080fd5b6131f087838801612f4d565b9350604086013591508082111561320657600080fd5b5061321386828701612f4d565b9150509250925092565b60006020828403121561322f57600080fd5b8135612d9281612d1e565b801515811461079c57600080fd5b6000806040838503121561325b57600080fd5b823561326681612d1e565b915060208301356132768161323a565b809150509250929050565b6000806040838503121561329457600080fd5b823561329f81612d1e565b9150602083013561327681612d1e565b600080600080600060a086880312156132c757600080fd5b85356132d281612d1e565b945060208601356132e281612d1e565b93506040860135925060608601359150608086013567ffffffffffffffff81111561330c57600080fd5b61307f88828901612fbe565b60008060006060848603121561332d57600080fd5b833561333881612d1e565b95602085013595506040909401359392505050565b600181811c9082168061336157607f821691505b6020821081141561338257634e487b7160e01b600052602260045260246000fd5b50919050565b6000835161339a818460208801612e83565b8351908301906133ae818360208801612e83565b01949350505050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156133e7576133e76133b7565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613411576134116133ec565b500490565b634e487b7160e01b600052603260045260246000fd5b6000600019821415613440576134406133b7565b5060010190565b60006060828403121561345957600080fd5b6040516060810167ffffffffffffffff828210818311171561347d5761347d612d99565b816040528451915061348e82612d1e565b90825260208401519080821682146134a557600080fd5b50602082015260408301516134b98161323a565b60408201529392505050565b600080600080600060a086880312156134dd57600080fd5b855162ffffff811681146134f057600080fd5b602087015190955065ffffffffffff8116811461350c57600080fd5b60408701516060880151919550935061352481612d1e565b608087015190925060ff8116811461353b57600080fd5b809150509295509295909350565b60008282101561355b5761355b6133b7565b500390565b60008261356f5761356f6133ec565b500690565b60008219821115613587576135876133b7565b500190565b60408152600061359f6040830185613159565b82810360208401526135b18185613159565b95945050505050565b60006001600160a01b03808816835280871660208401525060a060408301526135e660a0830186613159565b82810360608401526135f88186613159565b9050828103608084015261360c8185612eaf565b98975050505050505050565b60006020828403121561362a57600080fd5b8151612d9281612d5f565b600060033d111561364e5760046000803e5060005160e01c5b90565b600060443d101561365f5790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561368f57505050505090565b82850191508151818111156136a75750505050505090565b843d87010160208285010111156136c15750505050505090565b6136d060208286010187612daf565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261371360a0830184612eaf565b97965050505050505056fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212202db533a417855a09772f246e1da0de44a507ac856776a32cc85c8fbbfb66fc8664736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000326b0688d9869a19388312df6805d1d72aab7bc0000000000000000000000006dffb6415c96ec393bf018fb824934d7b5b637a0000000000000000000000000000000000000000000000000000000000000000a4d616e7573637269707400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a4d414e5553435249505400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005268747470733a2f2f6b61686972752e6d7970696e6174612e636c6f75642f697066732f516d585a375146663970325764544a42577a69645974596534694b6f476a7263764736735a6f4e36346f576133672f0000000000000000000000000000
-----Decoded View---------------
Arg [0] : _name (string): Manuscript
Arg [1] : _symbol (string): MANUSCRIPT
Arg [2] : _uri (string): https://kahiru.mypinata.cloud/ipfs/QmXZ7QFf9p2WdTJBWzidYtYe4iKoGjrcvG6sZoN64oWa3g/
Arg [3] : _nft (address): 0x0326b0688d9869a19388312Df6805d1D72AaB7bC
Arg [4] : _staking (address): 0x6DffB6415c96EC393Bf018fB824934d7b5B637a0
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [3] : 0000000000000000000000000326b0688d9869a19388312df6805d1d72aab7bc
Arg [4] : 0000000000000000000000006dffb6415c96ec393bf018fb824934d7b5b637a0
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [6] : 4d616e7573637269707400000000000000000000000000000000000000000000
Arg [7] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [8] : 4d414e5553435249505400000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000052
Arg [10] : 68747470733a2f2f6b61686972752e6d7970696e6174612e636c6f75642f6970
Arg [11] : 66732f516d585a375146663970325764544a42577a69645974596534694b6f47
Arg [12] : 6a7263764736735a6f4e36346f576133672f0000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.