Overview
TokenID
101
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
RingsForLoot
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol'; import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import 'base64-sol/base64.sol'; import './EIP712Whitelisting.sol'; pragma solidity ^0.8.0; interface ILoot { function ownerOf(uint256 tokenId) external view returns (address owner); function balanceOf(address owner) external view returns (uint256 balance); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function tokenByIndex(uint256 index) external view returns (uint256); function getRing(uint256 tokenId) external view returns (string memory); } interface IERC20 { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); } interface IERC2981 { function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount); } interface ProxyRegistry { function proxies(address) external view returns (address); } contract RingsForLoot is ERC1155, IERC2981, Ownable, EIP712Whitelisting { enum SaleState { Paused, OnlyCommon, Active } SaleState public state = SaleState.Paused; // The original Loot contract address is used to fetch the ring name // by loot bag id, so we don't have to inline the data in this contract ILoot private ogLootContract; // Loot-compatible contracts that we support. Users can claim a matching // ring if they own a token in this contract and `getRing` matches ring's name mapping(ILoot => bool) private lootContracts; // We only allow claiming one matching ring per bag. This data structure // holds the contract/bag ids that were already claimed mapping(ILoot => mapping(uint256 => bool)) public bagClaimed; // How many rings of each kind were already minted. Exposed via mintedBatched // for more efficient querying mapping(uint256 => uint256) private _minted; // Even though ERC1155 doesn't require these, most services still show this // information if it's available string public name = 'Rings for Loot'; string public symbol = 'R4L'; // IPFS hash of the folder that stores high resolution rings assets string public ipfs; // STORING RINGS SUPPLY // Each token id corresponds to a distinct ring in the Loot universe. // Ring id is defined as minimum loot bag id with this particular ring. // Unfortunately, given Loot's plucking algorithm, it's impossible to write // a function that can produce maximum ring supply given a ring id. So we // have to store (ring id, max supply) on the chain. Doing it as a mapping // would produce close to 54KB of data, so we need to be clever in the way // we pack it. Depending on how rare the ring is, we use a different encoding // mechanism. // Common rings are indexed by color: Gold, Silver, Bronze, Platinum, Titanium. uint256[5] private commonIds = [1, 6, 11, 7, 2]; uint256[5] private commonMax = [1093, 1178, 1166, 1163, 1112]; // Epic rings ids are stored as a tightly packed array of uint16 // Epic rings max supply is stored as a tightly packed array of uint8 bytes[5] private epicIds; bytes[5] private epicMax; // Legendary and mythic ring ids are stored as a tightly packed array of uint16 // The max supply is inferred from the number of times the ring is found in // the array. Each legendary ring is duplicated, mythic are one-of-a-kind. bytes[5] private legendaryIds; bytes[5] private mythicIds; // Pricing uint256 private constant PRICE_RING_COMMON = 0.02 ether; uint256 private constant PRICE_RING_EPIC = 0.06 ether; uint256 private constant PRICE_RING_LEGENDARY = 0.1 ether; uint256 private constant PRICE_RING_MYTHIC = 0.14 ether; uint256 private constant PRICE_FORGE_EPIC = 0.02 ether; uint256 private constant PRICE_FORGE_LEGENDARY = 0.04 ether; uint256 private constant PRICE_FORGE_MYTHIC = 0.06 ether; // Giveaway can only be used once per wallet address mapping(address => bool) public whitelistUsed; constructor(ILoot[] memory lootsList) ERC1155('') { for (uint256 i = 0; i < lootsList.length; i++) { if (i == 0) { ogLootContract = lootsList[i]; } lootContracts[lootsList[i]] = true; } // This data is generated and encoded via RingsForLoot-test.ts epicIds[0] = hex'00030009000d0016002300330078007d00b1011001ad022e02da038d03f604e0'; epicIds[1] = hex'002100a600d50156015c0174018301ba024402b702d002d40305032c03ab0429'; epicIds[2] = hex'002b0059006500730086009a00b600f50150016e01d502050209026302f8032f'; epicIds[3] = hex'00270031003400490064008a008b00b9012b0133016b017a026f0276028b0615'; epicIds[4] = hex'0024002e003c004300450047005c009c009e00b300d4010b018a01f202f40350'; epicMax[0] = hex'111412150f151113111a0f0d120f160b'; epicMax[1] = hex'16131c0f15120f1a0d180d0911111417'; epicMax[2] = hex'1712150f1412140d1014111011101118'; epicMax[3] = hex'1513120f1b1814130f1515161b13110e'; epicMax[4] = hex'19152019131410181a13110a0f121410'; legendaryIds[0] = hex'0151015101b401b4039203920558055807500750'; legendaryIds[1] = hex'00a400a400e900e905e105e10b140b140b5f0b5f132e132e'; legendaryIds[2] = hex'0125012504cd04cd0894089414f614f6'; legendaryIds[3] = hex'01b201b205180518056205620bac0bac16171617'; legendaryIds[4] = hex'02dc02dc06c506c50daa0daa105010501c7b1c7b'; // prettier-ignore mythicIds[0] = hex'00220123013b014c01e002d20325039603a003f903fe041504310448046c053b0561059305c505ee0638063a064c065a069b06a506c306f907050831083b08a70916095e09a00a120a5a0aa00aac0ab50aed0b1f0b280b340b5d0b890bbb0bc40c710c7a0c820cca0cd30cea0d2e0d340d550ef20f120f200f4e0f540f7d0fa410011014105e1070109f10b310d710e81101110d114b1176118111be11c6124f125812a412fe130d1378139413af13b213ec142d147814a214c914de14df14fd1543157f158115901598159a15a916df16f316ff170b171a175a179717e5187418d818ef18fc190a193c194519461a001a911a961abd1af31b1b1bcd1bd61c441c471c911cbd1cda1d031d651d9c1dfa1e391e6e1e8f1ef51f1c'; // prettier-ignore mythicIds[1] = hex'0025007e008200c500df016c01ee01fa02010211024202d802f3033c038203b003b303f70416041f042a0434053e056f05a505b605d505db06240653067d06e407380773079c07d2085e086e087c08b508bd08d70914097209d10a500a5b0a9c0ab10abd0b070b180b1d0b6f0b940c2f0c600c750c8d0cfa0d1f0d260d320d910de80e910e9b0eb00ed80edb0ef80f24104a106f107f109510c5110211261134118c11a011a111cc11d71274128a129212af12d712d9133b1343138413881412142c143a149a14c714ed15511580167016c716fb171017421763177817a117f8182e187619181924192b1967198019a719fa1a3f1a4a1a811ada1b111b2a1b4e1b5c1b621ba41bf11c2a1c701d001d161d361d611d731d781dc51dcb1dcf1e141ea31ea71eee1efd1f29'; // prettier-ignore mythicIds[2] = hex'001d0061007700dc01c4021b0221023c023d024e025e026b02bf02e9030903120358035a036603880424043c04d104dd05c205cc05d3061b06410680069c0766078f07d307d907e907f0082d0844089f08b208d4095709660983098609ac09d209fb0a1b0a4b0b020b660b930bd90c620d1b0d440d8c0db30dc30ddc0ed90f3e0f530f5b0fed0ffc103210bb11c81215132313471350137e13bc13c4140e14331493151b159415de15ec15f015f415fe161b167316a716b117701796179d17cb17e0181818311849189f18a918c918d718ff1956197d19a219d91acd1adc1ae91aea1b361b9c1bec1c871cc11ccd1cd61ce11cf51d141d1b1d311d5a1d621d681d6f1d741d901d9a1dba'; // prettier-ignore mythicIds[3] = hex'004200bf00d30107010e0116013001da01e102030208021402710273029b02b40359037403a903df041104370460048b04aa04e905510554055e0566057205c105ca05f00635066706b5071007200732076a07b60806086508c508e608fd095b099f0a030a220b7e0b810be20c330c350c380c9d0ca80cd40cd60d010d090d280dbb0df00dfc0e060ede0ee80f410fa810ac114e1150115e11c111ed11f711f912041216121f124112681309130f133f137313be14211427142f1459146e155415a715a815b11606164c168f1706182c189518b918c118e518ed194b198919f51a1f1a671a901ac11ad01b401b681b6f1b721b8a1bda1c6f1c8c1c9c1d3c1d551d661d801d9d1dea1def1e0b1e111e181e341e941ea51eb71ebd1ed11f0c1f16'; // prettier-ignore mythicIds[4] = hex'00380044006b00810104011101680170018501bd01c202190288028d02f002ff032b03720390042c045c04b204e60603061d063c064506b806c606db06e5071f07480765078207de082f088008f1090b09250943095f098b09ae09bc09cd09ea0a6d0a920a9f0aa30b210b7f0b960ba60bc90bcd0bcf0be40bf70bfa0c3a0c450c560d5d0de20e400e820e8b0e9d0eae0ec90ef70f520f7e0f910fb20fc40fd5103710561061110c115311641183118711a211fe1208124b131813441349136e13a613aa13cb13df147a14c214d91503150d15341629163f170c17b817f21816184c1856188618a3190e191a191b19341957197a1a171a321a371a511a601a691aa41ad31b2f1b3b1b791ba21beb1c341c7d1ce01d081d121d1f1d201d451d471d8e1e151e471ec91ed51eda1f041f131f1b'; } function purchaseCommon(uint256 amount, bytes calldata signature) public payable { require(state == SaleState.OnlyCommon || state == SaleState.Active, 'Sale not active'); // If signature is provided, treat this call as a candidate for // a giveaway for one free random common ring. if (signature.length > 0) { validateGiveawaySignature(signature); require(amount == 1, 'Can only get one'); require(msg.value == 0, 'Wrong price'); } else { require(amount > 0, 'Buy at least one'); require(amount <= 26, 'Too many at once'); require(msg.value == amount * PRICE_RING_COMMON, 'Wrong price'); } require(commonMax[0] + commonMax[1] + commonMax[2] + commonMax[3] + commonMax[4] >= amount, 'Not enough left'); uint256[5] memory amounts; uint256 rand = uint256(keccak256(abi.encodePacked(block.timestamp, msg.sender))); for (uint256 i = 0; i < amount; i++) { // The inner loop tries to find a common ring that still has // supply left. while (true) { require(rand > 0, 'ran out of randomness'); uint256 color = rand % 5; // Advance forward to find the next available common ring more efficiently, // in case some of them ran out. rand += 1; if (commonMax[color] > 0) { amounts[color] += 1; commonMax[color] -= 1; break; } } rand /= 5; } for (uint256 i = 0; i < 5; i++) { if (amounts[i] > 0) { _minted[commonIds[i]] += amounts[i]; // At the time of writing this contract, many cetralized tools had issues // with understanding `TransferBatch` event :/ _mint(msg.sender, commonIds[i], amounts[i], ''); } } } function purchaseMatching( ILoot loot, uint256 bagId, uint256 ringId, bytes calldata signature ) public payable { require(lootContracts[loot], 'Not compatible'); require(loot.ownerOf(bagId) == msg.sender, 'Not owner'); require( keccak256(abi.encodePacked(loot.getRing(bagId))) == keccak256(abi.encodePacked(ogLootContract.getRing(ringId))), 'Wrong ring' ); require(!bagClaimed[loot][bagId], 'Already claimed'); bagClaimed[loot][bagId] = true; uint256 price; // These are taken from Loot to get an approximation of how rare the matching // ring is. We need this information because each ring max supply is stored // differently depending on rarity. uint256 rand = uint256(keccak256(abi.encodePacked('RING', Strings.toString(ringId)))); uint256 greatness = rand % 21; uint256 color = rand % 5; require(state == SaleState.Active || (state == SaleState.OnlyCommon && greatness <= 14), 'Sale not active'); if (greatness <= 14) { // Common require(commonMax[color] > 0, 'Not in stock'); price = PRICE_RING_COMMON; commonMax[color] -= 1; } else if (greatness < 19) { // Epic price = PRICE_RING_EPIC; (bool found, uint256 index) = findRingIndex(epicIds[color], ringId); require(found, 'Not in stock'); uint8 max = uint8(epicMax[color][index]); max -= 1; if (max > 0) { epicMax[color][index] = bytes1(max); } else { removeUint16At(epicIds[color], index * 2); epicMax[color][index] = epicMax[color][epicMax[color].length - 1]; epicMax[color].pop(); } } else { // Legendary and Mythic. Unfortunately we don't know which one it is, since // it's based on rarity, not greatness. So check both: (bool found, uint256 index) = findRingIndex(legendaryIds[color], ringId); if (found) { price = PRICE_RING_LEGENDARY; removeUint16At(legendaryIds[color], index * 2); } else { price = PRICE_RING_MYTHIC; (found, index) = findRingIndex(mythicIds[color], ringId); require(found, 'Not in stock'); removeUint16At(mythicIds[color], index * 2); } } // If signature is provided, treat this call as a candidate for // a giveaway for one matching ring. if (signature.length > 0) { validateGiveawaySignature(signature); price = 0; } require(msg.value == price, 'Wrong price'); _minted[ringId] += 1; _mint(msg.sender, ringId, 1, ''); } function forge(uint256 color, uint256 amount) public payable { require(state == SaleState.Active, 'Sale not active'); require(color < 5, 'Not a common ring'); uint256 ringIdToBurn = commonIds[color]; bytes storage data; if (amount == 2) { require(msg.value == PRICE_FORGE_EPIC, 'Wrong price'); data = epicIds[color]; } else if (amount == 3) { require(msg.value == PRICE_FORGE_LEGENDARY, 'Wrong price'); data = legendaryIds[color]; } else if (amount == 4) { require(msg.value == PRICE_FORGE_MYTHIC, 'Wrong price'); data = mythicIds[color]; } else { revert('Wrong amount of rings to burn'); } (uint256 ringIdToMint, uint256 index) = pickRandomRing(data); uint256 ringsLeft; if (amount == 2) { ringsLeft = uint8(epicMax[color][index / 2]) - 1; epicMax[color][index / 2] = bytes1(uint8(ringsLeft)); } if (ringsLeft == 0) { removeUint16At(data, index); if (amount == 2) { epicMax[color][index / 2] = epicMax[color][epicMax[color].length - 1]; epicMax[color].pop(); } } _minted[ringIdToMint] += 1; _burn(msg.sender, ringIdToBurn, amount); _mint(msg.sender, ringIdToMint, 1, ''); } function mintedBatched(uint256[] calldata ids) public view returns (uint256[] memory counts) { counts = new uint256[](ids.length); for (uint256 i = 0; i < ids.length; i++) { counts[i] = _minted[ids[i]]; } } function uri(uint256 tokenId) public view override returns (string memory) { require(_minted[tokenId] > 0, 'Ring does not exist'); // Some Loot rings have quotes in them, so we need to escape these // to not break JSON. 34 is ", 92 is \ bytes memory ringName = bytes(ogLootContract.getRing(tokenId)); if (uint8(ringName[0]) == 34) { bytes memory escRingName = new bytes(ringName.length + 2); uint256 ei = 0; for (uint256 i = 0; i < ringName.length; i++) { if (uint8(ringName[i]) == 34) { escRingName[ei++] = bytes1(uint8(92)); } escRingName[ei++] = ringName[i]; } ringName = escRingName; } string memory json = Base64.encode( bytes( string( abi.encodePacked( '{"name": "', ringName, '", "description": "Rings (for Loot) is the first and largest 3D interpretation of an entire category in Loot. Adventurers, builders, and artists are encouraged to reference Rings (for Loot) to further expand on the imagination of Loot.", "image": "ipfs://', ipfs, '/', Strings.toString(tokenId), '.jpg"}' ) ) ) ); return string(abi.encodePacked('data:application/json;base64,', json)); } function pickRandomRing(bytes storage data) internal view returns (uint256 result, uint256 index) { require(data.length > 0, 'data is empty'); uint256 rand = uint256(keccak256(abi.encodePacked(block.timestamp))); index = rand % data.length; index -= (index % 2); result = readUint16At(data, index); } function findRingIndex(bytes storage data, uint256 ringId) internal view returns (bool found, uint256 index) { for (uint256 i = 0; i < data.length / 2; i++) { if (uint8(data[i * 2]) == ((ringId >> 8) & 0xFF) && uint8(data[i * 2 + 1]) == (ringId & 0xFF)) { return (true, i); } } return (false, 0); } function readUint16At(bytes storage data, uint256 index) internal view returns (uint16 result) { result = (uint16(uint8(data[index])) << 8) + uint8(data[index + 1]); } function writeUint16At( bytes storage data, uint256 index, uint16 value ) internal { data[index] = bytes1(uint8(value >> 8)); data[index + 1] = bytes1(uint8(value & 0xFF)); } function removeUint16At(bytes storage data, uint256 index) internal { require(data.length > 0, 'data is empty'); data[index] = data[data.length - 2]; data[index + 1] = data[data.length - 1]; data.pop(); data.pop(); } function validateGiveawaySignature(bytes calldata signature) internal returns (bool) { requiresWhitelist(signature); require(!whitelistUsed[msg.sender], 'Already used'); whitelistUsed[msg.sender] = true; return true; } // Interfaces function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount) { receiver = owner(); royaltyAmount = (salePrice * 5) / 100; } function isApprovedForAll(address owner, address operator) public view override returns (bool) { // Allow easier listing for sale on OpenSea. Based on // https://github.com/ProjectOpenSea/opensea-creatures/blob/f7257a043e82fae8251eec2bdde37a44fee474c4/migrations/2_deploy_contracts.js#L29 if (block.chainid == 4) { if (ProxyRegistry(0xF57B2c51dED3A29e6891aba85459d600256Cf317).proxies(owner) == operator) { return true; } } else if (block.chainid == 1) { if (ProxyRegistry(0xa5409ec958C83C3f309868babACA7c86DCB077c1).proxies(owner) == operator) { return true; } } return ERC1155.isApprovedForAll(owner, operator); } // Admin function setState(SaleState newState) public onlyOwner { state = newState; } function setIpfs(string calldata newIpfs) public onlyOwner { ipfs = newIpfs; } function withdrawAll() public payable onlyOwner { require(payable(msg.sender).send(address(this).balance)); } function withdrawAllERC20(IERC20 erc20Token) public onlyOwner { require(erc20Token.transfer(msg.sender, erc20Token.balanceOf(address(this)))); } }
// SPDX-License-Identifier: MIT 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() { _setOwner(_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 { _setOwner(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"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(_msgSender() != operator, "ERC1155: setting approval status for self"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `account`. * * Emits a {TransferSingle} event. * * Requirements: * * - `account` cannot be the zero address. * - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address account, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(account != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][account] += amount; emit TransferSingle(operator, address(0), account, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `account` * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens of token type `id`. */ function _burn( address account, uint256 id, uint256 amount ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 accountBalance = _balances[id][account]; require(accountBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][account] = accountBalance - amount; } emit TransferSingle(operator, account, address(0), id, amount); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address account, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 accountBalance = _balances[id][account]; require(accountBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][account] = accountBalance - amount; } } emit TransferBatch(operator, account, address(0), ids, amounts); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; /// @title Base64 /// @author Brecht Devos - <[email protected]> /// @notice Provides functions for encoding/decoding base64 library Base64 { string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000" hex"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000" hex"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000" hex"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000"; function encode(bytes memory data) internal pure returns (string memory) { if (data.length == 0) return ''; // load the table into memory string memory table = TABLE_ENCODE; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((data.length + 2) / 3); // add some extra buffer at the end required for the writing string memory result = new string(encodedLen + 32); assembly { // set the actual output length mstore(result, encodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 3 bytes at a time for {} lt(dataPtr, endPtr) {} { // read 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // write 4 characters mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and(shr( 6, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and( input, 0x3F)))) resultPtr := add(resultPtr, 1) } // padding with '=' switch mod(mload(data), 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } } return result; } function decode(string memory _data) internal pure returns (bytes memory) { bytes memory data = bytes(_data); if (data.length == 0) return new bytes(0); require(data.length % 4 == 0, "invalid base64 decoder input"); // load the table into memory bytes memory table = TABLE_DECODE; // every 4 characters represent 3 bytes uint256 decodedLen = (data.length / 4) * 3; // add some extra buffer at the end required for the writing bytes memory result = new bytes(decodedLen + 32); assembly { // padding with '=' let lastBytes := mload(add(data, mload(data))) if eq(and(lastBytes, 0xFF), 0x3d) { decodedLen := sub(decodedLen, 1) if eq(and(lastBytes, 0xFFFF), 0x3d3d) { decodedLen := sub(decodedLen, 1) } } // set the actual output length mstore(result, decodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 4 characters at a time for {} lt(dataPtr, endPtr) {} { // read 4 characters dataPtr := add(dataPtr, 4) let input := mload(dataPtr) // write 3 bytes let output := add( add( shl(18, and(mload(add(tablePtr, and(shr(24, input), 0xFF))), 0xFF)), shl(12, and(mload(add(tablePtr, and(shr(16, input), 0xFF))), 0xFF))), add( shl( 6, and(mload(add(tablePtr, and(shr( 8, input), 0xFF))), 0xFF)), and(mload(add(tablePtr, and( input , 0xFF))), 0xFF) ) ) mstore(resultPtr, shl(232, output)) resultPtr := add(resultPtr, 3) } } return result; } }
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; contract EIP712Whitelisting is Ownable { using ECDSA for bytes32; // The key used to sign whitelist signatures. // We will check to ensure that the key that signed the signature // is this one that we expect. address whitelistSigningKey = address(0); // Domain Separator is the EIP-712 defined structure that defines what contract // and chain these signatures can be used for. This ensures people can't take // a signature used to mint on one contract and use it for another, or a signature // from testnet to replay on mainnet. // It has to be created in the constructor so we can dynamically grab the chainId. // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#definition-of-domainseparator bytes32 internal DOMAIN_SEPARATOR; // The typehash for the data type specified in the structured data // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#rationale-for-typehash // This should match whats in the client side whitelist signing code // https://github.com/msfeldstein/EIP712-whitelisting/blob/main/test/signWhitelist.ts#L22 bytes32 internal constant MINTER_TYPEHASH = keccak256('Minter(address wallet)'); bytes32 internal constant DOMAIN_TYPEHASH = keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'); constructor() { // This should match whats in the client side whitelist signing code // https://github.com/msfeldstein/EIP712-whitelisting/blob/main/test/signWhitelist.ts#L12 DOMAIN_SEPARATOR = keccak256( abi.encode( DOMAIN_TYPEHASH, // This should match the domain you set in your client side signing. keccak256(bytes('RingsForLootWhitelistToken')), keccak256(bytes('1')), block.chainid, address(this) ) ); } function setWhitelistSigningAddress(address newSigningKey) public onlyOwner { whitelistSigningKey = newSigningKey; } function requiresWhitelist(bytes calldata signature) internal view { require(whitelistSigningKey != address(0), 'Whitelist not enabled'); // Verify EIP-712 signature by recreating the data structure // that we signed on the client side, and then using that to recover // the address that signed the signature for this data. bytes32 digest = keccak256( abi.encodePacked('\x19\x01', DOMAIN_SEPARATOR, keccak256(abi.encode(MINTER_TYPEHASH, msg.sender))) ); // Use the recover method to see what address was used to create // the signature on this data. // Note that if the digest doesn't exactly match what was signed we'll // get a random recovered address. address recoveredAddress = digest.recover(signature); require(recoveredAddress == whitelistSigningKey, 'Invalid Signature'); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector). @param operator The address which initiated the transfer (i.e. msg.sender) @param from The address which previously owned the token @param id The ID of the token being transferred @param value The amount of tokens being transferred @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** @dev Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector). @param operator The address which initiated the batch transfer (i.e. msg.sender) @param from The address which previously owned the token @param ids An array containing ids of each token being transferred (order and length must match values array) @param values An array containing amounts of each token being transferred (order and length must match ids array) @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev 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); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract ILoot[]","name":"lootsList","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":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"},{"inputs":[{"internalType":"contract ILoot","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"bagClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"uint256","name":"color","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"forge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"ipfs","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"mintedBatched","outputs":[{"internalType":"uint256[]","name":"counts","type":"uint256[]"}],"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":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"purchaseCommon","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract ILoot","name":"loot","type":"address"},{"internalType":"uint256","name":"bagId","type":"uint256"},{"internalType":"uint256","name":"ringId","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"purchaseMatching","outputs":[],"stateMutability":"payable","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":"newIpfs","type":"string"}],"name":"setIpfs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum RingsForLoot.SaleState","name":"newState","type":"uint8"}],"name":"setState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSigningKey","type":"address"}],"name":"setWhitelistSigningAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"enum RingsForLoot.SaleState","name":"","type":"uint8"}],"stateMutability":"view","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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20Token","type":"address"}],"name":"withdrawAllERC20","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
600480546001600160a01b03191690556006805460ff1916905560c0604052600e60808190526d149a5b99dcc8199bdc88131bdbdd60921b60a09081526200004b91600a919062000820565b5060408051808201909152600380825262148d1360ea1b60209092019182526200007891600b9162000820565b506040805160a0810182526001815260066020820152600b918101919091526007606082015260026080820152620000b590600d906005620008af565b506040805160a081018252610445815261049a602082015261048e9181019190915261048b60608201526104586080820152620000f7906012906005620008e5565b503480156200010557600080fd5b50604051620060fa380380620060fa833981016040819052620001289162000966565b6040805160208101909152600081526200014281620007b5565b506200014e33620007ce565b604080518082018252601a81527f52696e6773466f724c6f6f7457686974656c697374546f6b656e0000000000006020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527f8afb3e63ff3cdcd22bd590fb836df8a09d822fd2d6c412ab7f8e58f2807bae4d818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012060055560005b8151811015620002eb578062000289578181815181106200025a576200025a62000a38565b6020026020010151600660016101000a8154816001600160a01b0302191690836001600160a01b031602179055505b600160076000848481518110620002a457620002a462000a38565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620002e28162000a4e565b91505062000235565b506040805180820190915260208082527e030009000d0016002300330078007d00b1011001ad022e02da038d03f604e09181019182526200032f9160179162000820565b506040805180820190915260208082527e2100a600d50156015c0174018301ba024402b702d002d40305032c03ab0429918101918252620003739160189162000820565b506040805180820190915260208082527e2b0059006500730086009a00b600f50150016e01d502050209026302f8032f918101918252620003b79160199162000820565b506040805180820190915260208082527e270031003400490064008a008b00b9012b0133016b017a026f0276028b0615918101918252620003fb91601a9162000820565b506040805180820190915260208082527e24002e003c004300450047005c009c009e00b300d4010b018a01f202f403509181019182526200043f91601b9162000820565b506040805180820190915260108082526f111412150f151113111a0f0d120f160b60801b60209092019182526200047991601c9162000820565b506040805180820190915260108082526f16131c0f15120f1a0d180d091111141760801b6020909201918252620004b391601d9162000820565b506040805180820190915260108082526f02e242a1e2824281a20282220222022360831b6020909201918252620004ed91601e9162000820565b506040805180820190915260108082526f0a8989078d8c0a09878a8a8b0d89888760811b60209092019182526200052791601f9162000820565b506040805180820190915260108082526f019152019131410181a13110a0f1214160841b60209283019081526200055f929162000820565b5060408051808201909152601480825272151015101b401b40392039205580558075007560641b60209092019182526200059c9160219162000820565b506040805180820190915260188082527ea400a400e900e905e105e10b140b140b5f0b5f132e132e00000000000000006020909201918252620005e29160229162000820565b506040805180820190915260108082526e92809282668266844a044a0a7b0a7b60811b60209092019182526200061b9160239162000820565b506040805180820190915260148082527f01b201b205180518056205620bac0bac161716170000000000000000000000006020909201918252620006629160249162000820565b506040805180820190915260148082527f02dc02dc06c506c50daa0daa105010501c7b1c7b0000000000000000000000006020909201918252620006a99160259162000820565b5060405180610140016040528061011a815260200162005b5a61011a91398051620006dd9160269160209091019062000820565b5060405180610160016040528061012a815260200162005eb061012a91398051620007119160279160209091019062000820565b5060405180610140016040528061010a815260200162005da661010a91398051620007459160289160209091019062000820565b50604051806101400160405280610120815260200162005fda61012091398051620007799160299160209091019062000820565b50604051806101600160405280610132815260200162005c7461013291398051620007ad91602a9160209091019062000820565b505062000ab5565b8051620007ca90600290602084019062000820565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200082e9062000a78565b90600052602060002090601f0160209004810192826200085257600085556200089d565b82601f106200086d57805160ff19168380011785556200089d565b828001600101855582156200089d579182015b828111156200089d57825182559160200191906001019062000880565b50620008ab9291506200091c565b5090565b82600581019282156200089d579160200282015b828111156200089d578251829060ff16905591602001919060010190620008c3565b82600581019282156200089d579160200282015b828111156200089d578251829061ffff16905591602001919060010190620008f9565b5b80821115620008ab57600081556001016200091d565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200096157600080fd5b919050565b600060208083850312156200097a57600080fd5b82516001600160401b03808211156200099257600080fd5b818501915085601f830112620009a757600080fd5b815181811115620009bc57620009bc62000933565b8060051b604051601f19603f83011681018181108582111715620009e457620009e462000933565b60405291825284820192508381018501918883111562000a0357600080fd5b938501935b8285101562000a2c5762000a1c8562000949565b8452938501939285019262000a08565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600060001982141562000a7157634e487b7160e01b600052601160045260246000fd5b5060010190565b600181811c9082168062000a8d57607f821691505b6020821081141562000aaf57634e487b7160e01b600052602260045260246000fd5b50919050565b6150958062000ac56000396000f3fe6080604052600436106101ab5760003560e01c806395d89b41116100ec578063d7959cf91161008a578063ec10cbe311610064578063ec10cbe3146104d7578063ef0b8784146104ea578063f242432a146104fd578063f2fde38b1461051d57600080fd5b8063d7959cf914610482578063e774883714610497578063e985e9c5146104b757600080fd5b8063b926ef9a116100c6578063b926ef9a146103e0578063c19d93fb1461041b578063c31fa08314610442578063cd7708331461046257600080fd5b806395d89b41146103985780639b594001146103ad578063a22cb465146103c057600080fd5b80632eb2c2d611610159578063715018a611610133578063715018a614610333578063853828b614610348578063857abbd4146103505780638da5cb5b1461037057600080fd5b80632eb2c2d6146102c45780634e1273f4146102e657806356de96db1461031357600080fd5b80630e89341c1161018a5780630e89341c1461023557806321328f9e146102555780632a55205a1461028557600080fd5b8062fdd58e146101b057806301ffc9a7146101e357806306fdde0314610213575b600080fd5b3480156101bc57600080fd5b506101d06101cb3660046141f7565b61053d565b6040519081526020015b60405180910390f35b3480156101ef57600080fd5b506102036101fe366004614239565b6105e9565b60405190151581526020016101da565b34801561021f57600080fd5b50610228610627565b6040516101da91906142ae565b34801561024157600080fd5b506102286102503660046142c1565b6106b5565b34801561026157600080fd5b506102036102703660046142da565b602b6020526000908152604090205460ff1681565b34801561029157600080fd5b506102a56102a03660046142f7565b610981565b604080516001600160a01b0390931683526020830191909152016101da565b3480156102d057600080fd5b506102e46102df366004614475565b6109b8565b005b3480156102f257600080fd5b50610306610301366004614523565b610a5a565b6040516101da919061462b565b34801561031f57600080fd5b506102e461032e36600461463e565b610b98565b34801561033f57600080fd5b506102e4610c19565b6102e4610c7f565b34801561035c57600080fd5b506102e461036b3660046142da565b610cfd565b34801561037c57600080fd5b506003546040516001600160a01b0390911681526020016101da565b3480156103a457600080fd5b50610228610e7b565b6102e46103bb3660046146a1565b610e88565b3480156103cc57600080fd5b506102e46103db366004614719565b611832565b3480156103ec57600080fd5b506102036103fb3660046141f7565b600860209081526000928352604080842090915290825290205460ff1681565b34801561042757600080fd5b506006546104359060ff1681565b6040516101da9190614768565b34801561044e57600080fd5b506102e461045d366004614790565b61191d565b34801561046e57600080fd5b506102e461047d3660046142da565b611988565b34801561048e57600080fd5b50610228611a11565b3480156104a357600080fd5b506103066104b23660046147d2565b611a1e565b3480156104c357600080fd5b506102036104d2366004614847565b611ad2565b6102e46104e5366004614875565b611c68565b6102e46104f83660046142f7565b61213e565b34801561050957600080fd5b506102e46105183660046148c1565b6126a9565b34801561052957600080fd5b506102e46105383660046142da565b612744565b60006001600160a01b0383166105c05760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b031982167f2a55205a0000000000000000000000000000000000000000000000000000000014806105e357506105e382612823565b600a80546106349061492a565b80601f01602080910402602001604051908101604052809291908181526020018280546106609061492a565b80156106ad5780601f10610682576101008083540402835291602001916106ad565b820191906000526020600020905b81548152906001019060200180831161069057829003601f168201915b505050505081565b6000818152600960205260409020546060906107135760405162461bcd60e51b815260206004820152601360248201527f52696e6720646f6573206e6f742065786973740000000000000000000000000060448201526064016105b7565b60065460405163c08a5dd560e01b81526004810184905260009161010090046001600160a01b03169063c08a5dd59060240160006040518083038186803b15801561075d57600080fd5b505afa158015610771573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107999190810190614965565b9050806000815181106107ae576107ae6149e7565b60209101015160f81c6022141561091f576000815160026107cf9190614a13565b67ffffffffffffffff8111156107e7576107e7614319565b6040519080825280601f01601f191660200182016040528015610811576020820181803683370190505b5090506000805b835181101561091957838181518110610833576108336149e7565b60209101015160f81c6022141561089a577f5c00000000000000000000000000000000000000000000000000000000000000838361087081614a2b565b945081518110610882576108826149e7565b60200101906001600160f81b031916908160001a9053505b8381815181106108ac576108ac6149e7565b01602001517fff000000000000000000000000000000000000000000000000000000000000001683836108de81614a2b565b9450815181106108f0576108f06149e7565b60200101906001600160f81b031916908160001a9053508061091181614a2b565b915050610818565b50909150505b600061095682600c610930876128be565b60405160200161094293929190614afc565b6040516020818303038152906040526129e0565b9050806040516020016109699190614cd7565b60405160208183030381529060405292505050919050565b6000806109966003546001600160a01b031690565b915060646109a5846005614d1c565b6109af9190614d51565b90509250929050565b6001600160a01b0385163314806109d457506109d48533611ad2565b610a465760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f766564000000000000000000000000000060648201526084016105b7565b610a538585858585612b7d565b5050505050565b60608151835114610ad35760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d61746368000000000000000000000000000000000000000000000060648201526084016105b7565b6000835167ffffffffffffffff811115610aef57610aef614319565b604051908082528060200260200182016040528015610b18578160200160208202803683370190505b50905060005b8451811015610b9057610b63858281518110610b3c57610b3c6149e7565b6020026020010151858381518110610b5657610b566149e7565b602002602001015161053d565b828281518110610b7557610b756149e7565b6020908102919091010152610b8981614a2b565b9050610b1e565b509392505050565b6003546001600160a01b03163314610bf25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b6006805482919060ff19166001836002811115610c1157610c11614752565b021790555050565b6003546001600160a01b03163314610c735760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b610c7d6000612de8565b565b6003546001600160a01b03163314610cd95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b60405133904780156108fc02916000818181858888f19350505050610c7d57600080fd5b6003546001600160a01b03163314610d575760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0382169063a9059cbb90339083906370a082319060240160206040518083038186803b158015610db957600080fd5b505afa158015610dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df19190614d65565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190614d7e565b610e7857600080fd5b50565b600b80546106349061492a565b6001600160a01b03851660009081526007602052604090205460ff16610ef05760405162461bcd60e51b815260206004820152600e60248201527f4e6f7420636f6d70617469626c6500000000000000000000000000000000000060448201526064016105b7565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810185905233906001600160a01b03871690636352211e9060240160206040518083038186803b158015610f4b57600080fd5b505afa158015610f5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f839190614d9b565b6001600160a01b031614610fd95760405162461bcd60e51b815260206004820152600960248201527f4e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016105b7565b60065460405163c08a5dd560e01b8152600481018590526101009091046001600160a01b03169063c08a5dd59060240160006040518083038186803b15801561102157600080fd5b505afa158015611035573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261105d9190810190614965565b60405160200161106d9190614db8565b60408051601f1981840301815290829052805160209091012063c08a5dd560e01b825260048201869052906001600160a01b0387169063c08a5dd59060240160006040518083038186803b1580156110c457600080fd5b505afa1580156110d8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111009190810190614965565b6040516020016111109190614db8565b60405160208183030381529060405280519060200120146111735760405162461bcd60e51b815260206004820152600a60248201527f57726f6e672072696e670000000000000000000000000000000000000000000060448201526064016105b7565b6001600160a01b038516600090815260086020908152604080832087845290915290205460ff16156111e75760405162461bcd60e51b815260206004820152600f60248201527f416c726561647920636c61696d6564000000000000000000000000000000000060448201526064016105b7565b6001600160a01b03851660009081526008602090815260408083208784529091528120805460ff191660011790558061121f856128be565b60405160200161122f9190614dd4565b60408051601f19818403018152919052805160209091012090506000611256601583614e19565b90506000611265600584614e19565b9050600260065460ff16600281111561128057611280614752565b14806112ae5750600160065460ff1660028111156112a0576112a0614752565b1480156112ae5750600e8211155b6112ec5760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b60448201526064016105b7565b600e821161138157600060128260058110611309576113096149e7565b0154116113475760405162461bcd60e51b815260206004820152600c60248201526b4e6f7420696e2073746f636b60a01b60448201526064016105b7565b66470de4df8200009350600160128260058110611366576113666149e7565b0160008282546113769190614e2d565b909155506117929050565b60138210156116c25766d529ae9e86000093506000806113b4601784600581106113ad576113ad6149e7565b018a612e47565b91509150816113f45760405162461bcd60e51b815260206004820152600c60248201526b4e6f7420696e2073746f636b60a01b60448201526064016105b7565b6000601c8460058110611409576114096149e7565b018281546114169061492a565b8110611424576114246149e7565b8154600116156114435790600052602060002090602091828204019190065b9054600160f81b911a0260f81c905061145d600182614e44565b905060ff8116156114da578060f81b601c856005811061147f5761147f6149e7565b0183815461148c9061492a565b811061149a5761149a6149e7565b8154600116156114b95790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b840402179055506116ba565b611501601785600581106114f0576114f06149e7565b016114fc846002614d1c565b612f62565b601c8460058110611514576115146149e7565b016001601c866005811061152a5761152a6149e7565b0180546115369061492a565b611541929150614e2d565b815461154c9061492a565b811061155a5761155a6149e7565b8154600116156115795790600052602060002090602091828204019190065b9054901a600160f81b02601c8560058110611596576115966149e7565b018381546115a39061492a565b81106115b1576115b16149e7565b8154600116156115d05790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b84040217905550601c84600581106115ff576115ff6149e7565b01805461160b8161492a565b8061162657634e487b7160e01b600052603160045260246000fd5b601f8111801561163d576001811461165f576116b5565b6001826021036101000a036001830392506002830284821916179350506116b5565b83600052602060002082602081146116a2576020600019808601828104949094018054601f959095169092036101000a01199092168255600119909401936116b2565b81546000835560ff1916603e1794505b50505b505090555b505050611792565b6000806116db602184600581106113ad576113ad6149e7565b9150915081156117175767016345785d8a0000955061171260218460058110611706576117066149e7565b016114fc836002614d1c565b61178f565b6701f161421c8e00009550611738602684600581106113ad576113ad6149e7565b9092509050816117795760405162461bcd60e51b815260206004820152600c60248201526b4e6f7420696e2073746f636b60a01b60448201526064016105b7565b61178f60268460058110611706576117066149e7565b50505b84156117a8576117a28686613297565b50600093505b8334146117e55760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b6000878152600960205260408120805460019290611804908490614a13565b925050819055506118273388600160405180602001604052806000815250613327565b505050505050505050565b336001600160a01b03831614156118b15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084016105b7565b3360008181526001602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6003546001600160a01b031633146119775760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b611983600c838361412b565b505050565b6003546001600160a01b031633146119e25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600c80546106349061492a565b60608167ffffffffffffffff811115611a3957611a39614319565b604051908082528060200260200182016040528015611a62578160200160208202803683370190505b50905060005b82811015611acb5760096000858584818110611a8657611a866149e7565b90506020020135815260200190815260200160002054828281518110611aae57611aae6149e7565b602090810291909101015280611ac381614a2b565b915050611a68565b5092915050565b60004660041415611b885760405163c455279160e01b81526001600160a01b03848116600483015283169073f57b2c51ded3a29e6891aba85459d600256cf3179063c45527919060240160206040518083038186803b158015611b3457600080fd5b505afa158015611b48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6c9190614d9b565b6001600160a01b03161415611b83575060016105e3565b611c37565b4660011415611c375760405163c455279160e01b81526001600160a01b03848116600483015283169073a5409ec958c83c3f309868babaca7c86dcb077c19063c45527919060240160206040518083038186803b158015611be857600080fd5b505afa158015611bfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c209190614d9b565b6001600160a01b03161415611c37575060016105e3565b6001600160a01b0380841660009081526001602090815260408083209386168352929052205460ff165b9392505050565b600160065460ff166002811115611c8157611c81614752565b1480611ca35750600260065460ff166002811115611ca157611ca1614752565b145b611ce15760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b60448201526064016105b7565b8015611d8357611cf18282613297565b5082600114611d425760405162461bcd60e51b815260206004820152601060248201527f43616e206f6e6c7920676574206f6e650000000000000000000000000000000060448201526064016105b7565b3415611d7e5760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b611e71565b60008311611dd35760405162461bcd60e51b815260206004820152601060248201527f427579206174206c65617374206f6e650000000000000000000000000000000060448201526064016105b7565b601a831115611e245760405162461bcd60e51b815260206004820152601060248201527f546f6f206d616e79206174206f6e63650000000000000000000000000000000060448201526064016105b7565b611e3566470de4df82000084614d1c565b3414611e715760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b6016546015546014546013546012548794939291611e8e91614a13565b611e989190614a13565b611ea29190614a13565b611eac9190614a13565b1015611efa5760405162461bcd60e51b815260206004820152600f60248201527f4e6f7420656e6f756768206c656674000000000000000000000000000000000060448201526064016105b7565b611f026141af565b60004233604051602001611f3292919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012060001c905060005b85811015612060575b60008211611fa95760405162461bcd60e51b815260206004820152601560248201527f72616e206f7574206f662072616e646f6d6e657373000000000000000000000060448201526064016105b7565b6000611fb6600584614e19565b9050611fc3600184614a13565b9250600060128260058110611fda57611fda6149e7565b0154111561203b576001848260058110611ff657611ff66149e7565b602002018181516120079190614a13565b90525060016012826005811061201f5761201f6149e7565b01600082825461202f9190614e2d565b90915550612041915050565b50611f59565b61204c600583614d51565b91508061205881614a2b565b915050611f50565b5060005b6005811015612136576000838260058110612081576120816149e7565b602002015111156121245782816005811061209e5761209e6149e7565b602002015160096000600d84600581106120ba576120ba6149e7565b0154815260200190815260200160002060008282546120d99190614a13565b90915550612124905033600d83600581106120f6576120f66149e7565b015485846005811061210a5761210a6149e7565b602002015160405180602001604052806000815250613327565b8061212e81614a2b565b915050612064565b505050505050565b600260065460ff16600281111561215757612157614752565b146121965760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b60448201526064016105b7565b600582106121e65760405162461bcd60e51b815260206004820152601160248201527f4e6f74206120636f6d6d6f6e2072696e6700000000000000000000000000000060448201526064016105b7565b6000600d83600581106121fb576121fb6149e7565b01549050600082600214156122695766470de4df820000341461224e5760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b60178460058110612261576122616149e7565b019050612371565b82600314156122c957668e1bc9bf04000034146122b65760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b60218460058110612261576122616149e7565b82600414156123295766d529ae9e86000034146123165760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b60268460058110612261576122616149e7565b60405162461bcd60e51b815260206004820152601d60248201527f57726f6e6720616d6f756e74206f662072696e677320746f206275726e00000060448201526064016105b7565b60008061237d8361344d565b9150915060008560021415612479576001601c88600581106123a1576123a16149e7565b016123ad600285614d51565b81546123b89061492a565b81106123c6576123c66149e7565b8154600116156123e55790600052602060002090602091828204019190065b9054901a600160f81b0260f81c6123fc9190614e44565b60ff1690508060f81b601c8860058110612418576124186149e7565b01612424600285614d51565b815461242f9061492a565b811061243d5761243d6149e7565b81546001161561245c5790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b840402179055505b80612654576124888483612f62565b856002141561265457601c87600581106124a4576124a46149e7565b016001601c89600581106124ba576124ba6149e7565b0180546124c69061492a565b6124d1929150614e2d565b81546124dc9061492a565b81106124ea576124ea6149e7565b8154600116156125095790600052602060002090602091828204019190065b9054901a600160f81b02601c8860058110612526576125266149e7565b01612532600285614d51565b815461253d9061492a565b811061254b5761254b6149e7565b81546001161561256a5790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b84040217905550601c8760058110612599576125996149e7565b0180546125a58161492a565b806125c057634e487b7160e01b600052603160045260246000fd5b601f811180156125d757600181146125f95761264f565b6001826021036101000a0360018303925060028302848219161793505061264f565b836000526020600020826020811461263c576020600019808601828104949094018054601f959095169092036101000a011990921682556001199094019361264c565b81546000835560ff1916603e1794505b50505b505090555b6000838152600960205260408120805460019290612673908490614a13565b90915550612684905033868861350c565b6126a03384600160405180602001604052806000815250613327565b50505050505050565b6001600160a01b0385163314806126c557506126c58533611ad2565b6127375760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f766564000000000000000000000000000000000000000000000060648201526084016105b7565b610a5385858585856136b9565b6003546001600160a01b0316331461279e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b6001600160a01b03811661281a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016105b7565b610e7881612de8565b60006001600160e01b031982167fd9b67a2600000000000000000000000000000000000000000000000000000000148061288657506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b806105e357507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146105e3565b6060816128fe57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612928578061291281614a2b565b91506129219050600a83614d51565b9150612902565b60008167ffffffffffffffff81111561294357612943614319565b6040519080825280601f01601f19166020018201604052801561296d576020820181803683370190505b5090505b84156129d857612982600183614e2d565b915061298f600a86614e19565b61299a906030614a13565b60f81b8183815181106129af576129af6149e7565b60200101906001600160f81b031916908160001a9053506129d1600a86614d51565b9450612971565b949350505050565b6060815160001415612a0057505060408051602081019091526000815290565b60006040518060600160405280604081526020016150206040913990506000600384516002612a2f9190614a13565b612a399190614d51565b612a44906004614d1c565b90506000612a53826020614a13565b67ffffffffffffffff811115612a6b57612a6b614319565b6040519080825280601f01601f191660200182016040528015612a95576020820181803683370190505b509050818152600183018586518101602084015b81831015612b01576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f8116850151825350600101612aa9565b600389510660018114612b1b5760028114612b4757612b6f565b7f3d3d000000000000000000000000000000000000000000000000000000000000600119830152612b6f565b7f3d000000000000000000000000000000000000000000000000000000000000006000198301525b509398975050505050505050565b8151835114612bf45760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d6174636800000000000000000000000000000000000000000000000060648201526084016105b7565b6001600160a01b038416612c585760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016105b7565b3360005b8451811015612d82576000858281518110612c7957612c796149e7565b602002602001015190506000858381518110612c9757612c976149e7565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015612d2a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016105b7565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612d67908490614a13565b9250508190555050505080612d7b90614a2b565b9050612c5c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612dd2929190614e67565b60405180910390a461213681878787878761384e565b600380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060005b6002858054612e5b9061492a565b612e66929150614d51565b811015612f525760ff600885901c1685612e81836002614d1c565b8154612e8c9061492a565b8110612e9a57612e9a6149e7565b815460011615612eb95790600052602060002090602091828204019190065b9054600160f81b911a0260f81c148015612f30575060ff841685612ede836002614d1c565b612ee9906001614a13565b8154612ef49061492a565b8110612f0257612f026149e7565b815460011615612f215790600052602060002090602091828204019190065b9054600160f81b911a0260f81c145b15612f4057600192509050612f5b565b80612f4a81614a2b565b915050612e4d565b50600080915091505b9250929050565b6000828054612f709061492a565b905011612faf5760405162461bcd60e51b815260206004820152600d60248201526c6461746120697320656d70747960981b60448201526064016105b7565b816002838054612fbe9061492a565b612fc9929150614e2d565b8154612fd49061492a565b8110612fe257612fe26149e7565b8154600116156130015790600052602060002090602091828204019190065b9054901a600160f81b02828281546130189061492a565b8110613026576130266149e7565b8154600116156130455790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b840402179055508160018380546130709061492a565b61307b929150614e2d565b81546130869061492a565b8110613094576130946149e7565b8154600116156130b35790600052602060002090602091828204019190065b9054600160f81b911a02826130c9836001614a13565b81546130d49061492a565b81106130e2576130e26149e7565b8154600116156131015790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b840402179055508180548061312a9061492a565b8061314557634e487b7160e01b600052603160045260246000fd5b601f8111801561315c576001811461317e576131d4565b6001826021036101000a036001830392506002830284821916179350506131d4565b83600052602060002082602081146131c1576020600019808601828104949094018054601f959095169092036101000a01199092168255600119909401936131d1565b81546000835560ff1916603e1794505b50505b50509055815482906131e58161492a565b8061320057634e487b7160e01b600052603160045260246000fd5b601f8111801561321757600181146132395761328f565b6001826021036101000a0360018303925060028302848219161793505061328f565b836000526020600020826020811461327c576020600019808601828104949094018054601f959095169092036101000a011990921682556001199094019361328c565b81546000835560ff1916603e1794505b50505b505090555050565b60006132a38383613a03565b336000908152602b602052604090205460ff16156133035760405162461bcd60e51b815260206004820152600c60248201527f416c72656164792075736564000000000000000000000000000000000000000060448201526064016105b7565b50336000908152602b60205260409020805460ff1916600190811790915592915050565b6001600160a01b0384166133a35760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016105b7565b336133bd816000876133b488613bb1565b610a5388613bb1565b6000848152602081815260408083206001600160a01b0389168452909152812080548592906133ed908490614a13565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610a5381600087878787613bfc565b600080600083805461345e9061492a565b90501161349d5760405162461bcd60e51b815260206004820152600d60248201526c6461746120697320656d70747960981b60448201526064016105b7565b60408051426020820152600091016040516020818303038152906040528051906020012060001c90508380546134d29061492a565b6134dd915082614e19565b91506134ea600283614e19565b6134f49083614e2d565b91506135008483613d07565b61ffff16925050915091565b6001600160a01b0383166135885760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016105b7565b336135b88185600061359987613bb1565b6135a287613bb1565b5050604080516020810190915260009052505050565b6000838152602081815260408083206001600160a01b03881684529091529020548281101561364e5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e63650000000000000000000000000000000000000000000000000000000060648201526084016105b7565b6000848152602081815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6001600160a01b03841661371d5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016105b7565b3361372d8187876133b488613bb1565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156137b15760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016105b7565b6000858152602081815260408083206001600160a01b038b81168552925280832087850390559088168252812080548692906137ee908490614a13565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46126a0828888888888613bfc565b6001600160a01b0384163b156121365760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906138929089908990889088908890600401614e95565b602060405180830381600087803b1580156138ac57600080fd5b505af19250505080156138dc575060408051601f3d908101601f191682019092526138d991810190614ef3565b60015b613992576138e8614f10565b806308c379a0141561392257506138fd614f2c565b806139085750613924565b8060405162461bcd60e51b81526004016105b791906142ae565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016105b7565b6001600160e01b0319811663bc197c8160e01b146126a05760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016105b7565b6004546001600160a01b0316613a5b5760405162461bcd60e51b815260206004820152601560248201527f57686974656c697374206e6f7420656e61626c6564000000000000000000000060448201526064016105b7565b600554604080517f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c9602082015233918101919091526000919060600160405160208183030381529060405280519060200120604051602001613aef9291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6040516020818303038152906040528051906020012090506000613b4b84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050613db29050565b6004549091506001600160a01b03808316911614613bab5760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964205369676e617475726500000000000000000000000000000060448201526064016105b7565b50505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613beb57613beb6149e7565b602090810291909101015292915050565b6001600160a01b0384163b156121365760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190613c409089908990889088908890600401614fb6565b602060405180830381600087803b158015613c5a57600080fd5b505af1925050508015613c8a575060408051601f3d908101601f19168201909252613c8791810190614ef3565b60015b613c96576138e8614f10565b6001600160e01b0319811663f23a6e6160e01b146126a05760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016105b7565b600082613d15836001614a13565b8154613d209061492a565b8110613d2e57613d2e6149e7565b815460011615613d4d5790600052602060002090602091828204019190065b9054901a600160f81b0260f81c60ff16600884848154613d6c9061492a565b8110613d7a57613d7a6149e7565b815460011615613d995790600052602060002090602091828204019190065b9054611c619392911a600160f81b0260f81c901b614ff9565b6000806000613dc18585613dce565b91509150610b9081613e3b565b600080825160411415613e055760208301516040840151606085015160001a613df987828585613ff6565b94509450505050612f5b565b825160401415613e2f5760208301516040840151613e248683836140e3565b935093505050612f5b565b50600090506002612f5b565b6000816004811115613e4f57613e4f614752565b1415613e585750565b6001816004811115613e6c57613e6c614752565b1415613eba5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105b7565b6002816004811115613ece57613ece614752565b1415613f1c5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105b7565b6003816004811115613f3057613f30614752565b1415613f895760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105b7565b6004816004811115613f9d57613f9d614752565b1415610e785760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105b7565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561402d57506000905060036140da565b8460ff16601b1415801561404557508460ff16601c14155b1561405657506000905060046140da565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156140aa573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166140d3576000600192509250506140da565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b0161411d87828885613ff6565b935093505050935093915050565b8280546141379061492a565b90600052602060002090601f016020900481019282614159576000855561419f565b82601f106141725782800160ff1982351617855561419f565b8280016001018555821561419f579182015b8281111561419f578235825591602001919060010190614184565b506141ab9291506141cd565b5090565b6040518060a001604052806005906020820280368337509192915050565b5b808211156141ab57600081556001016141ce565b6001600160a01b0381168114610e7857600080fd5b6000806040838503121561420a57600080fd5b8235614215816141e2565b946020939093013593505050565b6001600160e01b031981168114610e7857600080fd5b60006020828403121561424b57600080fd5b8135611c6181614223565b60005b83811015614271578181015183820152602001614259565b83811115613bab5750506000910152565b6000815180845261429a816020860160208601614256565b601f01601f19169290920160200192915050565b602081526000611c616020830184614282565b6000602082840312156142d357600080fd5b5035919050565b6000602082840312156142ec57600080fd5b8135611c61816141e2565b6000806040838503121561430a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff8111828210171561435557614355614319565b6040525050565b600067ffffffffffffffff82111561437657614376614319565b5060051b60200190565b600082601f83011261439157600080fd5b8135602061439e8261435c565b6040516143ab828261432f565b83815260059390931b85018201928281019150868411156143cb57600080fd5b8286015b848110156143e657803583529183019183016143cf565b509695505050505050565b600067ffffffffffffffff82111561440b5761440b614319565b50601f01601f191660200190565b600082601f83011261442a57600080fd5b8135614435816143f1565b604051614442828261432f565b82815285602084870101111561445757600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561448d57600080fd5b8535614498816141e2565b945060208601356144a8816141e2565b9350604086013567ffffffffffffffff808211156144c557600080fd5b6144d189838a01614380565b945060608801359150808211156144e757600080fd5b6144f389838a01614380565b9350608088013591508082111561450957600080fd5b5061451688828901614419565b9150509295509295909350565b6000806040838503121561453657600080fd5b823567ffffffffffffffff8082111561454e57600080fd5b818501915085601f83011261456257600080fd5b8135602061456f8261435c565b60405161457c828261432f565b83815260059390931b850182019282810191508984111561459c57600080fd5b948201945b838610156145c35785356145b4816141e2565b825294820194908201906145a1565b965050860135925050808211156145d957600080fd5b506145e685828601614380565b9150509250929050565b600081518084526020808501945080840160005b8381101561462057815187529582019590820190600101614604565b509495945050505050565b602081526000611c6160208301846145f0565b60006020828403121561465057600080fd5b813560038110611c6157600080fd5b60008083601f84011261467157600080fd5b50813567ffffffffffffffff81111561468957600080fd5b602083019150836020828501011115612f5b57600080fd5b6000806000806000608086880312156146b957600080fd5b85356146c4816141e2565b94506020860135935060408601359250606086013567ffffffffffffffff8111156146ee57600080fd5b6146fa8882890161465f565b969995985093965092949392505050565b8015158114610e7857600080fd5b6000806040838503121561472c57600080fd5b8235614737816141e2565b915060208301356147478161470b565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b602081016003831061478a57634e487b7160e01b600052602160045260246000fd5b91905290565b600080602083850312156147a357600080fd5b823567ffffffffffffffff8111156147ba57600080fd5b6147c68582860161465f565b90969095509350505050565b600080602083850312156147e557600080fd5b823567ffffffffffffffff808211156147fd57600080fd5b818501915085601f83011261481157600080fd5b81358181111561482057600080fd5b8660208260051b850101111561483557600080fd5b60209290920196919550909350505050565b6000806040838503121561485a57600080fd5b8235614865816141e2565b91506020830135614747816141e2565b60008060006040848603121561488a57600080fd5b83359250602084013567ffffffffffffffff8111156148a857600080fd5b6148b48682870161465f565b9497909650939450505050565b600080600080600060a086880312156148d957600080fd5b85356148e4816141e2565b945060208601356148f4816141e2565b93506040860135925060608601359150608086013567ffffffffffffffff81111561491e57600080fd5b61451688828901614419565b600181811c9082168061493e57607f821691505b6020821081141561495f57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561497757600080fd5b815167ffffffffffffffff81111561498e57600080fd5b8201601f8101841361499f57600080fd5b80516149aa816143f1565b6040516149b7828261432f565b8281528660208486010111156149cc57600080fd5b6149dd836020830160208701614256565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115614a2657614a266149fd565b500190565b6000600019821415614a3f57614a3f6149fd565b5060010190565b60008151614a58818560208601614256565b9290920192915050565b8054600090600181811c9080831680614a7c57607f831692505b6020808410821415614a9e57634e487b7160e01b600052602260045260246000fd5b818015614ab25760018114614ac357614af0565b60ff19861689528489019650614af0565b60008881526020902060005b86811015614ae85781548b820152908501908301614acf565b505084890196505b50505050505092915050565b7f7b226e616d65223a202200000000000000000000000000000000000000000000815260008451614b3481600a850160208901614256565b7f222c20226465736372697074696f6e223a202252696e67732028666f72204c6f600a918401918201527f6f74292069732074686520666972737420616e64206c61726765737420334420602a8201527f696e746572707265746174696f6e206f6620616e20656e746972652063617465604a8201527f676f727920696e204c6f6f742e20416476656e7475726572732c206275696c64606a8201527f6572732c20616e6420617274697374732061726520656e636f75726167656420608a8201527f746f207265666572656e63652052696e67732028666f72204c6f6f742920746f60aa8201527f206675727468657220657870616e64206f6e2074686520696d6167696e61746960ca8201527f6f6e206f66204c6f6f742e222c2022696d616765223a2022697066733a2f2f0060ea8201526149dd614cae614ca8614c7f610109850189614a62565b7f2f00000000000000000000000000000000000000000000000000000000000000815260010190565b86614a46565b7f2e6a7067227d0000000000000000000000000000000000000000000000000000815260060190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251614d0f81601d850160208701614256565b91909101601d0192915050565b6000816000190483118215151615614d3657614d366149fd565b500290565b634e487b7160e01b600052601260045260246000fd5b600082614d6057614d60614d3b565b500490565b600060208284031215614d7757600080fd5b5051919050565b600060208284031215614d9057600080fd5b8151611c618161470b565b600060208284031215614dad57600080fd5b8151611c61816141e2565b60008251614dca818460208701614256565b9190910192915050565b7f52494e4700000000000000000000000000000000000000000000000000000000815260008251614e0c816004850160208701614256565b9190910160040192915050565b600082614e2857614e28614d3b565b500690565b600082821015614e3f57614e3f6149fd565b500390565b600060ff821660ff841680821015614e5e57614e5e6149fd565b90039392505050565b604081526000614e7a60408301856145f0565b8281036020840152614e8c81856145f0565b95945050505050565b60006001600160a01b03808816835280871660208401525060a06040830152614ec160a08301866145f0565b8281036060840152614ed381866145f0565b90508281036080840152614ee78185614282565b98975050505050505050565b600060208284031215614f0557600080fd5b8151611c6181614223565b600060033d1115614f295760046000803e5060005160e01c5b90565b600060443d1015614f3a5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715614f6a57505050505090565b8285019150815181811115614f825750505050505090565b843d8701016020828501011115614f9c5750505050505090565b614fab6020828601018761432f565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152614fee60a0830184614282565b979650505050505050565b600061ffff808316818516808303821115615016576150166149fd565b0194935050505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122030563407d903270a087f6555335e742972358ef08884b242b38ef82941f73ec764736f6c6343000809003300220123013b014c01e002d20325039603a003f903fe041504310448046c053b0561059305c505ee0638063a064c065a069b06a506c306f907050831083b08a70916095e09a00a120a5a0aa00aac0ab50aed0b1f0b280b340b5d0b890bbb0bc40c710c7a0c820cca0cd30cea0d2e0d340d550ef20f120f200f4e0f540f7d0fa410011014105e1070109f10b310d710e81101110d114b1176118111be11c6124f125812a412fe130d1378139413af13b213ec142d147814a214c914de14df14fd1543157f158115901598159a15a916df16f316ff170b171a175a179717e5187418d818ef18fc190a193c194519461a001a911a961abd1af31b1b1bcd1bd61c441c471c911cbd1cda1d031d651d9c1dfa1e391e6e1e8f1ef51f1c00380044006b00810104011101680170018501bd01c202190288028d02f002ff032b03720390042c045c04b204e60603061d063c064506b806c606db06e5071f07480765078207de082f088008f1090b09250943095f098b09ae09bc09cd09ea0a6d0a920a9f0aa30b210b7f0b960ba60bc90bcd0bcf0be40bf70bfa0c3a0c450c560d5d0de20e400e820e8b0e9d0eae0ec90ef70f520f7e0f910fb20fc40fd5103710561061110c115311641183118711a211fe1208124b131813441349136e13a613aa13cb13df147a14c214d91503150d15341629163f170c17b817f21816184c1856188618a3190e191a191b19341957197a1a171a321a371a511a601a691aa41ad31b2f1b3b1b791ba21beb1c341c7d1ce01d081d121d1f1d201d451d471d8e1e151e471ec91ed51eda1f041f131f1b001d0061007700dc01c4021b0221023c023d024e025e026b02bf02e9030903120358035a036603880424043c04d104dd05c205cc05d3061b06410680069c0766078f07d307d907e907f0082d0844089f08b208d4095709660983098609ac09d209fb0a1b0a4b0b020b660b930bd90c620d1b0d440d8c0db30dc30ddc0ed90f3e0f530f5b0fed0ffc103210bb11c81215132313471350137e13bc13c4140e14331493151b159415de15ec15f015f415fe161b167316a716b117701796179d17cb17e0181818311849189f18a918c918d718ff1956197d19a219d91acd1adc1ae91aea1b361b9c1bec1c871cc11ccd1cd61ce11cf51d141d1b1d311d5a1d621d681d6f1d741d901d9a1dba0025007e008200c500df016c01ee01fa02010211024202d802f3033c038203b003b303f70416041f042a0434053e056f05a505b605d505db06240653067d06e407380773079c07d2085e086e087c08b508bd08d70914097209d10a500a5b0a9c0ab10abd0b070b180b1d0b6f0b940c2f0c600c750c8d0cfa0d1f0d260d320d910de80e910e9b0eb00ed80edb0ef80f24104a106f107f109510c5110211261134118c11a011a111cc11d71274128a129212af12d712d9133b1343138413881412142c143a149a14c714ed15511580167016c716fb171017421763177817a117f8182e187619181924192b1967198019a719fa1a3f1a4a1a811ada1b111b2a1b4e1b5c1b621ba41bf11c2a1c701d001d161d361d611d731d781dc51dcb1dcf1e141ea31ea71eee1efd1f29004200bf00d30107010e0116013001da01e102030208021402710273029b02b40359037403a903df041104370460048b04aa04e905510554055e0566057205c105ca05f00635066706b5071007200732076a07b60806086508c508e608fd095b099f0a030a220b7e0b810be20c330c350c380c9d0ca80cd40cd60d010d090d280dbb0df00dfc0e060ede0ee80f410fa810ac114e1150115e11c111ed11f711f912041216121f124112681309130f133f137313be14211427142f1459146e155415a715a815b11606164c168f1706182c189518b918c118e518ed194b198919f51a1f1a671a901ac11ad01b401b681b6f1b721b8a1bda1c6f1c8c1c9c1d3c1d551d661d801d9d1dea1def1e0b1e111e181e341e941ea51eb71ebd1ed11f0c1f1600000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000ff9c1b15b16263c61d017ee9f65c50e4ae0113d70000000000000000000000001dfe7ca09e99d10835bf73044a23b73fc20623df0000000000000000000000008db687aceb92c66f013e1d614137238cc698fedb
Deployed Bytecode
0x6080604052600436106101ab5760003560e01c806395d89b41116100ec578063d7959cf91161008a578063ec10cbe311610064578063ec10cbe3146104d7578063ef0b8784146104ea578063f242432a146104fd578063f2fde38b1461051d57600080fd5b8063d7959cf914610482578063e774883714610497578063e985e9c5146104b757600080fd5b8063b926ef9a116100c6578063b926ef9a146103e0578063c19d93fb1461041b578063c31fa08314610442578063cd7708331461046257600080fd5b806395d89b41146103985780639b594001146103ad578063a22cb465146103c057600080fd5b80632eb2c2d611610159578063715018a611610133578063715018a614610333578063853828b614610348578063857abbd4146103505780638da5cb5b1461037057600080fd5b80632eb2c2d6146102c45780634e1273f4146102e657806356de96db1461031357600080fd5b80630e89341c1161018a5780630e89341c1461023557806321328f9e146102555780632a55205a1461028557600080fd5b8062fdd58e146101b057806301ffc9a7146101e357806306fdde0314610213575b600080fd5b3480156101bc57600080fd5b506101d06101cb3660046141f7565b61053d565b6040519081526020015b60405180910390f35b3480156101ef57600080fd5b506102036101fe366004614239565b6105e9565b60405190151581526020016101da565b34801561021f57600080fd5b50610228610627565b6040516101da91906142ae565b34801561024157600080fd5b506102286102503660046142c1565b6106b5565b34801561026157600080fd5b506102036102703660046142da565b602b6020526000908152604090205460ff1681565b34801561029157600080fd5b506102a56102a03660046142f7565b610981565b604080516001600160a01b0390931683526020830191909152016101da565b3480156102d057600080fd5b506102e46102df366004614475565b6109b8565b005b3480156102f257600080fd5b50610306610301366004614523565b610a5a565b6040516101da919061462b565b34801561031f57600080fd5b506102e461032e36600461463e565b610b98565b34801561033f57600080fd5b506102e4610c19565b6102e4610c7f565b34801561035c57600080fd5b506102e461036b3660046142da565b610cfd565b34801561037c57600080fd5b506003546040516001600160a01b0390911681526020016101da565b3480156103a457600080fd5b50610228610e7b565b6102e46103bb3660046146a1565b610e88565b3480156103cc57600080fd5b506102e46103db366004614719565b611832565b3480156103ec57600080fd5b506102036103fb3660046141f7565b600860209081526000928352604080842090915290825290205460ff1681565b34801561042757600080fd5b506006546104359060ff1681565b6040516101da9190614768565b34801561044e57600080fd5b506102e461045d366004614790565b61191d565b34801561046e57600080fd5b506102e461047d3660046142da565b611988565b34801561048e57600080fd5b50610228611a11565b3480156104a357600080fd5b506103066104b23660046147d2565b611a1e565b3480156104c357600080fd5b506102036104d2366004614847565b611ad2565b6102e46104e5366004614875565b611c68565b6102e46104f83660046142f7565b61213e565b34801561050957600080fd5b506102e46105183660046148c1565b6126a9565b34801561052957600080fd5b506102e46105383660046142da565b612744565b60006001600160a01b0383166105c05760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b031982167f2a55205a0000000000000000000000000000000000000000000000000000000014806105e357506105e382612823565b600a80546106349061492a565b80601f01602080910402602001604051908101604052809291908181526020018280546106609061492a565b80156106ad5780601f10610682576101008083540402835291602001916106ad565b820191906000526020600020905b81548152906001019060200180831161069057829003601f168201915b505050505081565b6000818152600960205260409020546060906107135760405162461bcd60e51b815260206004820152601360248201527f52696e6720646f6573206e6f742065786973740000000000000000000000000060448201526064016105b7565b60065460405163c08a5dd560e01b81526004810184905260009161010090046001600160a01b03169063c08a5dd59060240160006040518083038186803b15801561075d57600080fd5b505afa158015610771573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107999190810190614965565b9050806000815181106107ae576107ae6149e7565b60209101015160f81c6022141561091f576000815160026107cf9190614a13565b67ffffffffffffffff8111156107e7576107e7614319565b6040519080825280601f01601f191660200182016040528015610811576020820181803683370190505b5090506000805b835181101561091957838181518110610833576108336149e7565b60209101015160f81c6022141561089a577f5c00000000000000000000000000000000000000000000000000000000000000838361087081614a2b565b945081518110610882576108826149e7565b60200101906001600160f81b031916908160001a9053505b8381815181106108ac576108ac6149e7565b01602001517fff000000000000000000000000000000000000000000000000000000000000001683836108de81614a2b565b9450815181106108f0576108f06149e7565b60200101906001600160f81b031916908160001a9053508061091181614a2b565b915050610818565b50909150505b600061095682600c610930876128be565b60405160200161094293929190614afc565b6040516020818303038152906040526129e0565b9050806040516020016109699190614cd7565b60405160208183030381529060405292505050919050565b6000806109966003546001600160a01b031690565b915060646109a5846005614d1c565b6109af9190614d51565b90509250929050565b6001600160a01b0385163314806109d457506109d48533611ad2565b610a465760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f766564000000000000000000000000000060648201526084016105b7565b610a538585858585612b7d565b5050505050565b60608151835114610ad35760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d61746368000000000000000000000000000000000000000000000060648201526084016105b7565b6000835167ffffffffffffffff811115610aef57610aef614319565b604051908082528060200260200182016040528015610b18578160200160208202803683370190505b50905060005b8451811015610b9057610b63858281518110610b3c57610b3c6149e7565b6020026020010151858381518110610b5657610b566149e7565b602002602001015161053d565b828281518110610b7557610b756149e7565b6020908102919091010152610b8981614a2b565b9050610b1e565b509392505050565b6003546001600160a01b03163314610bf25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b6006805482919060ff19166001836002811115610c1157610c11614752565b021790555050565b6003546001600160a01b03163314610c735760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b610c7d6000612de8565b565b6003546001600160a01b03163314610cd95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b60405133904780156108fc02916000818181858888f19350505050610c7d57600080fd5b6003546001600160a01b03163314610d575760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0382169063a9059cbb90339083906370a082319060240160206040518083038186803b158015610db957600080fd5b505afa158015610dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df19190614d65565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190614d7e565b610e7857600080fd5b50565b600b80546106349061492a565b6001600160a01b03851660009081526007602052604090205460ff16610ef05760405162461bcd60e51b815260206004820152600e60248201527f4e6f7420636f6d70617469626c6500000000000000000000000000000000000060448201526064016105b7565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810185905233906001600160a01b03871690636352211e9060240160206040518083038186803b158015610f4b57600080fd5b505afa158015610f5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f839190614d9b565b6001600160a01b031614610fd95760405162461bcd60e51b815260206004820152600960248201527f4e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064016105b7565b60065460405163c08a5dd560e01b8152600481018590526101009091046001600160a01b03169063c08a5dd59060240160006040518083038186803b15801561102157600080fd5b505afa158015611035573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261105d9190810190614965565b60405160200161106d9190614db8565b60408051601f1981840301815290829052805160209091012063c08a5dd560e01b825260048201869052906001600160a01b0387169063c08a5dd59060240160006040518083038186803b1580156110c457600080fd5b505afa1580156110d8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111009190810190614965565b6040516020016111109190614db8565b60405160208183030381529060405280519060200120146111735760405162461bcd60e51b815260206004820152600a60248201527f57726f6e672072696e670000000000000000000000000000000000000000000060448201526064016105b7565b6001600160a01b038516600090815260086020908152604080832087845290915290205460ff16156111e75760405162461bcd60e51b815260206004820152600f60248201527f416c726561647920636c61696d6564000000000000000000000000000000000060448201526064016105b7565b6001600160a01b03851660009081526008602090815260408083208784529091528120805460ff191660011790558061121f856128be565b60405160200161122f9190614dd4565b60408051601f19818403018152919052805160209091012090506000611256601583614e19565b90506000611265600584614e19565b9050600260065460ff16600281111561128057611280614752565b14806112ae5750600160065460ff1660028111156112a0576112a0614752565b1480156112ae5750600e8211155b6112ec5760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b60448201526064016105b7565b600e821161138157600060128260058110611309576113096149e7565b0154116113475760405162461bcd60e51b815260206004820152600c60248201526b4e6f7420696e2073746f636b60a01b60448201526064016105b7565b66470de4df8200009350600160128260058110611366576113666149e7565b0160008282546113769190614e2d565b909155506117929050565b60138210156116c25766d529ae9e86000093506000806113b4601784600581106113ad576113ad6149e7565b018a612e47565b91509150816113f45760405162461bcd60e51b815260206004820152600c60248201526b4e6f7420696e2073746f636b60a01b60448201526064016105b7565b6000601c8460058110611409576114096149e7565b018281546114169061492a565b8110611424576114246149e7565b8154600116156114435790600052602060002090602091828204019190065b9054600160f81b911a0260f81c905061145d600182614e44565b905060ff8116156114da578060f81b601c856005811061147f5761147f6149e7565b0183815461148c9061492a565b811061149a5761149a6149e7565b8154600116156114b95790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b840402179055506116ba565b611501601785600581106114f0576114f06149e7565b016114fc846002614d1c565b612f62565b601c8460058110611514576115146149e7565b016001601c866005811061152a5761152a6149e7565b0180546115369061492a565b611541929150614e2d565b815461154c9061492a565b811061155a5761155a6149e7565b8154600116156115795790600052602060002090602091828204019190065b9054901a600160f81b02601c8560058110611596576115966149e7565b018381546115a39061492a565b81106115b1576115b16149e7565b8154600116156115d05790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b84040217905550601c84600581106115ff576115ff6149e7565b01805461160b8161492a565b8061162657634e487b7160e01b600052603160045260246000fd5b601f8111801561163d576001811461165f576116b5565b6001826021036101000a036001830392506002830284821916179350506116b5565b83600052602060002082602081146116a2576020600019808601828104949094018054601f959095169092036101000a01199092168255600119909401936116b2565b81546000835560ff1916603e1794505b50505b505090555b505050611792565b6000806116db602184600581106113ad576113ad6149e7565b9150915081156117175767016345785d8a0000955061171260218460058110611706576117066149e7565b016114fc836002614d1c565b61178f565b6701f161421c8e00009550611738602684600581106113ad576113ad6149e7565b9092509050816117795760405162461bcd60e51b815260206004820152600c60248201526b4e6f7420696e2073746f636b60a01b60448201526064016105b7565b61178f60268460058110611706576117066149e7565b50505b84156117a8576117a28686613297565b50600093505b8334146117e55760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b6000878152600960205260408120805460019290611804908490614a13565b925050819055506118273388600160405180602001604052806000815250613327565b505050505050505050565b336001600160a01b03831614156118b15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084016105b7565b3360008181526001602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6003546001600160a01b031633146119775760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b611983600c838361412b565b505050565b6003546001600160a01b031633146119e25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600c80546106349061492a565b60608167ffffffffffffffff811115611a3957611a39614319565b604051908082528060200260200182016040528015611a62578160200160208202803683370190505b50905060005b82811015611acb5760096000858584818110611a8657611a866149e7565b90506020020135815260200190815260200160002054828281518110611aae57611aae6149e7565b602090810291909101015280611ac381614a2b565b915050611a68565b5092915050565b60004660041415611b885760405163c455279160e01b81526001600160a01b03848116600483015283169073f57b2c51ded3a29e6891aba85459d600256cf3179063c45527919060240160206040518083038186803b158015611b3457600080fd5b505afa158015611b48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6c9190614d9b565b6001600160a01b03161415611b83575060016105e3565b611c37565b4660011415611c375760405163c455279160e01b81526001600160a01b03848116600483015283169073a5409ec958c83c3f309868babaca7c86dcb077c19063c45527919060240160206040518083038186803b158015611be857600080fd5b505afa158015611bfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c209190614d9b565b6001600160a01b03161415611c37575060016105e3565b6001600160a01b0380841660009081526001602090815260408083209386168352929052205460ff165b9392505050565b600160065460ff166002811115611c8157611c81614752565b1480611ca35750600260065460ff166002811115611ca157611ca1614752565b145b611ce15760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b60448201526064016105b7565b8015611d8357611cf18282613297565b5082600114611d425760405162461bcd60e51b815260206004820152601060248201527f43616e206f6e6c7920676574206f6e650000000000000000000000000000000060448201526064016105b7565b3415611d7e5760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b611e71565b60008311611dd35760405162461bcd60e51b815260206004820152601060248201527f427579206174206c65617374206f6e650000000000000000000000000000000060448201526064016105b7565b601a831115611e245760405162461bcd60e51b815260206004820152601060248201527f546f6f206d616e79206174206f6e63650000000000000000000000000000000060448201526064016105b7565b611e3566470de4df82000084614d1c565b3414611e715760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b6016546015546014546013546012548794939291611e8e91614a13565b611e989190614a13565b611ea29190614a13565b611eac9190614a13565b1015611efa5760405162461bcd60e51b815260206004820152600f60248201527f4e6f7420656e6f756768206c656674000000000000000000000000000000000060448201526064016105b7565b611f026141af565b60004233604051602001611f3292919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012060001c905060005b85811015612060575b60008211611fa95760405162461bcd60e51b815260206004820152601560248201527f72616e206f7574206f662072616e646f6d6e657373000000000000000000000060448201526064016105b7565b6000611fb6600584614e19565b9050611fc3600184614a13565b9250600060128260058110611fda57611fda6149e7565b0154111561203b576001848260058110611ff657611ff66149e7565b602002018181516120079190614a13565b90525060016012826005811061201f5761201f6149e7565b01600082825461202f9190614e2d565b90915550612041915050565b50611f59565b61204c600583614d51565b91508061205881614a2b565b915050611f50565b5060005b6005811015612136576000838260058110612081576120816149e7565b602002015111156121245782816005811061209e5761209e6149e7565b602002015160096000600d84600581106120ba576120ba6149e7565b0154815260200190815260200160002060008282546120d99190614a13565b90915550612124905033600d83600581106120f6576120f66149e7565b015485846005811061210a5761210a6149e7565b602002015160405180602001604052806000815250613327565b8061212e81614a2b565b915050612064565b505050505050565b600260065460ff16600281111561215757612157614752565b146121965760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b60448201526064016105b7565b600582106121e65760405162461bcd60e51b815260206004820152601160248201527f4e6f74206120636f6d6d6f6e2072696e6700000000000000000000000000000060448201526064016105b7565b6000600d83600581106121fb576121fb6149e7565b01549050600082600214156122695766470de4df820000341461224e5760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b60178460058110612261576122616149e7565b019050612371565b82600314156122c957668e1bc9bf04000034146122b65760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b60218460058110612261576122616149e7565b82600414156123295766d529ae9e86000034146123165760405162461bcd60e51b815260206004820152600b60248201526a57726f6e6720707269636560a81b60448201526064016105b7565b60268460058110612261576122616149e7565b60405162461bcd60e51b815260206004820152601d60248201527f57726f6e6720616d6f756e74206f662072696e677320746f206275726e00000060448201526064016105b7565b60008061237d8361344d565b9150915060008560021415612479576001601c88600581106123a1576123a16149e7565b016123ad600285614d51565b81546123b89061492a565b81106123c6576123c66149e7565b8154600116156123e55790600052602060002090602091828204019190065b9054901a600160f81b0260f81c6123fc9190614e44565b60ff1690508060f81b601c8860058110612418576124186149e7565b01612424600285614d51565b815461242f9061492a565b811061243d5761243d6149e7565b81546001161561245c5790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b840402179055505b80612654576124888483612f62565b856002141561265457601c87600581106124a4576124a46149e7565b016001601c89600581106124ba576124ba6149e7565b0180546124c69061492a565b6124d1929150614e2d565b81546124dc9061492a565b81106124ea576124ea6149e7565b8154600116156125095790600052602060002090602091828204019190065b9054901a600160f81b02601c8860058110612526576125266149e7565b01612532600285614d51565b815461253d9061492a565b811061254b5761254b6149e7565b81546001161561256a5790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b84040217905550601c8760058110612599576125996149e7565b0180546125a58161492a565b806125c057634e487b7160e01b600052603160045260246000fd5b601f811180156125d757600181146125f95761264f565b6001826021036101000a0360018303925060028302848219161793505061264f565b836000526020600020826020811461263c576020600019808601828104949094018054601f959095169092036101000a011990921682556001199094019361264c565b81546000835560ff1916603e1794505b50505b505090555b6000838152600960205260408120805460019290612673908490614a13565b90915550612684905033868861350c565b6126a03384600160405180602001604052806000815250613327565b50505050505050565b6001600160a01b0385163314806126c557506126c58533611ad2565b6127375760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f766564000000000000000000000000000000000000000000000060648201526084016105b7565b610a5385858585856136b9565b6003546001600160a01b0316331461279e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105b7565b6001600160a01b03811661281a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016105b7565b610e7881612de8565b60006001600160e01b031982167fd9b67a2600000000000000000000000000000000000000000000000000000000148061288657506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b806105e357507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146105e3565b6060816128fe57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612928578061291281614a2b565b91506129219050600a83614d51565b9150612902565b60008167ffffffffffffffff81111561294357612943614319565b6040519080825280601f01601f19166020018201604052801561296d576020820181803683370190505b5090505b84156129d857612982600183614e2d565b915061298f600a86614e19565b61299a906030614a13565b60f81b8183815181106129af576129af6149e7565b60200101906001600160f81b031916908160001a9053506129d1600a86614d51565b9450612971565b949350505050565b6060815160001415612a0057505060408051602081019091526000815290565b60006040518060600160405280604081526020016150206040913990506000600384516002612a2f9190614a13565b612a399190614d51565b612a44906004614d1c565b90506000612a53826020614a13565b67ffffffffffffffff811115612a6b57612a6b614319565b6040519080825280601f01601f191660200182016040528015612a95576020820181803683370190505b509050818152600183018586518101602084015b81831015612b01576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f8116850151825350600101612aa9565b600389510660018114612b1b5760028114612b4757612b6f565b7f3d3d000000000000000000000000000000000000000000000000000000000000600119830152612b6f565b7f3d000000000000000000000000000000000000000000000000000000000000006000198301525b509398975050505050505050565b8151835114612bf45760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d6174636800000000000000000000000000000000000000000000000060648201526084016105b7565b6001600160a01b038416612c585760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016105b7565b3360005b8451811015612d82576000858281518110612c7957612c796149e7565b602002602001015190506000858381518110612c9757612c976149e7565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015612d2a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016105b7565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612d67908490614a13565b9250508190555050505080612d7b90614a2b565b9050612c5c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612dd2929190614e67565b60405180910390a461213681878787878761384e565b600380546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060005b6002858054612e5b9061492a565b612e66929150614d51565b811015612f525760ff600885901c1685612e81836002614d1c565b8154612e8c9061492a565b8110612e9a57612e9a6149e7565b815460011615612eb95790600052602060002090602091828204019190065b9054600160f81b911a0260f81c148015612f30575060ff841685612ede836002614d1c565b612ee9906001614a13565b8154612ef49061492a565b8110612f0257612f026149e7565b815460011615612f215790600052602060002090602091828204019190065b9054600160f81b911a0260f81c145b15612f4057600192509050612f5b565b80612f4a81614a2b565b915050612e4d565b50600080915091505b9250929050565b6000828054612f709061492a565b905011612faf5760405162461bcd60e51b815260206004820152600d60248201526c6461746120697320656d70747960981b60448201526064016105b7565b816002838054612fbe9061492a565b612fc9929150614e2d565b8154612fd49061492a565b8110612fe257612fe26149e7565b8154600116156130015790600052602060002090602091828204019190065b9054901a600160f81b02828281546130189061492a565b8110613026576130266149e7565b8154600116156130455790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b840402179055508160018380546130709061492a565b61307b929150614e2d565b81546130869061492a565b8110613094576130946149e7565b8154600116156130b35790600052602060002090602091828204019190065b9054600160f81b911a02826130c9836001614a13565b81546130d49061492a565b81106130e2576130e26149e7565b8154600116156131015790600052602060002090602091828204019190065b601f036101000a81548160ff02191690600160f81b840402179055508180548061312a9061492a565b8061314557634e487b7160e01b600052603160045260246000fd5b601f8111801561315c576001811461317e576131d4565b6001826021036101000a036001830392506002830284821916179350506131d4565b83600052602060002082602081146131c1576020600019808601828104949094018054601f959095169092036101000a01199092168255600119909401936131d1565b81546000835560ff1916603e1794505b50505b50509055815482906131e58161492a565b8061320057634e487b7160e01b600052603160045260246000fd5b601f8111801561321757600181146132395761328f565b6001826021036101000a0360018303925060028302848219161793505061328f565b836000526020600020826020811461327c576020600019808601828104949094018054601f959095169092036101000a011990921682556001199094019361328c565b81546000835560ff1916603e1794505b50505b505090555050565b60006132a38383613a03565b336000908152602b602052604090205460ff16156133035760405162461bcd60e51b815260206004820152600c60248201527f416c72656164792075736564000000000000000000000000000000000000000060448201526064016105b7565b50336000908152602b60205260409020805460ff1916600190811790915592915050565b6001600160a01b0384166133a35760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016105b7565b336133bd816000876133b488613bb1565b610a5388613bb1565b6000848152602081815260408083206001600160a01b0389168452909152812080548592906133ed908490614a13565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610a5381600087878787613bfc565b600080600083805461345e9061492a565b90501161349d5760405162461bcd60e51b815260206004820152600d60248201526c6461746120697320656d70747960981b60448201526064016105b7565b60408051426020820152600091016040516020818303038152906040528051906020012060001c90508380546134d29061492a565b6134dd915082614e19565b91506134ea600283614e19565b6134f49083614e2d565b91506135008483613d07565b61ffff16925050915091565b6001600160a01b0383166135885760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016105b7565b336135b88185600061359987613bb1565b6135a287613bb1565b5050604080516020810190915260009052505050565b6000838152602081815260408083206001600160a01b03881684529091529020548281101561364e5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e63650000000000000000000000000000000000000000000000000000000060648201526084016105b7565b6000848152602081815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6001600160a01b03841661371d5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016105b7565b3361372d8187876133b488613bb1565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156137b15760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016105b7565b6000858152602081815260408083206001600160a01b038b81168552925280832087850390559088168252812080548692906137ee908490614a13565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46126a0828888888888613bfc565b6001600160a01b0384163b156121365760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906138929089908990889088908890600401614e95565b602060405180830381600087803b1580156138ac57600080fd5b505af19250505080156138dc575060408051601f3d908101601f191682019092526138d991810190614ef3565b60015b613992576138e8614f10565b806308c379a0141561392257506138fd614f2c565b806139085750613924565b8060405162461bcd60e51b81526004016105b791906142ae565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016105b7565b6001600160e01b0319811663bc197c8160e01b146126a05760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016105b7565b6004546001600160a01b0316613a5b5760405162461bcd60e51b815260206004820152601560248201527f57686974656c697374206e6f7420656e61626c6564000000000000000000000060448201526064016105b7565b600554604080517f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c9602082015233918101919091526000919060600160405160208183030381529060405280519060200120604051602001613aef9291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6040516020818303038152906040528051906020012090506000613b4b84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050613db29050565b6004549091506001600160a01b03808316911614613bab5760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964205369676e617475726500000000000000000000000000000060448201526064016105b7565b50505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613beb57613beb6149e7565b602090810291909101015292915050565b6001600160a01b0384163b156121365760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190613c409089908990889088908890600401614fb6565b602060405180830381600087803b158015613c5a57600080fd5b505af1925050508015613c8a575060408051601f3d908101601f19168201909252613c8791810190614ef3565b60015b613c96576138e8614f10565b6001600160e01b0319811663f23a6e6160e01b146126a05760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016105b7565b600082613d15836001614a13565b8154613d209061492a565b8110613d2e57613d2e6149e7565b815460011615613d4d5790600052602060002090602091828204019190065b9054901a600160f81b0260f81c60ff16600884848154613d6c9061492a565b8110613d7a57613d7a6149e7565b815460011615613d995790600052602060002090602091828204019190065b9054611c619392911a600160f81b0260f81c901b614ff9565b6000806000613dc18585613dce565b91509150610b9081613e3b565b600080825160411415613e055760208301516040840151606085015160001a613df987828585613ff6565b94509450505050612f5b565b825160401415613e2f5760208301516040840151613e248683836140e3565b935093505050612f5b565b50600090506002612f5b565b6000816004811115613e4f57613e4f614752565b1415613e585750565b6001816004811115613e6c57613e6c614752565b1415613eba5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105b7565b6002816004811115613ece57613ece614752565b1415613f1c5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105b7565b6003816004811115613f3057613f30614752565b1415613f895760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105b7565b6004816004811115613f9d57613f9d614752565b1415610e785760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105b7565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561402d57506000905060036140da565b8460ff16601b1415801561404557508460ff16601c14155b1561405657506000905060046140da565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156140aa573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166140d3576000600192509250506140da565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b0161411d87828885613ff6565b935093505050935093915050565b8280546141379061492a565b90600052602060002090601f016020900481019282614159576000855561419f565b82601f106141725782800160ff1982351617855561419f565b8280016001018555821561419f579182015b8281111561419f578235825591602001919060010190614184565b506141ab9291506141cd565b5090565b6040518060a001604052806005906020820280368337509192915050565b5b808211156141ab57600081556001016141ce565b6001600160a01b0381168114610e7857600080fd5b6000806040838503121561420a57600080fd5b8235614215816141e2565b946020939093013593505050565b6001600160e01b031981168114610e7857600080fd5b60006020828403121561424b57600080fd5b8135611c6181614223565b60005b83811015614271578181015183820152602001614259565b83811115613bab5750506000910152565b6000815180845261429a816020860160208601614256565b601f01601f19169290920160200192915050565b602081526000611c616020830184614282565b6000602082840312156142d357600080fd5b5035919050565b6000602082840312156142ec57600080fd5b8135611c61816141e2565b6000806040838503121561430a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff8111828210171561435557614355614319565b6040525050565b600067ffffffffffffffff82111561437657614376614319565b5060051b60200190565b600082601f83011261439157600080fd5b8135602061439e8261435c565b6040516143ab828261432f565b83815260059390931b85018201928281019150868411156143cb57600080fd5b8286015b848110156143e657803583529183019183016143cf565b509695505050505050565b600067ffffffffffffffff82111561440b5761440b614319565b50601f01601f191660200190565b600082601f83011261442a57600080fd5b8135614435816143f1565b604051614442828261432f565b82815285602084870101111561445757600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561448d57600080fd5b8535614498816141e2565b945060208601356144a8816141e2565b9350604086013567ffffffffffffffff808211156144c557600080fd5b6144d189838a01614380565b945060608801359150808211156144e757600080fd5b6144f389838a01614380565b9350608088013591508082111561450957600080fd5b5061451688828901614419565b9150509295509295909350565b6000806040838503121561453657600080fd5b823567ffffffffffffffff8082111561454e57600080fd5b818501915085601f83011261456257600080fd5b8135602061456f8261435c565b60405161457c828261432f565b83815260059390931b850182019282810191508984111561459c57600080fd5b948201945b838610156145c35785356145b4816141e2565b825294820194908201906145a1565b965050860135925050808211156145d957600080fd5b506145e685828601614380565b9150509250929050565b600081518084526020808501945080840160005b8381101561462057815187529582019590820190600101614604565b509495945050505050565b602081526000611c6160208301846145f0565b60006020828403121561465057600080fd5b813560038110611c6157600080fd5b60008083601f84011261467157600080fd5b50813567ffffffffffffffff81111561468957600080fd5b602083019150836020828501011115612f5b57600080fd5b6000806000806000608086880312156146b957600080fd5b85356146c4816141e2565b94506020860135935060408601359250606086013567ffffffffffffffff8111156146ee57600080fd5b6146fa8882890161465f565b969995985093965092949392505050565b8015158114610e7857600080fd5b6000806040838503121561472c57600080fd5b8235614737816141e2565b915060208301356147478161470b565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b602081016003831061478a57634e487b7160e01b600052602160045260246000fd5b91905290565b600080602083850312156147a357600080fd5b823567ffffffffffffffff8111156147ba57600080fd5b6147c68582860161465f565b90969095509350505050565b600080602083850312156147e557600080fd5b823567ffffffffffffffff808211156147fd57600080fd5b818501915085601f83011261481157600080fd5b81358181111561482057600080fd5b8660208260051b850101111561483557600080fd5b60209290920196919550909350505050565b6000806040838503121561485a57600080fd5b8235614865816141e2565b91506020830135614747816141e2565b60008060006040848603121561488a57600080fd5b83359250602084013567ffffffffffffffff8111156148a857600080fd5b6148b48682870161465f565b9497909650939450505050565b600080600080600060a086880312156148d957600080fd5b85356148e4816141e2565b945060208601356148f4816141e2565b93506040860135925060608601359150608086013567ffffffffffffffff81111561491e57600080fd5b61451688828901614419565b600181811c9082168061493e57607f821691505b6020821081141561495f57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561497757600080fd5b815167ffffffffffffffff81111561498e57600080fd5b8201601f8101841361499f57600080fd5b80516149aa816143f1565b6040516149b7828261432f565b8281528660208486010111156149cc57600080fd5b6149dd836020830160208701614256565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115614a2657614a266149fd565b500190565b6000600019821415614a3f57614a3f6149fd565b5060010190565b60008151614a58818560208601614256565b9290920192915050565b8054600090600181811c9080831680614a7c57607f831692505b6020808410821415614a9e57634e487b7160e01b600052602260045260246000fd5b818015614ab25760018114614ac357614af0565b60ff19861689528489019650614af0565b60008881526020902060005b86811015614ae85781548b820152908501908301614acf565b505084890196505b50505050505092915050565b7f7b226e616d65223a202200000000000000000000000000000000000000000000815260008451614b3481600a850160208901614256565b7f222c20226465736372697074696f6e223a202252696e67732028666f72204c6f600a918401918201527f6f74292069732074686520666972737420616e64206c61726765737420334420602a8201527f696e746572707265746174696f6e206f6620616e20656e746972652063617465604a8201527f676f727920696e204c6f6f742e20416476656e7475726572732c206275696c64606a8201527f6572732c20616e6420617274697374732061726520656e636f75726167656420608a8201527f746f207265666572656e63652052696e67732028666f72204c6f6f742920746f60aa8201527f206675727468657220657870616e64206f6e2074686520696d6167696e61746960ca8201527f6f6e206f66204c6f6f742e222c2022696d616765223a2022697066733a2f2f0060ea8201526149dd614cae614ca8614c7f610109850189614a62565b7f2f00000000000000000000000000000000000000000000000000000000000000815260010190565b86614a46565b7f2e6a7067227d0000000000000000000000000000000000000000000000000000815260060190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251614d0f81601d850160208701614256565b91909101601d0192915050565b6000816000190483118215151615614d3657614d366149fd565b500290565b634e487b7160e01b600052601260045260246000fd5b600082614d6057614d60614d3b565b500490565b600060208284031215614d7757600080fd5b5051919050565b600060208284031215614d9057600080fd5b8151611c618161470b565b600060208284031215614dad57600080fd5b8151611c61816141e2565b60008251614dca818460208701614256565b9190910192915050565b7f52494e4700000000000000000000000000000000000000000000000000000000815260008251614e0c816004850160208701614256565b9190910160040192915050565b600082614e2857614e28614d3b565b500690565b600082821015614e3f57614e3f6149fd565b500390565b600060ff821660ff841680821015614e5e57614e5e6149fd565b90039392505050565b604081526000614e7a60408301856145f0565b8281036020840152614e8c81856145f0565b95945050505050565b60006001600160a01b03808816835280871660208401525060a06040830152614ec160a08301866145f0565b8281036060840152614ed381866145f0565b90508281036080840152614ee78185614282565b98975050505050505050565b600060208284031215614f0557600080fd5b8151611c6181614223565b600060033d1115614f295760046000803e5060005160e01c5b90565b600060443d1015614f3a5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715614f6a57505050505090565b8285019150815181811115614f825750505050505090565b843d8701016020828501011115614f9c5750505050505090565b614fab6020828601018761432f565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152614fee60a0830184614282565b979650505050505050565b600061ffff808316818516808303821115615016576150166149fd565b0194935050505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122030563407d903270a087f6555335e742972358ef08884b242b38ef82941f73ec764736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000ff9c1b15b16263c61d017ee9f65c50e4ae0113d70000000000000000000000001dfe7ca09e99d10835bf73044a23b73fc20623df0000000000000000000000008db687aceb92c66f013e1d614137238cc698fedb
-----Decoded View---------------
Arg [0] : lootsList (address[]): 0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7,0x1dfe7Ca09e99d10835Bf73044a23B73Fc20623DF,0x8dB687aCEb92c66f013e1D614137238Cc698fEdb
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [2] : 000000000000000000000000ff9c1b15b16263c61d017ee9f65c50e4ae0113d7
Arg [3] : 0000000000000000000000001dfe7ca09e99d10835bf73044a23b73fc20623df
Arg [4] : 0000000000000000000000008db687aceb92c66f013e1d614137238cc698fedb
Loading...
Loading
Loading...
Loading
[ 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.