Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 314 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 16613712 | 1107 days ago | IN | 0 ETH | 0.00077227 | ||||
| Set Approval For... | 16398524 | 1137 days ago | IN | 0 ETH | 0.00156061 | ||||
| Set Approval For... | 16121330 | 1176 days ago | IN | 0 ETH | 0.00058382 | ||||
| Set Approval For... | 16121330 | 1176 days ago | IN | 0 ETH | 0.00058488 | ||||
| Set Approval For... | 15973502 | 1196 days ago | IN | 0 ETH | 0.00068257 | ||||
| Set Approval For... | 15970758 | 1197 days ago | IN | 0 ETH | 0.00092013 | ||||
| Set Approval For... | 15918250 | 1204 days ago | IN | 0 ETH | 0.00060592 | ||||
| Set Approval For... | 15915454 | 1204 days ago | IN | 0 ETH | 0.00060588 | ||||
| Set Approval For... | 15824902 | 1217 days ago | IN | 0 ETH | 0.00052132 | ||||
| Set Approval For... | 15816104 | 1218 days ago | IN | 0 ETH | 0.00070783 | ||||
| Set Approval For... | 15788370 | 1222 days ago | IN | 0 ETH | 0.00085248 | ||||
| Set Approval For... | 15787426 | 1222 days ago | IN | 0 ETH | 0.00093475 | ||||
| Set Approval For... | 15571560 | 1252 days ago | IN | 0 ETH | 0.00023064 | ||||
| Set Approval For... | 15311426 | 1293 days ago | IN | 0 ETH | 0.00024908 | ||||
| Set Approval For... | 15248433 | 1303 days ago | IN | 0 ETH | 0.00031888 | ||||
| Mint | 15191053 | 1312 days ago | IN | 0 ETH | 0.00175112 | ||||
| Mint | 15190988 | 1312 days ago | IN | 0 ETH | 0.00107992 | ||||
| Mint | 15190914 | 1312 days ago | IN | 0 ETH | 0.00089451 | ||||
| Mint | 15190903 | 1312 days ago | IN | 0 ETH | 0.00156069 | ||||
| Mint | 15190902 | 1312 days ago | IN | 0 ETH | 0.00107539 | ||||
| Mint | 15190891 | 1312 days ago | IN | 0 ETH | 0.00185295 | ||||
| Set Approval For... | 15190872 | 1312 days ago | IN | 0 ETH | 0.00044536 | ||||
| Mint | 15190852 | 1312 days ago | IN | 0 ETH | 0.00112765 | ||||
| Mint | 15190845 | 1312 days ago | IN | 0 ETH | 0.00139265 | ||||
| Mint | 15190835 | 1312 days ago | IN | 0 ETH | 0.00167999 |
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 15094852 | 1327 days ago | 0.32 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
rattownBaseNFT
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
/**
* @title LICENSE REQUIREMENT
* @dev This contract is licensed under the MIT license.
*/
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./interfaces/INFTExtension.sol";
import "./interfaces/IMetaverseNFT.sol";
import "./utils/OpenseaProxy.sol";
contract rattownBaseNFT is
ERC721A,
ReentrancyGuard,
Ownable,
IMetaverseNFT // implements IERC2981
{
using Address for address;
using SafeERC20 for IERC20;
using Counters for Counters.Counter;
Counters.Counter private _tokenIndexCounter; // token index counter
uint256 public constant SALE_STARTS_AT_INFINITY = 2**256 - 1;
uint256 public startTimestamp = SALE_STARTS_AT_INFINITY;
uint256 public reserved;
uint256 public maxSupply;
uint256 public maxPerMint;
uint256 public price;
uint256 public royaltyFee;
address public royaltyReceiver;
address public payoutReceiver = address(0x0);
address public uriExtension = address(0x0);
bool public isFrozen;
bool public isPayoutChangeLocked;
bool private isOpenSeaProxyActive = true;
bool private startAtOne = true;
/**
* @dev Additional data for each token that needs to be stored and accessed on-chain
*/
mapping(uint256 => bytes32) public data;
/**
* @dev List of connected extensions
*/
INFTExtension[] public extensions;
string public PROVENANCE_HASH = "";
string private CONTRACT_URI = "";
string private BASE_URI;
string private URI_POSTFIX = "";
event ExtensionAdded(address indexed extensionAddress);
event ExtensionRevoked(address indexed extensionAddress);
event ExtensionURIAdded(address indexed extensionAddress);
constructor(
uint256 _price,
uint256 _maxSupply,
uint256 _nReserved,
uint256 _maxPerMint,
uint256 _royaltyFee,
string memory _uri,
string memory _name,
string memory _symbol,
bool _startAtOne
) ERC721A(_name, _symbol) {
startTimestamp = SALE_STARTS_AT_INFINITY;
price = _price;
reserved = _nReserved;
maxPerMint = _maxPerMint;
maxSupply = _maxSupply;
royaltyFee = _royaltyFee;
royaltyReceiver = address(this);
startAtOne = _startAtOne;
BASE_URI = _uri;
}
function _baseURI() internal view override returns (string memory) {
return BASE_URI;
}
function _startTokenId() internal view virtual override returns (uint256) {
return startAtOne ? 1 : 0;
}
function contractURI() public view returns (string memory uri) {
uri = bytes(CONTRACT_URI).length > 0 ? CONTRACT_URI : _baseURI();
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
if (uriExtension != address(0)) {
string memory uri = INFTURIExtension(uriExtension).tokenURI(
tokenId
);
if (bytes(uri).length > 0) {
return uri;
}
}
if (bytes(URI_POSTFIX).length > 0) {
return
string(abi.encodePacked(super.tokenURI(tokenId), URI_POSTFIX));
} else {
return super.tokenURI(tokenId);
}
}
function startTokenId() public view returns (uint256) {
return _startTokenId();
}
// ----- Admin functions -----
function setBaseURI(string calldata uri) public onlyOwner {
BASE_URI = uri;
}
// Contract-level metadata for Opensea
function setContractURI(string calldata uri) public onlyOwner {
CONTRACT_URI = uri;
}
function setPostfixURI(string calldata postfix) public onlyOwner {
URI_POSTFIX = postfix;
}
function setPrice(uint256 _price) public onlyOwner {
price = _price;
}
// Freeze forever, irreversible
function freeze() public onlyOwner {
isFrozen = true;
}
// Lock changing withdraw address
function lockPayoutChange() public onlyOwner {
isPayoutChangeLocked = true;
}
function isExtensionAdded(address _extension) public view returns (bool) {
for (uint256 index = 0; index < extensions.length; index++) {
if (address(extensions[index]) == _extension) {
return true;
}
}
return false;
}
function extensionsLength() public view returns (uint256) {
return extensions.length;
}
// Extensions are allowed to mint
function addExtension(address _extension) public onlyOwner {
require(_extension != address(this), "Cannot add self as extension");
require(!isExtensionAdded(_extension), "Extension already added");
extensions.push(INFTExtension(_extension));
emit ExtensionAdded(_extension);
}
function revokeExtension(address _extension) public onlyOwner {
uint256 index = 0;
for (; index < extensions.length; index++) {
if (extensions[index] == INFTExtension(_extension)) {
break;
}
}
extensions[index] = extensions[extensions.length - 1];
extensions.pop();
emit ExtensionRevoked(_extension);
}
function setExtensionTokenURI(address extension) public onlyOwner {
require(extension != address(this), "Cannot add self as extension");
require(
extension == address(0x0) ||
ERC165Checker.supportsInterface(
extension,
type(INFTURIExtension).interfaceId
),
"Not conforms to extension"
);
uriExtension = extension;
emit ExtensionURIAdded(extension);
}
// function to disable gasless listings for security in case
// opensea ever shuts down or is compromised
// from CryptoCoven https://etherscan.io/address/0x5180db8f5c931aae63c74266b211f580155ecac8#code
function setIsOpenSeaProxyActive(bool _isOpenSeaProxyActive)
public
onlyOwner
{
isOpenSeaProxyActive = _isOpenSeaProxyActive;
}
// ---- Minting ----
function _mintConsecutive(
uint256 nTokens,
address to,
bytes32 extraData
) internal {
require(
_totalMinted() + nTokens + reserved <= maxSupply,
"Not enough Tokens left."
);
uint256 currentTokenIndex = _tokenIndexCounter.current();
_safeMint(to, nTokens, "");
if (extraData.length > 0) {
for (uint256 i; i < nTokens; i++) {
uint256 tokenId = currentTokenIndex + i;
data[tokenId] = extraData;
}
}
}
// ---- Mint control ----
modifier whenSaleStarted() {
require(saleStarted(), "Sale not started");
_;
}
modifier whenNotFrozen() {
require(!isFrozen, "Minting is frozen");
_;
}
modifier whenNotPayoutChangeLocked() {
require(!isPayoutChangeLocked, "Payout change is locked");
_;
}
modifier onlyExtension() {
require(
isExtensionAdded(msg.sender),
"Extension should be added to contract before minting"
);
_;
}
// ---- Mint public ----
// Contract can sell tokens
function mint(uint256 nTokens)
external
payable
nonReentrant
whenSaleStarted
{
require(
nTokens <= maxPerMint,
"You cannot mint more than MAX_TOKENS_PER_MINT tokens at once!"
);
require(nTokens * price <= msg.value, "Inconsistent amount sent!");
_mintConsecutive(nTokens, msg.sender, 0x0);
}
// Owner can claim free tokens
function claim(uint256 nTokens, address to)
external
nonReentrant
onlyOwner
{
require(nTokens <= reserved, "That would exceed the max reserved.");
reserved = reserved - nTokens;
_mintConsecutive(nTokens, to, 0x0);
}
// ---- Mint via extension
function mintExternal(
uint256 nTokens,
address to,
bytes32 extraData
) external payable onlyExtension nonReentrant {
_mintConsecutive(nTokens, to, extraData);
}
// ---- Sale control ----
function updateStartTimestamp(uint256 _startTimestamp)
public
onlyOwner
whenNotFrozen
{
startTimestamp = _startTimestamp;
}
function startSale() public onlyOwner whenNotFrozen {
startTimestamp = block.timestamp;
}
function stopSale() public onlyOwner {
startTimestamp = SALE_STARTS_AT_INFINITY;
}
function saleStarted() public view returns (bool) {
return block.timestamp >= startTimestamp;
}
// ---- Offchain Info ----
// This should be set before sales open.
function setProvenanceHash(string memory provenanceHash) public onlyOwner {
PROVENANCE_HASH = provenanceHash;
}
function setRoyaltyFee(uint256 _royaltyFee) public onlyOwner {
royaltyFee = _royaltyFee;
}
function setRoyaltyReceiver(address _receiver) public onlyOwner {
royaltyReceiver = _receiver;
}
function setPayoutReceiver(address _receiver)
public
onlyOwner
whenNotPayoutChangeLocked
{
payoutReceiver = payable(_receiver);
}
function royaltyInfo(uint256, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount)
{
// We use the same contract to split royalties: 5% of royalty goes to the developer
receiver = royaltyReceiver;
royaltyAmount = (salePrice * royaltyFee) / 10000;
}
function getPayoutReceiver()
public
view
returns (address payable receiver)
{
receiver = payoutReceiver != address(0x0)
? payable(payoutReceiver)
: payable(owner());
}
// ---- Allow royalty deposits from Opensea -----
receive() external payable {}
// ---- Withdraw -----
function withdraw() public virtual onlyOwner {
uint256 balance = address(this).balance;
address payable receiver = getPayoutReceiver();
Address.sendValue(receiver, balance);
}
function withdrawToken(IERC20 token) public virtual onlyOwner {
uint256 balance = token.balanceOf(address(this));
address payable receiver = getPayoutReceiver();
token.safeTransfer(receiver, balance);
}
// -------- ERC721 overrides --------
function supportsInterface(bytes4 interfaceId)
public
view
override
returns (bool)
{
return
interfaceId == type(IERC2981).interfaceId ||
interfaceId == type(IMetaverseNFT).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev Override isApprovedForAll to allowlist user's OpenSea proxy accounts to enable gas-less listings.
* Taken from CryptoCoven: https://etherscan.io/address/0x5180db8f5c931aae63c74266b211f580155ecac8#code
*/
function isApprovedForAll(address owner, address operator)
public
view
override
returns (bool)
{
// Get a reference to OpenSea's proxy registry contract by instantiating
// the contract using the already existing address.
ProxyRegistry proxyRegistry = ProxyRegistry(
0xa5409ec958C83C3f309868babACA7c86DCB077c1
);
if (
isOpenSeaProxyActive &&
address(proxyRegistry.proxies(owner)) == operator
) {
return true;
}
return super.isApprovedForAll(owner, operator);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
// These contract definitions are used to create a reference to the OpenSea
// ProxyRegistry contract by using the registry's address (see isApprovedForAll).
interface OwnableDelegateProxy {
}
interface ProxyRegistry {
function proxies(address) external view returns (OwnableDelegateProxy);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
interface IAvatarNFT {
// ------ View functions ------
function saleStarted() external view returns (bool);
function isExtensionAdded(address extension) external view returns (bool);
/**
Extra information stored for each tokenId. Optional, provided on mint
*/
function data(uint256 tokenId) external view returns (bytes32);
// ------ Mint functions ------
/**
Mint from NFTExtension contract. Optionally provide data parameter.
*/
function mintExternal(
uint256 tokenId,
address to,
bytes32 data
) external payable;
// ------ Admin functions ------
function addExtension(address extension) external;
function revokeExtension(address extension) external;
function withdraw() external;
}
interface IMetaverseNFT is IAvatarNFT {
// ------ View functions ------
/**
Recommended royalty for tokenId sale.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
// ------ Admin functions ------
function setRoyaltyReceiver(address receiver) external;
function setRoyaltyFee(uint256 fee) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
interface INFTExtension is IERC165 {
}
interface INFTURIExtension is INFTExtension {
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
/**
* @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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Checker.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Library used to query support of an interface declared via {IERC165}.
*
* Note that these functions return the actual result of the query: they do not
* `revert` if an interface is not supported. It is up to the caller to decide
* what to do in these cases.
*/
library ERC165Checker {
// As per the EIP-165 spec, no interface should ever match 0xffffffff
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
/**
* @dev Returns true if `account` supports the {IERC165} interface,
*/
function supportsERC165(address account) internal view returns (bool) {
// Any contract that implements ERC165 must explicitly indicate support of
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
return
_supportsERC165Interface(account, type(IERC165).interfaceId) &&
!_supportsERC165Interface(account, _INTERFACE_ID_INVALID);
}
/**
* @dev Returns true if `account` supports the interface defined by
* `interfaceId`. Support for {IERC165} itself is queried automatically.
*
* See {IERC165-supportsInterface}.
*/
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
// query support of both ERC165 as per the spec and support of _interfaceId
return supportsERC165(account) && _supportsERC165Interface(account, interfaceId);
}
/**
* @dev Returns a boolean array where each value corresponds to the
* interfaces passed in and whether they're supported or not. This allows
* you to batch check interfaces for a contract where your expectation
* is that some interfaces may not be supported.
*
* See {IERC165-supportsInterface}.
*
* _Available since v3.4._
*/
function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)
internal
view
returns (bool[] memory)
{
// an array of booleans corresponding to interfaceIds and whether they're supported or not
bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);
// query support of ERC165 itself
if (supportsERC165(account)) {
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);
}
}
return interfaceIdsSupported;
}
/**
* @dev Returns true if `account` supports all the interfaces defined in
* `interfaceIds`. Support for {IERC165} itself is queried automatically.
*
* Batch-querying can lead to gas savings by skipping repeated checks for
* {IERC165} support.
*
* See {IERC165-supportsInterface}.
*/
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself
if (!supportsERC165(account)) {
return false;
}
// query support of each interface in _interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!_supportsERC165Interface(account, interfaceIds[i])) {
return false;
}
}
// all interfaces supported
return true;
}
/**
* @notice Query if a contract implements an interface, does not check ERC165 support
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Assumes that account contains a contract that supports ERC165, otherwise
* the behavior of this method is undefined. This precondition can be checked
* with {supportsERC165}.
* Interface identification is specified in ERC-165.
*/
function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);
(bool success, bytes memory result) = account.staticcall{gas: 30000}(encodedParams);
if (result.length < 32) return false;
return success && abi.decode(result, (bool));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import './IERC721A.sol';
/**
* @dev ERC721 token receiver interface.
*/
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard,
* including the Metadata extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at `_startTokenId()`
* (defaults to 0, e.g. 0, 1, 2, 3..).
*
* Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
*
* Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
*/
contract ERC721A is IERC721A {
// Mask of an entry in packed address data.
uint256 private constant BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
// The bit position of `numberMinted` in packed address data.
uint256 private constant BITPOS_NUMBER_MINTED = 64;
// The bit position of `numberBurned` in packed address data.
uint256 private constant BITPOS_NUMBER_BURNED = 128;
// The bit position of `aux` in packed address data.
uint256 private constant BITPOS_AUX = 192;
// Mask of all 256 bits in packed address data except the 64 bits for `aux`.
uint256 private constant BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
// The bit position of `startTimestamp` in packed ownership.
uint256 private constant BITPOS_START_TIMESTAMP = 160;
// The bit mask of the `burned` bit in packed ownership.
uint256 private constant BITMASK_BURNED = 1 << 224;
// The bit position of the `nextInitialized` bit in packed ownership.
uint256 private constant BITPOS_NEXT_INITIALIZED = 225;
// The bit mask of the `nextInitialized` bit in packed ownership.
uint256 private constant BITMASK_NEXT_INITIALIZED = 1 << 225;
// The bit position of `extraData` in packed ownership.
uint256 private constant BITPOS_EXTRA_DATA = 232;
// Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
uint256 private constant BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
// The mask of the lower 160 bits for addresses.
uint256 private constant BITMASK_ADDRESS = (1 << 160) - 1;
// The maximum `quantity` that can be minted with `_mintERC2309`.
// This limit is to prevent overflows on the address data entries.
// For a limit of 5000, a total of 3.689e15 calls to `_mintERC2309`
// is required to cause an overflow, which is unrealistic.
uint256 private constant MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
// The tokenId of the next token to be minted.
uint256 private _currentIndex;
// The number of tokens burned.
uint256 private _burnCounter;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned.
// See `_packedOwnershipOf` implementation for details.
//
// Bits Layout:
// - [0..159] `addr`
// - [160..223] `startTimestamp`
// - [224] `burned`
// - [225] `nextInitialized`
// - [232..255] `extraData`
mapping(uint256 => uint256) private _packedOwnerships;
// Mapping owner address to address data.
//
// Bits Layout:
// - [0..63] `balance`
// - [64..127] `numberMinted`
// - [128..191] `numberBurned`
// - [192..255] `aux`
mapping(address => uint256) private _packedAddressData;
// Mapping from token ID to approved address.
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
/**
* @dev Returns the starting token ID.
* To change the starting token ID, please override this function.
*/
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev Returns the next token ID to be minted.
*/
function _nextTokenId() internal view returns (uint256) {
return _currentIndex;
}
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see `_totalMinted`.
*/
function totalSupply() public view override returns (uint256) {
// Counter underflow is impossible as _burnCounter cannot be incremented
// more than `_currentIndex - _startTokenId()` times.
unchecked {
return _currentIndex - _burnCounter - _startTokenId();
}
}
/**
* @dev Returns the total amount of tokens minted in the contract.
*/
function _totalMinted() internal view returns (uint256) {
// Counter underflow is impossible as _currentIndex does not decrement,
// and it is initialized to `_startTokenId()`
unchecked {
return _currentIndex - _startTokenId();
}
}
/**
* @dev Returns the total number of tokens burned.
*/
function _totalBurned() internal view returns (uint256) {
return _burnCounter;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
// The interface IDs are constants representing the first 4 bytes of the XOR of
// all function selectors in the interface. See: https://eips.ethereum.org/EIPS/eip-165
// e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`
return
interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return _packedAddressData[owner] & BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens minted by `owner`.
*/
function _numberMinted(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> BITPOS_NUMBER_MINTED) & BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens burned by or on behalf of `owner`.
*/
function _numberBurned(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> BITPOS_NUMBER_BURNED) & BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
*/
function _getAux(address owner) internal view returns (uint64) {
return uint64(_packedAddressData[owner] >> BITPOS_AUX);
}
/**
* Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
* If there are multiple variables, please pack them into a uint64.
*/
function _setAux(address owner, uint64 aux) internal {
uint256 packed = _packedAddressData[owner];
uint256 auxCasted;
// Cast `aux` with assembly to avoid redundant masking.
assembly {
auxCasted := aux
}
packed = (packed & BITMASK_AUX_COMPLEMENT) | (auxCasted << BITPOS_AUX);
_packedAddressData[owner] = packed;
}
/**
* Returns the packed ownership data of `tokenId`.
*/
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr)
if (curr < _currentIndex) {
uint256 packed = _packedOwnerships[curr];
// If not burned.
if (packed & BITMASK_BURNED == 0) {
// Invariant:
// There will always be an ownership that has an address and is not burned
// before an ownership that does not have an address and is not burned.
// Hence, curr will not underflow.
//
// We can directly compare the packed value.
// If the address is zero, packed is zero.
while (packed == 0) {
packed = _packedOwnerships[--curr];
}
return packed;
}
}
}
revert OwnerQueryForNonexistentToken();
}
/**
* Returns the unpacked `TokenOwnership` struct from `packed`.
*/
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP);
ownership.burned = packed & BITMASK_BURNED != 0;
ownership.extraData = uint24(packed >> BITPOS_EXTRA_DATA);
}
/**
* Returns the unpacked `TokenOwnership` struct at `index`.
*/
function _ownershipAt(uint256 index) internal view returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
/**
* @dev Initializes the ownership slot minted at `index` for efficiency purposes.
*/
function _initializeOwnershipAt(uint256 index) internal {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
/**
* Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around in the collection over time.
*/
function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
/**
* @dev Packs ownership data into a single uint256.
*/
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, BITMASK_ADDRESS)
// `owner | (block.timestamp << BITPOS_START_TIMESTAMP) | flags`.
result := or(owner, or(shl(BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
}
/**
* @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, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return '';
}
/**
* @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
*/
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
// For branchless setting of the `nextInitialized` flag.
assembly {
// `(quantity == 1) << BITPOS_NEXT_INITIALIZED`.
result := shl(BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
if (operator == _msgSenderERC721A()) revert ApproveToCaller();
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), 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-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 {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
return
_startTokenId() <= tokenId &&
tokenId < _currentIndex && // If within bounds,
_packedOwnerships[tokenId] & BITMASK_BURNED == 0; // and not burned.
}
/**
* @dev Equivalent to `_safeMint(to, quantity, '')`.
*/
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, '');
}
/**
* @dev Safely mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
* - `quantity` must be greater than 0.
*
* See {_mint}.
*
* Emits a {Transfer} event for each mint.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
_mint(to, quantity);
unchecked {
if (to.code.length != 0) {
uint256 end = _currentIndex;
uint256 index = end - quantity;
do {
if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
} while (index < end);
// Reentrancy protection.
if (_currentIndex != end) revert();
}
}
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event for each mint.
*/
function _mint(address to, uint256 quantity) internal {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are incredibly unrealistic.
// `balance` and `numberMinted` have a maximum limit of 2**64.
// `tokenId` has a maximum limit of 2**256.
unchecked {
// Updates:
// - `balance += quantity`.
// - `numberMinted += quantity`.
//
// We can directly add to the `balance` and `numberMinted`.
_packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1);
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `quantity == 1`.
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
uint256 tokenId = startTokenId;
uint256 end = startTokenId + quantity;
do {
emit Transfer(address(0), to, tokenId++);
} while (tokenId < end);
_currentIndex = end;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* This function is intended for efficient minting only during contract creation.
*
* It emits only one {ConsecutiveTransfer} as defined in
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
* instead of a sequence of {Transfer} event(s).
*
* Calling this function outside of contract creation WILL make your contract
* non-compliant with the ERC721 standard.
* For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
* {ConsecutiveTransfer} event is only permissible during contract creation.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {ConsecutiveTransfer} event.
*/
function _mintERC2309(address to, uint256 quantity) internal {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
if (quantity > MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are unrealistic due to the above check for `quantity` to be below the limit.
unchecked {
// Updates:
// - `balance += quantity`.
// - `numberMinted += quantity`.
//
// We can directly add to the `balance` and `numberMinted`.
_packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1);
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `quantity == 1`.
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);
_currentIndex = startTokenId + quantity;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Returns the storage slot and value for the approved address of `tokenId`.
*/
function _getApprovedAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
mapping(uint256 => address) storage tokenApprovalsPtr = _tokenApprovals;
// The following is equivalent to `approvedAddress = _tokenApprovals[tokenId]`.
assembly {
// Compute the slot.
mstore(0x00, tokenId)
mstore(0x20, tokenApprovalsPtr.slot)
approvedAddressSlot := keccak256(0x00, 0x40)
// Load the slot's value from storage.
approvedAddress := sload(approvedAddressSlot)
}
}
/**
* @dev Returns whether the `approvedAddress` is equals to `from` or `msgSender`.
*/
function _isOwnerOrApproved(
address approvedAddress,
address from,
address msgSender
) private pure returns (bool result) {
assembly {
// Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
from := and(from, BITMASK_ADDRESS)
// Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
msgSender := and(msgSender, BITMASK_ADDRESS)
// `msgSender == from || msgSender == approvedAddress`.
result := or(eq(msgSender, from), eq(msgSender, approvedAddress))
}
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedAddress(tokenId);
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isOwnerOrApproved(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner.
assembly {
if approvedAddress {
// This is equivalent to `delete _tokenApprovals[tokenId]`.
sstore(approvedAddressSlot, 0)
}
}
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
unchecked {
// We can directly increment and decrement the balances.
--_packedAddressData[from]; // Updates: `balance -= 1`.
++_packedAddressData[to]; // Updates: `balance += 1`.
// Updates:
// - `address` to the next owner.
// - `startTimestamp` to the timestamp of transfering.
// - `burned` to `false`.
// - `nextInitialized` to `true`.
_packedOwnerships[tokenId] = _packOwnershipData(
to,
BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
);
// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
// If the next slot's address is zero and not burned (i.e. packed value is zero).
if (_packedOwnerships[nextTokenId] == 0) {
// If the next slot is within bounds.
if (nextTokenId != _currentIndex) {
// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @dev Equivalent to `_burn(tokenId, false)`.
*/
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
address from = address(uint160(prevOwnershipPacked));
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedAddress(tokenId);
if (approvalCheck) {
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isOwnerOrApproved(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
// Clear approvals from the previous owner.
assembly {
if approvedAddress {
// This is equivalent to `delete _tokenApprovals[tokenId]`.
sstore(approvedAddressSlot, 0)
}
}
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
unchecked {
// Updates:
// - `balance -= 1`.
// - `numberBurned += 1`.
//
// We can directly decrement the balance, and increment the number burned.
// This is equivalent to `packed -= 1; packed += 1 << BITPOS_NUMBER_BURNED;`.
_packedAddressData[from] += (1 << BITPOS_NUMBER_BURNED) - 1;
// Updates:
// - `address` to the last owner.
// - `startTimestamp` to the timestamp of burning.
// - `burned` to `true`.
// - `nextInitialized` to `true`.
_packedOwnerships[tokenId] = _packOwnershipData(
from,
(BITMASK_BURNED | BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
);
// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
// If the next slot's address is zero and not burned (i.e. packed value is zero).
if (_packedOwnerships[nextTokenId] == 0) {
// If the next slot is within bounds.
if (nextTokenId != _currentIndex) {
// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
// Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
unchecked {
_burnCounter++;
}
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
bytes4 retval
) {
return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
/**
* @dev Directly sets the extra data for the ownership data `index`.
*/
function _setExtraDataAt(uint256 index, uint24 extraData) internal {
uint256 packed = _packedOwnerships[index];
if (packed == 0) revert OwnershipNotInitializedForExtraData();
uint256 extraDataCasted;
// Cast `extraData` with assembly to avoid redundant masking.
assembly {
extraDataCasted := extraData
}
packed = (packed & BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << BITPOS_EXTRA_DATA);
_packedOwnerships[index] = packed;
}
/**
* @dev Returns the next extra data for the packed ownership data.
* The returned result is shifted into position.
*/
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
uint24 extraData = uint24(prevOwnershipPacked >> BITPOS_EXTRA_DATA);
return uint256(_extraData(from, to, extraData)) << BITPOS_EXTRA_DATA;
}
/**
* @dev Called during each token transfer to set the 24bit `extraData` field.
* Intended to be overridden by the cosumer contract.
*
* `previousExtraData` - the value of `extraData` before transfer.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, `tokenId` will be burned by `from`.
* - `from` and `to` are never both zero.
*/
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
/**
* @dev Hook that is called before a set of serially-ordered token ids are about to be transferred.
* This includes minting.
* And also called before burning one token.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, `tokenId` will be burned by `from`.
* - `from` and `to` are never both zero.
*/
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Hook that is called after a set of serially-ordered token ids have been transferred.
* This includes minting.
* And also called after one token has been burned.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
* transferred to `to`.
* - When `from` is zero, `tokenId` has been minted for `to`.
* - When `to` is zero, `tokenId` has been burned by `from`.
* - `from` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Returns the message sender (defaults to `msg.sender`).
*
* If you are writing GSN compatible contracts, you need to override this function.
*/
function _msgSenderERC721A() internal view virtual returns (address) {
return msg.sender;
}
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function _toString(uint256 value) internal pure returns (string memory ptr) {
assembly {
// The maximum value of a uint256 contains 78 digits (1 byte per digit),
// but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged.
// We will need 1 32-byte word to store the length,
// and 3 32-byte words to store a maximum of 78 digits. Total: 32 + 3 * 32 = 128.
ptr := add(mload(0x40), 128)
// Update the free memory pointer to allocate.
mstore(0x40, ptr)
// Cache the end of the memory to calculate the length later.
let end := ptr
// We write the string from the rightmost digit to the leftmost digit.
// The following is essentially a do-while loop that also handles the zero case.
// Costs a bit more than early returning for the zero case,
// but cheaper in terms of deployment and overall runtime costs.
for {
// Initialize and perform the first pass without check.
let temp := value
// Move the pointer 1 byte leftwards to point to an empty character slot.
ptr := sub(ptr, 1)
// Write the character to the pointer. 48 is the ASCII index of '0'.
mstore8(ptr, add(48, mod(temp, 10)))
temp := div(temp, 10)
} temp {
// Keep dividing `temp` until zero.
temp := div(temp, 10)
} {
// Body of the for loop.
ptr := sub(ptr, 1)
mstore8(ptr, add(48, mod(temp, 10)))
}
let length := sub(end, ptr)
// Move the pointer 32 bytes leftwards to make room for the length.
ptr := sub(ptr, 32)
// Store the length.
mstore(ptr, length)
}
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of an ERC721A compliant contract.
*/
interface IERC721A {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* The caller cannot approve to their own address.
*/
error ApproveToCaller();
/**
* Cannot query the balance for the zero address.
*/
error BalanceQueryForZeroAddress();
/**
* Cannot mint to the zero address.
*/
error MintToZeroAddress();
/**
* The quantity of tokens minted must be more than zero.
*/
error MintZeroQuantity();
/**
* The token does not exist.
*/
error OwnerQueryForNonexistentToken();
/**
* The caller must own the token or be an approved operator.
*/
error TransferCallerNotOwnerNorApproved();
/**
* The token must be owned by `from`.
*/
error TransferFromIncorrectOwner();
/**
* Cannot safely transfer to a contract that does not implement the ERC721Receiver interface.
*/
error TransferToNonERC721ReceiverImplementer();
/**
* Cannot transfer to the zero address.
*/
error TransferToZeroAddress();
/**
* The token does not exist.
*/
error URIQueryForNonexistentToken();
/**
* The `quantity` minted with ERC2309 exceeds the safety limit.
*/
error MintERC2309QuantityExceedsLimit();
/**
* The `extraData` cannot be set on an unintialized ownership slot.
*/
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
// The address of the owner.
address addr;
// Keeps track of the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
// Arbitrary data similar to `startTimestamp` that can be set through `_extraData`.
uint24 extraData;
}
/**
* @dev Returns the total amount of tokens stored by the contract.
*
* Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens.
*/
function totalSupply() external view returns (uint256);
// ==============================
// 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);
// ==============================
// IERC721
// ==============================
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
// ==============================
// IERC721Metadata
// ==============================
/**
* @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);
// ==============================
// IERC2309
// ==============================
/**
* @dev Emitted when tokens in `fromTokenId` to `toTokenId` (inclusive) is transferred from `from` to `to`,
* as defined in the ERC2309 standard. See `_mintERC2309` for more details.
*/
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/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;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"uint256","name":"_nReserved","type":"uint256"},{"internalType":"uint256","name":"_maxPerMint","type":"uint256"},{"internalType":"uint256","name":"_royaltyFee","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"bool","name":"_startAtOne","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extensionAddress","type":"address"}],"name":"ExtensionAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extensionAddress","type":"address"}],"name":"ExtensionRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extensionAddress","type":"address"}],"name":"ExtensionURIAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"PROVENANCE_HASH","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SALE_STARTS_AT_INFINITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_extension","type":"address"}],"name":"addExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nTokens","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"uri","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"data","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"extensions","outputs":[{"internalType":"contract INFTExtension","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"extensionsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freeze","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPayoutReceiver","outputs":[{"internalType":"address payable","name":"receiver","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_extension","type":"address"}],"name":"isExtensionAdded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPayoutChangeLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockPayoutChange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxPerMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nTokens","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nTokens","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes32","name":"extraData","type":"bytes32"}],"name":"mintExternal","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payoutReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reserved","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_extension","type":"address"}],"name":"revokeExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleStarted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"}],"name":"setExtensionTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isOpenSeaProxyActive","type":"bool"}],"name":"setIsOpenSeaProxyActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"setPayoutReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"postfix","type":"string"}],"name":"setPostfixURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"provenanceHash","type":"string"}],"name":"setProvenanceHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_royaltyFee","type":"uint256"}],"name":"setRoyaltyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"setRoyaltyReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stopSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTimestamp","type":"uint256"}],"name":"updateStartTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uriExtension","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
600019600b55601280546001600160a01b031916905560138054600163ffff000160a01b03191661010160b01b17905560a06040819052600060808190526200004b91601691620001f6565b506040805160208101918290526000908190526200006c91601791620001f6565b506040805160208101918290526000908190526200008d91601991620001f6565b503480156200009b57600080fd5b50604051620037d7380380620037d7833981016040819052620000be916200037f565b825183908390620000d7906002906020850190620001f6565b508051620000ed906003906020840190620001f6565b50620000f86200017c565b600055505060016008556200010d33620001a4565b600019600b55600f899055600c879055600e869055600d8890556010859055601180546001600160a01b0319163017905560138054821515600160b81b0260ff60b81b1990911617905583516200016c906018906020870190620001f6565b5050505050505050505062000494565b601354600090600160b81b900460ff16620001995760006200019c565b60015b60ff16905090565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620002049062000457565b90600052602060002090601f01602090048101928262000228576000855562000273565b82601f106200024357805160ff191683800117855562000273565b8280016001018555821562000273579182015b828111156200027357825182559160200191906001019062000256565b506200028192915062000285565b5090565b5b8082111562000281576000815560010162000286565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620002c457600080fd5b81516001600160401b0380821115620002e157620002e16200029c565b604051601f8301601f19908116603f011681019082821181831017156200030c576200030c6200029c565b816040528381526020925086838588010111156200032957600080fd5b600091505b838210156200034d57858201830151818301840152908201906200032e565b838211156200035f5760008385830101525b9695505050505050565b805180151581146200037a57600080fd5b919050565b60008060008060008060008060006101208a8c0312156200039f57600080fd5b895160208b015160408c015160608d015160808e015160a08f0151949d50929b50909950975095506001600160401b0380821115620003dd57600080fd5b620003eb8d838e01620002b2565b955060c08c01519150808211156200040257600080fd5b620004108d838e01620002b2565b945060e08c01519150808211156200042757600080fd5b50620004368c828d01620002b2565b925050620004486101008b0162000369565b90509295985092959850929598565b600181811c908216806200046c57607f821691505b602082108114156200048e57634e487b7160e01b600052602260045260246000fd5b50919050565b61333380620004a46000396000f3fe6080604052600436106103a65760003560e01c80638dc251e3116101e7578063c87b56dd1161010d578063e6798baa116100a0578063f0ba84401161006f578063f0ba844014610a4a578063f2fde38b14610a77578063fe60d12c14610a97578063ff1b655614610aad57600080fd5b8063e6798baa146109ea578063e6fd48bc146109ff578063e8a3d48514610a15578063e985e9c514610a2a57600080fd5b8063ddd5e1b2116100dc578063ddd5e1b214610975578063e36b0b3714610995578063e43082f7146109aa578063e67151ae146109ca57600080fd5b8063c87b56dd1461090a578063d5abeb011461092a578063d69b2e4514610940578063db85d59c1461095557600080fd5b8063a0712d6811610185578063a769310a11610154578063a769310a1461089f578063b66a0e5d146108bf578063b88d4fde146108d4578063b8997a97146108f457600080fd5b8063a0712d681461082b578063a22cb4651461083e578063a474935c1461085e578063a4f6628d1461087f57600080fd5b806395d89b41116101c157806395d89b41146107ca5780639eb88b2c146107df5780639fbc8713146107f5578063a035b1fe1461081557600080fd5b80638dc251e31461076a57806391b7f5ed1461078a578063938e3d7b146107aa57600080fd5b80633e4086e5116102cc57806362a5af3b1161026a57806370a082311161023957806370a08231146106f7578063715018a614610717578063894760691461072c5780638da5cb5b1461074c57600080fd5b806362a5af3b1461068d5780636352211e146106a25780636b853314146106c25780636e878ffb146106e257600080fd5b8063507e094f116102a6578063507e094f1461061f57806352ee46961461063557806355f804b3146106555780635c474f9e1461067557600080fd5b80633e4086e5146105cc57806342842e0e146105ec5780634690521b1461060c57600080fd5b8063170ff3e1116103445780632a30e4c2116103135780632a30e4c2146105375780632a55205a1461055757806333eeb147146105965780633ccfd60b146105b757600080fd5b8063170ff3e1146104c257806318160ddd146104e257806320b7b8df146104f757806323b872dd1461051757600080fd5b80630768c618116103805780630768c61814610428578063081812fc1461044a578063095ea7b31461048257806310969523146104a257600080fd5b806301ffc9a7146103b25780630563aae5146103e757806306fdde031461040657600080fd5b366103ad57005b600080fd5b3480156103be57600080fd5b506103d26103cd366004612b4b565b610ac2565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b506015545b6040519081526020016103de565b34801561041257600080fd5b5061041b610b08565b6040516103de9190612bc0565b34801561043457600080fd5b50610448610443366004612bd3565b610b9a565b005b34801561045657600080fd5b5061046a610465366004612c45565b610bde565b6040516001600160a01b0390911681526020016103de565b34801561048e57600080fd5b5061044861049d366004612c73565b610c22565b3480156104ae57600080fd5b506104486104bd366004612d4c565b610cc2565b3480156104ce57600080fd5b506104486104dd366004612d95565b610d03565b3480156104ee57600080fd5b506103f8610e54565b34801561050357600080fd5b5060125461046a906001600160a01b031681565b34801561052357600080fd5b50610448610532366004612db2565b610e6b565b34801561054357600080fd5b50610448610552366004612d95565b610ffc565b34801561056357600080fd5b50610577610572366004612df3565b6110a2565b604080516001600160a01b0390931683526020830191909152016103de565b3480156105a257600080fd5b506013546103d290600160a01b900460ff1681565b3480156105c357600080fd5b506104486110d8565b3480156105d857600080fd5b506104486105e7366004612c45565b611119565b3480156105f857600080fd5b50610448610607366004612db2565b611148565b61044861061a366004612e15565b611163565b34801561062b57600080fd5b506103f8600e5481565b34801561064157600080fd5b5060135461046a906001600160a01b031681565b34801561066157600080fd5b50610448610670366004612bd3565b611212565b34801561068157600080fd5b50600b544210156103d2565b34801561069957600080fd5b50610448611248565b3480156106ae57600080fd5b5061046a6106bd366004612c45565b611287565b3480156106ce57600080fd5b506104486106dd366004612d95565b611292565b3480156106ee57600080fd5b5061046a6113cd565b34801561070357600080fd5b506103f8610712366004612d95565b611405565b34801561072357600080fd5b50610448611454565b34801561073857600080fd5b50610448610747366004612d95565b61148a565b34801561075857600080fd5b506009546001600160a01b031661046a565b34801561077657600080fd5b50610448610785366004612d95565b611550565b34801561079657600080fd5b506104486107a5366004612c45565b61159c565b3480156107b657600080fd5b506104486107c5366004612bd3565b6115cb565b3480156107d657600080fd5b5061041b611601565b3480156107eb57600080fd5b506103f860001981565b34801561080157600080fd5b5060115461046a906001600160a01b031681565b34801561082157600080fd5b506103f8600f5481565b610448610839366004612c45565b611610565b34801561084a57600080fd5b50610448610859366004612e4a565b611766565b34801561086a57600080fd5b506013546103d290600160a81b900460ff1681565b34801561088b57600080fd5b506103d261089a366004612d95565b6117fc565b3480156108ab57600080fd5b506104486108ba366004612d95565b611866565b3480156108cb57600080fd5b506104486119d1565b3480156108e057600080fd5b506104486108ef366004612e83565b611a4f565b34801561090057600080fd5b506103f860105481565b34801561091657600080fd5b5061041b610925366004612c45565b611a99565b34801561093657600080fd5b506103f8600d5481565b34801561094c57600080fd5b50610448611b92565b34801561096157600080fd5b5061046a610970366004612c45565b611bd1565b34801561098157600080fd5b50610448610990366004612f03565b611bfb565b3480156109a157600080fd5b50610448611cd1565b3480156109b657600080fd5b506104486109c5366004612f28565b611d03565b3480156109d657600080fd5b506104486109e5366004612c45565b611d4b565b3480156109f657600080fd5b506103f8611dc8565b348015610a0b57600080fd5b506103f8600b5481565b348015610a2157600080fd5b5061041b611dd2565b348015610a3657600080fd5b506103d2610a45366004612f45565b611dff565b348015610a5657600080fd5b506103f8610a65366004612c45565b60146020526000908152604090205481565b348015610a8357600080fd5b50610448610a92366004612d95565b611ef6565b348015610aa357600080fd5b506103f8600c5481565b348015610ab957600080fd5b5061041b611f91565b60006001600160e01b0319821663152a902d60e11b1480610af357506001600160e01b03198216632675fdd760e21b145b80610b025750610b028261201f565b92915050565b606060028054610b1790612f73565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4390612f73565b8015610b905780601f10610b6557610100808354040283529160200191610b90565b820191906000526020600020905b815481529060010190602001808311610b7357829003601f168201915b5050505050905090565b6009546001600160a01b03163314610bcd5760405162461bcd60e51b8152600401610bc490612fae565b60405180910390fd5b610bd960198383612a28565b505050565b6000610be98261206d565b610c06576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610c2d82611287565b9050336001600160a01b03821614610c6657610c498133611dff565b610c66576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6009546001600160a01b03163314610cec5760405162461bcd60e51b8152600401610bc490612fae565b8051610cff906016906020840190612aac565b5050565b6009546001600160a01b03163314610d2d5760405162461bcd60e51b8152600401610bc490612fae565b6001600160a01b038116301415610d865760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f74206164642073656c6620617320657874656e73696f6e000000006044820152606401610bc4565b610d8f816117fc565b15610ddc5760405162461bcd60e51b815260206004820152601760248201527f457874656e73696f6e20616c72656164792061646465640000000000000000006044820152606401610bc4565b6015805460018101825560009182527f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec4750180546001600160a01b0319166001600160a01b03841690811790915560405190917f99c6112dbaef85e57ac8ca86dd23e3c785162b58a6e810e5d5e7455b568d66b191a250565b6000610e5e6120a8565b6001546000540303905090565b6000610e76826120ce565b9050836001600160a01b0316816001600160a01b031614610ea95760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417610ef657610ed98633611dff565b610ef657604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610f1d57604051633a954ecd60e21b815260040160405180910390fd5b8015610f2857600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040902055600160e11b8316610fb35760018401600081815260046020526040902054610fb1576000548114610fb15760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6009546001600160a01b031633146110265760405162461bcd60e51b8152600401610bc490612fae565b601354600160a81b900460ff16156110805760405162461bcd60e51b815260206004820152601760248201527f5061796f7574206368616e6765206973206c6f636b65640000000000000000006044820152606401610bc4565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b6011546010546001600160a01b0390911690600090612710906110c59085612ff9565b6110cf9190613018565b90509250929050565b6009546001600160a01b031633146111025760405162461bcd60e51b8152600401610bc490612fae565b47600061110d6113cd565b9050610cff8183612144565b6009546001600160a01b031633146111435760405162461bcd60e51b8152600401610bc490612fae565b601055565b610bd983838360405180602001604052806000815250611a4f565b61116c336117fc565b6111d55760405162461bcd60e51b815260206004820152603460248201527f457874656e73696f6e2073686f756c6420626520616464656420746f20636f6e6044820152737472616374206265666f7265206d696e74696e6760601b6064820152608401610bc4565b600260085414156111f85760405162461bcd60e51b8152600401610bc49061303a565b600260085561120883838361225d565b5050600160085550565b6009546001600160a01b0316331461123c5760405162461bcd60e51b8152600401610bc490612fae565b610bd960188383612a28565b6009546001600160a01b031633146112725760405162461bcd60e51b8152600401610bc490612fae565b6013805460ff60a01b1916600160a01b179055565b6000610b02826120ce565b6009546001600160a01b031633146112bc5760405162461bcd60e51b8152600401610bc490612fae565b6001600160a01b0381163014156113155760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f74206164642073656c6620617320657874656e73696f6e000000006044820152606401610bc4565b6001600160a01b038116158061133757506113378163c87b56dd60e01b612337565b6113835760405162461bcd60e51b815260206004820152601960248201527f4e6f7420636f6e666f726d7320746f20657874656e73696f6e000000000000006044820152606401610bc4565b601380546001600160a01b0319166001600160a01b0383169081179091556040517f92597a601f19fe4d50f14ea76d7ba45d21bad7992f7e1709c605642b190de09290600090a250565b6012546000906001600160a01b03166113f557506009546001600160a01b031690565b905090565b506012546001600160a01b031690565b60006001600160a01b03821661142e576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6009546001600160a01b0316331461147e5760405162461bcd60e51b8152600401610bc490612fae565b6114886000612353565b565b6009546001600160a01b031633146114b45760405162461bcd60e51b8152600401610bc490612fae565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b1580156114f657600080fd5b505afa15801561150a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152e9190613071565b9050600061153a6113cd565b9050610bd96001600160a01b03841682846123a5565b6009546001600160a01b0316331461157a5760405162461bcd60e51b8152600401610bc490612fae565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b031633146115c65760405162461bcd60e51b8152600401610bc490612fae565b600f55565b6009546001600160a01b031633146115f55760405162461bcd60e51b8152600401610bc490612fae565b610bd960178383612a28565b606060038054610b1790612f73565b600260085414156116335760405162461bcd60e51b8152600401610bc49061303a565b6002600855600b5442101561167d5760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bc4565b600e548111156116f55760405162461bcd60e51b815260206004820152603d60248201527f596f752063616e6e6f74206d696e74206d6f7265207468616e204d41585f544f60448201527f4b454e535f5045525f4d494e5420746f6b656e73206174206f6e6365210000006064820152608401610bc4565b34600f54826117049190612ff9565b11156117525760405162461bcd60e51b815260206004820152601960248201527f496e636f6e73697374656e7420616d6f756e742073656e7421000000000000006044820152606401610bc4565b61175e8133600061225d565b506001600855565b6001600160a01b0382163314156117905760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000805b60155481101561185d57826001600160a01b0316601582815481106118275761182761308a565b6000918252602090912001546001600160a01b0316141561184b5750600192915050565b80611855816130a0565b915050611800565b50600092915050565b6009546001600160a01b031633146118905760405162461bcd60e51b8152600401610bc490612fae565b60005b6015548110156118ec57816001600160a01b0316601582815481106118ba576118ba61308a565b6000918252602090912001546001600160a01b031614156118da576118ec565b806118e4816130a0565b915050611893565b601580546118fc906001906130bb565b8154811061190c5761190c61308a565b600091825260209091200154601580546001600160a01b0390921691839081106119385761193861308a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506015805480611977576119776130d2565b600082815260208120820160001990810180546001600160a01b03191690559091019091556040516001600160a01b038416917fe056b30f86b962fc88925cb7559e4364707cab11d2c52e090e6c0db62eb9113591a25050565b6009546001600160a01b031633146119fb5760405162461bcd60e51b8152600401610bc490612fae565b601354600160a01b900460ff1615611a495760405162461bcd60e51b815260206004820152601160248201527026b4b73a34b7339034b990333937bd32b760791b6044820152606401610bc4565b42600b55565b611a5a848484610e6b565b6001600160a01b0383163b15611a9357611a76848484846123f7565b611a93576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6013546060906001600160a01b031615611b405760135460405163c87b56dd60e01b8152600481018490526000916001600160a01b03169063c87b56dd9060240160006040518083038186803b158015611af257600080fd5b505afa158015611b06573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611b2e91908101906130e8565b805190915015611b3e5792915050565b505b600060198054611b4f90612f73565b90501115611b8957611b60826124ee565b6019604051602001611b7392919061315f565b6040516020818303038152906040529050919050565b610b02826124ee565b6009546001600160a01b03163314611bbc5760405162461bcd60e51b8152600401610bc490612fae565b6013805460ff60a81b1916600160a81b179055565b60158181548110611be157600080fd5b6000918252602090912001546001600160a01b0316905081565b60026008541415611c1e5760405162461bcd60e51b8152600401610bc49061303a565b60026008556009546001600160a01b03163314611c4d5760405162461bcd60e51b8152600401610bc490612fae565b600c54821115611cab5760405162461bcd60e51b815260206004820152602360248201527f5468617420776f756c642065786365656420746865206d61782072657365727660448201526232b21760e91b6064820152608401610bc4565b81600c54611cb991906130bb565b600c55611cc88282600061225d565b50506001600855565b6009546001600160a01b03163314611cfb5760405162461bcd60e51b8152600401610bc490612fae565b600019600b55565b6009546001600160a01b03163314611d2d5760405162461bcd60e51b8152600401610bc490612fae565b60138054911515600160b01b0260ff60b01b19909216919091179055565b6009546001600160a01b03163314611d755760405162461bcd60e51b8152600401610bc490612fae565b601354600160a01b900460ff1615611dc35760405162461bcd60e51b815260206004820152601160248201527026b4b73a34b7339034b990333937bd32b760791b6044820152606401610bc4565b600b55565b60006113f06120a8565b6060600060178054611de390612f73565b905011611df2576113f0612572565b60178054610b1790612f73565b60135460009073a5409ec958c83c3f309868babaca7c86dcb077c190600160b01b900460ff168015611eb5575060405163c455279160e01b81526001600160a01b038581166004830152808516919083169063c45527919060240160206040518083038186803b158015611e7257600080fd5b505afa158015611e86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eaa9190613210565b6001600160a01b0316145b15611ec4576001915050610b02565b6001600160a01b0380851660009081526007602090815260408083209387168352929052205460ff165b949350505050565b6009546001600160a01b03163314611f205760405162461bcd60e51b8152600401610bc490612fae565b6001600160a01b038116611f855760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bc4565b611f8e81612353565b50565b60168054611f9e90612f73565b80601f0160208091040260200160405190810160405280929190818152602001828054611fca90612f73565b80156120175780601f10611fec57610100808354040283529160200191612017565b820191906000526020600020905b815481529060010190602001808311611ffa57829003601f168201915b505050505081565b60006301ffc9a760e01b6001600160e01b03198316148061205057506380ac58cd60e01b6001600160e01b03198316145b80610b025750506001600160e01b031916635b5e139f60e01b1490565b6000816120786120a8565b11158015612087575060005482105b8015610b02575050600090815260046020526040902054600160e01b161590565b601354600090600160b81b900460ff166120c35760006120c6565b60015b60ff16905090565b600081806120da6120a8565b1161212b5760005481101561212b57600081815260046020526040902054600160e01b8116612129575b80612122575060001901600081815260046020526040902054612104565b9392505050565b505b604051636f96cda160e11b815260040160405180910390fd5b804710156121945760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610bc4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146121e1576040519150601f19603f3d011682016040523d82523d6000602084013e6121e6565b606091505b5050905080610bd95760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610bc4565b600d54600c548461226c612581565b612276919061322d565b612280919061322d565b11156122ce5760405162461bcd60e51b815260206004820152601760248201527f4e6f7420656e6f75676820546f6b656e73206c6566742e0000000000000000006044820152606401610bc4565b60006122d9600a5490565b90506122f5838560405180602001604052806000815250612594565b60005b8481101561233057600061230c828461322d565b60009081526014602052604090208490555080612328816130a0565b9150506122f8565b5050505050565b6000612342836125fa565b80156121225750612122838361262d565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610bd9908490612716565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061242c903390899088908890600401613245565b602060405180830381600087803b15801561244657600080fd5b505af1925050508015612476575060408051601f3d908101601f1916820190925261247391810190613278565b60015b6124d1573d8080156124a4576040519150601f19603f3d011682016040523d82523d6000602084013e6124a9565b606091505b5080516124c9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b60606124f98261206d565b61251657604051630a14c4b560e41b815260040160405180910390fd5b6000612520612572565b90508051600014156125415760405180602001604052806000815250612122565b8061254b846127e8565b60405160200161255c929190613295565b6040516020818303038152906040529392505050565b606060188054610b1790612f73565b600061258b6120a8565b60005403905090565b61259e8383612837565b6001600160a01b0383163b15610bd9576000548281035b6125c860008683806001019450866123f7565b6125e5576040516368d2bf6b60e11b815260040160405180910390fd5b8181106125b557816000541461233057600080fd5b600061260d826301ffc9a760e01b61262d565b8015610b025750612626826001600160e01b031961262d565b1592915050565b604080516001600160e01b0319831660248083019190915282518083039091018152604490910182526020810180516001600160e01b03166301ffc9a760e01b179052905160009190829081906001600160a01b03871690617530906126949086906132c4565b6000604051808303818686fa925050503d80600081146126d0576040519150601f19603f3d011682016040523d82523d6000602084013e6126d5565b606091505b50915091506020815110156126f05760009350505050610b02565b81801561270c57508080602001905181019061270c91906132e0565b9695505050505050565b600061276b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129149092919063ffffffff16565b805190915015610bd9578080602001905181019061278991906132e0565b610bd95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610bc4565b604080516080810191829052607f0190826030600a8206018353600a90045b801561282557600183039250600a81066030018353600a9004612807565b50819003601f19909101908152919050565b6000546001600160a01b03831661286057604051622e076360e81b815260040160405180910390fd5b8161287e5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038316600081815260056020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260046020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082106128c85760005550505050565b6060611eee8484600085856001600160a01b0385163b6129765760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610bc4565b600080866001600160a01b0316858760405161299291906132c4565b60006040518083038185875af1925050503d80600081146129cf576040519150601f19603f3d011682016040523d82523d6000602084013e6129d4565b606091505b50915091506129e48282866129ef565b979650505050505050565b606083156129fe575081612122565b825115612a0e5782518084602001fd5b8160405162461bcd60e51b8152600401610bc49190612bc0565b828054612a3490612f73565b90600052602060002090601f016020900481019282612a565760008555612a9c565b82601f10612a6f5782800160ff19823516178555612a9c565b82800160010185558215612a9c579182015b82811115612a9c578235825591602001919060010190612a81565b50612aa8929150612b20565b5090565b828054612ab890612f73565b90600052602060002090601f016020900481019282612ada5760008555612a9c565b82601f10612af357805160ff1916838001178555612a9c565b82800160010185558215612a9c579182015b82811115612a9c578251825591602001919060010190612b05565b5b80821115612aa85760008155600101612b21565b6001600160e01b031981168114611f8e57600080fd5b600060208284031215612b5d57600080fd5b813561212281612b35565b60005b83811015612b83578181015183820152602001612b6b565b83811115611a935750506000910152565b60008151808452612bac816020860160208601612b68565b601f01601f19169290920160200192915050565b6020815260006121226020830184612b94565b60008060208385031215612be657600080fd5b823567ffffffffffffffff80821115612bfe57600080fd5b818501915085601f830112612c1257600080fd5b813581811115612c2157600080fd5b866020828501011115612c3357600080fd5b60209290920196919550909350505050565b600060208284031215612c5757600080fd5b5035919050565b6001600160a01b0381168114611f8e57600080fd5b60008060408385031215612c8657600080fd5b8235612c9181612c5e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612cde57612cde612c9f565b604052919050565b600067ffffffffffffffff821115612d0057612d00612c9f565b50601f01601f191660200190565b6000612d21612d1c84612ce6565b612cb5565b9050828152838383011115612d3557600080fd5b828260208301376000602084830101529392505050565b600060208284031215612d5e57600080fd5b813567ffffffffffffffff811115612d7557600080fd5b8201601f81018413612d8657600080fd5b611eee84823560208401612d0e565b600060208284031215612da757600080fd5b813561212281612c5e565b600080600060608486031215612dc757600080fd5b8335612dd281612c5e565b92506020840135612de281612c5e565b929592945050506040919091013590565b60008060408385031215612e0657600080fd5b50508035926020909101359150565b600080600060608486031215612e2a57600080fd5b833592506020840135612de281612c5e565b8015158114611f8e57600080fd5b60008060408385031215612e5d57600080fd5b8235612e6881612c5e565b91506020830135612e7881612e3c565b809150509250929050565b60008060008060808587031215612e9957600080fd5b8435612ea481612c5e565b93506020850135612eb481612c5e565b925060408501359150606085013567ffffffffffffffff811115612ed757600080fd5b8501601f81018713612ee857600080fd5b612ef787823560208401612d0e565b91505092959194509250565b60008060408385031215612f1657600080fd5b823591506020830135612e7881612c5e565b600060208284031215612f3a57600080fd5b813561212281612e3c565b60008060408385031215612f5857600080fd5b8235612f6381612c5e565b91506020830135612e7881612c5e565b600181811c90821680612f8757607f821691505b60208210811415612fa857634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561301357613013612fe3565b500290565b60008261303557634e487b7160e01b600052601260045260246000fd5b500490565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006020828403121561308357600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b60006000198214156130b4576130b4612fe3565b5060010190565b6000828210156130cd576130cd612fe3565b500390565b634e487b7160e01b600052603160045260246000fd5b6000602082840312156130fa57600080fd5b815167ffffffffffffffff81111561311157600080fd5b8201601f8101841361312257600080fd5b8051613130612d1c82612ce6565b81815285602083850101111561314557600080fd5b613156826020830160208601612b68565b95945050505050565b6000835160206131728285838901612b68565b845491840191600090600181811c908083168061319057607f831692505b8583108114156131ae57634e487b7160e01b85526022600452602485fd5b8080156131c257600181146131d357613200565b60ff19851688528388019550613200565b60008b81526020902060005b858110156131f85781548a8201529084019088016131df565b505083880195505b50939a9950505050505050505050565b60006020828403121561322257600080fd5b815161212281612c5e565b6000821982111561324057613240612fe3565b500190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061270c90830184612b94565b60006020828403121561328a57600080fd5b815161212281612b35565b600083516132a7818460208801612b68565b8351908301906132bb818360208801612b68565b01949350505050565b600082516132d6818460208701612b68565b9190910192915050565b6000602082840312156132f257600080fd5b815161212281612e3c56fea26469706673582212207f7de207770b9542557c769deff03fbd22a26d941db8901403265aec6ffb13f964736f6c634300080900330000000000000000000000000000000000000000000000000011c37937e08000000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d4e79346b4538503264754e4a57784d38794d6a434745594375523631657263593748376a654a566d536666362f000000000000000000000000000000000000000000000000000000000000000000000000000000000007726174746f776e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035241540000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103a65760003560e01c80638dc251e3116101e7578063c87b56dd1161010d578063e6798baa116100a0578063f0ba84401161006f578063f0ba844014610a4a578063f2fde38b14610a77578063fe60d12c14610a97578063ff1b655614610aad57600080fd5b8063e6798baa146109ea578063e6fd48bc146109ff578063e8a3d48514610a15578063e985e9c514610a2a57600080fd5b8063ddd5e1b2116100dc578063ddd5e1b214610975578063e36b0b3714610995578063e43082f7146109aa578063e67151ae146109ca57600080fd5b8063c87b56dd1461090a578063d5abeb011461092a578063d69b2e4514610940578063db85d59c1461095557600080fd5b8063a0712d6811610185578063a769310a11610154578063a769310a1461089f578063b66a0e5d146108bf578063b88d4fde146108d4578063b8997a97146108f457600080fd5b8063a0712d681461082b578063a22cb4651461083e578063a474935c1461085e578063a4f6628d1461087f57600080fd5b806395d89b41116101c157806395d89b41146107ca5780639eb88b2c146107df5780639fbc8713146107f5578063a035b1fe1461081557600080fd5b80638dc251e31461076a57806391b7f5ed1461078a578063938e3d7b146107aa57600080fd5b80633e4086e5116102cc57806362a5af3b1161026a57806370a082311161023957806370a08231146106f7578063715018a614610717578063894760691461072c5780638da5cb5b1461074c57600080fd5b806362a5af3b1461068d5780636352211e146106a25780636b853314146106c25780636e878ffb146106e257600080fd5b8063507e094f116102a6578063507e094f1461061f57806352ee46961461063557806355f804b3146106555780635c474f9e1461067557600080fd5b80633e4086e5146105cc57806342842e0e146105ec5780634690521b1461060c57600080fd5b8063170ff3e1116103445780632a30e4c2116103135780632a30e4c2146105375780632a55205a1461055757806333eeb147146105965780633ccfd60b146105b757600080fd5b8063170ff3e1146104c257806318160ddd146104e257806320b7b8df146104f757806323b872dd1461051757600080fd5b80630768c618116103805780630768c61814610428578063081812fc1461044a578063095ea7b31461048257806310969523146104a257600080fd5b806301ffc9a7146103b25780630563aae5146103e757806306fdde031461040657600080fd5b366103ad57005b600080fd5b3480156103be57600080fd5b506103d26103cd366004612b4b565b610ac2565b60405190151581526020015b60405180910390f35b3480156103f357600080fd5b506015545b6040519081526020016103de565b34801561041257600080fd5b5061041b610b08565b6040516103de9190612bc0565b34801561043457600080fd5b50610448610443366004612bd3565b610b9a565b005b34801561045657600080fd5b5061046a610465366004612c45565b610bde565b6040516001600160a01b0390911681526020016103de565b34801561048e57600080fd5b5061044861049d366004612c73565b610c22565b3480156104ae57600080fd5b506104486104bd366004612d4c565b610cc2565b3480156104ce57600080fd5b506104486104dd366004612d95565b610d03565b3480156104ee57600080fd5b506103f8610e54565b34801561050357600080fd5b5060125461046a906001600160a01b031681565b34801561052357600080fd5b50610448610532366004612db2565b610e6b565b34801561054357600080fd5b50610448610552366004612d95565b610ffc565b34801561056357600080fd5b50610577610572366004612df3565b6110a2565b604080516001600160a01b0390931683526020830191909152016103de565b3480156105a257600080fd5b506013546103d290600160a01b900460ff1681565b3480156105c357600080fd5b506104486110d8565b3480156105d857600080fd5b506104486105e7366004612c45565b611119565b3480156105f857600080fd5b50610448610607366004612db2565b611148565b61044861061a366004612e15565b611163565b34801561062b57600080fd5b506103f8600e5481565b34801561064157600080fd5b5060135461046a906001600160a01b031681565b34801561066157600080fd5b50610448610670366004612bd3565b611212565b34801561068157600080fd5b50600b544210156103d2565b34801561069957600080fd5b50610448611248565b3480156106ae57600080fd5b5061046a6106bd366004612c45565b611287565b3480156106ce57600080fd5b506104486106dd366004612d95565b611292565b3480156106ee57600080fd5b5061046a6113cd565b34801561070357600080fd5b506103f8610712366004612d95565b611405565b34801561072357600080fd5b50610448611454565b34801561073857600080fd5b50610448610747366004612d95565b61148a565b34801561075857600080fd5b506009546001600160a01b031661046a565b34801561077657600080fd5b50610448610785366004612d95565b611550565b34801561079657600080fd5b506104486107a5366004612c45565b61159c565b3480156107b657600080fd5b506104486107c5366004612bd3565b6115cb565b3480156107d657600080fd5b5061041b611601565b3480156107eb57600080fd5b506103f860001981565b34801561080157600080fd5b5060115461046a906001600160a01b031681565b34801561082157600080fd5b506103f8600f5481565b610448610839366004612c45565b611610565b34801561084a57600080fd5b50610448610859366004612e4a565b611766565b34801561086a57600080fd5b506013546103d290600160a81b900460ff1681565b34801561088b57600080fd5b506103d261089a366004612d95565b6117fc565b3480156108ab57600080fd5b506104486108ba366004612d95565b611866565b3480156108cb57600080fd5b506104486119d1565b3480156108e057600080fd5b506104486108ef366004612e83565b611a4f565b34801561090057600080fd5b506103f860105481565b34801561091657600080fd5b5061041b610925366004612c45565b611a99565b34801561093657600080fd5b506103f8600d5481565b34801561094c57600080fd5b50610448611b92565b34801561096157600080fd5b5061046a610970366004612c45565b611bd1565b34801561098157600080fd5b50610448610990366004612f03565b611bfb565b3480156109a157600080fd5b50610448611cd1565b3480156109b657600080fd5b506104486109c5366004612f28565b611d03565b3480156109d657600080fd5b506104486109e5366004612c45565b611d4b565b3480156109f657600080fd5b506103f8611dc8565b348015610a0b57600080fd5b506103f8600b5481565b348015610a2157600080fd5b5061041b611dd2565b348015610a3657600080fd5b506103d2610a45366004612f45565b611dff565b348015610a5657600080fd5b506103f8610a65366004612c45565b60146020526000908152604090205481565b348015610a8357600080fd5b50610448610a92366004612d95565b611ef6565b348015610aa357600080fd5b506103f8600c5481565b348015610ab957600080fd5b5061041b611f91565b60006001600160e01b0319821663152a902d60e11b1480610af357506001600160e01b03198216632675fdd760e21b145b80610b025750610b028261201f565b92915050565b606060028054610b1790612f73565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4390612f73565b8015610b905780601f10610b6557610100808354040283529160200191610b90565b820191906000526020600020905b815481529060010190602001808311610b7357829003601f168201915b5050505050905090565b6009546001600160a01b03163314610bcd5760405162461bcd60e51b8152600401610bc490612fae565b60405180910390fd5b610bd960198383612a28565b505050565b6000610be98261206d565b610c06576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610c2d82611287565b9050336001600160a01b03821614610c6657610c498133611dff565b610c66576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6009546001600160a01b03163314610cec5760405162461bcd60e51b8152600401610bc490612fae565b8051610cff906016906020840190612aac565b5050565b6009546001600160a01b03163314610d2d5760405162461bcd60e51b8152600401610bc490612fae565b6001600160a01b038116301415610d865760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f74206164642073656c6620617320657874656e73696f6e000000006044820152606401610bc4565b610d8f816117fc565b15610ddc5760405162461bcd60e51b815260206004820152601760248201527f457874656e73696f6e20616c72656164792061646465640000000000000000006044820152606401610bc4565b6015805460018101825560009182527f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec4750180546001600160a01b0319166001600160a01b03841690811790915560405190917f99c6112dbaef85e57ac8ca86dd23e3c785162b58a6e810e5d5e7455b568d66b191a250565b6000610e5e6120a8565b6001546000540303905090565b6000610e76826120ce565b9050836001600160a01b0316816001600160a01b031614610ea95760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417610ef657610ed98633611dff565b610ef657604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610f1d57604051633a954ecd60e21b815260040160405180910390fd5b8015610f2857600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040902055600160e11b8316610fb35760018401600081815260046020526040902054610fb1576000548114610fb15760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6009546001600160a01b031633146110265760405162461bcd60e51b8152600401610bc490612fae565b601354600160a81b900460ff16156110805760405162461bcd60e51b815260206004820152601760248201527f5061796f7574206368616e6765206973206c6f636b65640000000000000000006044820152606401610bc4565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b6011546010546001600160a01b0390911690600090612710906110c59085612ff9565b6110cf9190613018565b90509250929050565b6009546001600160a01b031633146111025760405162461bcd60e51b8152600401610bc490612fae565b47600061110d6113cd565b9050610cff8183612144565b6009546001600160a01b031633146111435760405162461bcd60e51b8152600401610bc490612fae565b601055565b610bd983838360405180602001604052806000815250611a4f565b61116c336117fc565b6111d55760405162461bcd60e51b815260206004820152603460248201527f457874656e73696f6e2073686f756c6420626520616464656420746f20636f6e6044820152737472616374206265666f7265206d696e74696e6760601b6064820152608401610bc4565b600260085414156111f85760405162461bcd60e51b8152600401610bc49061303a565b600260085561120883838361225d565b5050600160085550565b6009546001600160a01b0316331461123c5760405162461bcd60e51b8152600401610bc490612fae565b610bd960188383612a28565b6009546001600160a01b031633146112725760405162461bcd60e51b8152600401610bc490612fae565b6013805460ff60a01b1916600160a01b179055565b6000610b02826120ce565b6009546001600160a01b031633146112bc5760405162461bcd60e51b8152600401610bc490612fae565b6001600160a01b0381163014156113155760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f74206164642073656c6620617320657874656e73696f6e000000006044820152606401610bc4565b6001600160a01b038116158061133757506113378163c87b56dd60e01b612337565b6113835760405162461bcd60e51b815260206004820152601960248201527f4e6f7420636f6e666f726d7320746f20657874656e73696f6e000000000000006044820152606401610bc4565b601380546001600160a01b0319166001600160a01b0383169081179091556040517f92597a601f19fe4d50f14ea76d7ba45d21bad7992f7e1709c605642b190de09290600090a250565b6012546000906001600160a01b03166113f557506009546001600160a01b031690565b905090565b506012546001600160a01b031690565b60006001600160a01b03821661142e576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6009546001600160a01b0316331461147e5760405162461bcd60e51b8152600401610bc490612fae565b6114886000612353565b565b6009546001600160a01b031633146114b45760405162461bcd60e51b8152600401610bc490612fae565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b1580156114f657600080fd5b505afa15801561150a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152e9190613071565b9050600061153a6113cd565b9050610bd96001600160a01b03841682846123a5565b6009546001600160a01b0316331461157a5760405162461bcd60e51b8152600401610bc490612fae565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b031633146115c65760405162461bcd60e51b8152600401610bc490612fae565b600f55565b6009546001600160a01b031633146115f55760405162461bcd60e51b8152600401610bc490612fae565b610bd960178383612a28565b606060038054610b1790612f73565b600260085414156116335760405162461bcd60e51b8152600401610bc49061303a565b6002600855600b5442101561167d5760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bc4565b600e548111156116f55760405162461bcd60e51b815260206004820152603d60248201527f596f752063616e6e6f74206d696e74206d6f7265207468616e204d41585f544f60448201527f4b454e535f5045525f4d494e5420746f6b656e73206174206f6e6365210000006064820152608401610bc4565b34600f54826117049190612ff9565b11156117525760405162461bcd60e51b815260206004820152601960248201527f496e636f6e73697374656e7420616d6f756e742073656e7421000000000000006044820152606401610bc4565b61175e8133600061225d565b506001600855565b6001600160a01b0382163314156117905760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000805b60155481101561185d57826001600160a01b0316601582815481106118275761182761308a565b6000918252602090912001546001600160a01b0316141561184b5750600192915050565b80611855816130a0565b915050611800565b50600092915050565b6009546001600160a01b031633146118905760405162461bcd60e51b8152600401610bc490612fae565b60005b6015548110156118ec57816001600160a01b0316601582815481106118ba576118ba61308a565b6000918252602090912001546001600160a01b031614156118da576118ec565b806118e4816130a0565b915050611893565b601580546118fc906001906130bb565b8154811061190c5761190c61308a565b600091825260209091200154601580546001600160a01b0390921691839081106119385761193861308a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506015805480611977576119776130d2565b600082815260208120820160001990810180546001600160a01b03191690559091019091556040516001600160a01b038416917fe056b30f86b962fc88925cb7559e4364707cab11d2c52e090e6c0db62eb9113591a25050565b6009546001600160a01b031633146119fb5760405162461bcd60e51b8152600401610bc490612fae565b601354600160a01b900460ff1615611a495760405162461bcd60e51b815260206004820152601160248201527026b4b73a34b7339034b990333937bd32b760791b6044820152606401610bc4565b42600b55565b611a5a848484610e6b565b6001600160a01b0383163b15611a9357611a76848484846123f7565b611a93576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6013546060906001600160a01b031615611b405760135460405163c87b56dd60e01b8152600481018490526000916001600160a01b03169063c87b56dd9060240160006040518083038186803b158015611af257600080fd5b505afa158015611b06573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611b2e91908101906130e8565b805190915015611b3e5792915050565b505b600060198054611b4f90612f73565b90501115611b8957611b60826124ee565b6019604051602001611b7392919061315f565b6040516020818303038152906040529050919050565b610b02826124ee565b6009546001600160a01b03163314611bbc5760405162461bcd60e51b8152600401610bc490612fae565b6013805460ff60a81b1916600160a81b179055565b60158181548110611be157600080fd5b6000918252602090912001546001600160a01b0316905081565b60026008541415611c1e5760405162461bcd60e51b8152600401610bc49061303a565b60026008556009546001600160a01b03163314611c4d5760405162461bcd60e51b8152600401610bc490612fae565b600c54821115611cab5760405162461bcd60e51b815260206004820152602360248201527f5468617420776f756c642065786365656420746865206d61782072657365727660448201526232b21760e91b6064820152608401610bc4565b81600c54611cb991906130bb565b600c55611cc88282600061225d565b50506001600855565b6009546001600160a01b03163314611cfb5760405162461bcd60e51b8152600401610bc490612fae565b600019600b55565b6009546001600160a01b03163314611d2d5760405162461bcd60e51b8152600401610bc490612fae565b60138054911515600160b01b0260ff60b01b19909216919091179055565b6009546001600160a01b03163314611d755760405162461bcd60e51b8152600401610bc490612fae565b601354600160a01b900460ff1615611dc35760405162461bcd60e51b815260206004820152601160248201527026b4b73a34b7339034b990333937bd32b760791b6044820152606401610bc4565b600b55565b60006113f06120a8565b6060600060178054611de390612f73565b905011611df2576113f0612572565b60178054610b1790612f73565b60135460009073a5409ec958c83c3f309868babaca7c86dcb077c190600160b01b900460ff168015611eb5575060405163c455279160e01b81526001600160a01b038581166004830152808516919083169063c45527919060240160206040518083038186803b158015611e7257600080fd5b505afa158015611e86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eaa9190613210565b6001600160a01b0316145b15611ec4576001915050610b02565b6001600160a01b0380851660009081526007602090815260408083209387168352929052205460ff165b949350505050565b6009546001600160a01b03163314611f205760405162461bcd60e51b8152600401610bc490612fae565b6001600160a01b038116611f855760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610bc4565b611f8e81612353565b50565b60168054611f9e90612f73565b80601f0160208091040260200160405190810160405280929190818152602001828054611fca90612f73565b80156120175780601f10611fec57610100808354040283529160200191612017565b820191906000526020600020905b815481529060010190602001808311611ffa57829003601f168201915b505050505081565b60006301ffc9a760e01b6001600160e01b03198316148061205057506380ac58cd60e01b6001600160e01b03198316145b80610b025750506001600160e01b031916635b5e139f60e01b1490565b6000816120786120a8565b11158015612087575060005482105b8015610b02575050600090815260046020526040902054600160e01b161590565b601354600090600160b81b900460ff166120c35760006120c6565b60015b60ff16905090565b600081806120da6120a8565b1161212b5760005481101561212b57600081815260046020526040902054600160e01b8116612129575b80612122575060001901600081815260046020526040902054612104565b9392505050565b505b604051636f96cda160e11b815260040160405180910390fd5b804710156121945760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610bc4565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146121e1576040519150601f19603f3d011682016040523d82523d6000602084013e6121e6565b606091505b5050905080610bd95760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610bc4565b600d54600c548461226c612581565b612276919061322d565b612280919061322d565b11156122ce5760405162461bcd60e51b815260206004820152601760248201527f4e6f7420656e6f75676820546f6b656e73206c6566742e0000000000000000006044820152606401610bc4565b60006122d9600a5490565b90506122f5838560405180602001604052806000815250612594565b60005b8481101561233057600061230c828461322d565b60009081526014602052604090208490555080612328816130a0565b9150506122f8565b5050505050565b6000612342836125fa565b80156121225750612122838361262d565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610bd9908490612716565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061242c903390899088908890600401613245565b602060405180830381600087803b15801561244657600080fd5b505af1925050508015612476575060408051601f3d908101601f1916820190925261247391810190613278565b60015b6124d1573d8080156124a4576040519150601f19603f3d011682016040523d82523d6000602084013e6124a9565b606091505b5080516124c9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b60606124f98261206d565b61251657604051630a14c4b560e41b815260040160405180910390fd5b6000612520612572565b90508051600014156125415760405180602001604052806000815250612122565b8061254b846127e8565b60405160200161255c929190613295565b6040516020818303038152906040529392505050565b606060188054610b1790612f73565b600061258b6120a8565b60005403905090565b61259e8383612837565b6001600160a01b0383163b15610bd9576000548281035b6125c860008683806001019450866123f7565b6125e5576040516368d2bf6b60e11b815260040160405180910390fd5b8181106125b557816000541461233057600080fd5b600061260d826301ffc9a760e01b61262d565b8015610b025750612626826001600160e01b031961262d565b1592915050565b604080516001600160e01b0319831660248083019190915282518083039091018152604490910182526020810180516001600160e01b03166301ffc9a760e01b179052905160009190829081906001600160a01b03871690617530906126949086906132c4565b6000604051808303818686fa925050503d80600081146126d0576040519150601f19603f3d011682016040523d82523d6000602084013e6126d5565b606091505b50915091506020815110156126f05760009350505050610b02565b81801561270c57508080602001905181019061270c91906132e0565b9695505050505050565b600061276b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129149092919063ffffffff16565b805190915015610bd9578080602001905181019061278991906132e0565b610bd95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610bc4565b604080516080810191829052607f0190826030600a8206018353600a90045b801561282557600183039250600a81066030018353600a9004612807565b50819003601f19909101908152919050565b6000546001600160a01b03831661286057604051622e076360e81b815260040160405180910390fd5b8161287e5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038316600081815260056020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260046020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082106128c85760005550505050565b6060611eee8484600085856001600160a01b0385163b6129765760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610bc4565b600080866001600160a01b0316858760405161299291906132c4565b60006040518083038185875af1925050503d80600081146129cf576040519150601f19603f3d011682016040523d82523d6000602084013e6129d4565b606091505b50915091506129e48282866129ef565b979650505050505050565b606083156129fe575081612122565b825115612a0e5782518084602001fd5b8160405162461bcd60e51b8152600401610bc49190612bc0565b828054612a3490612f73565b90600052602060002090601f016020900481019282612a565760008555612a9c565b82601f10612a6f5782800160ff19823516178555612a9c565b82800160010185558215612a9c579182015b82811115612a9c578235825591602001919060010190612a81565b50612aa8929150612b20565b5090565b828054612ab890612f73565b90600052602060002090601f016020900481019282612ada5760008555612a9c565b82601f10612af357805160ff1916838001178555612a9c565b82800160010185558215612a9c579182015b82811115612a9c578251825591602001919060010190612b05565b5b80821115612aa85760008155600101612b21565b6001600160e01b031981168114611f8e57600080fd5b600060208284031215612b5d57600080fd5b813561212281612b35565b60005b83811015612b83578181015183820152602001612b6b565b83811115611a935750506000910152565b60008151808452612bac816020860160208601612b68565b601f01601f19169290920160200192915050565b6020815260006121226020830184612b94565b60008060208385031215612be657600080fd5b823567ffffffffffffffff80821115612bfe57600080fd5b818501915085601f830112612c1257600080fd5b813581811115612c2157600080fd5b866020828501011115612c3357600080fd5b60209290920196919550909350505050565b600060208284031215612c5757600080fd5b5035919050565b6001600160a01b0381168114611f8e57600080fd5b60008060408385031215612c8657600080fd5b8235612c9181612c5e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612cde57612cde612c9f565b604052919050565b600067ffffffffffffffff821115612d0057612d00612c9f565b50601f01601f191660200190565b6000612d21612d1c84612ce6565b612cb5565b9050828152838383011115612d3557600080fd5b828260208301376000602084830101529392505050565b600060208284031215612d5e57600080fd5b813567ffffffffffffffff811115612d7557600080fd5b8201601f81018413612d8657600080fd5b611eee84823560208401612d0e565b600060208284031215612da757600080fd5b813561212281612c5e565b600080600060608486031215612dc757600080fd5b8335612dd281612c5e565b92506020840135612de281612c5e565b929592945050506040919091013590565b60008060408385031215612e0657600080fd5b50508035926020909101359150565b600080600060608486031215612e2a57600080fd5b833592506020840135612de281612c5e565b8015158114611f8e57600080fd5b60008060408385031215612e5d57600080fd5b8235612e6881612c5e565b91506020830135612e7881612e3c565b809150509250929050565b60008060008060808587031215612e9957600080fd5b8435612ea481612c5e565b93506020850135612eb481612c5e565b925060408501359150606085013567ffffffffffffffff811115612ed757600080fd5b8501601f81018713612ee857600080fd5b612ef787823560208401612d0e565b91505092959194509250565b60008060408385031215612f1657600080fd5b823591506020830135612e7881612c5e565b600060208284031215612f3a57600080fd5b813561212281612e3c565b60008060408385031215612f5857600080fd5b8235612f6381612c5e565b91506020830135612e7881612c5e565b600181811c90821680612f8757607f821691505b60208210811415612fa857634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561301357613013612fe3565b500290565b60008261303557634e487b7160e01b600052601260045260246000fd5b500490565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006020828403121561308357600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b60006000198214156130b4576130b4612fe3565b5060010190565b6000828210156130cd576130cd612fe3565b500390565b634e487b7160e01b600052603160045260246000fd5b6000602082840312156130fa57600080fd5b815167ffffffffffffffff81111561311157600080fd5b8201601f8101841361312257600080fd5b8051613130612d1c82612ce6565b81815285602083850101111561314557600080fd5b613156826020830160208601612b68565b95945050505050565b6000835160206131728285838901612b68565b845491840191600090600181811c908083168061319057607f831692505b8583108114156131ae57634e487b7160e01b85526022600452602485fd5b8080156131c257600181146131d357613200565b60ff19851688528388019550613200565b60008b81526020902060005b858110156131f85781548a8201529084019088016131df565b505083880195505b50939a9950505050505050505050565b60006020828403121561322257600080fd5b815161212281612c5e565b6000821982111561324057613240612fe3565b500190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061270c90830184612b94565b60006020828403121561328a57600080fd5b815161212281612b35565b600083516132a7818460208801612b68565b8351908301906132bb818360208801612b68565b01949350505050565b600082516132d6818460208701612b68565b9190910192915050565b6000602082840312156132f257600080fd5b815161212281612e3c56fea26469706673582212207f7de207770b9542557c769deff03fbd22a26d941db8901403265aec6ffb13f964736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000011c37937e08000000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d4e79346b4538503264754e4a57784d38794d6a434745594375523631657263593748376a654a566d536666362f000000000000000000000000000000000000000000000000000000000000000000000000000000000007726174746f776e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035241540000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _price (uint256): 5000000000000000
Arg [1] : _maxSupply (uint256): 10000
Arg [2] : _nReserved (uint256): 500
Arg [3] : _maxPerMint (uint256): 20
Arg [4] : _royaltyFee (uint256): 0
Arg [5] : _uri (string): ipfs://QmNy4kE8P2duNJWxM8yMjCGEYCuR61ercY7H7jeJVmSff6/
Arg [6] : _name (string): rattown
Arg [7] : _symbol (string): RAT
Arg [8] : _startAtOne (bool): False
-----Encoded View---------------
16 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000011c37937e08000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000014
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [7] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [10] : 697066733a2f2f516d4e79346b4538503264754e4a57784d38794d6a43474559
Arg [11] : 4375523631657263593748376a654a566d536666362f00000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [13] : 726174746f776e00000000000000000000000000000000000000000000000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [15] : 5241540000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.