ERC-1155
Overview
Max Total Supply
175
Holders
36
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
skateDonate
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /** ERC1155 Smart Contract - SkateDonate __ _ _ ___ _ / _\ | ____ _| |_ ___ / \___ _ __ __ _| |_ ___ \ \| |/ / _` | __/ _ \ / /\ / _ \| '_ \ / _` | __/ _ \ _\ \ < (_| | || __// /_// (_) | | | | (_| | || __/ \__/_|\_\__,_|\__\___/___,' \___/|_| |_|\__,_|\__\___| */ import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/finance/PaymentSplitter.sol"; /// @custom:security-contact [email protected] contract skateDonate is ERC1155, AccessControl, ERC1155Burnable,Pausable, ERC1155Supply, PaymentSplitter { using Counters for Counters.Counter; uint public constant NUMBER_RESERVED_TOKENS = 500; uint256 public price = 1e18; // The initial price to mint in WEI. uint256 public discount = 0; mapping(uint256 => uint256) public tokenMaxSupply; // 0 is openEnd mapping(uint256 => uint256) public perWalletMaxTokens; // 0 is openEnd mapping(address => mapping(uint256 => uint256)) public mintCount; bytes32 public merkleRoot; address public discountContract = 0x0000000000000000000000000000000000000000; bytes4 public discountOwnerFunctionSelector = bytes4(keccak256("ownerOf(uint256)")); bytes32 public constant URI_SETTER_ROLE = keccak256("URI_SETTER_ROLE"); bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE"); bytes32 public constant SALES_ROLE = keccak256("SALES_ROLE"); bytes32 public constant RESERVED_MINT_ROLE = keccak256("RESERVED_MINT_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); bytes32 public constant MERKLE_ROLE = keccak256("MERKLE_ROLE"); uint256[] public saleIsActive; struct saleSchedule { uint256 start; uint256 end; } struct foreignTokenLimitsRule { address foreignContract; uint256 foreignTokenTypeId; uint256 multiplier; saleSchedule schedule; } foreignTokenLimitsRule[] public foreignTokenLimits; mapping(uint256 => saleSchedule) public saleSchedules; bool public saleMaxLock = false; bool public allowContractMints = false; bool public allowNonRandomMinting = true; bool[] public discountUsed; Counters.Counter public reservedSupply; string private _contractURI; //The URI to the contract json constructor(string memory uri_, address[] memory _payees, uint256[] memory _shares) ERC1155(uri_) PaymentSplitter(_payees, _shares) payable { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setupRole(URI_SETTER_ROLE, msg.sender); _setupRole(ADMIN_ROLE, msg.sender); _setupRole(SALES_ROLE, msg.sender); _setupRole(RESERVED_MINT_ROLE, msg.sender); _setupRole(MERKLE_ROLE, msg.sender); } function setURI(string memory newuri) public onlyRole(URI_SETTER_ROLE) { _setURI(newuri); } /** * @dev Pauses all token transfers. * * See {Pausable} and {Pausable-_pause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */ function pause() public onlyRole(PAUSER_ROLE) { _pause(); } /** * @dev Sets the value of `allowNonRandomMinting`. * * Requirements: * * - the caller must have the `SALES_ROLE`. * * @param _allowNonRandomMinting The new value for `allowNonRandomMinting`. */ function setAllowNonRandomMinting(bool _allowNonRandomMinting) public onlyRole(SALES_ROLE) { allowNonRandomMinting = _allowNonRandomMinting; } /** * @dev Unpauses all token transfers. * * See {Pausable} and {Pausable-_unpause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */ function unpause() public onlyRole(PAUSER_ROLE) { _unpause(); } /** * @dev Retrieves the summary of mint counts for a given wallet. * @param wallet The address of the wallet. * @return The total sum of mint counts for the wallet. */ function getMintCountSummary(address wallet) public view returns (uint256) { uint256 summary = 0; for (uint256 i = 0; i < saleIsActive.length; i++) { summary += mintCount[wallet][saleIsActive[i]]; } return summary; } /** * @dev Increments the mint count for the specified wallet, token IDs, and amounts. * * @param to The address of the wallet. * @param ids The array of token IDs. * @param amounts The array of corresponding token amounts. */ function incrementMintCount(address to, uint256[] memory ids, uint256[] memory amounts) internal { uint256 idsLen = ids.length; for (uint256 i = 0; i < idsLen; ++i) { mintCount[to][ids[i]] += amounts[i]; } } /** * @dev Finds the token IDs with the least minted count for a given wallet address. * * This function returns an array of token IDs that have the least minted count for the specified wallet. * If multiple token IDs have the same least minted count, all of them will be included in the result. * * Requirements: * - `wallet` must be a valid address. * * @param wallet The wallet address for which to find the least owned token IDs. * @return An array of token IDs with the least minted count for the specified wallet. */ function findLeastOwnedIds(address wallet) public view returns (uint256[] memory) { uint256[] memory leastOwnedIds; uint256 leastBalance = mintCount[wallet][saleIsActive[0]]; uint256 leastOwnedCount = 0; for (uint256 i = 0; i < saleIsActive.length; i++) { uint256 tokenId = saleIsActive[i]; uint256 balance = mintCount[wallet][tokenId]; if (balance < leastBalance) { leastBalance = balance; leastOwnedCount = 1; } else if (balance == leastBalance) { leastOwnedCount++; } } leastOwnedIds = new uint256[](leastOwnedCount); uint256 index = 0; for (uint256 i = 0; i < saleIsActive.length; i++) { uint256 tokenId = saleIsActive[i]; if (mintCount[wallet][tokenId] == leastBalance) { leastOwnedIds[index] = tokenId; index++; } } return leastOwnedIds; } function createArrayWithSameNumber(uint256 amount, uint256 number) internal pure returns (uint256[] memory) { uint256[] memory newArray = new uint256[](amount); for (uint256 i = 0; i < amount; i++) { newArray[i] = number; } return newArray; } function shuffleArray(uint256[] memory array, uint256 seed) internal view returns (uint256[] memory) { uint256[] memory shuffled = array; uint256 length = shuffled.length; for (uint256 i = length - 1; i > 0; i--) { uint256 j = _getRandomIndex(i + 1, seed); uint256 temp = shuffled[i]; shuffled[i] = shuffled[j]; shuffled[j] = temp; seed++; } return shuffled; } function mint(address to, uint256 id, uint256 amount, uint256 discountTokenId, bytes32[] calldata proof, bytes memory data) public payable { require(msg.sender == tx.origin || allowContractMints, "No contracts!"); require(checkSaleState(id), "Sale not active"); require(_checkSaleSchedule(saleSchedules[id]), "Not at this time"); require(tokenMaxSupply[id] == 0 || totalSupply(id) + amount <= tokenMaxSupply[id], "Supply exhausted"); require(perWalletMaxTokens[id] == 0 || balanceOf(to,id) + amount <= perWalletMaxTokens[id], "Reached per-wallet limit!"); require(checkForeignTokenLimits(to, amount), "Not enough foreign tokens"); require((merkleRoot == 0 || _verify(_leaf(msg.sender), proof) || _verify(_leaf(to), proof)), "Invalid Merkle proof"); require(discountTokenId <= discountUsed.length, "discountTokenId is out of range"); require(_checkPrice(amount, discountTokenId), "Not enough ETH"); if (id == 0) { uint256[] memory leastOwnedIds = findLeastOwnedIds(to); // Shuffle the leastOwnedIds array require(leastOwnedIds.length >= amount, "Unreasonable randomization request"); uint256 nounce = amount; leastOwnedIds = shuffleArray(leastOwnedIds, nounce); uint256[] memory randomIds = new uint256[](amount); uint256 uniqueCount = 0; for (uint256 i = 0; i < amount; i++) { randomIds[i] = leastOwnedIds[i]; uniqueCount++; } require(uniqueCount == amount, "Unable to generate unique token IDs"); uint256[] memory amounts = createArrayWithSameNumber(amount, 1); incrementMintCount(to, randomIds, amounts); _mintBatch(to, randomIds, amounts, data); return; } else { require(allowNonRandomMinting, "Only random minting"); mintCount[to][id] += amount; _mint(to, id, amount, data); } } function _getRandomIndex(uint256 length, uint256 nonce) internal view returns (uint256) { uint256 seed = uint256( keccak256( abi.encodePacked( block.timestamp, block.difficulty, block.number, blockhash(block.number - 1), msg.sender, nonce ) ) ); return seed % length; } function calculateForeignTokenCountMultiplied(address _wallet) public view returns (uint256) { uint256 foreignTokenCountMultiplied = 0; for (uint256 i = 0; i < foreignTokenLimits.length; i++) { if (_checkSaleSchedule(foreignTokenLimits[i].schedule)) { // add foreignToken Balance * multiplier foreignTokenCountMultiplied += _walletHoldsForeign1155TokenCount(_wallet, foreignTokenLimits[i].foreignTokenTypeId, foreignTokenLimits[i].foreignContract) * foreignTokenLimits[i].multiplier; } } return foreignTokenCountMultiplied; } function checkForeignTokenLimits(address _wallet, uint256 _desiredAmount) public view returns (bool) { // If there are no rules, it is always okay to mint if (foreignTokenLimits.length < 1) { return true; } // Use the new function here uint256 foreignTokenCountMultiplied = calculateForeignTokenCountMultiplied(_wallet); // If the sum of mintCounts + desiredAmount is less than or equal to the foreignTokenCountMultiplied if (getMintCountSummary(_wallet) + _desiredAmount <= foreignTokenCountMultiplied) { return true; } return false; } function reduce(uint256[] memory arr) pure internal returns (uint256 result){ for (uint256 i = 0; i < arr.length; i++) { result += arr[i]; } } function checkSaleState(uint256 _id) internal view returns (bool){ if (_id == 0 && saleIsActive.length > 0) { // allow random (0) if anything is on sale return true; } for (uint256 i=0; i<saleIsActive.length; i++) { if (saleIsActive[i] == _id) { return true; } } return false; } function setSaleActive(uint256[] memory ids) external onlyRole(SALES_ROLE){ saleIsActive = ids; } function addForeignTokenLimitRule( address _foreignContract, uint256 _foreignTokenTypeId, uint256 _multiplier, uint256 _start, uint256 _end ) external onlyRole(SALES_ROLE) { saleSchedule memory schedule = saleSchedule(_start, _end); foreignTokenLimits.push( foreignTokenLimitsRule( _foreignContract, _foreignTokenTypeId, _multiplier, schedule ) ); } function resetForeignTokenLimits() external onlyRole(SALES_ROLE) { delete foreignTokenLimits; } function setSaleSchedule(uint256 _id, uint256 _start, uint256 _end) external onlyRole(SALES_ROLE){ require(_id > 0, "Invalid token type ID"); saleSchedules[_id].start = _start; saleSchedules[_id].end = _end; } function flipAllowContractMintsState() external onlyRole(ADMIN_ROLE){ allowContractMints = !allowContractMints; } function mintReservedTokens(address to, uint256 id, uint256 amount, bytes memory data) external onlyRole(RESERVED_MINT_ROLE){ require(id > 0, "Invalid token type ID"); require(reservedSupply.current() + amount <= NUMBER_RESERVED_TOKENS, "amount over max allowed"); require(amount == 1 || hasRole(ADMIN_ROLE, _msgSender()), "> 1 only ADMIN_ROLE"); _mint(to, id, amount, data); for (uint i = 0; i < amount; i++) { reservedSupply.increment(); } } function withdraw() external onlyRole(WITHDRAW_ROLE){ payable(msg.sender).transfer(address(this).balance); } function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes32[] calldata proof, bytes memory data) public payable { require(allowNonRandomMinting, "Only random minting"); require(msg.sender == tx.origin || allowContractMints, "No contracts!"); require((merkleRoot == 0 || _verify(_leaf(msg.sender), proof) || _verify(_leaf(to), proof)), "Invalid Merkle proof"); uint256 idsLen = ids.length; uint256 totalAmount = 0; for (uint256 i = 0; i < idsLen; ++i) { require(ids[i] > 0, "Invalid token type ID"); require(checkSaleState(ids[i]), "Sale not active"); require(_checkSaleSchedule(saleSchedules[ids[i]]), "Not at this time"); require(tokenMaxSupply[ids[i]] == 0 || totalSupply(ids[i]) + amounts[i] <= tokenMaxSupply[ids[i]], "Supply exhausted"); require(perWalletMaxTokens[ids[i]] == 0 || balanceOf(to, ids[i]) + amounts[i] <= perWalletMaxTokens[ids[i]], "Reached per-wallet limit!"); totalAmount = totalAmount + amounts[i]; } require(checkForeignTokenLimits(to, totalAmount), "Not enough foreign tokens"); require(_checkPrice(totalAmount, 0), "Not enough ETH"); incrementMintCount(to,ids,amounts); _mintBatch(to, ids, amounts, data); } function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal whenNotPaused override(ERC1155, ERC1155Supply) { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); } // The following functions are overrides required by Solidity. function supportsInterface(bytes4 interfaceId) public view override(ERC1155, AccessControl) returns (bool) { return super.supportsInterface(interfaceId); } function setMerkleRoot(bytes32 _merkleRoot) external onlyRole(MERKLE_ROLE){ merkleRoot = _merkleRoot; } function setSaleMax(uint32 _limit, uint256 _id, bool _globalLockAfterUpdate) external onlyRole(SALES_ROLE){ require(saleMaxLock == false , "saleMaxLock is set"); require(_id > 0, "Invalid token type ID"); saleMaxLock = _globalLockAfterUpdate; tokenMaxSupply[_id] = _limit; } function setPrice(uint256 _price) external onlyRole(SALES_ROLE){ price = _price; } function setWalletMax(uint256 _id, uint256 _walletLimit) external onlyRole(SALES_ROLE){ require(_id > 0, "Invalid token type ID"); perWalletMaxTokens[_id] = _walletLimit; } function setDiscountOwnerFunctionSelector(bytes4 _discountOwnerFunctionSelector) external onlyRole(SALES_ROLE){ discountOwnerFunctionSelector = _discountOwnerFunctionSelector; } function setContractURI(string memory _uri) external onlyRole(ADMIN_ROLE) { _contractURI = _uri; } function contractURI() public view returns (string memory) { return _contractURI; } function _leaf(address account) internal pure returns (bytes32) { return keccak256(abi.encodePacked(account)); } function _verify(bytes32 leaf, bytes32[] memory proof) internal view returns (bool) { return MerkleProof.verify(proof, merkleRoot, leaf); } function _checkSaleSchedule(saleSchedule memory s) internal view returns (bool) { if ( (s.start == 0 || s.start <= block.timestamp) && (s.end == 0 ||s.end >= block.timestamp) ) { return true; } return false; } function _checkPrice(uint256 amount, uint256 discountTokenId) internal returns (bool) { if (msg.value >= price * amount) { return true; } else if (discountTokenId > 0 && discountTokenId <= discountUsed.length && amount == 1 && _walletHoldsUnusedDiscountToken(msg.sender, discountContract, discountTokenId)) { uint256 discountedPrice = price - discount; // discount in wei if (msg.value >= discountedPrice) { discountUsed[discountTokenId - 1] = true; return true; } } return false; } function bytesToAddress(bytes memory bys) private pure returns (address addr) { assembly { addr := mload(add(bys, 32)) } } function _walletHoldsUnusedDiscountToken(address _wallet, address _contract, uint256 discountTokenId) internal returns (bool) { if ((discountTokenId <= discountUsed.length || discountUsed[discountTokenId - 1] == false)) { (bool success, bytes memory owner) = _contract.call(abi.encodeWithSelector(discountOwnerFunctionSelector, discountTokenId)); require (success, "ownerOf call failed"); require (bytesToAddress(owner) == _wallet, "Owner of discountToken not equal mint sender"); return true; } require (false, "TokenId invalid or used"); return false; } function _walletHoldsForeign1155TokenCount(address _wallet, uint256 _foreignTokenId, address _contract) internal view returns (uint256) { ERC1155 token = ERC1155(_contract); return token.balanceOf(_wallet, _foreignTokenId); } function setDiscountContract(address _discountContract, uint256 _maxTokenId, uint256 _discount) external onlyRole(ADMIN_ROLE) { if (discountContract != _discountContract) { // reset all tokenId states to false discountUsed = new bool[](_maxTokenId); } discountContract = _discountContract; discount = _discount; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155Supply.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of ERC1155 that adds tracking of total supply per id. * * Useful for scenarios where Fungible and Non-fungible tokens have to be * clearly identified. Note: While a totalSupply of 1 might mean the * corresponding is an NFT, there is no guarantees that no other token with the * same id are not going to be minted. */ abstract contract ERC1155Supply is ERC1155 { mapping(uint256 => uint256) private _totalSupply; /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Indicates whether any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return ERC1155Supply.totalSupply(id) > 0; } /** * @dev See {ERC1155-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); if (from == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; } } if (to == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 supply = _totalSupply[id]; require(supply >= amount, "ERC1155: burn amount exceeds totalSupply"); unchecked { _totalSupply[id] = supply - amount; } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155Burnable is ERC1155 { function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner or approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner or approved" ); _burnBatch(account, ids, values); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or 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: caller is not token owner or approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * 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 _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (finance/PaymentSplitter.sol) pragma solidity ^0.8.0; import "../token/ERC20/utils/SafeERC20.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. The distribution of shares is set at the * time of contract deployment and can't be updated thereafter. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. * * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you * to run tests before sending real value to this contract. */ contract PaymentSplitter is Context { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; mapping(IERC20 => uint256) private _erc20TotalReleased; mapping(IERC20 => mapping(address => uint256)) private _erc20Released; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ constructor(address[] memory payees, uint256[] memory shares_) payable { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20 * contract. */ function totalReleased(IERC20 token) public view returns (uint256) { return _erc20TotalReleased[token]; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an * IERC20 contract. */ function released(IERC20 token, address account) public view returns (uint256) { return _erc20Released[token][account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Getter for the amount of payee's releasable Ether. */ function releasable(address account) public view returns (uint256) { uint256 totalReceived = address(this).balance + totalReleased(); return _pendingPayment(account, totalReceived, released(account)); } /** * @dev Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an * IERC20 contract. */ function releasable(IERC20 token, address account) public view returns (uint256) { uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token); return _pendingPayment(account, totalReceived, released(token, account)); } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _totalReleased is the sum of all values in _released. // If "_totalReleased += payment" does not overflow, then "_released[account] += payment" cannot overflow. _totalReleased += payment; unchecked { _released[account] += payment; } Address.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20 * contract. */ function release(IERC20 token, address account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(token, account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _erc20TotalReleased[token] is the sum of all values in _erc20Released[token]. // If "_erc20TotalReleased[token] += payment" does not overflow, then "_erc20Released[token][account] += payment" // cannot overflow. _erc20TotalReleased[token] += payment; unchecked { _erc20Released[token][account] += payment; } SafeERC20.safeTransfer(token, account, payment); emit ERC20PaymentReleased(token, account, payment); } /** * @dev internal logic for computing the pending payment of an `account` given the token historical balances and * already released amounts. */ function _pendingPayment( address account, uint256 totalReceived, uint256 alreadyReleased ) private view returns (uint256) { return (totalReceived * _shares[account]) / _totalShares - alreadyReleased; } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"uri_","type":"string"},{"internalType":"address[]","name":"_payees","type":"address[]"},{"internalType":"uint256[]","name":"_shares","type":"uint256[]"}],"stateMutability":"payable","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":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"PayeeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MERKLE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NUMBER_RESERVED_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESERVED_MINT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SALES_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"URI_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_foreignContract","type":"address"},{"internalType":"uint256","name":"_foreignTokenTypeId","type":"uint256"},{"internalType":"uint256","name":"_multiplier","type":"uint256"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"addForeignTokenLimitRule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowContractMints","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowNonRandomMinting","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":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"calculateForeignTokenCountMultiplied","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"},{"internalType":"uint256","name":"_desiredAmount","type":"uint256"}],"name":"checkForeignTokenLimits","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"discount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"discountContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"discountOwnerFunctionSelector","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"discountUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"findLeastOwnedIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flipAllowContractMintsState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"foreignTokenLimits","outputs":[{"internalType":"address","name":"foreignContract","type":"address"},{"internalType":"uint256","name":"foreignTokenTypeId","type":"uint256"},{"internalType":"uint256","name":"multiplier","type":"uint256"},{"components":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"internalType":"struct skateDonate.saleSchedule","name":"schedule","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"getMintCountSummary","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"discountTokenId","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":"mintReservedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"payee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"perWalletMaxTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reservedSupply","outputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"resetForeignTokenLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","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":"uint256","name":"","type":"uint256"}],"name":"saleIsActive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleMaxLock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"saleSchedules","outputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_allowNonRandomMinting","type":"bool"}],"name":"setAllowNonRandomMinting","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":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_discountContract","type":"address"},{"internalType":"uint256","name":"_maxTokenId","type":"uint256"},{"internalType":"uint256","name":"_discount","type":"uint256"}],"name":"setDiscountContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_discountOwnerFunctionSelector","type":"bytes4"}],"name":"setDiscountOwnerFunctionSelector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"setSaleActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_limit","type":"uint32"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bool","name":"_globalLockAfterUpdate","type":"bool"}],"name":"setSaleMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"setSaleSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newuri","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_walletLimit","type":"uint256"}],"name":"setWalletMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040819052670de0b6b3a7640000600d556000600e55601380546331a9108f60a11b6001600160c01b03199091161790556017805462ffffff191662010000179055620066fb388190039081908339810160408190526200006291620006bb565b8181846200007081620002a3565b506004805460ff191690558051825114620000ed5760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b6000825111620001405760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f207061796565730000000000006044820152606401620000e4565b60005b8251811015620001ac5762000197838281518110620001665762000166620007be565b6020026020010151838381518110620001835762000183620007be565b6020026020010151620002b560201b60201c565b80620001a381620007ea565b91505062000143565b50620001be91506000905033620004a3565b620001ea7f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c33620004a3565b620002167fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533620004a3565b620002427fdeccffc5821b949817830292498e44ccb6097e4b74ff2f2db960723873324def33620004a3565b6200026e7f3d801a24ff41e923496f3e680edb15bc7eda1c1687277be9821dbfa1af9ae0aa33620004a3565b6200029a7fefb9a0764f88417a6977b3a6851c8fb991983b58bf47fec627571b2120bd9d1333620004a3565b50505062000977565b6002620002b1828262000895565b5050565b6001600160a01b038216620003225760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b6064820152608401620000e4565b60008111620003745760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a207368617265732061726520300000006044820152606401620000e4565b6001600160a01b03821660009081526008602052604090205415620003f05760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b6064820152608401620000e4565b600a8054600181019091557fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b0319166001600160a01b03841690811790915560009081526008602052604090208190556006546200045a90829062000961565b600655604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b620002b18282620004b5828262000533565b620002b15760008281526003602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620004ef3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526003602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620005a157620005a162000560565b604052919050565b60006001600160401b03821115620005c557620005c562000560565b5060051b60200190565b600082601f830112620005e157600080fd5b81516020620005fa620005f483620005a9565b62000576565b82815260059290921b840181019181810190868411156200061a57600080fd5b8286015b848110156200064e5780516001600160a01b0381168114620006405760008081fd5b83529183019183016200061e565b509695505050505050565b600082601f8301126200066b57600080fd5b815160206200067e620005f483620005a9565b82815260059290921b840181019181810190868411156200069e57600080fd5b8286015b848110156200064e5780518352918301918301620006a2565b600080600060608486031215620006d157600080fd5b83516001600160401b0380821115620006e957600080fd5b818601915086601f830112620006fe57600080fd5b81518181111562000713576200071362000560565b602062000729601f8301601f1916820162000576565b82815289828487010111156200073e57600080fd5b60005b838110156200075e57858101830151828201840152820162000741565b5060009281018201929092528701519095509150808211156200078057600080fd5b6200078e87838801620005cf565b93506040860151915080821115620007a557600080fd5b50620007b48682870162000659565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620007ff57620007ff620007d4565b5060010190565b600181811c908216806200081b57607f821691505b6020821081036200083c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200089057600081815260208120601f850160051c810160208610156200086b5750805b601f850160051c820191505b818110156200088c5782815560010162000877565b5050505b505050565b81516001600160401b03811115620008b157620008b162000560565b620008c981620008c2845462000806565b8462000842565b602080601f831160018114620009015760008415620008e85750858301515b600019600386901b1c1916600185901b1785556200088c565b600085815260208120601f198616915b82811015620009325788860151825594840194600190910190840162000911565b5085821015620009515787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b808201808211156200055a576200055a620007d4565b615d7480620009876000396000f3fe60806040526004361061046a5760003560e01c80638456cb591161024a578063c7d07c6311610139578063e63ab1e9116100b6578063f5298aca1161007a578063f5298aca14610f59578063f7c8ce7c14610f79578063fae9c53514610f99578063fd233ce814610fb9578063fd54b8c914610fce57600080fd5b8063e63ab1e914610e85578063e8a3d48514610eb9578063e985e9c514610ece578063ee98523414610f17578063f242432a14610f3957600080fd5b8063de7d780f116100fd578063de7d780f14610dc8578063deb000ee14610de8578063e02023a114610e1c578063e33b7de314610e50578063e3b40deb14610e6557600080fd5b8063c7d07c6314610ce4578063ce7c2ac214610d04578063d547741f14610d3a578063d79779b214610d5a578063d970723f14610d9057600080fd5b8063a217fddf116101c7578063b55881811161018b578063b558818114610c42578063bd85b03914610c57578063c45ac05014610c84578063c61adfea14610ca4578063c62117c314610cc457600080fd5b8063a217fddf14610bc4578063a22cb46514610bd9578063a3f8eace14610bf9578063afc557a014610c19578063b22edfbc14610c2c57600080fd5b8063938e3d7b1161020e578063938e3d7b14610b1e5780639852595c14610b3e5780639df87de414610b74578063a035b1fe14610b94578063a049dd4014610baa57600080fd5b80638456cb5914610a895780638b83209b14610a9e5780638f3a291914610abe57806391b7f5ed14610ade57806391d1485414610afe57600080fd5b806337df0269116103665780634f558e79116102e357806375b238fc116102a757806375b238fc146109b957806377e45a18146109db57806379a2e22614610a155780637cb6475914610a355780637f34571014610a5557600080fd5b80634f558e791461091c5780635c975abb1461094b5780635d74dd3e146109635780636b20c454146109835780636b6f4a9d146109a357600080fd5b806344d19d2b1161032a57806344d19d2b1461083557806348b750441461084c57806349bceddb1461086c5780634b98983f146108995780634e1273f4146108ef57600080fd5b806337df0269146107905780633a98ef39146107b05780633ccfd60b146107c55780633f4ba83a146107da578063406072a9146107ef57600080fd5b8063248a9ca3116103f45780632eb4a7ab116103b85780632eb4a7ab146106fb5780632eb9020d146107115780632f2ff15d146107305780632fb85f8f1461075057806336568abe1461077057600080fd5b8063248a9ca31461062257806324d043e01461065257806329e239cc146106725780632dae160f146106bb5780632eb2c2d6146106db57600080fd5b80630e89341c1161043b5780630e89341c1461056a578063104789c71461059757806319165587146105cf57806321a08f47146105ef578063221193e31461060f57600080fd5b80624221f0146104b8578062fdd58e146104f857806301ffc9a71461051857806302fe53051461054857600080fd5b366104b3577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b3480156104c457600080fd5b506104e56104d3366004614c5c565b600f6020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561050457600080fd5b506104e5610513366004614c8a565b611002565b34801561052457600080fd5b50610538610533366004614ccc565b61109b565b60405190151581526020016104ef565b34801561055457600080fd5b50610568610563366004614d88565b6110a6565b005b34801561057657600080fd5b5061058a610585366004614c5c565b6110dd565b6040516104ef9190614e20565b3480156105a357600080fd5b506013546105b7906001600160a01b031681565b6040516001600160a01b0390911681526020016104ef565b3480156105db57600080fd5b506105686105ea366004614e33565b611171565b3480156105fb57600080fd5b5061056861060a366004614e50565b611258565b61056861061d366004614f93565b611399565b34801561062e57600080fd5b506104e561063d366004614c5c565b60009081526003602052604090206001015490565b34801561065e57600080fd5b5061056861066d366004615056565b6118f5565b34801561067e57600080fd5b506106a661068d366004614c5c565b6016602052600090815260409020805460019091015482565b604080519283526020830191909152016104ef565b3480156106c757600080fd5b506105386106d6366004614c8a565b6119a2565b3480156106e757600080fd5b506105686106f636600461508b565b6119f3565b34801561070757600080fd5b506104e560125481565b34801561071d57600080fd5b5060175461053890610100900460ff1681565b34801561073c57600080fd5b5061056861074b366004615138565b611a3f565b34801561075c57600080fd5b506017546105389062010000900460ff1681565b34801561077c57600080fd5b5061056861078b366004615138565b611a69565b34801561079c57600080fd5b506104e56107ab366004614e33565b611ae3565b3480156107bc57600080fd5b506006546104e5565b3480156107d157600080fd5b50610568611bf2565b3480156107e657600080fd5b50610568611c48565b3480156107fb57600080fd5b506104e561080a366004615168565b6001600160a01b039182166000908152600c6020908152604080832093909416825291909152205490565b34801561084157600080fd5b506019546104e59081565b34801561085857600080fd5b50610568610867366004615168565b611c7d565b34801561087857600080fd5b506104e5610887366004614c5c565b60106020526000908152604090205481565b3480156108a557600080fd5b506108b96108b4366004614c5c565b611d8e565b604080516001600160a01b039095168552602080860194909452840191909152805160608401520151608082015260a0016104ef565b3480156108fb57600080fd5b5061090f61090a366004615196565b611deb565b6040516104ef919061529d565b34801561092857600080fd5b50610538610937366004614c5c565b600090815260056020526040902054151590565b34801561095757600080fd5b5060045460ff16610538565b34801561096f57600080fd5b5061056861097e3660046152b0565b611f07565b34801561098f57600080fd5b5061056861099e3660046152e4565b611f32565b3480156109af57600080fd5b506104e5600e5481565b3480156109c557600080fd5b506104e5600080516020615cff83398151915281565b3480156109e757600080fd5b506013546109fc90600160a01b900460e01b81565b6040516001600160e01b031990911681526020016104ef565b348015610a2157600080fd5b506104e5610a30366004614c5c565b611f75565b348015610a4157600080fd5b50610568610a50366004614c5c565b611f96565b348015610a6157600080fd5b506104e57f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c81565b348015610a9557600080fd5b50610568611fc6565b348015610aaa57600080fd5b506105b7610ab9366004614c5c565b611ff8565b348015610aca57600080fd5b50610568610ad9366004615367565b612028565b348015610aea57600080fd5b50610568610af9366004614c5c565b61205d565b348015610b0a57600080fd5b50610538610b19366004615138565b61207b565b348015610b2a57600080fd5b50610568610b39366004614d88565b6120a6565b348015610b4a57600080fd5b506104e5610b59366004614e33565b6001600160a01b031660009081526009602052604090205490565b348015610b8057600080fd5b506104e5610b8f366004614e33565b6120ca565b348015610ba057600080fd5b506104e5600d5481565b348015610bb657600080fd5b506017546105389060ff1681565b348015610bd057600080fd5b506104e5600081565b348015610be557600080fd5b50610568610bf4366004615384565b612141565b348015610c0557600080fd5b506104e5610c14366004614e33565b61214c565b610568610c273660046153b2565b612194565b348015610c3857600080fd5b506104e56101f481565b348015610c4e57600080fd5b50610568612742565b348015610c6357600080fd5b506104e5610c72366004614c5c565b60009081526005602052604090205490565b348015610c9057600080fd5b506104e5610c9f366004615168565b612778565b348015610cb057600080fd5b50610568610cbf36600461544a565b612843565b348015610cd057600080fd5b50610568610cdf36600461546c565b61288e565b348015610cf057600080fd5b50610568610cff366004614ccc565b6128df565b348015610d1057600080fd5b506104e5610d1f366004614e33565b6001600160a01b031660009081526008602052604090205490565b348015610d4657600080fd5b50610568610d55366004615138565b61291c565b348015610d6657600080fd5b506104e5610d75366004614e33565b6001600160a01b03166000908152600b602052604090205490565b348015610d9c57600080fd5b506104e5610dab366004614c8a565b601160209081526000928352604080842090915290825290205481565b348015610dd457600080fd5b50610568610de3366004615498565b612941565b348015610df457600080fd5b506104e57f3d801a24ff41e923496f3e680edb15bc7eda1c1687277be9821dbfa1af9ae0aa81565b348015610e2857600080fd5b506104e57f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec81565b348015610e5c57600080fd5b506007546104e5565b348015610e7157600080fd5b50610568610e803660046154fa565b612a93565b348015610e9157600080fd5b506104e57f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610ec557600080fd5b5061058a612b40565b348015610eda57600080fd5b50610538610ee9366004615168565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b348015610f2357600080fd5b506104e5600080516020615d1f83398151915281565b348015610f4557600080fd5b50610568610f54366004615545565b612bd2565b348015610f6557600080fd5b50610568610f74366004615056565b612c17565b348015610f8557600080fd5b50610538610f94366004614c5c565b612c5a565b348015610fa557600080fd5b5061090f610fb4366004614e33565b612c8e565b348015610fc557600080fd5b50610568612e62565b348015610fda57600080fd5b506104e57fefb9a0764f88417a6977b3a6851c8fb991983b58bf47fec627571b2120bd9d1381565b60006001600160a01b0383166110725760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b600061109582612e86565b7f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c6110d081612eab565b6110d982612eb5565b5050565b6060600280546110ec906155ad565b80601f0160208091040260200160405190810160405280929190818152602001828054611118906155ad565b80156111655780601f1061113a57610100808354040283529160200191611165565b820191906000526020600020905b81548152906001019060200180831161114857829003601f168201915b50505050509050919050565b6001600160a01b0381166000908152600860205260409020546111a65760405162461bcd60e51b8152600401611069906155e7565b60006111b18261214c565b9050806000036111d35760405162461bcd60e51b81526004016110699061562d565b80600760008282546111e5919061568e565b90915550506001600160a01b03821660009081526009602052604090208054820190556112128282612ec1565b604080516001600160a01b0384168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a15050565b600080516020615d1f83398151915261127081612eab565b5060408051808201825292835260208084019290925280516080810182526001600160a01b039687168152808301958652908101938452606081019283526015805460018101825560009190915290517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec475600590920291820180546001600160a01b031916919097161790955592517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47685015590517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec4778401555180517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47884015501517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47990910155565b60175462010000900460ff166113e75760405162461bcd60e51b81526020600482015260136024820152724f6e6c792072616e646f6d206d696e74696e6760681b6044820152606401611069565b333214806113fc5750601754610100900460ff165b6114385760405162461bcd60e51b815260206004820152600d60248201526c4e6f20636f6e7472616374732160981b6044820152606401611069565b6012541580611487575061148761144e33612fda565b84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061301992505050565b80611499575061149961144e87612fda565b6114dc5760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21026b2b935b63290383937b7b360611b6044820152606401611069565b84516000805b828110156118395760008882815181106114fe576114fe6156a1565b6020026020010151116115235760405162461bcd60e51b8152600401611069906156b7565b611545888281518110611538576115386156a1565b6020026020010151613028565b6115835760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b6044820152606401611069565b6115d6601660008a848151811061159c5761159c6156a1565b602002602001015181526020019081526020016000206040518060400160405290816000820154815260200160018201548152505061309b565b6116155760405162461bcd60e51b815260206004820152601060248201526f4e6f7420617420746869732074696d6560801b6044820152606401611069565b600f600089838151811061162b5761162b6156a1565b6020026020010151815260200190815260200160002054600014806116ce5750600f6000898381518110611661576116616156a1565b602002602001015181526020019081526020016000205487828151811061168a5761168a6156a1565b60200260200101516116c18a84815181106116a7576116a76156a1565b602002602001015160009081526005602052604090205490565b6116cb919061568e565b11155b61170d5760405162461bcd60e51b815260206004820152601060248201526f14dd5c1c1b1e48195e1a185d5cdd195960821b6044820152606401611069565b60106000898381518110611723576117236156a1565b6020026020010151815260200190815260200160002054600014806117ba575060106000898381518110611759576117596156a1565b6020026020010151815260200190815260200160002054878281518110611782576117826156a1565b60200260200101516117ad8b8b85815181106117a0576117a06156a1565b6020026020010151611002565b6117b7919061568e565b11155b6118025760405162461bcd60e51b815260206004820152601960248201527852656163686564207065722d77616c6c6574206c696d69742160381b6044820152606401611069565b868181518110611814576118146156a1565b602002602001015182611827919061568e565b9150611832816156e6565b90506114e2565b5061184488826119a2565b61188c5760405162461bcd60e51b81526020600482015260196024820152784e6f7420656e6f75676820666f726569676e20746f6b656e7360381b6044820152606401611069565b6118978160006130de565b6118d45760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401611069565b6118df8888886131b4565b6118eb8888888661324f565b5050505050505050565b600080516020615cff83398151915261190d81612eab565b6013546001600160a01b0385811691161461197a57826001600160401b0381111561193a5761193a614ce9565b604051908082528060200260200182016040528015611963578160200160208202803683370190505b50805161197891601891602090910190614b0b565b505b50601380546001600160a01b0319166001600160a01b03949094169390931790925550600e55565b601554600090600111156119b857506001611095565b60006119c384611ae3565b905080836119d0866120ca565b6119da919061568e565b116119e9576001915050611095565b5060009392505050565b6001600160a01b038516331480611a0f5750611a0f8533610ee9565b611a2b5760405162461bcd60e51b8152600401611069906156ff565b611a3885858585856133a9565b5050505050565b600082815260036020526040902060010154611a5a81612eab565b611a64838361354b565b505050565b6001600160a01b0381163314611ad95760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401611069565b6110d982826135d1565b600080805b601554811015611beb57611b3d60158281548110611b0857611b086156a1565b90600052602060002090600502016003016040518060400160405290816000820154815260200160018201548152505061309b565b15611bd95760158181548110611b5557611b556156a1565b906000526020600020906005020160020154611bc28560158481548110611b7e57611b7e6156a1565b90600052602060002090600502016001015460158581548110611ba357611ba36156a1565b60009182526020909120600590910201546001600160a01b0316613638565b611bcc919061574d565b611bd6908361568e565b91505b80611be3816156e6565b915050611ae8565b5092915050565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec611c1c81612eab565b60405133904780156108fc02916000818181858888f193505050501580156110d9573d6000803e3d6000fd5b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611c7281612eab565b611c7a6136b5565b50565b6001600160a01b038116600090815260086020526040902054611cb25760405162461bcd60e51b8152600401611069906155e7565b6000611cbe8383612778565b905080600003611ce05760405162461bcd60e51b81526004016110699061562d565b6001600160a01b0383166000908152600b602052604081208054839290611d0890849061568e565b90915550506001600160a01b038084166000908152600c60209081526040808320938616835292905220805482019055611d43838383613707565b604080516001600160a01b038481168252602082018490528516917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a2505050565b60158181548110611d9e57600080fd5b60009182526020918290206005909102018054600182015460028301546040805180820190915260038501548152600490940154948401949094526001600160a01b039091169350919084565b60608151835114611e505760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401611069565b600083516001600160401b03811115611e6b57611e6b614ce9565b604051908082528060200260200182016040528015611e94578160200160208202803683370190505b50905060005b8451811015611eff57611ed2858281518110611eb857611eb86156a1565b60200260200101518583815181106117a0576117a06156a1565b828281518110611ee457611ee46156a1565b6020908102919091010152611ef8816156e6565b9050611e9a565b509392505050565b600080516020615d1f833981519152611f1f81612eab565b8151611a64906014906020850190614bb0565b6001600160a01b038316331480611f4e5750611f4e8333610ee9565b611f6a5760405162461bcd60e51b8152600401611069906156ff565b611a64838383613759565b60148181548110611f8557600080fd5b600091825260209091200154905081565b7fefb9a0764f88417a6977b3a6851c8fb991983b58bf47fec627571b2120bd9d13611fc081612eab565b50601255565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611ff081612eab565b611c7a6138f6565b6000600a828154811061200d5761200d6156a1565b6000918252602090912001546001600160a01b031692915050565b600080516020615d1f83398151915261204081612eab565b5060178054911515620100000262ff000019909216919091179055565b600080516020615d1f83398151915261207581612eab565b50600d55565b60009182526003602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020615cff8339815191526120be81612eab565b601a611a6483826157aa565b600080805b601454811015611beb576001600160a01b03841660009081526011602052604081206014805491929184908110612108576121086156a1565b90600052602060002001548152602001908152602001600020548261212d919061568e565b915080612139816156e6565b9150506120cf565b6110d9338383613933565b60008061215860075490565b612162904761568e565b905061218d8382612188866001600160a01b031660009081526009602052604090205490565b613a13565b9392505050565b333214806121a95750601754610100900460ff165b6121e55760405162461bcd60e51b815260206004820152600d60248201526c4e6f20636f6e7472616374732160981b6044820152606401611069565b6121ee86613028565b61222c5760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b6044820152606401611069565b600086815260166020908152604091829020825180840190935280548352600101549082015261225b9061309b565b61229a5760405162461bcd60e51b815260206004820152601060248201526f4e6f7420617420746869732074696d6560801b6044820152606401611069565b6000868152600f602052604090205415806122d957506000868152600f60209081526040808320546005909252909120546122d690879061568e565b11155b6123185760405162461bcd60e51b815260206004820152601060248201526f14dd5c1c1b1e48195e1a185d5cdd195960821b6044820152606401611069565b60008681526010602052604090205415806123555750600086815260106020526040902054856123488989611002565b612352919061568e565b11155b61239d5760405162461bcd60e51b815260206004820152601960248201527852656163686564207065722d77616c6c6574206c696d69742160381b6044820152606401611069565b6123a787866119a2565b6123ef5760405162461bcd60e51b81526020600482015260196024820152784e6f7420656e6f75676820666f726569676e20746f6b656e7360381b6044820152606401611069565b6012541580612405575061240561144e33612fda565b80612417575061241761144e88612fda565b61245a5760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21026b2b935b63290383937b7b360611b6044820152606401611069565b6018548411156124ac5760405162461bcd60e51b815260206004820152601f60248201527f646973636f756e74546f6b656e4964206973206f7574206f662072616e6765006044820152606401611069565b6124b685856130de565b6124f35760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401611069565b856000036126a657600061250688612c8e565b905085815110156125645760405162461bcd60e51b815260206004820152602260248201527f556e726561736f6e61626c652072616e646f6d697a6174696f6e2072657175656044820152611cdd60f21b6064820152608401611069565b8561256f8282613a51565b91506000876001600160401b0381111561258b5761258b614ce9565b6040519080825280602002602001820160405280156125b4578160200160208202803683370190505b5090506000805b8981101561261a578481815181106125d5576125d56156a1565b60200260200101518382815181106125ef576125ef6156a1565b602090810291909101015281612604816156e6565b9250508080612612906156e6565b9150506125bb565b508881146126765760405162461bcd60e51b815260206004820152602360248201527f556e61626c6520746f2067656e657261746520756e6971756520746f6b656e2060448201526249447360e81b6064820152608401611069565b60006126838a6001613b26565b90506126908c84836131b4565b61269c8c84838961324f565b5050505050612739565b60175462010000900460ff166126f45760405162461bcd60e51b81526020600482015260136024820152724f6e6c792072616e646f6d206d696e74696e6760681b6044820152606401611069565b6001600160a01b03871660009081526011602090815260408083208984529091528120805487929061272790849061568e565b90915550612739905087878784613ba9565b50505050505050565b600080516020615cff83398151915261275a81612eab565b506017805461ff001981166101009182900460ff1615909102179055565b6001600160a01b0382166000908152600b602052604081205481906040516370a0823160e01b81523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa1580156127d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fb9190615869565b612805919061568e565b6001600160a01b038086166000908152600c602090815260408083209388168352929052205490915061283b9084908390613a13565b949350505050565b600080516020615d1f83398151915261285b81612eab565b6000831161287b5760405162461bcd60e51b8152600401611069906156b7565b5060009182526010602052604090912055565b600080516020615d1f8339815191526128a681612eab565b600084116128c65760405162461bcd60e51b8152600401611069906156b7565b5060009283526016602052604090922090815560010155565b600080516020615d1f8339815191526128f781612eab565b506013805460e09290921c600160a01b0263ffffffff60a01b19909216919091179055565b60008281526003602052604090206001015461293781612eab565b611a6483836135d1565b7f3d801a24ff41e923496f3e680edb15bc7eda1c1687277be9821dbfa1af9ae0aa61296b81612eab565b6000841161298b5760405162461bcd60e51b8152600401611069906156b7565b6101f48361299860195490565b6129a2919061568e565b11156129f05760405162461bcd60e51b815260206004820152601760248201527f616d6f756e74206f766572206d617820616c6c6f7765640000000000000000006044820152606401611069565b8260011480612a125750612a12600080516020615cff8339815191523361207b565b612a545760405162461bcd60e51b81526020600482015260136024820152723e2031206f6e6c792041444d494e5f524f4c4560681b6044820152606401611069565b612a6085858585613ba9565b60005b83811015612a8b57612a79601980546001019055565b80612a83816156e6565b915050612a63565b505050505050565b600080516020615d1f833981519152612aab81612eab565b60175460ff1615612af35760405162461bcd60e51b81526020600482015260126024820152711cd85b1953585e131bd8dac81a5cc81cd95d60721b6044820152606401611069565b60008311612b135760405162461bcd60e51b8152600401611069906156b7565b506017805460ff19169115159190911790556000908152600f6020526040902063ffffffff919091169055565b6060601a8054612b4f906155ad565b80601f0160208091040260200160405190810160405280929190818152602001828054612b7b906155ad565b8015612bc85780601f10612b9d57610100808354040283529160200191612bc8565b820191906000526020600020905b815481529060010190602001808311612bab57829003601f168201915b5050505050905090565b6001600160a01b038516331480612bee5750612bee8533610ee9565b612c0a5760405162461bcd60e51b8152600401611069906156ff565b611a388585858585613c89565b6001600160a01b038316331480612c335750612c338333610ee9565b612c4f5760405162461bcd60e51b8152600401611069906156ff565b611a64838383613dc1565b60188181548110612c6a57600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b606080600060116000856001600160a01b03166001600160a01b0316815260200190815260200160002060006014600081548110612cce57612cce6156a1565b906000526020600020015481526020019081526020016000205490506000805b601454811015612d7a57600060148281548110612d0d57612d0d6156a1565b60009182526020808320909101546001600160a01b038a16835260118252604080842082855290925291205490915084811015612d505780945060019350612d65565b848103612d655783612d61816156e6565b9450505b50508080612d72906156e6565b915050612cee565b50806001600160401b03811115612d9357612d93614ce9565b604051908082528060200260200182016040528015612dbc578160200160208202803683370190505b5092506000805b601454811015612e5757600060148281548110612de257612de26156a1565b60009182526020808320909101546001600160a01b038b168352601182526040808420828552909252912054909150859003612e445780868481518110612e2b57612e2b6156a1565b602090810291909101015282612e40816156e6565b9350505b5080612e4f816156e6565b915050612dc3565b509295945050505050565b600080516020615d1f833981519152612e7a81612eab565b611c7a60156000614beb565b60006001600160e01b03198216637965db0b60e01b1480611095575061109582613ed9565b611c7a8133613f29565b60026110d982826157aa565b80471015612f115760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401611069565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612f5e576040519150601f19603f3d011682016040523d82523d6000602084013e612f63565b606091505b5050905080611a645760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401611069565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b600061218d8260125485613f82565b600081158015613039575060145415155b1561304657506001919050565b60005b601454811015613092578260148281548110613067576130676156a1565b9060005260206000200154036130805750600192915050565b8061308a816156e6565b915050613049565b50600092915050565b805160009015806130ad575081514210155b80156130c95750602082015115806130c9575042826020015110155b156130d657506001919050565b506000919050565b600082600d546130ee919061574d565b34106130fc57506001611095565b60008211801561310e57506018548211155b801561311a5750826001145b801561313957506013546131399033906001600160a01b031684613f98565b15613092576000600e54600d546131509190615882565b90508034106131aa57600160186131678286615882565b81548110613177576131776156a1565b90600052602060002090602091828204019190066101000a81548160ff0219169083151502179055506001915050611095565b5050600092915050565b815160005b81811015611a38578281815181106131d3576131d36156a1565b602002602001015160116000876001600160a01b03166001600160a01b031681526020019081526020016000206000868481518110613214576132146156a1565b602002602001015181526020019081526020016000206000828254613239919061568e565b909155506132489050816156e6565b90506131b9565b6001600160a01b0384166132755760405162461bcd60e51b815260040161106990615895565b81518351146132965760405162461bcd60e51b8152600401611069906158d6565b336132a6816000878787876141b1565b60005b8451811015613341578381815181106132c4576132c46156a1565b60200260200101516000808784815181106132e1576132e16156a1565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254613329919061568e565b90915550819050613339816156e6565b9150506132a9565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161339292919061591e565b60405180910390a4611a38816000878787876141c7565b81518351146133ca5760405162461bcd60e51b8152600401611069906158d6565b6001600160a01b0384166133f05760405162461bcd60e51b815260040161106990615943565b336133ff8187878787876141b1565b60005b84518110156134e557600085828151811061341f5761341f6156a1565b60200260200101519050600085838151811061343d5761343d6156a1565b602090810291909101810151600084815280835260408082206001600160a01b038e16835290935291909120549091508181101561348d5760405162461bcd60e51b815260040161106990615988565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906134ca90849061568e565b92505081905550505050806134de906156e6565b9050613402565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161353592919061591e565b60405180910390a4612a8b8187878787876141c7565b613555828261207b565b6110d95760008281526003602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561358d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6135db828261207b565b156110d95760008281526003602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604051627eeac760e11b81526001600160a01b03848116600483015260248201849052600091839182169062fdd58e90604401602060405180830381865afa158015613688573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ac9190615869565b95945050505050565b6136bd614322565b6004805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611a6490849061436d565b6001600160a01b03831661377f5760405162461bcd60e51b8152600401611069906159d2565b80518251146137a05760405162461bcd60e51b8152600401611069906158d6565b60003390506137c3818560008686604051806020016040528060008152506141b1565b60005b83518110156138885760008482815181106137e3576137e36156a1565b602002602001015190506000848381518110613801576138016156a1565b602090810291909101810151600084815280835260408082206001600160a01b038c1683529093529190912054909150818110156138515760405162461bcd60e51b815260040161106990615a15565b6000928352602083815260408085206001600160a01b038b1686529091529092209103905580613880816156e6565b9150506137c6565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516138d992919061591e565b60405180910390a460408051602081019091526000905250505050565b6138fe61443f565b6004805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586136ea3390565b816001600160a01b0316836001600160a01b0316036139a65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401611069565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6006546001600160a01b03841660009081526008602052604081205490918391613a3d908661574d565b613a479190615a6f565b61283b9190615882565b815160609083906000613a65600183615882565b90505b8015613b1c576000613a84613a7e83600161568e565b87614485565b90506000848381518110613a9a57613a9a6156a1565b60200260200101519050848281518110613ab657613ab66156a1565b6020026020010151858481518110613ad057613ad06156a1565b60200260200101818152505080858381518110613aef57613aef6156a1565b602090810291909101015286613b04816156e6565b97505050508080613b1490615a83565b915050613a68565b5090949350505050565b60606000836001600160401b03811115613b4257613b42614ce9565b604051908082528060200260200182016040528015613b6b578160200160208202803683370190505b50905060005b84811015611eff5783828281518110613b8c57613b8c6156a1565b602090810291909101015280613ba1816156e6565b915050613b71565b6001600160a01b038416613bcf5760405162461bcd60e51b815260040161106990615895565b336000613bdb856144fd565b90506000613be8856144fd565b9050613bf9836000898585896141b1565b6000868152602081815260408083206001600160a01b038b16845290915281208054879290613c2990849061568e565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461273983600089898989614548565b6001600160a01b038416613caf5760405162461bcd60e51b815260040161106990615943565b336000613cbb856144fd565b90506000613cc8856144fd565b9050613cd88389898585896141b1565b6000868152602081815260408083206001600160a01b038c16845290915290205485811015613d195760405162461bcd60e51b815260040161106990615988565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290613d5690849061568e565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613db6848a8a8a8a8a614548565b505050505050505050565b6001600160a01b038316613de75760405162461bcd60e51b8152600401611069906159d2565b336000613df3846144fd565b90506000613e00846144fd565b9050613e20838760008585604051806020016040528060008152506141b1565b6000858152602081815260408083206001600160a01b038a16845290915290205484811015613e615760405162461bcd60e51b815260040161106990615a15565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052612739565b60006001600160e01b03198216636cdb3d1360e11b1480613f0a57506001600160e01b031982166303a24d0760e21b145b8061109557506301ffc9a760e01b6001600160e01b0319831614611095565b613f33828261207b565b6110d957613f4081614603565b613f4b836020614615565b604051602001613f5c929190615a9a565b60408051601f198184030181529082905262461bcd60e51b825261106991600401614e20565b600082613f8f85846147b0565b14949350505050565b60185460009082111580613fe657506018613fb4600184615882565b81548110613fc457613fc46156a1565b60009182526020918290209181049091015460ff601f9092166101000a900416155b15614169576013546040516024810184905260009182916001600160a01b03871691600160a01b900460e01b9060440160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516140549190615b0f565b6000604051808303816000865af19150503d8060008114614091576040519150601f19603f3d011682016040523d82523d6000602084013e614096565b606091505b5091509150816140de5760405162461bcd60e51b81526020600482015260136024820152721bdddb995c93d98818d85b1b0819985a5b1959606a1b6044820152606401611069565b856001600160a01b03166140f3826020015190565b6001600160a01b03161461415e5760405162461bcd60e51b815260206004820152602c60248201527f4f776e6572206f6620646973636f756e74546f6b656e206e6f7420657175616c60448201526b1036b4b73a1039b2b73232b960a11b6064820152608401611069565b60019250505061218d565b60405162461bcd60e51b815260206004820152601760248201527f546f6b656e496420696e76616c6964206f7220757365640000000000000000006044820152606401611069565b6141b961443f565b612a8b8686868686866147f5565b6001600160a01b0384163b15612a8b5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061420b9089908990889088908890600401615b2b565b6020604051808303816000875af1925050508015614246575060408051601f3d908101601f1916820190925261424391810190615b89565b60015b6142f257614252615ba6565b806308c379a00361428b5750614266615bc2565b80614271575061428d565b8060405162461bcd60e51b81526004016110699190614e20565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401611069565b6001600160e01b0319811663bc197c8160e01b146127395760405162461bcd60e51b815260040161106990615c4b565b60045460ff1661436b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401611069565b565b60006143c2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661496e9092919063ffffffff16565b805190915015611a6457808060200190518101906143e09190615c93565b611a645760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611069565b60045460ff161561436b5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401611069565b600080424443614496600182615882565b6040805160208101959095528401929092526060808401919091529040608083015233901b6bffffffffffffffffffffffff191660a082015260b4810184905260d40160408051601f198184030181529190528051602090910120905061283b8482615cb0565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110614537576145376156a1565b602090810291909101015292915050565b6001600160a01b0384163b15612a8b5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061458c9089908990889088908890600401615cc4565b6020604051808303816000875af19250505080156145c7575060408051601f3d908101601f191682019092526145c491810190615b89565b60015b6145d357614252615ba6565b6001600160e01b0319811663f23a6e6160e01b146127395760405162461bcd60e51b815260040161106990615c4b565b60606110956001600160a01b03831660145b6060600061462483600261574d565b61462f90600261568e565b6001600160401b0381111561464657614646614ce9565b6040519080825280601f01601f191660200182016040528015614670576020820181803683370190505b509050600360fc1b8160008151811061468b5761468b6156a1565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106146ba576146ba6156a1565b60200101906001600160f81b031916908160001a90535060006146de84600261574d565b6146e990600161568e565b90505b6001811115614761576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061471d5761471d6156a1565b1a60f81b828281518110614733576147336156a1565b60200101906001600160f81b031916908160001a90535060049490941c9361475a81615a83565b90506146ec565b50831561218d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401611069565b600081815b8451811015611eff576147e1828683815181106147d4576147d46156a1565b602002602001015161497d565b9150806147ed816156e6565b9150506147b5565b6001600160a01b03851661487c5760005b835181101561487a57828181518110614821576148216156a1565b60200260200101516005600086848151811061483f5761483f6156a1565b602002602001015181526020019081526020016000206000828254614864919061568e565b909155506148739050816156e6565b9050614806565b505b6001600160a01b038416612a8b5760005b83518110156127395760008482815181106148aa576148aa6156a1565b6020026020010151905060008483815181106148c8576148c86156a1565b602002602001015190506000600560008481526020019081526020016000205490508181101561494b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b6064820152608401611069565b60009283526005602052604090922091039055614967816156e6565b905061488d565b606061283b84846000856149ac565b600081831061499957600082815260208490526040902061218d565b600083815260208390526040902061218d565b606082471015614a0d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611069565b600080866001600160a01b03168587604051614a299190615b0f565b60006040518083038185875af1925050503d8060008114614a66576040519150601f19603f3d011682016040523d82523d6000602084013e614a6b565b606091505b5091509150614a7c87838387614a87565b979650505050505050565b60608315614af6578251600003614aef576001600160a01b0385163b614aef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611069565b508161283b565b61283b83838151156142715781518083602001fd5b82805482825590600052602060002090601f01602090048101928215614ba05791602002820160005b83821115614b7157835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302614b34565b8015614b9e5782816101000a81549060ff0219169055600101602081600001049283019260010302614b71565b505b50614bac929150614c0c565b5090565b828054828255906000526020600020908101928215614ba0579160200282015b82811115614ba0578251825591602001919060010190614bd0565b5080546000825560050290600052602060002090810190611c7a9190614c21565b5b80821115614bac5760008155600101614c0d565b5b80821115614bac5780546001600160a01b031916815560006001820181905560028201819055600382018190556004820155600501614c22565b600060208284031215614c6e57600080fd5b5035919050565b6001600160a01b0381168114611c7a57600080fd5b60008060408385031215614c9d57600080fd5b8235614ca881614c75565b946020939093013593505050565b6001600160e01b031981168114611c7a57600080fd5b600060208284031215614cde57600080fd5b813561218d81614cb6565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715614d2457614d24614ce9565b6040525050565b60006001600160401b03831115614d4457614d44614ce9565b604051614d5b601f8501601f191660200182614cff565b809150838152848484011115614d7057600080fd5b83836020830137600060208583010152509392505050565b600060208284031215614d9a57600080fd5b81356001600160401b03811115614db057600080fd5b8201601f81018413614dc157600080fd5b61283b84823560208401614d2b565b60005b83811015614deb578181015183820152602001614dd3565b50506000910152565b60008151808452614e0c816020860160208601614dd0565b601f01601f19169290920160200192915050565b60208152600061218d6020830184614df4565b600060208284031215614e4557600080fd5b813561218d81614c75565b600080600080600060a08688031215614e6857600080fd5b8535614e7381614c75565b97602087013597506040870135966060810135965060800135945092505050565b60006001600160401b03821115614ead57614ead614ce9565b5060051b60200190565b600082601f830112614ec857600080fd5b81356020614ed582614e94565b604051614ee28282614cff565b83815260059390931b8501820192828101915086841115614f0257600080fd5b8286015b84811015614f1d5780358352918301918301614f06565b509695505050505050565b60008083601f840112614f3a57600080fd5b5081356001600160401b03811115614f5157600080fd5b6020830191508360208260051b8501011115614f6c57600080fd5b9250929050565b600082601f830112614f8457600080fd5b61218d83833560208501614d2b565b60008060008060008060a08789031215614fac57600080fd5b8635614fb781614c75565b955060208701356001600160401b0380821115614fd357600080fd5b614fdf8a838b01614eb7565b96506040890135915080821115614ff557600080fd5b6150018a838b01614eb7565b9550606089013591508082111561501757600080fd5b6150238a838b01614f28565b9095509350608089013591508082111561503c57600080fd5b5061504989828a01614f73565b9150509295509295509295565b60008060006060848603121561506b57600080fd5b833561507681614c75565b95602085013595506040909401359392505050565b600080600080600060a086880312156150a357600080fd5b85356150ae81614c75565b945060208601356150be81614c75565b935060408601356001600160401b03808211156150da57600080fd5b6150e689838a01614eb7565b945060608801359150808211156150fc57600080fd5b61510889838a01614eb7565b9350608088013591508082111561511e57600080fd5b5061512b88828901614f73565b9150509295509295909350565b6000806040838503121561514b57600080fd5b82359150602083013561515d81614c75565b809150509250929050565b6000806040838503121561517b57600080fd5b823561518681614c75565b9150602083013561515d81614c75565b600080604083850312156151a957600080fd5b82356001600160401b03808211156151c057600080fd5b818501915085601f8301126151d457600080fd5b813560206151e182614e94565b6040516151ee8282614cff565b83815260059390931b850182019282810191508984111561520e57600080fd5b948201945b8386101561523557853561522681614c75565b82529482019490820190615213565b9650508601359250508082111561524b57600080fd5b5061525885828601614eb7565b9150509250929050565b600081518084526020808501945080840160005b8381101561529257815187529582019590820190600101615276565b509495945050505050565b60208152600061218d6020830184615262565b6000602082840312156152c257600080fd5b81356001600160401b038111156152d857600080fd5b61283b84828501614eb7565b6000806000606084860312156152f957600080fd5b833561530481614c75565b925060208401356001600160401b038082111561532057600080fd5b61532c87838801614eb7565b9350604086013591508082111561534257600080fd5b5061534f86828701614eb7565b9150509250925092565b8015158114611c7a57600080fd5b60006020828403121561537957600080fd5b813561218d81615359565b6000806040838503121561539757600080fd5b82356153a281614c75565b9150602083013561515d81615359565b600080600080600080600060c0888a0312156153cd57600080fd5b87356153d881614c75565b965060208801359550604088013594506060880135935060808801356001600160401b038082111561540957600080fd5b6154158b838c01614f28565b909550935060a08a013591508082111561542e57600080fd5b5061543b8a828b01614f73565b91505092959891949750929550565b6000806040838503121561545d57600080fd5b50508035926020909101359150565b60008060006060848603121561548157600080fd5b505081359360208301359350604090920135919050565b600080600080608085870312156154ae57600080fd5b84356154b981614c75565b9350602085013592506040850135915060608501356001600160401b038111156154e257600080fd5b6154ee87828801614f73565b91505092959194509250565b60008060006060848603121561550f57600080fd5b833563ffffffff8116811461552357600080fd5b925060208401359150604084013561553a81615359565b809150509250925092565b600080600080600060a0868803121561555d57600080fd5b853561556881614c75565b9450602086013561557881614c75565b9350604086013592506060860135915060808601356001600160401b038111156155a157600080fd5b61512b88828901614f73565b600181811c908216806155c157607f821691505b6020821081036155e157634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561109557611095615678565b634e487b7160e01b600052603260045260246000fd5b602080825260159082015274125b9d985b1a59081d1bdad95b881d1e5c19481251605a1b604082015260600190565b6000600182016156f8576156f8615678565b5060010190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b808202811582820484141761109557611095615678565b601f821115611a6457600081815260208120601f850160051c8101602086101561578b5750805b601f850160051c820191505b81811015612a8b57828155600101615797565b81516001600160401b038111156157c3576157c3614ce9565b6157d7816157d184546155ad565b84615764565b602080601f83116001811461580c57600084156157f45750858301515b600019600386901b1c1916600185901b178555612a8b565b600085815260208120601f198616915b8281101561583b5788860151825594840194600190910190840161581c565b50858210156158595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121561587b57600080fd5b5051919050565b8181038181111561109557611095615678565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b6040815260006159316040830185615262565b82810360208401526136ac8185615262565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b600082615a7e57615a7e615a59565b500490565b600081615a9257615a92615678565b506000190190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615ad2816017850160208801614dd0565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615b03816028840160208801614dd0565b01602801949350505050565b60008251615b21818460208701614dd0565b9190910192915050565b6001600160a01b0386811682528516602082015260a060408201819052600090615b5790830186615262565b8281036060840152615b698186615262565b90508281036080840152615b7d8185614df4565b98975050505050505050565b600060208284031215615b9b57600080fd5b815161218d81614cb6565b600060033d1115615bbf5760046000803e5060005160e01c5b90565b600060443d1015615bd05790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615bff57505050505090565b8285019150815181811115615c175750505050505090565b843d8701016020828501011115615c315750505050505090565b615c4060208286010187614cff565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b600060208284031215615ca557600080fd5b815161218d81615359565b600082615cbf57615cbf615a59565b500690565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614a7c90830184614df456fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775deccffc5821b949817830292498e44ccb6097e4b74ff2f2db960723873324defa2646970667358221220e6ccacbcf5c8c4550105cac51815109ad73c80c7eefbb6d53c609cbe52a1b01764736f6c634300081100330000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000090845ae0e32e08fb01082615882aa07cebe30ff200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000064
Deployed Bytecode
0x60806040526004361061046a5760003560e01c80638456cb591161024a578063c7d07c6311610139578063e63ab1e9116100b6578063f5298aca1161007a578063f5298aca14610f59578063f7c8ce7c14610f79578063fae9c53514610f99578063fd233ce814610fb9578063fd54b8c914610fce57600080fd5b8063e63ab1e914610e85578063e8a3d48514610eb9578063e985e9c514610ece578063ee98523414610f17578063f242432a14610f3957600080fd5b8063de7d780f116100fd578063de7d780f14610dc8578063deb000ee14610de8578063e02023a114610e1c578063e33b7de314610e50578063e3b40deb14610e6557600080fd5b8063c7d07c6314610ce4578063ce7c2ac214610d04578063d547741f14610d3a578063d79779b214610d5a578063d970723f14610d9057600080fd5b8063a217fddf116101c7578063b55881811161018b578063b558818114610c42578063bd85b03914610c57578063c45ac05014610c84578063c61adfea14610ca4578063c62117c314610cc457600080fd5b8063a217fddf14610bc4578063a22cb46514610bd9578063a3f8eace14610bf9578063afc557a014610c19578063b22edfbc14610c2c57600080fd5b8063938e3d7b1161020e578063938e3d7b14610b1e5780639852595c14610b3e5780639df87de414610b74578063a035b1fe14610b94578063a049dd4014610baa57600080fd5b80638456cb5914610a895780638b83209b14610a9e5780638f3a291914610abe57806391b7f5ed14610ade57806391d1485414610afe57600080fd5b806337df0269116103665780634f558e79116102e357806375b238fc116102a757806375b238fc146109b957806377e45a18146109db57806379a2e22614610a155780637cb6475914610a355780637f34571014610a5557600080fd5b80634f558e791461091c5780635c975abb1461094b5780635d74dd3e146109635780636b20c454146109835780636b6f4a9d146109a357600080fd5b806344d19d2b1161032a57806344d19d2b1461083557806348b750441461084c57806349bceddb1461086c5780634b98983f146108995780634e1273f4146108ef57600080fd5b806337df0269146107905780633a98ef39146107b05780633ccfd60b146107c55780633f4ba83a146107da578063406072a9146107ef57600080fd5b8063248a9ca3116103f45780632eb4a7ab116103b85780632eb4a7ab146106fb5780632eb9020d146107115780632f2ff15d146107305780632fb85f8f1461075057806336568abe1461077057600080fd5b8063248a9ca31461062257806324d043e01461065257806329e239cc146106725780632dae160f146106bb5780632eb2c2d6146106db57600080fd5b80630e89341c1161043b5780630e89341c1461056a578063104789c71461059757806319165587146105cf57806321a08f47146105ef578063221193e31461060f57600080fd5b80624221f0146104b8578062fdd58e146104f857806301ffc9a71461051857806302fe53051461054857600080fd5b366104b3577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b3480156104c457600080fd5b506104e56104d3366004614c5c565b600f6020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561050457600080fd5b506104e5610513366004614c8a565b611002565b34801561052457600080fd5b50610538610533366004614ccc565b61109b565b60405190151581526020016104ef565b34801561055457600080fd5b50610568610563366004614d88565b6110a6565b005b34801561057657600080fd5b5061058a610585366004614c5c565b6110dd565b6040516104ef9190614e20565b3480156105a357600080fd5b506013546105b7906001600160a01b031681565b6040516001600160a01b0390911681526020016104ef565b3480156105db57600080fd5b506105686105ea366004614e33565b611171565b3480156105fb57600080fd5b5061056861060a366004614e50565b611258565b61056861061d366004614f93565b611399565b34801561062e57600080fd5b506104e561063d366004614c5c565b60009081526003602052604090206001015490565b34801561065e57600080fd5b5061056861066d366004615056565b6118f5565b34801561067e57600080fd5b506106a661068d366004614c5c565b6016602052600090815260409020805460019091015482565b604080519283526020830191909152016104ef565b3480156106c757600080fd5b506105386106d6366004614c8a565b6119a2565b3480156106e757600080fd5b506105686106f636600461508b565b6119f3565b34801561070757600080fd5b506104e560125481565b34801561071d57600080fd5b5060175461053890610100900460ff1681565b34801561073c57600080fd5b5061056861074b366004615138565b611a3f565b34801561075c57600080fd5b506017546105389062010000900460ff1681565b34801561077c57600080fd5b5061056861078b366004615138565b611a69565b34801561079c57600080fd5b506104e56107ab366004614e33565b611ae3565b3480156107bc57600080fd5b506006546104e5565b3480156107d157600080fd5b50610568611bf2565b3480156107e657600080fd5b50610568611c48565b3480156107fb57600080fd5b506104e561080a366004615168565b6001600160a01b039182166000908152600c6020908152604080832093909416825291909152205490565b34801561084157600080fd5b506019546104e59081565b34801561085857600080fd5b50610568610867366004615168565b611c7d565b34801561087857600080fd5b506104e5610887366004614c5c565b60106020526000908152604090205481565b3480156108a557600080fd5b506108b96108b4366004614c5c565b611d8e565b604080516001600160a01b039095168552602080860194909452840191909152805160608401520151608082015260a0016104ef565b3480156108fb57600080fd5b5061090f61090a366004615196565b611deb565b6040516104ef919061529d565b34801561092857600080fd5b50610538610937366004614c5c565b600090815260056020526040902054151590565b34801561095757600080fd5b5060045460ff16610538565b34801561096f57600080fd5b5061056861097e3660046152b0565b611f07565b34801561098f57600080fd5b5061056861099e3660046152e4565b611f32565b3480156109af57600080fd5b506104e5600e5481565b3480156109c557600080fd5b506104e5600080516020615cff83398151915281565b3480156109e757600080fd5b506013546109fc90600160a01b900460e01b81565b6040516001600160e01b031990911681526020016104ef565b348015610a2157600080fd5b506104e5610a30366004614c5c565b611f75565b348015610a4157600080fd5b50610568610a50366004614c5c565b611f96565b348015610a6157600080fd5b506104e57f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c81565b348015610a9557600080fd5b50610568611fc6565b348015610aaa57600080fd5b506105b7610ab9366004614c5c565b611ff8565b348015610aca57600080fd5b50610568610ad9366004615367565b612028565b348015610aea57600080fd5b50610568610af9366004614c5c565b61205d565b348015610b0a57600080fd5b50610538610b19366004615138565b61207b565b348015610b2a57600080fd5b50610568610b39366004614d88565b6120a6565b348015610b4a57600080fd5b506104e5610b59366004614e33565b6001600160a01b031660009081526009602052604090205490565b348015610b8057600080fd5b506104e5610b8f366004614e33565b6120ca565b348015610ba057600080fd5b506104e5600d5481565b348015610bb657600080fd5b506017546105389060ff1681565b348015610bd057600080fd5b506104e5600081565b348015610be557600080fd5b50610568610bf4366004615384565b612141565b348015610c0557600080fd5b506104e5610c14366004614e33565b61214c565b610568610c273660046153b2565b612194565b348015610c3857600080fd5b506104e56101f481565b348015610c4e57600080fd5b50610568612742565b348015610c6357600080fd5b506104e5610c72366004614c5c565b60009081526005602052604090205490565b348015610c9057600080fd5b506104e5610c9f366004615168565b612778565b348015610cb057600080fd5b50610568610cbf36600461544a565b612843565b348015610cd057600080fd5b50610568610cdf36600461546c565b61288e565b348015610cf057600080fd5b50610568610cff366004614ccc565b6128df565b348015610d1057600080fd5b506104e5610d1f366004614e33565b6001600160a01b031660009081526008602052604090205490565b348015610d4657600080fd5b50610568610d55366004615138565b61291c565b348015610d6657600080fd5b506104e5610d75366004614e33565b6001600160a01b03166000908152600b602052604090205490565b348015610d9c57600080fd5b506104e5610dab366004614c8a565b601160209081526000928352604080842090915290825290205481565b348015610dd457600080fd5b50610568610de3366004615498565b612941565b348015610df457600080fd5b506104e57f3d801a24ff41e923496f3e680edb15bc7eda1c1687277be9821dbfa1af9ae0aa81565b348015610e2857600080fd5b506104e57f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec81565b348015610e5c57600080fd5b506007546104e5565b348015610e7157600080fd5b50610568610e803660046154fa565b612a93565b348015610e9157600080fd5b506104e57f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b348015610ec557600080fd5b5061058a612b40565b348015610eda57600080fd5b50610538610ee9366004615168565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b348015610f2357600080fd5b506104e5600080516020615d1f83398151915281565b348015610f4557600080fd5b50610568610f54366004615545565b612bd2565b348015610f6557600080fd5b50610568610f74366004615056565b612c17565b348015610f8557600080fd5b50610538610f94366004614c5c565b612c5a565b348015610fa557600080fd5b5061090f610fb4366004614e33565b612c8e565b348015610fc557600080fd5b50610568612e62565b348015610fda57600080fd5b506104e57fefb9a0764f88417a6977b3a6851c8fb991983b58bf47fec627571b2120bd9d1381565b60006001600160a01b0383166110725760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b600061109582612e86565b7f7804d923f43a17d325d77e781528e0793b2edd9890ab45fc64efd7b4b427744c6110d081612eab565b6110d982612eb5565b5050565b6060600280546110ec906155ad565b80601f0160208091040260200160405190810160405280929190818152602001828054611118906155ad565b80156111655780601f1061113a57610100808354040283529160200191611165565b820191906000526020600020905b81548152906001019060200180831161114857829003601f168201915b50505050509050919050565b6001600160a01b0381166000908152600860205260409020546111a65760405162461bcd60e51b8152600401611069906155e7565b60006111b18261214c565b9050806000036111d35760405162461bcd60e51b81526004016110699061562d565b80600760008282546111e5919061568e565b90915550506001600160a01b03821660009081526009602052604090208054820190556112128282612ec1565b604080516001600160a01b0384168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a15050565b600080516020615d1f83398151915261127081612eab565b5060408051808201825292835260208084019290925280516080810182526001600160a01b039687168152808301958652908101938452606081019283526015805460018101825560009190915290517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec475600590920291820180546001600160a01b031916919097161790955592517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47685015590517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec4778401555180517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47884015501517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47990910155565b60175462010000900460ff166113e75760405162461bcd60e51b81526020600482015260136024820152724f6e6c792072616e646f6d206d696e74696e6760681b6044820152606401611069565b333214806113fc5750601754610100900460ff165b6114385760405162461bcd60e51b815260206004820152600d60248201526c4e6f20636f6e7472616374732160981b6044820152606401611069565b6012541580611487575061148761144e33612fda565b84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061301992505050565b80611499575061149961144e87612fda565b6114dc5760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21026b2b935b63290383937b7b360611b6044820152606401611069565b84516000805b828110156118395760008882815181106114fe576114fe6156a1565b6020026020010151116115235760405162461bcd60e51b8152600401611069906156b7565b611545888281518110611538576115386156a1565b6020026020010151613028565b6115835760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b6044820152606401611069565b6115d6601660008a848151811061159c5761159c6156a1565b602002602001015181526020019081526020016000206040518060400160405290816000820154815260200160018201548152505061309b565b6116155760405162461bcd60e51b815260206004820152601060248201526f4e6f7420617420746869732074696d6560801b6044820152606401611069565b600f600089838151811061162b5761162b6156a1565b6020026020010151815260200190815260200160002054600014806116ce5750600f6000898381518110611661576116616156a1565b602002602001015181526020019081526020016000205487828151811061168a5761168a6156a1565b60200260200101516116c18a84815181106116a7576116a76156a1565b602002602001015160009081526005602052604090205490565b6116cb919061568e565b11155b61170d5760405162461bcd60e51b815260206004820152601060248201526f14dd5c1c1b1e48195e1a185d5cdd195960821b6044820152606401611069565b60106000898381518110611723576117236156a1565b6020026020010151815260200190815260200160002054600014806117ba575060106000898381518110611759576117596156a1565b6020026020010151815260200190815260200160002054878281518110611782576117826156a1565b60200260200101516117ad8b8b85815181106117a0576117a06156a1565b6020026020010151611002565b6117b7919061568e565b11155b6118025760405162461bcd60e51b815260206004820152601960248201527852656163686564207065722d77616c6c6574206c696d69742160381b6044820152606401611069565b868181518110611814576118146156a1565b602002602001015182611827919061568e565b9150611832816156e6565b90506114e2565b5061184488826119a2565b61188c5760405162461bcd60e51b81526020600482015260196024820152784e6f7420656e6f75676820666f726569676e20746f6b656e7360381b6044820152606401611069565b6118978160006130de565b6118d45760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401611069565b6118df8888886131b4565b6118eb8888888661324f565b5050505050505050565b600080516020615cff83398151915261190d81612eab565b6013546001600160a01b0385811691161461197a57826001600160401b0381111561193a5761193a614ce9565b604051908082528060200260200182016040528015611963578160200160208202803683370190505b50805161197891601891602090910190614b0b565b505b50601380546001600160a01b0319166001600160a01b03949094169390931790925550600e55565b601554600090600111156119b857506001611095565b60006119c384611ae3565b905080836119d0866120ca565b6119da919061568e565b116119e9576001915050611095565b5060009392505050565b6001600160a01b038516331480611a0f5750611a0f8533610ee9565b611a2b5760405162461bcd60e51b8152600401611069906156ff565b611a3885858585856133a9565b5050505050565b600082815260036020526040902060010154611a5a81612eab565b611a64838361354b565b505050565b6001600160a01b0381163314611ad95760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401611069565b6110d982826135d1565b600080805b601554811015611beb57611b3d60158281548110611b0857611b086156a1565b90600052602060002090600502016003016040518060400160405290816000820154815260200160018201548152505061309b565b15611bd95760158181548110611b5557611b556156a1565b906000526020600020906005020160020154611bc28560158481548110611b7e57611b7e6156a1565b90600052602060002090600502016001015460158581548110611ba357611ba36156a1565b60009182526020909120600590910201546001600160a01b0316613638565b611bcc919061574d565b611bd6908361568e565b91505b80611be3816156e6565b915050611ae8565b5092915050565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec611c1c81612eab565b60405133904780156108fc02916000818181858888f193505050501580156110d9573d6000803e3d6000fd5b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611c7281612eab565b611c7a6136b5565b50565b6001600160a01b038116600090815260086020526040902054611cb25760405162461bcd60e51b8152600401611069906155e7565b6000611cbe8383612778565b905080600003611ce05760405162461bcd60e51b81526004016110699061562d565b6001600160a01b0383166000908152600b602052604081208054839290611d0890849061568e565b90915550506001600160a01b038084166000908152600c60209081526040808320938616835292905220805482019055611d43838383613707565b604080516001600160a01b038481168252602082018490528516917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a2505050565b60158181548110611d9e57600080fd5b60009182526020918290206005909102018054600182015460028301546040805180820190915260038501548152600490940154948401949094526001600160a01b039091169350919084565b60608151835114611e505760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401611069565b600083516001600160401b03811115611e6b57611e6b614ce9565b604051908082528060200260200182016040528015611e94578160200160208202803683370190505b50905060005b8451811015611eff57611ed2858281518110611eb857611eb86156a1565b60200260200101518583815181106117a0576117a06156a1565b828281518110611ee457611ee46156a1565b6020908102919091010152611ef8816156e6565b9050611e9a565b509392505050565b600080516020615d1f833981519152611f1f81612eab565b8151611a64906014906020850190614bb0565b6001600160a01b038316331480611f4e5750611f4e8333610ee9565b611f6a5760405162461bcd60e51b8152600401611069906156ff565b611a64838383613759565b60148181548110611f8557600080fd5b600091825260209091200154905081565b7fefb9a0764f88417a6977b3a6851c8fb991983b58bf47fec627571b2120bd9d13611fc081612eab565b50601255565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611ff081612eab565b611c7a6138f6565b6000600a828154811061200d5761200d6156a1565b6000918252602090912001546001600160a01b031692915050565b600080516020615d1f83398151915261204081612eab565b5060178054911515620100000262ff000019909216919091179055565b600080516020615d1f83398151915261207581612eab565b50600d55565b60009182526003602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020615cff8339815191526120be81612eab565b601a611a6483826157aa565b600080805b601454811015611beb576001600160a01b03841660009081526011602052604081206014805491929184908110612108576121086156a1565b90600052602060002001548152602001908152602001600020548261212d919061568e565b915080612139816156e6565b9150506120cf565b6110d9338383613933565b60008061215860075490565b612162904761568e565b905061218d8382612188866001600160a01b031660009081526009602052604090205490565b613a13565b9392505050565b333214806121a95750601754610100900460ff165b6121e55760405162461bcd60e51b815260206004820152600d60248201526c4e6f20636f6e7472616374732160981b6044820152606401611069565b6121ee86613028565b61222c5760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b6044820152606401611069565b600086815260166020908152604091829020825180840190935280548352600101549082015261225b9061309b565b61229a5760405162461bcd60e51b815260206004820152601060248201526f4e6f7420617420746869732074696d6560801b6044820152606401611069565b6000868152600f602052604090205415806122d957506000868152600f60209081526040808320546005909252909120546122d690879061568e565b11155b6123185760405162461bcd60e51b815260206004820152601060248201526f14dd5c1c1b1e48195e1a185d5cdd195960821b6044820152606401611069565b60008681526010602052604090205415806123555750600086815260106020526040902054856123488989611002565b612352919061568e565b11155b61239d5760405162461bcd60e51b815260206004820152601960248201527852656163686564207065722d77616c6c6574206c696d69742160381b6044820152606401611069565b6123a787866119a2565b6123ef5760405162461bcd60e51b81526020600482015260196024820152784e6f7420656e6f75676820666f726569676e20746f6b656e7360381b6044820152606401611069565b6012541580612405575061240561144e33612fda565b80612417575061241761144e88612fda565b61245a5760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21026b2b935b63290383937b7b360611b6044820152606401611069565b6018548411156124ac5760405162461bcd60e51b815260206004820152601f60248201527f646973636f756e74546f6b656e4964206973206f7574206f662072616e6765006044820152606401611069565b6124b685856130de565b6124f35760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401611069565b856000036126a657600061250688612c8e565b905085815110156125645760405162461bcd60e51b815260206004820152602260248201527f556e726561736f6e61626c652072616e646f6d697a6174696f6e2072657175656044820152611cdd60f21b6064820152608401611069565b8561256f8282613a51565b91506000876001600160401b0381111561258b5761258b614ce9565b6040519080825280602002602001820160405280156125b4578160200160208202803683370190505b5090506000805b8981101561261a578481815181106125d5576125d56156a1565b60200260200101518382815181106125ef576125ef6156a1565b602090810291909101015281612604816156e6565b9250508080612612906156e6565b9150506125bb565b508881146126765760405162461bcd60e51b815260206004820152602360248201527f556e61626c6520746f2067656e657261746520756e6971756520746f6b656e2060448201526249447360e81b6064820152608401611069565b60006126838a6001613b26565b90506126908c84836131b4565b61269c8c84838961324f565b5050505050612739565b60175462010000900460ff166126f45760405162461bcd60e51b81526020600482015260136024820152724f6e6c792072616e646f6d206d696e74696e6760681b6044820152606401611069565b6001600160a01b03871660009081526011602090815260408083208984529091528120805487929061272790849061568e565b90915550612739905087878784613ba9565b50505050505050565b600080516020615cff83398151915261275a81612eab565b506017805461ff001981166101009182900460ff1615909102179055565b6001600160a01b0382166000908152600b602052604081205481906040516370a0823160e01b81523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa1580156127d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fb9190615869565b612805919061568e565b6001600160a01b038086166000908152600c602090815260408083209388168352929052205490915061283b9084908390613a13565b949350505050565b600080516020615d1f83398151915261285b81612eab565b6000831161287b5760405162461bcd60e51b8152600401611069906156b7565b5060009182526010602052604090912055565b600080516020615d1f8339815191526128a681612eab565b600084116128c65760405162461bcd60e51b8152600401611069906156b7565b5060009283526016602052604090922090815560010155565b600080516020615d1f8339815191526128f781612eab565b506013805460e09290921c600160a01b0263ffffffff60a01b19909216919091179055565b60008281526003602052604090206001015461293781612eab565b611a6483836135d1565b7f3d801a24ff41e923496f3e680edb15bc7eda1c1687277be9821dbfa1af9ae0aa61296b81612eab565b6000841161298b5760405162461bcd60e51b8152600401611069906156b7565b6101f48361299860195490565b6129a2919061568e565b11156129f05760405162461bcd60e51b815260206004820152601760248201527f616d6f756e74206f766572206d617820616c6c6f7765640000000000000000006044820152606401611069565b8260011480612a125750612a12600080516020615cff8339815191523361207b565b612a545760405162461bcd60e51b81526020600482015260136024820152723e2031206f6e6c792041444d494e5f524f4c4560681b6044820152606401611069565b612a6085858585613ba9565b60005b83811015612a8b57612a79601980546001019055565b80612a83816156e6565b915050612a63565b505050505050565b600080516020615d1f833981519152612aab81612eab565b60175460ff1615612af35760405162461bcd60e51b81526020600482015260126024820152711cd85b1953585e131bd8dac81a5cc81cd95d60721b6044820152606401611069565b60008311612b135760405162461bcd60e51b8152600401611069906156b7565b506017805460ff19169115159190911790556000908152600f6020526040902063ffffffff919091169055565b6060601a8054612b4f906155ad565b80601f0160208091040260200160405190810160405280929190818152602001828054612b7b906155ad565b8015612bc85780601f10612b9d57610100808354040283529160200191612bc8565b820191906000526020600020905b815481529060010190602001808311612bab57829003601f168201915b5050505050905090565b6001600160a01b038516331480612bee5750612bee8533610ee9565b612c0a5760405162461bcd60e51b8152600401611069906156ff565b611a388585858585613c89565b6001600160a01b038316331480612c335750612c338333610ee9565b612c4f5760405162461bcd60e51b8152600401611069906156ff565b611a64838383613dc1565b60188181548110612c6a57600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b606080600060116000856001600160a01b03166001600160a01b0316815260200190815260200160002060006014600081548110612cce57612cce6156a1565b906000526020600020015481526020019081526020016000205490506000805b601454811015612d7a57600060148281548110612d0d57612d0d6156a1565b60009182526020808320909101546001600160a01b038a16835260118252604080842082855290925291205490915084811015612d505780945060019350612d65565b848103612d655783612d61816156e6565b9450505b50508080612d72906156e6565b915050612cee565b50806001600160401b03811115612d9357612d93614ce9565b604051908082528060200260200182016040528015612dbc578160200160208202803683370190505b5092506000805b601454811015612e5757600060148281548110612de257612de26156a1565b60009182526020808320909101546001600160a01b038b168352601182526040808420828552909252912054909150859003612e445780868481518110612e2b57612e2b6156a1565b602090810291909101015282612e40816156e6565b9350505b5080612e4f816156e6565b915050612dc3565b509295945050505050565b600080516020615d1f833981519152612e7a81612eab565b611c7a60156000614beb565b60006001600160e01b03198216637965db0b60e01b1480611095575061109582613ed9565b611c7a8133613f29565b60026110d982826157aa565b80471015612f115760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401611069565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612f5e576040519150601f19603f3d011682016040523d82523d6000602084013e612f63565b606091505b5050905080611a645760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401611069565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b600061218d8260125485613f82565b600081158015613039575060145415155b1561304657506001919050565b60005b601454811015613092578260148281548110613067576130676156a1565b9060005260206000200154036130805750600192915050565b8061308a816156e6565b915050613049565b50600092915050565b805160009015806130ad575081514210155b80156130c95750602082015115806130c9575042826020015110155b156130d657506001919050565b506000919050565b600082600d546130ee919061574d565b34106130fc57506001611095565b60008211801561310e57506018548211155b801561311a5750826001145b801561313957506013546131399033906001600160a01b031684613f98565b15613092576000600e54600d546131509190615882565b90508034106131aa57600160186131678286615882565b81548110613177576131776156a1565b90600052602060002090602091828204019190066101000a81548160ff0219169083151502179055506001915050611095565b5050600092915050565b815160005b81811015611a38578281815181106131d3576131d36156a1565b602002602001015160116000876001600160a01b03166001600160a01b031681526020019081526020016000206000868481518110613214576132146156a1565b602002602001015181526020019081526020016000206000828254613239919061568e565b909155506132489050816156e6565b90506131b9565b6001600160a01b0384166132755760405162461bcd60e51b815260040161106990615895565b81518351146132965760405162461bcd60e51b8152600401611069906158d6565b336132a6816000878787876141b1565b60005b8451811015613341578381815181106132c4576132c46156a1565b60200260200101516000808784815181106132e1576132e16156a1565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254613329919061568e565b90915550819050613339816156e6565b9150506132a9565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161339292919061591e565b60405180910390a4611a38816000878787876141c7565b81518351146133ca5760405162461bcd60e51b8152600401611069906158d6565b6001600160a01b0384166133f05760405162461bcd60e51b815260040161106990615943565b336133ff8187878787876141b1565b60005b84518110156134e557600085828151811061341f5761341f6156a1565b60200260200101519050600085838151811061343d5761343d6156a1565b602090810291909101810151600084815280835260408082206001600160a01b038e16835290935291909120549091508181101561348d5760405162461bcd60e51b815260040161106990615988565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906134ca90849061568e565b92505081905550505050806134de906156e6565b9050613402565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161353592919061591e565b60405180910390a4612a8b8187878787876141c7565b613555828261207b565b6110d95760008281526003602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561358d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6135db828261207b565b156110d95760008281526003602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604051627eeac760e11b81526001600160a01b03848116600483015260248201849052600091839182169062fdd58e90604401602060405180830381865afa158015613688573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ac9190615869565b95945050505050565b6136bd614322565b6004805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611a6490849061436d565b6001600160a01b03831661377f5760405162461bcd60e51b8152600401611069906159d2565b80518251146137a05760405162461bcd60e51b8152600401611069906158d6565b60003390506137c3818560008686604051806020016040528060008152506141b1565b60005b83518110156138885760008482815181106137e3576137e36156a1565b602002602001015190506000848381518110613801576138016156a1565b602090810291909101810151600084815280835260408082206001600160a01b038c1683529093529190912054909150818110156138515760405162461bcd60e51b815260040161106990615a15565b6000928352602083815260408085206001600160a01b038b1686529091529092209103905580613880816156e6565b9150506137c6565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516138d992919061591e565b60405180910390a460408051602081019091526000905250505050565b6138fe61443f565b6004805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586136ea3390565b816001600160a01b0316836001600160a01b0316036139a65760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401611069565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6006546001600160a01b03841660009081526008602052604081205490918391613a3d908661574d565b613a479190615a6f565b61283b9190615882565b815160609083906000613a65600183615882565b90505b8015613b1c576000613a84613a7e83600161568e565b87614485565b90506000848381518110613a9a57613a9a6156a1565b60200260200101519050848281518110613ab657613ab66156a1565b6020026020010151858481518110613ad057613ad06156a1565b60200260200101818152505080858381518110613aef57613aef6156a1565b602090810291909101015286613b04816156e6565b97505050508080613b1490615a83565b915050613a68565b5090949350505050565b60606000836001600160401b03811115613b4257613b42614ce9565b604051908082528060200260200182016040528015613b6b578160200160208202803683370190505b50905060005b84811015611eff5783828281518110613b8c57613b8c6156a1565b602090810291909101015280613ba1816156e6565b915050613b71565b6001600160a01b038416613bcf5760405162461bcd60e51b815260040161106990615895565b336000613bdb856144fd565b90506000613be8856144fd565b9050613bf9836000898585896141b1565b6000868152602081815260408083206001600160a01b038b16845290915281208054879290613c2990849061568e565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461273983600089898989614548565b6001600160a01b038416613caf5760405162461bcd60e51b815260040161106990615943565b336000613cbb856144fd565b90506000613cc8856144fd565b9050613cd88389898585896141b1565b6000868152602081815260408083206001600160a01b038c16845290915290205485811015613d195760405162461bcd60e51b815260040161106990615988565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290613d5690849061568e565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613db6848a8a8a8a8a614548565b505050505050505050565b6001600160a01b038316613de75760405162461bcd60e51b8152600401611069906159d2565b336000613df3846144fd565b90506000613e00846144fd565b9050613e20838760008585604051806020016040528060008152506141b1565b6000858152602081815260408083206001600160a01b038a16845290915290205484811015613e615760405162461bcd60e51b815260040161106990615a15565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052612739565b60006001600160e01b03198216636cdb3d1360e11b1480613f0a57506001600160e01b031982166303a24d0760e21b145b8061109557506301ffc9a760e01b6001600160e01b0319831614611095565b613f33828261207b565b6110d957613f4081614603565b613f4b836020614615565b604051602001613f5c929190615a9a565b60408051601f198184030181529082905262461bcd60e51b825261106991600401614e20565b600082613f8f85846147b0565b14949350505050565b60185460009082111580613fe657506018613fb4600184615882565b81548110613fc457613fc46156a1565b60009182526020918290209181049091015460ff601f9092166101000a900416155b15614169576013546040516024810184905260009182916001600160a01b03871691600160a01b900460e01b9060440160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516140549190615b0f565b6000604051808303816000865af19150503d8060008114614091576040519150601f19603f3d011682016040523d82523d6000602084013e614096565b606091505b5091509150816140de5760405162461bcd60e51b81526020600482015260136024820152721bdddb995c93d98818d85b1b0819985a5b1959606a1b6044820152606401611069565b856001600160a01b03166140f3826020015190565b6001600160a01b03161461415e5760405162461bcd60e51b815260206004820152602c60248201527f4f776e6572206f6620646973636f756e74546f6b656e206e6f7420657175616c60448201526b1036b4b73a1039b2b73232b960a11b6064820152608401611069565b60019250505061218d565b60405162461bcd60e51b815260206004820152601760248201527f546f6b656e496420696e76616c6964206f7220757365640000000000000000006044820152606401611069565b6141b961443f565b612a8b8686868686866147f5565b6001600160a01b0384163b15612a8b5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061420b9089908990889088908890600401615b2b565b6020604051808303816000875af1925050508015614246575060408051601f3d908101601f1916820190925261424391810190615b89565b60015b6142f257614252615ba6565b806308c379a00361428b5750614266615bc2565b80614271575061428d565b8060405162461bcd60e51b81526004016110699190614e20565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401611069565b6001600160e01b0319811663bc197c8160e01b146127395760405162461bcd60e51b815260040161106990615c4b565b60045460ff1661436b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401611069565b565b60006143c2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661496e9092919063ffffffff16565b805190915015611a6457808060200190518101906143e09190615c93565b611a645760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611069565b60045460ff161561436b5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401611069565b600080424443614496600182615882565b6040805160208101959095528401929092526060808401919091529040608083015233901b6bffffffffffffffffffffffff191660a082015260b4810184905260d40160408051601f198184030181529190528051602090910120905061283b8482615cb0565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110614537576145376156a1565b602090810291909101015292915050565b6001600160a01b0384163b15612a8b5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061458c9089908990889088908890600401615cc4565b6020604051808303816000875af19250505080156145c7575060408051601f3d908101601f191682019092526145c491810190615b89565b60015b6145d357614252615ba6565b6001600160e01b0319811663f23a6e6160e01b146127395760405162461bcd60e51b815260040161106990615c4b565b60606110956001600160a01b03831660145b6060600061462483600261574d565b61462f90600261568e565b6001600160401b0381111561464657614646614ce9565b6040519080825280601f01601f191660200182016040528015614670576020820181803683370190505b509050600360fc1b8160008151811061468b5761468b6156a1565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106146ba576146ba6156a1565b60200101906001600160f81b031916908160001a90535060006146de84600261574d565b6146e990600161568e565b90505b6001811115614761576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061471d5761471d6156a1565b1a60f81b828281518110614733576147336156a1565b60200101906001600160f81b031916908160001a90535060049490941c9361475a81615a83565b90506146ec565b50831561218d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401611069565b600081815b8451811015611eff576147e1828683815181106147d4576147d46156a1565b602002602001015161497d565b9150806147ed816156e6565b9150506147b5565b6001600160a01b03851661487c5760005b835181101561487a57828181518110614821576148216156a1565b60200260200101516005600086848151811061483f5761483f6156a1565b602002602001015181526020019081526020016000206000828254614864919061568e565b909155506148739050816156e6565b9050614806565b505b6001600160a01b038416612a8b5760005b83518110156127395760008482815181106148aa576148aa6156a1565b6020026020010151905060008483815181106148c8576148c86156a1565b602002602001015190506000600560008481526020019081526020016000205490508181101561494b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b6064820152608401611069565b60009283526005602052604090922091039055614967816156e6565b905061488d565b606061283b84846000856149ac565b600081831061499957600082815260208490526040902061218d565b600083815260208390526040902061218d565b606082471015614a0d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611069565b600080866001600160a01b03168587604051614a299190615b0f565b60006040518083038185875af1925050503d8060008114614a66576040519150601f19603f3d011682016040523d82523d6000602084013e614a6b565b606091505b5091509150614a7c87838387614a87565b979650505050505050565b60608315614af6578251600003614aef576001600160a01b0385163b614aef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611069565b508161283b565b61283b83838151156142715781518083602001fd5b82805482825590600052602060002090601f01602090048101928215614ba05791602002820160005b83821115614b7157835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302614b34565b8015614b9e5782816101000a81549060ff0219169055600101602081600001049283019260010302614b71565b505b50614bac929150614c0c565b5090565b828054828255906000526020600020908101928215614ba0579160200282015b82811115614ba0578251825591602001919060010190614bd0565b5080546000825560050290600052602060002090810190611c7a9190614c21565b5b80821115614bac5760008155600101614c0d565b5b80821115614bac5780546001600160a01b031916815560006001820181905560028201819055600382018190556004820155600501614c22565b600060208284031215614c6e57600080fd5b5035919050565b6001600160a01b0381168114611c7a57600080fd5b60008060408385031215614c9d57600080fd5b8235614ca881614c75565b946020939093013593505050565b6001600160e01b031981168114611c7a57600080fd5b600060208284031215614cde57600080fd5b813561218d81614cb6565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715614d2457614d24614ce9565b6040525050565b60006001600160401b03831115614d4457614d44614ce9565b604051614d5b601f8501601f191660200182614cff565b809150838152848484011115614d7057600080fd5b83836020830137600060208583010152509392505050565b600060208284031215614d9a57600080fd5b81356001600160401b03811115614db057600080fd5b8201601f81018413614dc157600080fd5b61283b84823560208401614d2b565b60005b83811015614deb578181015183820152602001614dd3565b50506000910152565b60008151808452614e0c816020860160208601614dd0565b601f01601f19169290920160200192915050565b60208152600061218d6020830184614df4565b600060208284031215614e4557600080fd5b813561218d81614c75565b600080600080600060a08688031215614e6857600080fd5b8535614e7381614c75565b97602087013597506040870135966060810135965060800135945092505050565b60006001600160401b03821115614ead57614ead614ce9565b5060051b60200190565b600082601f830112614ec857600080fd5b81356020614ed582614e94565b604051614ee28282614cff565b83815260059390931b8501820192828101915086841115614f0257600080fd5b8286015b84811015614f1d5780358352918301918301614f06565b509695505050505050565b60008083601f840112614f3a57600080fd5b5081356001600160401b03811115614f5157600080fd5b6020830191508360208260051b8501011115614f6c57600080fd5b9250929050565b600082601f830112614f8457600080fd5b61218d83833560208501614d2b565b60008060008060008060a08789031215614fac57600080fd5b8635614fb781614c75565b955060208701356001600160401b0380821115614fd357600080fd5b614fdf8a838b01614eb7565b96506040890135915080821115614ff557600080fd5b6150018a838b01614eb7565b9550606089013591508082111561501757600080fd5b6150238a838b01614f28565b9095509350608089013591508082111561503c57600080fd5b5061504989828a01614f73565b9150509295509295509295565b60008060006060848603121561506b57600080fd5b833561507681614c75565b95602085013595506040909401359392505050565b600080600080600060a086880312156150a357600080fd5b85356150ae81614c75565b945060208601356150be81614c75565b935060408601356001600160401b03808211156150da57600080fd5b6150e689838a01614eb7565b945060608801359150808211156150fc57600080fd5b61510889838a01614eb7565b9350608088013591508082111561511e57600080fd5b5061512b88828901614f73565b9150509295509295909350565b6000806040838503121561514b57600080fd5b82359150602083013561515d81614c75565b809150509250929050565b6000806040838503121561517b57600080fd5b823561518681614c75565b9150602083013561515d81614c75565b600080604083850312156151a957600080fd5b82356001600160401b03808211156151c057600080fd5b818501915085601f8301126151d457600080fd5b813560206151e182614e94565b6040516151ee8282614cff565b83815260059390931b850182019282810191508984111561520e57600080fd5b948201945b8386101561523557853561522681614c75565b82529482019490820190615213565b9650508601359250508082111561524b57600080fd5b5061525885828601614eb7565b9150509250929050565b600081518084526020808501945080840160005b8381101561529257815187529582019590820190600101615276565b509495945050505050565b60208152600061218d6020830184615262565b6000602082840312156152c257600080fd5b81356001600160401b038111156152d857600080fd5b61283b84828501614eb7565b6000806000606084860312156152f957600080fd5b833561530481614c75565b925060208401356001600160401b038082111561532057600080fd5b61532c87838801614eb7565b9350604086013591508082111561534257600080fd5b5061534f86828701614eb7565b9150509250925092565b8015158114611c7a57600080fd5b60006020828403121561537957600080fd5b813561218d81615359565b6000806040838503121561539757600080fd5b82356153a281614c75565b9150602083013561515d81615359565b600080600080600080600060c0888a0312156153cd57600080fd5b87356153d881614c75565b965060208801359550604088013594506060880135935060808801356001600160401b038082111561540957600080fd5b6154158b838c01614f28565b909550935060a08a013591508082111561542e57600080fd5b5061543b8a828b01614f73565b91505092959891949750929550565b6000806040838503121561545d57600080fd5b50508035926020909101359150565b60008060006060848603121561548157600080fd5b505081359360208301359350604090920135919050565b600080600080608085870312156154ae57600080fd5b84356154b981614c75565b9350602085013592506040850135915060608501356001600160401b038111156154e257600080fd5b6154ee87828801614f73565b91505092959194509250565b60008060006060848603121561550f57600080fd5b833563ffffffff8116811461552357600080fd5b925060208401359150604084013561553a81615359565b809150509250925092565b600080600080600060a0868803121561555d57600080fd5b853561556881614c75565b9450602086013561557881614c75565b9350604086013592506060860135915060808601356001600160401b038111156155a157600080fd5b61512b88828901614f73565b600181811c908216806155c157607f821691505b6020821081036155e157634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561109557611095615678565b634e487b7160e01b600052603260045260246000fd5b602080825260159082015274125b9d985b1a59081d1bdad95b881d1e5c19481251605a1b604082015260600190565b6000600182016156f8576156f8615678565b5060010190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b808202811582820484141761109557611095615678565b601f821115611a6457600081815260208120601f850160051c8101602086101561578b5750805b601f850160051c820191505b81811015612a8b57828155600101615797565b81516001600160401b038111156157c3576157c3614ce9565b6157d7816157d184546155ad565b84615764565b602080601f83116001811461580c57600084156157f45750858301515b600019600386901b1c1916600185901b178555612a8b565b600085815260208120601f198616915b8281101561583b5788860151825594840194600190910190840161581c565b50858210156158595787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121561587b57600080fd5b5051919050565b8181038181111561109557611095615678565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b6040815260006159316040830185615262565b82810360208401526136ac8185615262565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b634e487b7160e01b600052601260045260246000fd5b600082615a7e57615a7e615a59565b500490565b600081615a9257615a92615678565b506000190190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615ad2816017850160208801614dd0565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615b03816028840160208801614dd0565b01602801949350505050565b60008251615b21818460208701614dd0565b9190910192915050565b6001600160a01b0386811682528516602082015260a060408201819052600090615b5790830186615262565b8281036060840152615b698186615262565b90508281036080840152615b7d8185614df4565b98975050505050505050565b600060208284031215615b9b57600080fd5b815161218d81614cb6565b600060033d1115615bbf5760046000803e5060005160e01c5b90565b600060443d1015615bd05790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615bff57505050505090565b8285019150815181811115615c175750505050505090565b843d8701016020828501011115615c315750505050505090565b615c4060208286010187614cff565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b600060208284031215615ca557600080fd5b815161218d81615359565b600082615cbf57615cbf615a59565b500690565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614a7c90830184614df456fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775deccffc5821b949817830292498e44ccb6097e4b74ff2f2db960723873324defa2646970667358221220e6ccacbcf5c8c4550105cac51815109ad73c80c7eefbb6d53c609cbe52a1b01764736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000090845ae0e32e08fb01082615882aa07cebe30ff200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000064
-----Decoded View---------------
Arg [0] : uri_ (string):
Arg [1] : _payees (address[]): 0x90845AE0e32E08fB01082615882aA07CeBE30fF2
Arg [2] : _shares (uint256[]): 100
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [5] : 00000000000000000000000090845ae0e32e08fb01082615882aa07cebe30ff2
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000064
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.