Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- TheFatTigers
- Optimization enabled
- true
- Compiler version
- v0.8.7+commit.e28d00a7
- Optimization runs
- 1000
- EVM Version
- default
- Verified at
- 2022-09-24T10:16:04.515144Z
Constructor Arguments
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016c3288f85388fdcb2453de414022b3a8d7d9dd00000000000000000000000000000000000000000000000000000000000001f4
Arg [0] (address) : 0x0000000000000000000000000000000000000000
Arg [1] (address) : 0x016c3288f85388fdcb2453de414022b3a8d7d9dd
Arg [2] (uint96) : 500
Contract source code
// SPDX-License-Identifier: MIT // File contracts/interface/IFtso.sol pragma solidity 0.8.7; interface IFtso { /** * @notice Returns the asset decimals. This is a custom state variable getter declaration. */ function ASSET_PRICE_USD_DECIMALS() external view returns (uint256); /** * @notice Returns if FTSO is active */ function active() external view returns (bool); /** * @notice Returns the FTSO symbol */ function symbol() external view returns (string memory); /** * @notice Returns current asset price * @return _price Price in USD multiplied by ASSET_PRICE_USD_DECIMALS * @return _timestamp Time when price was updated for the last time */ function getCurrentPrice() external view returns (uint256 _price, uint256 _timestamp); /** * @notice Returns current random number */ function getCurrentRandom() external view returns (uint256); } // File @openzeppelin/contracts/utils/[email protected] // 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; } } // File @openzeppelin/contracts/access/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File @openzeppelin/contracts/security/[email protected] // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } // File @openzeppelin/contracts/utils/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File @openzeppelin/contracts/utils/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_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) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @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); } } // File @openzeppelin/contracts/token/ERC721/[email protected] // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } // File @openzeppelin/contracts/utils/introspection/[email protected] // 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); } // File @openzeppelin/contracts/token/ERC721/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); } // File @openzeppelin/contracts/utils/introspection/[email protected] // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } // File @openzeppelin/contracts/token/ERC721/extensions/[email protected] // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); } // File @openzeppelin/contracts/token/ERC721/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved" ); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved" ); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require( _checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @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, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns ( bytes4 retval ) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} } // File @openzeppelin/contracts/token/ERC721/extensions/[email protected] // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); } // File @openzeppelin/contracts/token/ERC721/extensions/[email protected] // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } } // File @openzeppelin/contracts/interfaces/[email protected] // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); } // File @openzeppelin/contracts/token/common/[email protected] // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } } // File @openzeppelin/contracts/token/ERC721/extensions/[email protected] // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/ERC721Royalty.sol) pragma solidity ^0.8.0; /** * @dev Extension of ERC721 with the ERC2981 NFT Royalty Standard, a standardized way to retrieve royalty payment * information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC721Royalty is ERC2981, ERC721 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } /** * @dev See {ERC721-_burn}. This override additionally clears the royalty information for the token. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); _resetTokenRoyalty(tokenId); } } // File contracts/TheFatTigers.sol pragma solidity 0.8.7; /* _____ _ _____ _ ____ _ ____ _ _ |_ _| |__ ___ | ___|_ _| |_ / ___|__ _| |_ ___ / ___| |_ _| |__ | | | '_ \ / _ \ | |_ / _` | __| | | / _` | __/ __| | | | | | | | '_ \ | | | | | | __/ | _| (_| | |_ | |__| (_| | |_\__ \ | |___| | |_| | |_) | |_| |_| |_|\___| |_| \__,_|\__| \____\__,_|\__|___/ \____|_|\__,_|_.__/ */ // Errors error TheFatTigers__InvalidContractInit(); error TheFatTigers__InvalidRoyaltyBips(uint96 _royaltyBips); error TheFatTigers__InvalidMintAmount(); error TheFatTigers__MaxSupplyExceeded(); error TheFatTigers__ContractPaused(); error TheFatTigers__MintComplete(); error TheFatTigers__InvalidTSOConfig(address _tsoAddress); error TheFatTigers__IncorrectFunds(uint256 _sentAmount); error TheFatTigers__WhitelistInactive(); error TheFatTigers__ExceedsWhitelistAllowance(); error TheFatTigers__InvalidMaxSupply( uint256 _currentSupply, uint256 _maxSupply, uint256 _maxPossible ); contract TheFatTigers is ERC721Royalty, ERC721Enumerable, Ownable, ReentrancyGuard { using Strings for uint256; /* State Variables */ // Constants uint256 public constant PRICEUSD = 150; uint256 public constant WHITELIST_DISCOUNT_BIPS = 1000; // 10 percent uint256 public constant CURRENCY_SYMBOL_IDX = 0; // index of the currency symbol assuming ["SGB", "FLR"] ordering. // Private uint256[6000] private nftIds; // Public IFtso public sparkTso; mapping(address => uint256) public whitelist; string public uriPrefix = ""; string public uriSuffix = ".json"; string public hiddenMetadataUri; uint256 public maxSupply = 6000; uint256 public maxMintAmountPerTx = 20; uint256 public priceSpark = 7500 ether; uint256 public precision = 6; bool public useManualPrice = true; bool public paused = true; bool public isWhitelistActive = false; bool public revealed = false; /* Events */ event Revealed(bool indexed _state); event Paused(bool indexed _state); event WhitelistOpened(bool indexed _state); modifier mintCompliance(uint256 _mintAmount) { if (_mintAmount == 0 || (_mintAmount > maxMintAmountPerTx)) { revert TheFatTigers__InvalidMintAmount(); } if ((totalSupply() + _mintAmount) > maxSupply) { revert TheFatTigers__MaxSupplyExceeded(); } _; } modifier mintPriceCompliance(uint256 _mintAmount, bool _asWhitelist) { uint256 basePrice = price(); uint256 newPrice; if (_asWhitelist) { newPrice = whitelistPrice(); } else { newPrice = basePrice; } if (msg.value != (newPrice * _mintAmount)) { revert TheFatTigers__IncorrectFunds(msg.value); } _; } /** @param _sparkTsoAddress Address of the relevant Spark Flare/Songbird Time Series Oracle. @param _royaltyReceiver Address where royalties should be sent to. @param _royaltyBips The royalty percentage in bips (100% = 10000). */ constructor( address _sparkTsoAddress, address _royaltyReceiver, uint96 _royaltyBips ) ERC721("The Fat Tigers", "FATTIGR") { // Check nftIds and maxSupply initialisation matches if (nftIds.length != maxSupply) { revert TheFatTigers__InvalidContractInit(); } // Set up TSO with basic checks setSparkTso(_sparkTsoAddress); // Set up Royalty info and other metadata setRoyaltyInfo(_royaltyReceiver, _royaltyBips); setHiddenMetadataUri("ipfs://QmSGZ9wA7DYLcHxZCVsSCiEKQte38b5FJwd2H77sfpHcHB/hidden.json"); } // public function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { require(_exists(_tokenId), "ERC721Metadata: URI query for nonexistent token"); if (revealed == false) { return hiddenMetadataUri; } string memory currentBaseURI = _baseURI(); return bytes(currentBaseURI).length > 0 ? string(abi.encodePacked(currentBaseURI, _tokenId.toString(), uriSuffix)) : ""; } /** * @dev Gets the manually set priceSpark if useManualPrice is true or sparkTso address is null. Otherwise uses TSO conversion. */ function price() public view returns (uint256 _price) { if (useManualPrice || address(sparkTso) == address(0x0)) { _price = priceSpark; } else { // The below reverts if using a bad Spark TSO address (i.e. if address is not a TSO) ( uint256 usdPerSpark, /* timestamp */ ) = sparkTso.getCurrentPrice(); uint256 numDecimals = sparkTso.ASSET_PRICE_USD_DECIMALS(); uint256 usdPow = PRICEUSD * 10**(numDecimals + precision); uint256 numSpark = (usdPow / usdPerSpark); _price = numSpark * 10**(18 - precision); } } function whitelistPrice() public view returns (uint256 _whitelistPrice) { uint256 basePrice = price(); uint256 numerator = (basePrice * WHITELIST_DISCOUNT_BIPS); uint256 denomBips = 10000; return basePrice - (numerator / denomBips); } // external function mint(uint256 _mintAmount) external payable mintCompliance(_mintAmount) mintPriceCompliance(_mintAmount, false) { if (paused) { revert TheFatTigers__ContractPaused(); } _mintLoop(msg.sender, _mintAmount); } function walletOfOwner(address _owner) external view returns (uint256[] memory) { uint256 ownerTokenCount = balanceOf(_owner); uint256[] memory ownedTokenIds = new uint256[](ownerTokenCount); for (uint256 i = 0; i < ownerTokenCount; i++) { uint256 tokenIdAtIndex = tokenOfOwnerByIndex(_owner, i); ownedTokenIds[i] = tokenIdAtIndex; } return ownedTokenIds; } // WL - external function mintWhitelist(uint256 _mintAmount) external payable mintCompliance(_mintAmount) mintPriceCompliance(_mintAmount, true) { if (!isWhitelistActive) { revert TheFatTigers__WhitelistInactive(); } if (_mintAmount > whitelist[msg.sender]) { revert TheFatTigers__ExceedsWhitelistAllowance(); } whitelist[msg.sender] -= _mintAmount; _mintLoop(msg.sender, _mintAmount); } // Giveaways - external function mintForAddress(uint256 _mintAmount, address _receiver) external mintCompliance(_mintAmount) onlyOwner { _mintLoop(_receiver, _mintAmount); } // onlyOwner - public function setSparkTso(address _sparkTsoAddress) public onlyOwner { IFtso tsoContract = IFtso(_sparkTsoAddress); // It is ok to set the TSO to null. This means it will fail TSO checks // if useManualPrice is false. if (_sparkTsoAddress != address(0x0) && !_checkTsoConfig(tsoContract)) { revert TheFatTigers__InvalidTSOConfig(_sparkTsoAddress); } sparkTso = tsoContract; } function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner { hiddenMetadataUri = _hiddenMetadataUri; } function setRoyaltyInfo(address _royaltyReceiver, uint96 _royaltyBips) public onlyOwner { if (_royaltyBips > 10000) { revert TheFatTigers__InvalidRoyaltyBips(_royaltyBips); } super._setDefaultRoyalty(_royaltyReceiver, _royaltyBips); } // onlyOwner - external function setMaxSupply(uint256 _maxSupply) external onlyOwner { uint256 currentSupply = totalSupply(); // Do not allow maxSupply change if: // 1. Mint has started, meaning currentSupply is not zero. // 2. Mint has not started, but we are extending beyond nftIds init value, as this will break // the mint. if (_maxSupply > nftIds.length || currentSupply > 0) { revert TheFatTigers__InvalidMaxSupply(currentSupply, _maxSupply, nftIds.length); } maxSupply = _maxSupply; } function setWhitelistActive(bool _isWhitelistActive) external onlyOwner { isWhitelistActive = _isWhitelistActive; emit WhitelistOpened(_isWhitelistActive); } function setWhitelist(address[] calldata _addresses, uint256 _numAllowedToMint) external onlyOwner { for (uint256 i = 0; i < _addresses.length; i++) { whitelist[_addresses[i]] = _numAllowedToMint; } } function setRevealed(bool _state) external onlyOwner { revealed = _state; emit Revealed(_state); } function setUseManualPrice(bool _useManualPrice) external onlyOwner { useManualPrice = _useManualPrice; } function setPriceSpark(uint256 _priceSpark) external onlyOwner { priceSpark = _priceSpark; } function setMaxMintAmountPerTx(uint256 _maxMintAmountPerTx) external onlyOwner { maxMintAmountPerTx = _maxMintAmountPerTx; } function setUriPrefix(string memory _uriPrefix) external onlyOwner { uriPrefix = _uriPrefix; } function setUriSuffix(string memory _uriSuffix) external onlyOwner { uriSuffix = _uriSuffix; } function setPaused(bool _state) external onlyOwner { paused = _state; emit Paused(_state); } function setPrecision(uint256 _precision) external onlyOwner { precision = _precision; } function withdraw(bool asTest) external onlyOwner nonReentrant { require( !asTest || (asTest && address(this).balance >= 1 ether), "Insufficient funds to run test!" ); require(address(this).balance > 0, "No funds to withdraw!"); // Transfer funds to owner // ============================================================================= if (asTest) { (bool sent, ) = payable(owner()).call{value: 1 ether}(""); require(sent, "Couldn't send test amount"); } else { (bool sent, ) = payable(owner()).call{value: address(this).balance}(""); require(sent, "Couldn't send balance"); } // ============================================================================= } // Internal function _mintLoop(address _receiver, uint256 _mintAmount) internal { for (uint256 i = 0; i < _mintAmount; i++) { uint256 _random = uint256( keccak256( abi.encodePacked(totalSupply(), msg.sender, block.timestamp, blockhash(block.number - 1)) ) ); uint256 _randomId = _pickRandomUniqueId(_random); _safeMint(_receiver, _randomId); } } function _baseURI() internal view virtual override returns (string memory) { return uriPrefix; } /** * @dev Test TSO has required functionality. * @param _tso TSO expected to conform with IFtso interface. */ function _checkTsoConfig(IFtso _tso) internal view returns (bool _state) { // This is a hard-coded order, matching constructor assumptions string memory expectedSymbol = ["SGB", "FLR"][CURRENCY_SYMBOL_IDX]; string memory foundSymbol = _tso.symbol(); bool isCorrectSymbol = (keccak256(bytes(foundSymbol)) == keccak256(bytes(expectedSymbol))); bool isActive = _tso.active(); ( uint256 usdPerSpark, /* timestamp */ ) = _tso.getCurrentPrice(); // This is just a check that we can return this value without reverting _tso.ASSET_PRICE_USD_DECIMALS(); _state = isCorrectSymbol && isActive && usdPerSpark > 0; } // Private function _pickRandomUniqueId(uint256 random) private returns (uint256) { // len uses maxSupply as we have the option to make maxSupply lower than // initial nftIds.length BEFORE mint starts. setMaxSupply checks that // maxSupply is never changed after mint starts (i.e. when totalSupply() > 0) uint256 len = maxSupply - (totalSupply()); if (len <= 0) { revert TheFatTigers__MintComplete(); } uint256 randomIndex = random % len; uint256 id = nftIds[randomIndex] != 0 ? nftIds[randomIndex] : randomIndex; id++; // 1 indexed tokenId nftIds[randomIndex] = uint256(nftIds[len - 1] == 0 ? len - 1 : nftIds[len - 1]); nftIds[len - 1] = 0; return id; } // Required overrides /** * @dev See {ERC721Enumerable-supportsInterface}, {ERC721Royalty-supportsInterface} and {ERC2981-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, ERC721Royalty) returns (bool) { // Each appends their own interface check so we need to // check for both. return ERC721Royalty.supportsInterface(interfaceId) || ERC721Enumerable.supportsInterface(interfaceId); } /** * @dev See {ERC721-_burn} and {ERC721Royalty-_burn}. */ function _burn(uint256 tokenId) internal virtual override(ERC721, ERC721Royalty) { // Calls ERC721 _burn and then does required token royalty cleanup ERC721Royalty._burn(tokenId); } /** * @dev See {ERC721-_beforeTokenTransfer} and {ERC721Enumerable-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721, ERC721Enumerable) { // Calls ERC721-_beforeTokenTransfer and then does required index cleanup ERC721Enumerable._beforeTokenTransfer(from, to, tokenId); } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_sparkTsoAddress","internalType":"address"},{"type":"address","name":"_royaltyReceiver","internalType":"address"},{"type":"uint96","name":"_royaltyBips","internalType":"uint96"}]},{"type":"error","name":"TheFatTigers__ContractPaused","inputs":[]},{"type":"error","name":"TheFatTigers__ExceedsWhitelistAllowance","inputs":[]},{"type":"error","name":"TheFatTigers__IncorrectFunds","inputs":[{"type":"uint256","name":"_sentAmount","internalType":"uint256"}]},{"type":"error","name":"TheFatTigers__InvalidContractInit","inputs":[]},{"type":"error","name":"TheFatTigers__InvalidMaxSupply","inputs":[{"type":"uint256","name":"_currentSupply","internalType":"uint256"},{"type":"uint256","name":"_maxSupply","internalType":"uint256"},{"type":"uint256","name":"_maxPossible","internalType":"uint256"}]},{"type":"error","name":"TheFatTigers__InvalidMintAmount","inputs":[]},{"type":"error","name":"TheFatTigers__InvalidRoyaltyBips","inputs":[{"type":"uint96","name":"_royaltyBips","internalType":"uint96"}]},{"type":"error","name":"TheFatTigers__InvalidTSOConfig","inputs":[{"type":"address","name":"_tsoAddress","internalType":"address"}]},{"type":"error","name":"TheFatTigers__MaxSupplyExceeded","inputs":[]},{"type":"error","name":"TheFatTigers__MintComplete","inputs":[]},{"type":"error","name":"TheFatTigers__WhitelistInactive","inputs":[]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"approved","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"operator","internalType":"address","indexed":true},{"type":"bool","name":"approved","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"bool","name":"_state","internalType":"bool","indexed":true}],"anonymous":false},{"type":"event","name":"Revealed","inputs":[{"type":"bool","name":"_state","internalType":"bool","indexed":true}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"WhitelistOpened","inputs":[{"type":"bool","name":"_state","internalType":"bool","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"CURRENCY_SYMBOL_IDX","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"PRICEUSD","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"WHITELIST_DISCOUNT_BIPS","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"approve","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getApproved","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"hiddenMetadataUri","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isWhitelistActive","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxMintAmountPerTx","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxSupply","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"mint","inputs":[{"type":"uint256","name":"_mintAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintForAddress","inputs":[{"type":"uint256","name":"_mintAmount","internalType":"uint256"},{"type":"address","name":"_receiver","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"mintWhitelist","inputs":[{"type":"uint256","name":"_mintAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"precision","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"_price","internalType":"uint256"}],"name":"price","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"priceSpark","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"revealed","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"royaltyInfo","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"uint256","name":"_salePrice","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setHiddenMetadataUri","inputs":[{"type":"string","name":"_hiddenMetadataUri","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxMintAmountPerTx","inputs":[{"type":"uint256","name":"_maxMintAmountPerTx","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxSupply","inputs":[{"type":"uint256","name":"_maxSupply","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPaused","inputs":[{"type":"bool","name":"_state","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPrecision","inputs":[{"type":"uint256","name":"_precision","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPriceSpark","inputs":[{"type":"uint256","name":"_priceSpark","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRevealed","inputs":[{"type":"bool","name":"_state","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRoyaltyInfo","inputs":[{"type":"address","name":"_royaltyReceiver","internalType":"address"},{"type":"uint96","name":"_royaltyBips","internalType":"uint96"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSparkTso","inputs":[{"type":"address","name":"_sparkTsoAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setUriPrefix","inputs":[{"type":"string","name":"_uriPrefix","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setUriSuffix","inputs":[{"type":"string","name":"_uriSuffix","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setUseManualPrice","inputs":[{"type":"bool","name":"_useManualPrice","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWhitelist","inputs":[{"type":"address[]","name":"_addresses","internalType":"address[]"},{"type":"uint256","name":"_numAllowedToMint","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWhitelistActive","inputs":[{"type":"bool","name":"_isWhitelistActive","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IFtso"}],"name":"sparkTso","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenByIndex","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenOfOwnerByIndex","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"tokenURI","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"uriPrefix","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"uriSuffix","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"useManualPrice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"walletOfOwner","inputs":[{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"whitelist","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"_whitelistPrice","internalType":"uint256"}],"name":"whitelistPrice","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"bool","name":"asTest","internalType":"bool"}]}]
Contract Creation Code
0x60a06040819052600060808190526200001c9161178091620006bc565b5060408051808201909152600580825264173539b7b760d91b60209092019182526200004c9161178191620006bc565b50611770611783556014611784556901969368974c05b0000061178555600661178655611787805463ffffffff19166101011790553480156200008e57600080fd5b506040516200453d3803806200453d833981016040819052620000b1916200077f565b604080518082018252600e81526d546865204661742054696765727360901b6020808301918252835180850190945260078452662320aa2a24a3a960c91b9084015281519192916200010691600291620006bc565b5080516200011c906003906020840190620006bc565b5050506200013962000133620001a860201b60201c565b620001ac565b6001600d556117835461177014620001645760405163b71c954360e01b815260040160405180910390fd5b6200016f83620001fe565b6200017b82826200027d565b6200019f604051806080016040528060418152602001620044fc60419139620002db565b50505062000972565b3390565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b62000208620002fb565b806001600160a01b038116158015906200022a5750620002288162000359565b155b15620002595760405163336f0b9760e01b81526001600160a01b03831660048201526024015b60405180910390fd5b61177e80546001600160a01b0319166001600160a01b039290921691909117905550565b62000287620002fb565b612710816001600160601b03161115620002c0576040516372bbf3b360e11b81526001600160601b038216600482015260240162000250565b620002d78282620005bb60201b62001f5c1760201c565b5050565b620002e5620002fb565b8051620002d790611782906020840190620006bc565b600c546001600160a01b03163314620003575760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000250565b565b6040805160808101825260038183018181526229a3a160e91b60608401528252825180840184529081526223262960e91b6020808301919091528201525181516395d89b4160e01b8152915160009283916001600160a01b038616916395d89b419160048083019286929190829003018186803b158015620003da57600080fd5b505afa158015620003ef573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000419919081019062000804565b90506000828051906020012082805190602001201490506000856001600160a01b03166302fb0c5e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200046c57600080fd5b505afa15801562000481573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004a79190620007d9565b90506000866001600160a01b031663eb91d37e6040518163ffffffff1660e01b8152600401604080518083038186803b158015620004e457600080fd5b505afa158015620004f9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200051f9190620008fa565b509050866001600160a01b0316636b52b2426040518163ffffffff1660e01b815260040160206040518083038186803b1580156200055c57600080fd5b505afa15801562000571573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005979190620008e0565b50828015620005a35750815b8015620005b05750600081115b979650505050505050565b6127106001600160601b03821611156200062b5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b606482015260840162000250565b6001600160a01b038216620006835760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640162000250565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600055565b828054620006ca906200091f565b90600052602060002090601f016020900481019282620006ee576000855562000739565b82601f106200070957805160ff191683800117855562000739565b8280016001018555821562000739579182015b82811115620007395782518255916020019190600101906200071c565b50620007479291506200074b565b5090565b5b808211156200074757600081556001016200074c565b80516001600160a01b03811681146200077a57600080fd5b919050565b6000806000606084860312156200079557600080fd5b620007a08462000762565b9250620007b06020850162000762565b60408501519092506001600160601b0381168114620007ce57600080fd5b809150509250925092565b600060208284031215620007ec57600080fd5b81518015158114620007fd57600080fd5b9392505050565b600060208083850312156200081857600080fd5b82516001600160401b03808211156200083057600080fd5b818501915085601f8301126200084557600080fd5b8151818111156200085a576200085a6200095c565b604051601f8201601f19908116603f011681019083821181831017156200088557620008856200095c565b8160405282815288868487010111156200089e57600080fd5b600093505b82841015620008c25784840186015181850187015292850192620008a3565b82841115620008d45760008684830101525b98975050505050505050565b600060208284031215620008f357600080fd5b5051919050565b600080604083850312156200090e57600080fd5b505080516020909101519092909150565b600181811c908216806200093457607f821691505b602082108114156200095657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b613b7a80620009826000396000f3fe6080604052600436106103765760003560e01c8063715018a6116101d1578063a810a54c11610102578063d5abeb01116100a0578063e985e9c51161006f578063e985e9c5146109e6578063efbd73f414610a2f578063f2fde38b14610a4f578063fc1a1c3614610a6f57600080fd5b8063d5abeb0114610973578063e0a808531461098a578063e4590b87146109aa578063e82ba406146109cb57600080fd5b8063b88d4fde116100dc578063b88d4fde146108fc578063c3b754dc1461091c578063c87b56dd1461093c578063d3b5dc3b1461095c57600080fd5b8063a810a54c146108a7578063a863dc36146108c7578063b071401b146108dc57600080fd5b806394354fd01161016f578063a035b1fe11610149578063a035b1fe1461084a578063a0712d681461085f578063a22cb46514610872578063a45ba8e71461089257600080fd5b806394354fd0146107f057806395d89b41146108075780639b19251a1461081c57600080fd5b8063863f5c9c116101ab578063863f5c9c1461077c5780638a818cff146107925780638d814a8c146107b25780638da5cb5b146107d257600080fd5b8063715018a6146107305780637ec4a6591461074557806385d5771c1461076557600080fd5b806342842e0e116102ab5780635503a0e8116102495780636352211e116102235780636352211e146106b0578063691a9d85146106d05780636f8b44b0146106f057806370a082311461071057600080fd5b80635503a0e8146106665780635c975abb1461067b57806362b99ad41461069b57600080fd5b80634f6ccce7116102855780634f6ccce7146105e35780634fdd43cb146106035780635183022714610623578063524513d61461064557600080fd5b806342842e0e14610583578063438b6300146105a35780634618163e146105d057600080fd5b806316ba10e01161031857806318160ddd116102f257806318160ddd146104ef57806323b872dd146105045780632a55205a146105245780632f745c591461056357600080fd5b806316ba10e01461048f57806316c38b3c146104af578063176f832e146104cf57600080fd5b8063081812fc11610354578063081812fc146103f4578063095ea7b31461042c5780630a3eaf961461044c578063115025191461046c57600080fd5b806301ffc9a71461037b57806302fa7c47146103b057806306fdde03146103d2575b600080fd5b34801561038757600080fd5b5061039b61039636600461355e565b610a84565b60405190151581526020015b60405180910390f35b3480156103bc57600080fd5b506103d06103cb36600461346c565b610aa4565b005b3480156103de57600080fd5b506103e7610b19565b6040516103a79190613863565b34801561040057600080fd5b5061041461040f366004613658565b610bab565b6040516001600160a01b0390911681526020016103a7565b34801561043857600080fd5b506103d0610447366004613442565b610bd2565b34801561045857600080fd5b506103d0610467366004613305565b610d04565b34801561047857600080fd5b50610481600081565b6040519081526020016103a7565b34801561049b57600080fd5b506103d06104aa366004613598565b610d91565b3480156104bb57600080fd5b506103d06104ca366004613524565b610dad565b3480156104db57600080fd5b506103d06104ea366004613658565b610dfb565b3480156104fb57600080fd5b50600a54610481565b34801561051057600080fd5b506103d061051f366004613353565b610e09565b34801561053057600080fd5b5061054461053f3660046136ad565b610e90565b604080516001600160a01b0390931683526020830191909152016103a7565b34801561056f57600080fd5b5061048161057e366004613442565b610f4b565b34801561058f57600080fd5b506103d061059e366004613353565b610ff3565b3480156105af57600080fd5b506105c36105be366004613305565b61100e565b6040516103a7919061381f565b6103d06105de366004613658565b6110b6565b3480156105ef57600080fd5b506104816105fe366004613658565b611234565b34801561060f57600080fd5b506103d061061e366004613598565b6112d8565b34801561062f57600080fd5b506117875461039b906301000000900460ff1681565b34801561065157600080fd5b506117875461039b9062010000900460ff1681565b34801561067257600080fd5b506103e76112f4565b34801561068757600080fd5b506117875461039b90610100900460ff1681565b3480156106a757600080fd5b506103e7611383565b3480156106bc57600080fd5b506104146106cb366004613658565b611391565b3480156106dc57600080fd5b506103d06106eb366004613658565b6113f6565b3480156106fc57600080fd5b506103d061070b366004613658565b611404565b34801561071c57600080fd5b5061048161072b366004613305565b611479565b34801561073c57600080fd5b506103d0611513565b34801561075157600080fd5b506103d0610760366004613598565b611527565b34801561077157600080fd5b506104816117855481565b34801561078857600080fd5b506104816103e881565b34801561079e57600080fd5b506103d06107ad366004613524565b611543565b3480156107be57600080fd5b506103d06107cd3660046134a9565b61155f565b3480156107de57600080fd5b50600c546001600160a01b0316610414565b3480156107fc57600080fd5b506104816117845481565b34801561081357600080fd5b506103e76115d1565b34801561082857600080fd5b50610481610837366004613305565b61177f6020526000908152604090205481565b34801561085657600080fd5b506104816115e0565b6103d061086d366004613658565b611792565b34801561087e57600080fd5b506103d061088d36600461340b565b611897565b34801561089e57600080fd5b506103e76118a2565b3480156108b357600080fd5b506103d06108c2366004613524565b6118b0565b3480156108d357600080fd5b50610481609681565b3480156108e857600080fd5b506103d06108f7366004613658565b611b4f565b34801561090857600080fd5b506103d061091736600461338f565b611b5d565b34801561092857600080fd5b506103d0610937366004613524565b611be5565b34801561094857600080fd5b506103e7610957366004613658565b611c35565b34801561096857600080fd5b506104816117865481565b34801561097f57600080fd5b506104816117835481565b34801561099657600080fd5b506103d06109a5366004613524565b611dc7565b3480156109b657600080fd5b5061177e54610414906001600160a01b031681565b3480156109d757600080fd5b506117875461039b9060ff1681565b3480156109f257600080fd5b5061039b610a01366004613320565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a3b57600080fd5b506103d0610a4a36600461368a565b611e19565b348015610a5b57600080fd5b506103d0610a6a366004613305565b611e90565b348015610a7b57600080fd5b50610481611f20565b6000610a8f82612076565b80610a9e5750610a9e82612081565b92915050565b610aac6120bf565b612710816bffffffffffffffffffffffff161115610b0b576040517fe577e7660000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff821660048201526024015b60405180910390fd5b610b158282611f5c565b5050565b606060028054610b2890613a48565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5490613a48565b8015610ba15780601f10610b7657610100808354040283529160200191610ba1565b820191906000526020600020905b815481529060010190602001808311610b8457829003601f168201915b5050505050905090565b6000610bb682612119565b506000908152600660205260409020546001600160a01b031690565b6000610bdd82611391565b9050806001600160a01b0316836001600160a01b03161415610c675760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610b02565b336001600160a01b0382161480610c835750610c838133610a01565b610cf55760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610b02565b610cff838361217d565b505050565b610d0c6120bf565b806001600160a01b03811615801590610d2b5750610d29816121eb565b155b15610d6d576040517f336f0b970000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610b02565b61177e80546001600160a01b0319166001600160a01b039290921691909117905550565b610d996120bf565b8051610b1590611781906020840190613212565b610db56120bf565b611787805461ff001916610100831515908102919091179091556040517f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd290600090a250565b610e036120bf565b61178655565b610e133382612488565b610e855760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610b02565b610cff838383612507565b60008281526001602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff16928201929092528291610f0f5750604080518082019091526000546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b602081015160009061271090610f33906bffffffffffffffffffffffff16876139e6565b610f3d91906138e7565b915196919550909350505050565b6000610f5683611479565b8210610fca5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610b02565b506001600160a01b03919091166000908152600860209081526040808320938352929052205490565b610cff83838360405180602001604052806000815250611b5d565b6060600061101b83611479565b905060008167ffffffffffffffff81111561103857611038613b0a565b604051908082528060200260200182016040528015611061578160200160208202803683370190505b50905060005b828110156110ae57600061107b8683610f4b565b90508083838151811061109057611090613af4565b602090810291909101015250806110a681613a83565b915050611067565b509392505050565b808015806110c657506117845481115b156110e45760405163d6483bcd60e01b815260040160405180910390fd5b61178354816110f2600a5490565b6110fc91906138cf565b111561111b57604051630834d33960e11b815260040160405180910390fd5b81600160006111286115e0565b9050600082156111415761113a611f20565b9050611144565b50805b61114e84826139e6565b341461116f5760405163d9cac65760e01b8152346004820152602401610b02565b6117875462010000900460ff166111b2576040517feb3026e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815261177f60205260409020548611156111fc576040517f3e88681c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815261177f60205260408120805488929061121c908490613a05565b9091555061122c905033876126df565b505050505050565b600061123f600a5490565b82106112b35760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610b02565b600a82815481106112c6576112c6613af4565b90600052602060002001549050919050565b6112e06120bf565b8051610b1590611782906020840190613212565b611781805461130290613a48565b80601f016020809104026020016040519081016040528092919081815260200182805461132e90613a48565b801561137b5780601f106113505761010080835404028352916020019161137b565b820191906000526020600020905b81548152906001019060200180831161135e57829003601f168201915b505050505081565b611780805461130290613a48565b6000818152600460205260408120546001600160a01b031680610a9e5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610b02565b6113fe6120bf565b61178555565b61140c6120bf565b6000611417600a5490565b90506117708211806114295750600081115b15611472576040517fd1d1155b00000000000000000000000000000000000000000000000000000000815260048101829052602481018390526117706044820152606401610b02565b5061178355565b60006001600160a01b0382166114f75760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610b02565b506001600160a01b031660009081526005602052604090205490565b61151b6120bf565b6115256000612785565b565b61152f6120bf565b8051610b1590611780906020840190613212565b61154b6120bf565b611787805460ff1916911515919091179055565b6115676120bf565b60005b828110156115cb578161177f600086868581811061158a5761158a613af4565b905060200201602081019061159f9190613305565b6001600160a01b03168152602081019190915260400160002055806115c381613a83565b91505061156a565b50505050565b606060038054610b2890613a48565b6117875460009060ff16806115ff575061177e546001600160a01b0316155b1561160c57506117855490565b61177e54604080517feb91d37e00000000000000000000000000000000000000000000000000000000815281516000936001600160a01b03169263eb91d37e9260048082019391829003018186803b15801561166757600080fd5b505afa15801561167b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169f91906136cf565b509050600061177e60009054906101000a90046001600160a01b03166001600160a01b0316636b52b2426040518163ffffffff1660e01b815260040160206040518083038186803b1580156116f357600080fd5b505afa158015611707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172b9190613671565b90506000611786548261173e91906138cf565b61174990600a61393e565b6117549060966139e6565b9050600061176284836138e7565b90506117865460126117749190613a05565b61177f90600a61393e565b61178990826139e6565b94505050505090565b808015806117a257506117845481115b156117c05760405163d6483bcd60e01b815260040160405180910390fd5b61178354816117ce600a5490565b6117d891906138cf565b11156117f757604051630834d33960e11b815260040160405180910390fd5b816000806118036115e0565b90506000821561181c57611815611f20565b905061181f565b50805b61182984826139e6565b341461184a5760405163d9cac65760e01b8152346004820152602401610b02565b61178754610100900460ff161561188d576040517f40dc29f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61122c33876126df565b610b153383836127d7565b611782805461130290613a48565b6118b86120bf565b6002600d54141561190b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b02565b6002600d5580158061192d575080801561192d5750670de0b6b3a76400004710155b6119795760405162461bcd60e51b815260206004820152601f60248201527f496e73756666696369656e742066756e647320746f2072756e207465737421006044820152606401610b02565b600047116119c95760405162461bcd60e51b815260206004820152601560248201527f4e6f2066756e647320746f2077697468647261772100000000000000000000006044820152606401610b02565b8015611a915760006119e3600c546001600160a01b031690565b6001600160a01b0316670de0b6b3a764000060405160006040518083038185875af1925050503d8060008114611a35576040519150601f19603f3d011682016040523d82523d6000602084013e611a3a565b606091505b5050905080611a8b5760405162461bcd60e51b815260206004820152601960248201527f436f756c646e27742073656e64207465737420616d6f756e74000000000000006044820152606401610b02565b50611b47565b6000611aa5600c546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114611aef576040519150601f19603f3d011682016040523d82523d6000602084013e611af4565b606091505b5050905080611b455760405162461bcd60e51b815260206004820152601560248201527f436f756c646e27742073656e642062616c616e636500000000000000000000006044820152606401610b02565b505b506001600d55565b611b576120bf565b61178455565b611b673383612488565b611bd95760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610b02565b6115cb848484846128a6565b611bed6120bf565b611787805462ff0000191662010000831515908102919091179091556040517f3f085cd13a5229562f9922dedb8732367dba3ecbf0989a9ce29bb805fe94644a90600090a250565b6000818152600460205260409020546060906001600160a01b0316611cc25760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610b02565b611787546301000000900460ff16611d67576117828054611ce290613a48565b80601f0160208091040260200160405190810160405280929190818152602001828054611d0e90613a48565b8015611d5b5780601f10611d3057610100808354040283529160200191611d5b565b820191906000526020600020905b815481529060010190602001808311611d3e57829003601f168201915b50505050509050919050565b6000611d71612924565b90506000815111611d915760405180602001604052806000815250611dc0565b80611d9b84612934565b611781604051602001611db09392919061371f565b6040516020818303038152906040525b9392505050565b611dcf6120bf565b611787805463ff00000019166301000000831515908102919091179091556040517f20a5b4e05b29089957b31c76110692167d828e9ecb1be33824e11609370e802190600090a250565b81801580611e2957506117845481115b15611e475760405163d6483bcd60e01b815260040160405180910390fd5b6117835481611e55600a5490565b611e5f91906138cf565b1115611e7e57604051630834d33960e11b815260040160405180910390fd5b611e866120bf565b610cff82846126df565b611e986120bf565b6001600160a01b038116611f145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b02565b611f1d81612785565b50565b600080611f2b6115e0565b90506000611f3b6103e8836139e6565b9050612710611f4a81836138e7565b611f549084613a05565b935050505090565b6127106bffffffffffffffffffffffff82161115611fe25760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610b02565b6001600160a01b0382166120385760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610b02565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600055565b6000610a9e82612a66565b60006001600160e01b031982167f780e9d63000000000000000000000000000000000000000000000000000000001480610a9e5750610a9e82612076565b600c546001600160a01b031633146115255760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b02565b6000818152600460205260409020546001600160a01b0316611f1d5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610b02565b600081815260066020526040902080546001600160a01b0319166001600160a01b03841690811790915581906121b282611391565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6040805160808101825260038183018181527f534742000000000000000000000000000000000000000000000000000000000060608401528252825180840184529081527f464c5200000000000000000000000000000000000000000000000000000000006020808301919091528201525181517f95d89b41000000000000000000000000000000000000000000000000000000008152915160009283916001600160a01b038616916395d89b419160048083019286929190829003018186803b1580156122b857600080fd5b505afa1580156122cc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122f491908101906135e1565b90506000828051906020012082805190602001201490506000856001600160a01b03166302fb0c5e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561234657600080fd5b505afa15801561235a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237e9190613541565b90506000866001600160a01b031663eb91d37e6040518163ffffffff1660e01b8152600401604080518083038186803b1580156123ba57600080fd5b505afa1580156123ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123f291906136cf565b509050866001600160a01b0316636b52b2426040518163ffffffff1660e01b815260040160206040518083038186803b15801561242e57600080fd5b505afa158015612442573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124669190613671565b508280156124715750815b801561247d5750600081115b979650505050505050565b60008061249483611391565b9050806001600160a01b0316846001600160a01b031614806124db57506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b806124ff5750836001600160a01b03166124f484610bab565b6001600160a01b0316145b949350505050565b826001600160a01b031661251a82611391565b6001600160a01b0316146125965760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610b02565b6001600160a01b0382166126115760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610b02565b61261c838383612ad8565b61262760008261217d565b6001600160a01b0383166000908152600560205260408120805460019290612650908490613a05565b90915550506001600160a01b038216600090815260056020526040812080546001929061267e9084906138cf565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60005b81811015610cff5760006126f5600a5490565b3342612702600143613a05565b4060405160200161273e949392919093845260609290921b6bffffffffffffffffffffffff191660208401526034830152605482015260740190565b6040516020818303038152906040528051906020012060001c9050600061276482612ae3565b90506127708582612c25565b5050808061277d90613a83565b9150506126e2565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156128395760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b02565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6128b1848484612507565b6128bd84848484612c3f565b6115cb5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610b02565b60606117808054610b2890613a48565b60608161297457505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561299e578061298881613a83565b91506129979050600a836138e7565b9150612978565b60008167ffffffffffffffff8111156129b9576129b9613b0a565b6040519080825280601f01601f1916602001820160405280156129e3576020820181803683370190505b5090505b84156124ff576129f8600183613a05565b9150612a05600a86613a9e565b612a109060306138cf565b60f81b818381518110612a2557612a25613af4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612a5f600a866138e7565b94506129e7565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480612ac957506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610a9e5750610a9e82612d97565b610cff838383612dfe565b600080612aef600a5490565b61178354612afd9190613a05565b905060008111612b39576040517fb602dfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612b458285613a9e565b90506000600e826117708110612b5d57612b5d613af4565b0154612b695781612b80565b600e826117708110612b7d57612b7d613af4565b01545b905080612b8c81613a83565b9150600e9050612b9d600185613a05565b6117708110612bae57612bae613af4565b015415612bda57600e612bc2600185613a05565b6117708110612bd357612bd3613af4565b0154612be5565b612be5600184613a05565b600e836117708110612bf957612bf9613af4565b01556000600e612c0a600186613a05565b6117708110612c1b57612c1b613af4565b0155949350505050565b610b15828260405180602001604052806000815250612eb6565b60006001600160a01b0384163b15612d8c57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612c839033908990889088906004016137e3565b602060405180830381600087803b158015612c9d57600080fd5b505af1925050508015612ccd575060408051601f3d908101601f19168201909252612cca9181019061357b565b60015b612d72573d808015612cfb576040519150601f19603f3d011682016040523d82523d6000602084013e612d00565b606091505b508051612d6a5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610b02565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506124ff565b506001949350505050565b60006001600160e01b031982167f2a55205a000000000000000000000000000000000000000000000000000000001480610a9e57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610a9e565b6001600160a01b038316612e5957612e5481600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b612e7c565b816001600160a01b0316836001600160a01b031614612e7c57612e7c8382612f34565b6001600160a01b038216612e9357610cff81612fd1565b826001600160a01b0316826001600160a01b031614610cff57610cff8282613080565b612ec083836130c4565b612ecd6000848484612c3f565b610cff5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610b02565b60006001612f4184611479565b612f4b9190613a05565b600083815260096020526040902054909150808214612f9e576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a54600090612fe390600190613a05565b6000838152600b6020526040812054600a805493945090928490811061300b5761300b613af4565b9060005260206000200154905080600a838154811061302c5761302c613af4565b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a80548061306457613064613ade565b6001900381819060005260206000200160009055905550505050565b600061308b83611479565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b6001600160a01b03821661311a5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b02565b6000818152600460205260409020546001600160a01b03161561317f5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b02565b61318b60008383612ad8565b6001600160a01b03821660009081526005602052604081208054600192906131b49084906138cf565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461321e90613a48565b90600052602060002090601f0160209004810192826132405760008555613286565b82601f1061325957805160ff1916838001178555613286565b82800160010185558215613286579182015b8281111561328657825182559160200191906001019061326b565b50613292929150613296565b5090565b5b808211156132925760008155600101613297565b60006132be6132b9846138a7565b613876565b90508281528383830111156132d257600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b038116811461330057600080fd5b919050565b60006020828403121561331757600080fd5b611dc0826132e9565b6000806040838503121561333357600080fd5b61333c836132e9565b915061334a602084016132e9565b90509250929050565b60008060006060848603121561336857600080fd5b613371846132e9565b925061337f602085016132e9565b9150604084013590509250925092565b600080600080608085870312156133a557600080fd5b6133ae856132e9565b93506133bc602086016132e9565b925060408501359150606085013567ffffffffffffffff8111156133df57600080fd5b8501601f810187136133f057600080fd5b6133ff878235602084016132ab565b91505092959194509250565b6000806040838503121561341e57600080fd5b613427836132e9565b9150602083013561343781613b20565b809150509250929050565b6000806040838503121561345557600080fd5b61345e836132e9565b946020939093013593505050565b6000806040838503121561347f57600080fd5b613488836132e9565b915060208301356bffffffffffffffffffffffff8116811461343757600080fd5b6000806000604084860312156134be57600080fd5b833567ffffffffffffffff808211156134d657600080fd5b818601915086601f8301126134ea57600080fd5b8135818111156134f957600080fd5b8760208260051b850101111561350e57600080fd5b6020928301989097509590910135949350505050565b60006020828403121561353657600080fd5b8135611dc081613b20565b60006020828403121561355357600080fd5b8151611dc081613b20565b60006020828403121561357057600080fd5b8135611dc081613b2e565b60006020828403121561358d57600080fd5b8151611dc081613b2e565b6000602082840312156135aa57600080fd5b813567ffffffffffffffff8111156135c157600080fd5b8201601f810184136135d257600080fd5b6124ff848235602084016132ab565b6000602082840312156135f357600080fd5b815167ffffffffffffffff81111561360a57600080fd5b8201601f8101841361361b57600080fd5b80516136296132b9826138a7565b81815285602083850101111561363e57600080fd5b61364f826020830160208601613a1c565b95945050505050565b60006020828403121561366a57600080fd5b5035919050565b60006020828403121561368357600080fd5b5051919050565b6000806040838503121561369d57600080fd5b8235915061334a602084016132e9565b600080604083850312156136c057600080fd5b50508035926020909101359150565b600080604083850312156136e257600080fd5b505080516020909101519092909150565b6000815180845261370b816020860160208601613a1c565b601f01601f19169290920160200192915050565b6000845160206137328285838a01613a1c565b8551918401916137458184848a01613a1c565b8554920191600090600181811c908083168061376257607f831692505b85831081141561378057634e487b7160e01b85526022600452602485fd5b80801561379457600181146137a5576137d2565b60ff198516885283880195506137d2565b60008b81526020902060005b858110156137ca5781548a8201529084019088016137b1565b505083880195505b50939b9a5050505050505050505050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261381560808301846136f3565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156138575783518352928401929184019160010161383b565b50909695505050505050565b602081526000611dc060208301846136f3565b604051601f8201601f1916810167ffffffffffffffff8111828210171561389f5761389f613b0a565b604052919050565b600067ffffffffffffffff8211156138c1576138c1613b0a565b50601f01601f191660200190565b600082198211156138e2576138e2613ab2565b500190565b6000826138f6576138f6613ac8565b500490565b600181815b8085111561393657816000190482111561391c5761391c613ab2565b8085161561392957918102915b93841c9390800290613900565b509250929050565b6000611dc0838360008261395457506001610a9e565b8161396157506000610a9e565b816001811461397757600281146139815761399d565b6001915050610a9e565b60ff84111561399257613992613ab2565b50506001821b610a9e565b5060208310610133831016604e8410600b84101617156139c0575081810a610a9e565b6139ca83836138fb565b80600019048211156139de576139de613ab2565b029392505050565b6000816000190483118215151615613a0057613a00613ab2565b500290565b600082821015613a1757613a17613ab2565b500390565b60005b83811015613a37578181015183820152602001613a1f565b838111156115cb5750506000910152565b600181811c90821680613a5c57607f821691505b60208210811415613a7d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613a9757613a97613ab2565b5060010190565b600082613aad57613aad613ac8565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114611f1d57600080fd5b6001600160e01b031981168114611f1d57600080fdfea2646970667358221220cbc7b08706ae0f4fcb9620511daa02e5ac001678435b2ca1160d36c4304ff45164736f6c63430008070033697066733a2f2f516d53475a3977413744594c6348785a435673534369454b51746533386235464a776432483737736670486348422f68696464656e2e6a736f6e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016c3288f85388fdcb2453de414022b3a8d7d9dd00000000000000000000000000000000000000000000000000000000000001f4
Deployed ByteCode
0x6080604052600436106103765760003560e01c8063715018a6116101d1578063a810a54c11610102578063d5abeb01116100a0578063e985e9c51161006f578063e985e9c5146109e6578063efbd73f414610a2f578063f2fde38b14610a4f578063fc1a1c3614610a6f57600080fd5b8063d5abeb0114610973578063e0a808531461098a578063e4590b87146109aa578063e82ba406146109cb57600080fd5b8063b88d4fde116100dc578063b88d4fde146108fc578063c3b754dc1461091c578063c87b56dd1461093c578063d3b5dc3b1461095c57600080fd5b8063a810a54c146108a7578063a863dc36146108c7578063b071401b146108dc57600080fd5b806394354fd01161016f578063a035b1fe11610149578063a035b1fe1461084a578063a0712d681461085f578063a22cb46514610872578063a45ba8e71461089257600080fd5b806394354fd0146107f057806395d89b41146108075780639b19251a1461081c57600080fd5b8063863f5c9c116101ab578063863f5c9c1461077c5780638a818cff146107925780638d814a8c146107b25780638da5cb5b146107d257600080fd5b8063715018a6146107305780637ec4a6591461074557806385d5771c1461076557600080fd5b806342842e0e116102ab5780635503a0e8116102495780636352211e116102235780636352211e146106b0578063691a9d85146106d05780636f8b44b0146106f057806370a082311461071057600080fd5b80635503a0e8146106665780635c975abb1461067b57806362b99ad41461069b57600080fd5b80634f6ccce7116102855780634f6ccce7146105e35780634fdd43cb146106035780635183022714610623578063524513d61461064557600080fd5b806342842e0e14610583578063438b6300146105a35780634618163e146105d057600080fd5b806316ba10e01161031857806318160ddd116102f257806318160ddd146104ef57806323b872dd146105045780632a55205a146105245780632f745c591461056357600080fd5b806316ba10e01461048f57806316c38b3c146104af578063176f832e146104cf57600080fd5b8063081812fc11610354578063081812fc146103f4578063095ea7b31461042c5780630a3eaf961461044c578063115025191461046c57600080fd5b806301ffc9a71461037b57806302fa7c47146103b057806306fdde03146103d2575b600080fd5b34801561038757600080fd5b5061039b61039636600461355e565b610a84565b60405190151581526020015b60405180910390f35b3480156103bc57600080fd5b506103d06103cb36600461346c565b610aa4565b005b3480156103de57600080fd5b506103e7610b19565b6040516103a79190613863565b34801561040057600080fd5b5061041461040f366004613658565b610bab565b6040516001600160a01b0390911681526020016103a7565b34801561043857600080fd5b506103d0610447366004613442565b610bd2565b34801561045857600080fd5b506103d0610467366004613305565b610d04565b34801561047857600080fd5b50610481600081565b6040519081526020016103a7565b34801561049b57600080fd5b506103d06104aa366004613598565b610d91565b3480156104bb57600080fd5b506103d06104ca366004613524565b610dad565b3480156104db57600080fd5b506103d06104ea366004613658565b610dfb565b3480156104fb57600080fd5b50600a54610481565b34801561051057600080fd5b506103d061051f366004613353565b610e09565b34801561053057600080fd5b5061054461053f3660046136ad565b610e90565b604080516001600160a01b0390931683526020830191909152016103a7565b34801561056f57600080fd5b5061048161057e366004613442565b610f4b565b34801561058f57600080fd5b506103d061059e366004613353565b610ff3565b3480156105af57600080fd5b506105c36105be366004613305565b61100e565b6040516103a7919061381f565b6103d06105de366004613658565b6110b6565b3480156105ef57600080fd5b506104816105fe366004613658565b611234565b34801561060f57600080fd5b506103d061061e366004613598565b6112d8565b34801561062f57600080fd5b506117875461039b906301000000900460ff1681565b34801561065157600080fd5b506117875461039b9062010000900460ff1681565b34801561067257600080fd5b506103e76112f4565b34801561068757600080fd5b506117875461039b90610100900460ff1681565b3480156106a757600080fd5b506103e7611383565b3480156106bc57600080fd5b506104146106cb366004613658565b611391565b3480156106dc57600080fd5b506103d06106eb366004613658565b6113f6565b3480156106fc57600080fd5b506103d061070b366004613658565b611404565b34801561071c57600080fd5b5061048161072b366004613305565b611479565b34801561073c57600080fd5b506103d0611513565b34801561075157600080fd5b506103d0610760366004613598565b611527565b34801561077157600080fd5b506104816117855481565b34801561078857600080fd5b506104816103e881565b34801561079e57600080fd5b506103d06107ad366004613524565b611543565b3480156107be57600080fd5b506103d06107cd3660046134a9565b61155f565b3480156107de57600080fd5b50600c546001600160a01b0316610414565b3480156107fc57600080fd5b506104816117845481565b34801561081357600080fd5b506103e76115d1565b34801561082857600080fd5b50610481610837366004613305565b61177f6020526000908152604090205481565b34801561085657600080fd5b506104816115e0565b6103d061086d366004613658565b611792565b34801561087e57600080fd5b506103d061088d36600461340b565b611897565b34801561089e57600080fd5b506103e76118a2565b3480156108b357600080fd5b506103d06108c2366004613524565b6118b0565b3480156108d357600080fd5b50610481609681565b3480156108e857600080fd5b506103d06108f7366004613658565b611b4f565b34801561090857600080fd5b506103d061091736600461338f565b611b5d565b34801561092857600080fd5b506103d0610937366004613524565b611be5565b34801561094857600080fd5b506103e7610957366004613658565b611c35565b34801561096857600080fd5b506104816117865481565b34801561097f57600080fd5b506104816117835481565b34801561099657600080fd5b506103d06109a5366004613524565b611dc7565b3480156109b657600080fd5b5061177e54610414906001600160a01b031681565b3480156109d757600080fd5b506117875461039b9060ff1681565b3480156109f257600080fd5b5061039b610a01366004613320565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a3b57600080fd5b506103d0610a4a36600461368a565b611e19565b348015610a5b57600080fd5b506103d0610a6a366004613305565b611e90565b348015610a7b57600080fd5b50610481611f20565b6000610a8f82612076565b80610a9e5750610a9e82612081565b92915050565b610aac6120bf565b612710816bffffffffffffffffffffffff161115610b0b576040517fe577e7660000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff821660048201526024015b60405180910390fd5b610b158282611f5c565b5050565b606060028054610b2890613a48565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5490613a48565b8015610ba15780601f10610b7657610100808354040283529160200191610ba1565b820191906000526020600020905b815481529060010190602001808311610b8457829003601f168201915b5050505050905090565b6000610bb682612119565b506000908152600660205260409020546001600160a01b031690565b6000610bdd82611391565b9050806001600160a01b0316836001600160a01b03161415610c675760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610b02565b336001600160a01b0382161480610c835750610c838133610a01565b610cf55760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610b02565b610cff838361217d565b505050565b610d0c6120bf565b806001600160a01b03811615801590610d2b5750610d29816121eb565b155b15610d6d576040517f336f0b970000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610b02565b61177e80546001600160a01b0319166001600160a01b039290921691909117905550565b610d996120bf565b8051610b1590611781906020840190613212565b610db56120bf565b611787805461ff001916610100831515908102919091179091556040517f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd290600090a250565b610e036120bf565b61178655565b610e133382612488565b610e855760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610b02565b610cff838383612507565b60008281526001602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff16928201929092528291610f0f5750604080518082019091526000546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b602081015160009061271090610f33906bffffffffffffffffffffffff16876139e6565b610f3d91906138e7565b915196919550909350505050565b6000610f5683611479565b8210610fca5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610b02565b506001600160a01b03919091166000908152600860209081526040808320938352929052205490565b610cff83838360405180602001604052806000815250611b5d565b6060600061101b83611479565b905060008167ffffffffffffffff81111561103857611038613b0a565b604051908082528060200260200182016040528015611061578160200160208202803683370190505b50905060005b828110156110ae57600061107b8683610f4b565b90508083838151811061109057611090613af4565b602090810291909101015250806110a681613a83565b915050611067565b509392505050565b808015806110c657506117845481115b156110e45760405163d6483bcd60e01b815260040160405180910390fd5b61178354816110f2600a5490565b6110fc91906138cf565b111561111b57604051630834d33960e11b815260040160405180910390fd5b81600160006111286115e0565b9050600082156111415761113a611f20565b9050611144565b50805b61114e84826139e6565b341461116f5760405163d9cac65760e01b8152346004820152602401610b02565b6117875462010000900460ff166111b2576040517feb3026e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815261177f60205260409020548611156111fc576040517f3e88681c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600090815261177f60205260408120805488929061121c908490613a05565b9091555061122c905033876126df565b505050505050565b600061123f600a5490565b82106112b35760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610b02565b600a82815481106112c6576112c6613af4565b90600052602060002001549050919050565b6112e06120bf565b8051610b1590611782906020840190613212565b611781805461130290613a48565b80601f016020809104026020016040519081016040528092919081815260200182805461132e90613a48565b801561137b5780601f106113505761010080835404028352916020019161137b565b820191906000526020600020905b81548152906001019060200180831161135e57829003601f168201915b505050505081565b611780805461130290613a48565b6000818152600460205260408120546001600160a01b031680610a9e5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610b02565b6113fe6120bf565b61178555565b61140c6120bf565b6000611417600a5490565b90506117708211806114295750600081115b15611472576040517fd1d1155b00000000000000000000000000000000000000000000000000000000815260048101829052602481018390526117706044820152606401610b02565b5061178355565b60006001600160a01b0382166114f75760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610b02565b506001600160a01b031660009081526005602052604090205490565b61151b6120bf565b6115256000612785565b565b61152f6120bf565b8051610b1590611780906020840190613212565b61154b6120bf565b611787805460ff1916911515919091179055565b6115676120bf565b60005b828110156115cb578161177f600086868581811061158a5761158a613af4565b905060200201602081019061159f9190613305565b6001600160a01b03168152602081019190915260400160002055806115c381613a83565b91505061156a565b50505050565b606060038054610b2890613a48565b6117875460009060ff16806115ff575061177e546001600160a01b0316155b1561160c57506117855490565b61177e54604080517feb91d37e00000000000000000000000000000000000000000000000000000000815281516000936001600160a01b03169263eb91d37e9260048082019391829003018186803b15801561166757600080fd5b505afa15801561167b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169f91906136cf565b509050600061177e60009054906101000a90046001600160a01b03166001600160a01b0316636b52b2426040518163ffffffff1660e01b815260040160206040518083038186803b1580156116f357600080fd5b505afa158015611707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172b9190613671565b90506000611786548261173e91906138cf565b61174990600a61393e565b6117549060966139e6565b9050600061176284836138e7565b90506117865460126117749190613a05565b61177f90600a61393e565b61178990826139e6565b94505050505090565b808015806117a257506117845481115b156117c05760405163d6483bcd60e01b815260040160405180910390fd5b61178354816117ce600a5490565b6117d891906138cf565b11156117f757604051630834d33960e11b815260040160405180910390fd5b816000806118036115e0565b90506000821561181c57611815611f20565b905061181f565b50805b61182984826139e6565b341461184a5760405163d9cac65760e01b8152346004820152602401610b02565b61178754610100900460ff161561188d576040517f40dc29f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61122c33876126df565b610b153383836127d7565b611782805461130290613a48565b6118b86120bf565b6002600d54141561190b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b02565b6002600d5580158061192d575080801561192d5750670de0b6b3a76400004710155b6119795760405162461bcd60e51b815260206004820152601f60248201527f496e73756666696369656e742066756e647320746f2072756e207465737421006044820152606401610b02565b600047116119c95760405162461bcd60e51b815260206004820152601560248201527f4e6f2066756e647320746f2077697468647261772100000000000000000000006044820152606401610b02565b8015611a915760006119e3600c546001600160a01b031690565b6001600160a01b0316670de0b6b3a764000060405160006040518083038185875af1925050503d8060008114611a35576040519150601f19603f3d011682016040523d82523d6000602084013e611a3a565b606091505b5050905080611a8b5760405162461bcd60e51b815260206004820152601960248201527f436f756c646e27742073656e64207465737420616d6f756e74000000000000006044820152606401610b02565b50611b47565b6000611aa5600c546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114611aef576040519150601f19603f3d011682016040523d82523d6000602084013e611af4565b606091505b5050905080611b455760405162461bcd60e51b815260206004820152601560248201527f436f756c646e27742073656e642062616c616e636500000000000000000000006044820152606401610b02565b505b506001600d55565b611b576120bf565b61178455565b611b673383612488565b611bd95760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610b02565b6115cb848484846128a6565b611bed6120bf565b611787805462ff0000191662010000831515908102919091179091556040517f3f085cd13a5229562f9922dedb8732367dba3ecbf0989a9ce29bb805fe94644a90600090a250565b6000818152600460205260409020546060906001600160a01b0316611cc25760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610b02565b611787546301000000900460ff16611d67576117828054611ce290613a48565b80601f0160208091040260200160405190810160405280929190818152602001828054611d0e90613a48565b8015611d5b5780601f10611d3057610100808354040283529160200191611d5b565b820191906000526020600020905b815481529060010190602001808311611d3e57829003601f168201915b50505050509050919050565b6000611d71612924565b90506000815111611d915760405180602001604052806000815250611dc0565b80611d9b84612934565b611781604051602001611db09392919061371f565b6040516020818303038152906040525b9392505050565b611dcf6120bf565b611787805463ff00000019166301000000831515908102919091179091556040517f20a5b4e05b29089957b31c76110692167d828e9ecb1be33824e11609370e802190600090a250565b81801580611e2957506117845481115b15611e475760405163d6483bcd60e01b815260040160405180910390fd5b6117835481611e55600a5490565b611e5f91906138cf565b1115611e7e57604051630834d33960e11b815260040160405180910390fd5b611e866120bf565b610cff82846126df565b611e986120bf565b6001600160a01b038116611f145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b02565b611f1d81612785565b50565b600080611f2b6115e0565b90506000611f3b6103e8836139e6565b9050612710611f4a81836138e7565b611f549084613a05565b935050505090565b6127106bffffffffffffffffffffffff82161115611fe25760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610b02565b6001600160a01b0382166120385760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610b02565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600055565b6000610a9e82612a66565b60006001600160e01b031982167f780e9d63000000000000000000000000000000000000000000000000000000001480610a9e5750610a9e82612076565b600c546001600160a01b031633146115255760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b02565b6000818152600460205260409020546001600160a01b0316611f1d5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610b02565b600081815260066020526040902080546001600160a01b0319166001600160a01b03841690811790915581906121b282611391565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6040805160808101825260038183018181527f534742000000000000000000000000000000000000000000000000000000000060608401528252825180840184529081527f464c5200000000000000000000000000000000000000000000000000000000006020808301919091528201525181517f95d89b41000000000000000000000000000000000000000000000000000000008152915160009283916001600160a01b038616916395d89b419160048083019286929190829003018186803b1580156122b857600080fd5b505afa1580156122cc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122f491908101906135e1565b90506000828051906020012082805190602001201490506000856001600160a01b03166302fb0c5e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561234657600080fd5b505afa15801561235a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237e9190613541565b90506000866001600160a01b031663eb91d37e6040518163ffffffff1660e01b8152600401604080518083038186803b1580156123ba57600080fd5b505afa1580156123ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123f291906136cf565b509050866001600160a01b0316636b52b2426040518163ffffffff1660e01b815260040160206040518083038186803b15801561242e57600080fd5b505afa158015612442573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124669190613671565b508280156124715750815b801561247d5750600081115b979650505050505050565b60008061249483611391565b9050806001600160a01b0316846001600160a01b031614806124db57506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b806124ff5750836001600160a01b03166124f484610bab565b6001600160a01b0316145b949350505050565b826001600160a01b031661251a82611391565b6001600160a01b0316146125965760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610b02565b6001600160a01b0382166126115760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610b02565b61261c838383612ad8565b61262760008261217d565b6001600160a01b0383166000908152600560205260408120805460019290612650908490613a05565b90915550506001600160a01b038216600090815260056020526040812080546001929061267e9084906138cf565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60005b81811015610cff5760006126f5600a5490565b3342612702600143613a05565b4060405160200161273e949392919093845260609290921b6bffffffffffffffffffffffff191660208401526034830152605482015260740190565b6040516020818303038152906040528051906020012060001c9050600061276482612ae3565b90506127708582612c25565b5050808061277d90613a83565b9150506126e2565b600c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156128395760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b02565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6128b1848484612507565b6128bd84848484612c3f565b6115cb5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610b02565b60606117808054610b2890613a48565b60608161297457505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561299e578061298881613a83565b91506129979050600a836138e7565b9150612978565b60008167ffffffffffffffff8111156129b9576129b9613b0a565b6040519080825280601f01601f1916602001820160405280156129e3576020820181803683370190505b5090505b84156124ff576129f8600183613a05565b9150612a05600a86613a9e565b612a109060306138cf565b60f81b818381518110612a2557612a25613af4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612a5f600a866138e7565b94506129e7565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480612ac957506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610a9e5750610a9e82612d97565b610cff838383612dfe565b600080612aef600a5490565b61178354612afd9190613a05565b905060008111612b39576040517fb602dfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612b458285613a9e565b90506000600e826117708110612b5d57612b5d613af4565b0154612b695781612b80565b600e826117708110612b7d57612b7d613af4565b01545b905080612b8c81613a83565b9150600e9050612b9d600185613a05565b6117708110612bae57612bae613af4565b015415612bda57600e612bc2600185613a05565b6117708110612bd357612bd3613af4565b0154612be5565b612be5600184613a05565b600e836117708110612bf957612bf9613af4565b01556000600e612c0a600186613a05565b6117708110612c1b57612c1b613af4565b0155949350505050565b610b15828260405180602001604052806000815250612eb6565b60006001600160a01b0384163b15612d8c57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612c839033908990889088906004016137e3565b602060405180830381600087803b158015612c9d57600080fd5b505af1925050508015612ccd575060408051601f3d908101601f19168201909252612cca9181019061357b565b60015b612d72573d808015612cfb576040519150601f19603f3d011682016040523d82523d6000602084013e612d00565b606091505b508051612d6a5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610b02565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506124ff565b506001949350505050565b60006001600160e01b031982167f2a55205a000000000000000000000000000000000000000000000000000000001480610a9e57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610a9e565b6001600160a01b038316612e5957612e5481600a80546000838152600b60205260408120829055600182018355919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80155565b612e7c565b816001600160a01b0316836001600160a01b031614612e7c57612e7c8382612f34565b6001600160a01b038216612e9357610cff81612fd1565b826001600160a01b0316826001600160a01b031614610cff57610cff8282613080565b612ec083836130c4565b612ecd6000848484612c3f565b610cff5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610b02565b60006001612f4184611479565b612f4b9190613a05565b600083815260096020526040902054909150808214612f9e576001600160a01b03841660009081526008602090815260408083208584528252808320548484528184208190558352600990915290208190555b5060009182526009602090815260408084208490556001600160a01b039094168352600881528383209183525290812055565b600a54600090612fe390600190613a05565b6000838152600b6020526040812054600a805493945090928490811061300b5761300b613af4565b9060005260206000200154905080600a838154811061302c5761302c613af4565b6000918252602080832090910192909255828152600b9091526040808220849055858252812055600a80548061306457613064613ade565b6001900381819060005260206000200160009055905550505050565b600061308b83611479565b6001600160a01b039093166000908152600860209081526040808320868452825280832085905593825260099052919091209190915550565b6001600160a01b03821661311a5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b02565b6000818152600460205260409020546001600160a01b03161561317f5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b02565b61318b60008383612ad8565b6001600160a01b03821660009081526005602052604081208054600192906131b49084906138cf565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461321e90613a48565b90600052602060002090601f0160209004810192826132405760008555613286565b82601f1061325957805160ff1916838001178555613286565b82800160010185558215613286579182015b8281111561328657825182559160200191906001019061326b565b50613292929150613296565b5090565b5b808211156132925760008155600101613297565b60006132be6132b9846138a7565b613876565b90508281528383830111156132d257600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b038116811461330057600080fd5b919050565b60006020828403121561331757600080fd5b611dc0826132e9565b6000806040838503121561333357600080fd5b61333c836132e9565b915061334a602084016132e9565b90509250929050565b60008060006060848603121561336857600080fd5b613371846132e9565b925061337f602085016132e9565b9150604084013590509250925092565b600080600080608085870312156133a557600080fd5b6133ae856132e9565b93506133bc602086016132e9565b925060408501359150606085013567ffffffffffffffff8111156133df57600080fd5b8501601f810187136133f057600080fd5b6133ff878235602084016132ab565b91505092959194509250565b6000806040838503121561341e57600080fd5b613427836132e9565b9150602083013561343781613b20565b809150509250929050565b6000806040838503121561345557600080fd5b61345e836132e9565b946020939093013593505050565b6000806040838503121561347f57600080fd5b613488836132e9565b915060208301356bffffffffffffffffffffffff8116811461343757600080fd5b6000806000604084860312156134be57600080fd5b833567ffffffffffffffff808211156134d657600080fd5b818601915086601f8301126134ea57600080fd5b8135818111156134f957600080fd5b8760208260051b850101111561350e57600080fd5b6020928301989097509590910135949350505050565b60006020828403121561353657600080fd5b8135611dc081613b20565b60006020828403121561355357600080fd5b8151611dc081613b20565b60006020828403121561357057600080fd5b8135611dc081613b2e565b60006020828403121561358d57600080fd5b8151611dc081613b2e565b6000602082840312156135aa57600080fd5b813567ffffffffffffffff8111156135c157600080fd5b8201601f810184136135d257600080fd5b6124ff848235602084016132ab565b6000602082840312156135f357600080fd5b815167ffffffffffffffff81111561360a57600080fd5b8201601f8101841361361b57600080fd5b80516136296132b9826138a7565b81815285602083850101111561363e57600080fd5b61364f826020830160208601613a1c565b95945050505050565b60006020828403121561366a57600080fd5b5035919050565b60006020828403121561368357600080fd5b5051919050565b6000806040838503121561369d57600080fd5b8235915061334a602084016132e9565b600080604083850312156136c057600080fd5b50508035926020909101359150565b600080604083850312156136e257600080fd5b505080516020909101519092909150565b6000815180845261370b816020860160208601613a1c565b601f01601f19169290920160200192915050565b6000845160206137328285838a01613a1c565b8551918401916137458184848a01613a1c565b8554920191600090600181811c908083168061376257607f831692505b85831081141561378057634e487b7160e01b85526022600452602485fd5b80801561379457600181146137a5576137d2565b60ff198516885283880195506137d2565b60008b81526020902060005b858110156137ca5781548a8201529084019088016137b1565b505083880195505b50939b9a5050505050505050505050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261381560808301846136f3565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156138575783518352928401929184019160010161383b565b50909695505050505050565b602081526000611dc060208301846136f3565b604051601f8201601f1916810167ffffffffffffffff8111828210171561389f5761389f613b0a565b604052919050565b600067ffffffffffffffff8211156138c1576138c1613b0a565b50601f01601f191660200190565b600082198211156138e2576138e2613ab2565b500190565b6000826138f6576138f6613ac8565b500490565b600181815b8085111561393657816000190482111561391c5761391c613ab2565b8085161561392957918102915b93841c9390800290613900565b509250929050565b6000611dc0838360008261395457506001610a9e565b8161396157506000610a9e565b816001811461397757600281146139815761399d565b6001915050610a9e565b60ff84111561399257613992613ab2565b50506001821b610a9e565b5060208310610133831016604e8410600b84101617156139c0575081810a610a9e565b6139ca83836138fb565b80600019048211156139de576139de613ab2565b029392505050565b6000816000190483118215151615613a0057613a00613ab2565b500290565b600082821015613a1757613a17613ab2565b500390565b60005b83811015613a37578181015183820152602001613a1f565b838111156115cb5750506000910152565b600181811c90821680613a5c57607f821691505b60208210811415613a7d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613a9757613a97613ab2565b5060010190565b600082613aad57613aad613ac8565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114611f1d57600080fd5b6001600160e01b031981168114611f1d57600080fdfea2646970667358221220cbc7b08706ae0f4fcb9620511daa02e5ac001678435b2ca1160d36c4304ff45164736f6c63430008070033