Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 1,050 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Base Token U... | 24422339 | 13 days ago | IN | 0 ETH | 0.00000201 | ||||
| Set Base Token U... | 24422312 | 13 days ago | IN | 0 ETH | 0.00000265 | ||||
| Safe Transfer Fr... | 24248810 | 37 days ago | IN | 0 ETH | 0.00020746 | ||||
| Set Approval For... | 24175622 | 47 days ago | IN | 0 ETH | 0.0000087 | ||||
| Set Approval For... | 24070362 | 62 days ago | IN | 0 ETH | 0.00013305 | ||||
| Safe Transfer Fr... | 24042887 | 66 days ago | IN | 0 ETH | 0.00018453 | ||||
| Safe Transfer Fr... | 23871802 | 90 days ago | IN | 0 ETH | 0.00000426 | ||||
| Safe Transfer Fr... | 23871798 | 90 days ago | IN | 0 ETH | 0.00000428 | ||||
| Set Approval For... | 23788774 | 101 days ago | IN | 0 ETH | 0.00007717 | ||||
| Set Approval For... | 23674178 | 117 days ago | IN | 0 ETH | 0.00013724 | ||||
| Set Approval For... | 23505159 | 141 days ago | IN | 0 ETH | 0.00001596 | ||||
| Set Approval For... | 23318457 | 167 days ago | IN | 0 ETH | 0.00010955 | ||||
| Set Approval For... | 23293381 | 171 days ago | IN | 0 ETH | 0.00000993 | ||||
| Safe Transfer Fr... | 23259942 | 175 days ago | IN | 0 ETH | 0.00002214 | ||||
| Set Approval For... | 23246859 | 177 days ago | IN | 0 ETH | 0.00011317 | ||||
| Set Approval For... | 23233853 | 179 days ago | IN | 0 ETH | 0.0001115 | ||||
| Set Approval For... | 23200710 | 184 days ago | IN | 0 ETH | 0.00005253 | ||||
| Set Approval For... | 23125830 | 194 days ago | IN | 0 ETH | 0.00027466 | ||||
| Set Approval For... | 23119689 | 195 days ago | IN | 0 ETH | 0.00020074 | ||||
| Set Approval For... | 23118770 | 195 days ago | IN | 0 ETH | 0.0002108 | ||||
| Set Approval For... | 23113101 | 196 days ago | IN | 0 ETH | 0.00002237 | ||||
| Set Approval For... | 23111921 | 196 days ago | IN | 0 ETH | 0.00017972 | ||||
| Safe Transfer Fr... | 23107473 | 197 days ago | IN | 0 ETH | 0.000235 | ||||
| Safe Transfer Fr... | 23101007 | 197 days ago | IN | 0 ETH | 0.00020114 | ||||
| Set Base Token U... | 23090047 | 199 days ago | IN | 0 ETH | 0.00018384 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 18114516 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114516 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114515 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114515 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114514 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114514 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114514 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114514 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114514 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114514 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114514 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114514 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114513 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114513 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114513 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114512 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114512 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114512 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114512 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114512 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114512 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114512 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114511 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114510 | 895 days ago | 0.15 ETH | ||||
| Transfer | 18114510 | 895 days ago | 0.15 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
GmStudioADaydreamForLibby
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) 2022 gmDAO
pragma solidity >=0.8.0 <0.9.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@divergencetech/ethier/contracts/erc721/ERC721ACommon.sol";
import "@divergencetech/ethier/contracts/crypto/SignatureChecker.sol";
import "@divergencetech/ethier-0-39/contracts/factories/PaymentSplitterDeployer.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "../../utils/ERC2981SinglePercentual.sol";
import "../../utils/IDelegationRegistry.sol";
// __ __ __
// | \ | \ \
// ______ ______ ____ _______ _| ▓▓_ __ __ ____| ▓▓\▓▓ ______
// / \| \ \ / \ ▓▓ \ | \ | \/ ▓▓ \/ \
// | ▓▓▓▓▓▓\ ▓▓▓▓▓▓\▓▓▓▓\ | ▓▓▓▓▓▓▓\▓▓▓▓▓▓ | ▓▓ | ▓▓ ▓▓▓▓▓▓▓ ▓▓ ▓▓▓▓▓▓\
// | ▓▓ | ▓▓ ▓▓ | ▓▓ | ▓▓ \▓▓ \ | ▓▓ __| ▓▓ | ▓▓ ▓▓ | ▓▓ ▓▓ ▓▓ | ▓▓
// | ▓▓__| ▓▓ ▓▓ | ▓▓ | ▓▓__ _\▓▓▓▓▓▓\ | ▓▓| \ ▓▓__/ ▓▓ ▓▓__| ▓▓ ▓▓ ▓▓__/ ▓▓
// \▓▓ ▓▓ ▓▓ | ▓▓ | ▓▓ \ | ▓▓ \▓▓ ▓▓\▓▓ ▓▓\▓▓ ▓▓ ▓▓\▓▓ ▓▓
// _\▓▓▓▓▓▓▓\▓▓ \▓▓ \▓▓\▓▓ \▓▓▓▓▓▓▓ \▓▓▓▓ \▓▓▓▓▓▓ \▓▓▓▓▓▓▓\▓▓ \▓▓▓▓▓▓
// | \__| ▓▓
// \▓▓ ▓▓
// \▓▓▓▓▓▓
//
contract GmStudioADaydreamForLibby is
ERC721ACommon,
ReentrancyGuard,
DefaultOperatorFilterer,
ERC2981SinglePercentual
{
using EnumerableSet for EnumerableSet.AddressSet;
using SignatureChecker for EnumerableSet.AddressSet;
using Address for address payable;
IDelegationRegistry public delegateCash =
IDelegationRegistry(0x00000000000076A84feF008CDAbe6409d2FE638B);
IERC721 public gmToken;
/// @notice Price for minting
uint256 public constant MINT_PRICE = 0.15 ether;
/// @notice Splits payments between the Studio and the artist.
address payable public immutable paymentSplitter;
/// @notice Splits payments between the Studio and the artist.
address payable public immutable paymentSplitterRoyalties;
/// @notice Total maximum amount of tokens
uint32 public constant MAX_NUM_TOKENS = 548;
/// @notice Number of mints through the early access minting interface.
uint32 internal constant NUM_EARLY_ACCESS_MINTS = 522;
/// @notice Number of mints for reserved the studio/artist.
uint32 internal constant NUM_RESERVED_MINTS = 26;
/// @notice gmDAO special tokens starts at 870
uint32 internal constant GM_DAO_SPECIAL_TOKENS_START = 870;
/// @notice enables early access minting for all gmToken holders
bool internal constant GM_EARLY_ACCESS_ENABLED = true;
/// @notice Locks the mintReserve function
bool internal reserveMinted;
/// @notice Timestamps to enables/disables minting interfaces
/// @dev The following order is assumed
/// signedMintOpeningTimestamp < publicMintOpeningTimestamp < mintClosingTimestamp
struct MintConfig {
uint64 signedMintOpeningTimestamp;
uint64 publicMintOpeningTimestamp;
uint64 mintClosingTimestamp;
}
/// @notice The minting configuration
MintConfig public mintConfig;
/// @notice Stores number of tokens that have been prepaid
/// @dev Used in `prePay` and `mintPrepaid`
uint256 public numPrepaidUnminted;
/// @notice Stores if a gmDAO token already has a prepay reservation
/// @dev Used in `prePay`
mapping(uint256 => bool) public hasPrepaid;
/// @notice Stores the number of tokens an address has in prepay reserve
/// @dev Used in `prePay` and `mintPrepaid`
mapping(address => uint256) public prepaidTokensUnminted;
/// @notice Stores the number of tokens minted from a signature during the
/// early access stage.
/// @dev Used in `mintEarlyAccess`
mapping(bytes32 => uint256) public numEarlyAccessMintsFrom;
/// @notice Stores the number of tokens minted from a signature during the
/// public minting stage.
/// @dev Used in `mintPublic`
mapping(bytes32 => uint256) private _numPublicMintsFrom;
/// @notice Signature signers for the early access stage.
/// @dev Removing signers invalidates the corresponding signatures.
EnumerableSet.AddressSet private _signersEarlyAccess;
/// @notice Signature signers for the early access stage.
/// @dev Removing signers invalidates the corresponding signatures.
EnumerableSet.AddressSet private _signersPublic;
/// @notice tokenURI() base path.
/// @dev Without trailing slash
string internal _baseTokenURI;
constructor(
address newOwner,
address signerEarlyAccess,
address signerPublic,
string memory baseTokenURI,
MintConfig memory config,
address[] memory payees,
uint256[] memory shares,
uint256[] memory sharesRoyalties,
IERC721 _gmToken
) ERC721ACommon("A Daydream For Libby by genlight", "ADFL") {
_signersEarlyAccess.add(signerEarlyAccess);
_signersPublic.add(signerPublic);
_baseTokenURI = baseTokenURI;
mintConfig = config;
gmToken = _gmToken;
paymentSplitter = payable(
PaymentSplitterDeployer.instance().deploy(payees, shares)
);
paymentSplitterRoyalties = payable(
PaymentSplitterDeployer.instance().deploy(payees, sharesRoyalties)
);
_setRoyaltyPercentage(750);
_setRoyaltyReceiver(paymentSplitterRoyalties);
transferOwnership(newOwner);
}
// -------------------------------------------------------------------------
//
// Minting
//
// -------------------------------------------------------------------------
/// @notice Toggle minting relevant flags.
function setMintConfig(MintConfig calldata config) external onlyOwner {
mintConfig = config;
}
/* solhint-disable not-rely-on-time */
/// @dev Reverts if we are past the start of the early access minting window.
modifier onlyBeforeEarlyAccessMintingPeriod() {
if (
// solhint-disable-next-line not-rely-on-time
block.timestamp >= mintConfig.signedMintOpeningTimestamp
) revert PrepaymentDisabled();
_;
}
/* solhint-disable not-rely-on-time */
/// @dev Reverts if we are NOT past the start of the early access minting window.
modifier onlyAfterEarlyAccessMintingPeriodStarts() {
if (
// solhint-disable-next-line not-rely-on-time
block.timestamp < mintConfig.signedMintOpeningTimestamp
) revert PrepaidMintDisabled();
_;
}
/* solhint-disable not-rely-on-time */
/// @dev Reverts if we are not in the early access minting window or the if
/// `mintConfig` has not been set yet.
modifier onlyDuringEarlyAccessMintingPeriod() {
if (
// solhint-disable-next-line not-rely-on-time
block.timestamp < mintConfig.signedMintOpeningTimestamp ||
block.timestamp > mintConfig.publicMintOpeningTimestamp
) revert MintDisabled();
_;
}
/// @dev Reverts if we are not in the public minting window or the if
/// `mintConfig` has not been set yet.
modifier onlyDuringPublicMintingPeriod() {
if (
block.timestamp < mintConfig.publicMintOpeningTimestamp ||
block.timestamp > mintConfig.mintClosingTimestamp
) revert MintDisabled();
_;
}
/* solhint-enable not-rely-on-time */
/// @dev Reverts if called by a contract.
modifier onlyEOA() {
/* solhint-disable-next-line avoid-tx-origin */
if (tx.origin != msg.sender) {
revert OnlyEOA();
}
_;
}
function hasValidGMTokenOwnership(address collector, uint256 tokenId)
internal
view
returns (bool)
{
address tokenOwner = gmToken.ownerOf(tokenId);
if (tokenOwner == collector) {
return true;
}
// This cascades down to check delegations at the
// contract and wallet level too.
return
delegateCash.checkDelegateForToken(
collector,
tokenOwner,
address(gmToken),
tokenId
);
}
/// @notice Mints tokens to a given address using a signed message.
/// @dev The minter might be different than the receiver.
/// @param to Token receiver
/// @param num Number of tokens to be minted.
/// @param numMax Max number of tokens that can be minted to the receiver.
/// @param nonce additional signature salt.
/// @param signature to prove that the receiver is allowed to get mints.
/// @dev The signed messages is generated by concatenating
/// `address(this) || to || numMax || nonce`.
function _mintSigned(
address to,
uint16 num,
uint16 numMax,
uint128 nonce,
bytes calldata signature,
EnumerableSet.AddressSet storage signers,
mapping(bytes32 => uint256) storage numMintedFrom
) internal {
// General checks
if (num * MINT_PRICE != msg.value) revert InvalidPayment();
// Signature related checks
bytes32 message = ECDSA.toEthSignedMessageHash(
abi.encodePacked(address(this), to, numMax, nonce)
);
if (num + numMintedFrom[message] > numMax)
revert TooManyMintsRequested();
signers.requireValidSignature(message, signature);
numMintedFrom[message] += num;
_processPayment();
_processMint(to, num);
}
/// @notice allows to get the price a gmDAO token holder would have to pay
/// @param tokenIds the ids the user holds
/// @return the price the user would have to pay
function getPrepayPrice(uint256[] calldata tokenIds)
external
view
returns (uint256)
{
uint256 num = tokenIds.length;
uint256 requiredPayment = num * MINT_PRICE;
uint256 tokenId;
for (uint256 i; i < num; i++) {
tokenId = tokenIds[i];
if (hasPrepaid[tokenId]) {
revert TokenAlreadyPrepaid();
}
//Special Tokens (IDs 870+) are exempt from payment.
if (tokenId >= GM_DAO_SPECIAL_TOKENS_START) {
requiredPayment -= MINT_PRICE;
}
}
return requiredPayment;
}
/// @notice allows gmDAO holders to prepay in order to reserve tokens
/// @dev The minter might be different than the token owner.
/// @param tokenIds A list of gmDAO tokens that are to be prepaid
function prePay(uint256[] calldata tokenIds)
external
payable
onlyBeforeEarlyAccessMintingPeriod
{
uint256 num = tokenIds.length;
uint256 requiredPayment = num * MINT_PRICE;
// availability check
if (num > availablePrepaidSpots()) {
revert InsufficientTokensRemanining();
}
uint256 tokenId;
for (uint256 i; i < num; i++) {
tokenId = tokenIds[i];
if (!hasValidGMTokenOwnership(msg.sender, tokenId)) {
revert NotAuthorized();
}
if (hasPrepaid[tokenId]) {
revert TokenAlreadyPrepaid();
}
hasPrepaid[tokenId] = true;
//Special Tokens (IDs 870+) are exempt from payment.
if (tokenId >= GM_DAO_SPECIAL_TOKENS_START) {
requiredPayment -= MINT_PRICE;
}
}
if (requiredPayment != msg.value) {
revert InvalidPayment();
}
//Increase the number of prepaid tokens mintable by the msg.sender
prepaidTokensUnminted[msg.sender] += num;
//Increase the number of prepaid tokens that are unminted
numPrepaidUnminted += num;
_processPayment();
}
/// @notice
/// @dev The minter might be different than the token owner.
/// @param to The recipient address of the mints prepaid by the msg.sender
function mintPrepaid(address to, uint256 num)
external
onlyAfterEarlyAccessMintingPeriodStarts
{
if (num > prepaidTokensUnminted[msg.sender]) {
revert InsufficientTokensRemanining();
}
numPrepaidUnminted -= num;
prepaidTokensUnminted[msg.sender] -= num;
_processMint(to, num);
}
/// @notice Mints tokens to a given address using a signed message during
/// the early access stage.
/// @dev The minter might be different than the receiver.
/// @param to Token receiver
/// @param num Number of tokens to be minted.
/// @param numMax Max number of tokens that can be minted to the receiver.
/// @param nonce additional signature salt.
/// @param signature to prove that the receiver is allowed to get mints.
function mintEarlyAccess(
address to,
uint16 num,
uint16 numMax,
uint128 nonce,
bytes calldata signature
)
external
payable
onlyDuringEarlyAccessMintingPeriod // nonReentrant
{
if (num > _numEarlyAccessMintsRemaining())
revert InsufficientTokensRemanining();
_mintSigned(
to,
num,
numMax,
nonce,
signature,
_signersEarlyAccess,
numEarlyAccessMintsFrom
);
}
/// @notice Computes the number of remaining early access mints.
/// @dev This takes into account whether or not the reserve was alredy minted.
function _numEarlyAccessMintsRemaining() internal view returns (uint256) {
uint256 maxMints = reserveMinted
? NUM_EARLY_ACCESS_MINTS + NUM_RESERVED_MINTS
: NUM_EARLY_ACCESS_MINTS;
return maxMints - totalSupply() - numPrepaidUnminted;
}
/// @notice Computes the number of remaining prepaid spots
/// @return the amount of tokens that can still be prepaid for
function availablePrepaidSpots() public view returns (uint256) {
return MAX_NUM_TOKENS - NUM_RESERVED_MINTS - numPrepaidUnminted;
}
/// @notice Mints tokens for the sender using a signed message during
/// the public minting stage.
/// @param num Number of tokens to be minted.
/// @param numMax Max number of tokens that can be minted.
/// @param nonce additional signature salt.
/// @param signature to prove that the receiver is allowed to get mints.
function mintPublic(
uint16 num,
uint16 numMax,
uint128 nonce,
bytes calldata signature
) external payable onlyDuringPublicMintingPeriod onlyEOA {
_mintSigned(
msg.sender,
num,
numMax,
nonce,
signature,
_signersPublic,
_numPublicMintsFrom
);
}
/// @notice Receiver of reserve mints.
/// @dev `to` corresponds to the address of the receiver and `num` to the
/// number of tokens to be minted.
struct ReserveReceiver {
address to;
uint32 num;
}
/// @notice Mints the initial token reserve.
/// @param receivers Array of token receivers
/// @dev The minter might be different than the receiver.
/// @dev Reverts if the number of minted tokens does not equal
/// NUM_RESERVED_MINTS
function mintReserve(ReserveReceiver[] calldata receivers)
external
onlyOwner
{
if (reserveMinted) revert MintDisabled();
reserveMinted = true;
uint256 numReceivers = receivers.length;
uint256 minted = 0;
for (uint256 idx = 0; idx < numReceivers; ++idx) {
minted += receivers[idx].num;
_processMint(receivers[idx].to, receivers[idx].num);
}
if (minted != NUM_RESERVED_MINTS) revert WrongNumberOfReserveMints();
}
/// @notice allows gmTokens holders to mint during the early access phase
/// @param tokenId the gmToken id
function mintEarlyAccessWithGMToken(uint256 tokenId)
external
payable
onlyDuringEarlyAccessMintingPeriod // nonReentrant
{
if (!GM_EARLY_ACCESS_ENABLED) {
revert NotAuthorized();
}
if (_numEarlyAccessMintsRemaining() == 0) {
revert InsufficientTokensRemanining();
}
if (!hasValidGMTokenOwnership(msg.sender, tokenId)) {
revert NotAuthorized();
}
if (MINT_PRICE != msg.value) {
revert InvalidPayment();
}
_processPayment();
_processMint(msg.sender, 1);
}
/// @notice Mints new tokens for the recipient.
function _processMint(address to, uint256 num) internal {
if (_totalMinted() + numPrepaidUnminted + num > MAX_NUM_TOKENS) {
revert InsufficientTokensRemanining();
}
_mint(to, num);
}
/// @notice Computes a pseudorandom seed for a mint batch.
/// @dev Even though this process can be gamed in principle, it is extremly
/// difficult to do so in practise. Therefore we can still rely on this to
/// derive fair seeds.
function _computeBatchSeed(address to) private view returns (uint24) {
return
uint24(
bytes3(
keccak256(
abi.encodePacked(
block.timestamp,
block.difficulty,
blockhash(block.number - 1),
to
)
)
)
);
}
/// @dev Sets the extra data field during token transfers
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual override returns (uint24) {
// if minting, compute a batch seed
if (from == address(0)) {
return _computeBatchSeed(to);
}
// else return the current value
return previousExtraData;
}
// -------------------------------------------------------------------------
//
// Signature validataion
//
// -------------------------------------------------------------------------
/// @notice The different minting stages
enum MintingStage {
EarlyAccess,
Public
}
/// @notice Helper function the retrieves the correct set of signers for
/// a given minting stage.
function _getSigners(MintingStage stage)
internal
view
returns (EnumerableSet.AddressSet storage)
{
if (stage == MintingStage.EarlyAccess) return _signersEarlyAccess;
if (stage == MintingStage.Public) return _signersPublic;
revert WrongMintingStage();
}
/// @notice Removes and adds addresses to the set of allowed signers.
/// @dev Removal is performed before addition.
function changeSigners(
MintingStage stage,
address[] calldata delSigners,
address[] calldata addSigners
) external onlyOwner {
EnumerableSet.AddressSet storage _signers = _getSigners(stage);
for (uint256 idx; idx < delSigners.length; ++idx) {
_signers.remove(delSigners[idx]);
}
for (uint256 idx; idx < addSigners.length; ++idx) {
_signers.add(addSigners[idx]);
}
}
/// @notice Returns the addresses that are used for signature verification
/// for a given minting stage.
function getSigners(MintingStage stage)
external
view
returns (address[] memory signers)
{
EnumerableSet.AddressSet storage _signers = _getSigners(stage);
uint256 len = _signers.length();
signers = new address[](len);
for (uint256 idx = 0; idx < len; ++idx) {
signers[idx] = _signers.at(idx);
}
}
// -------------------------------------------------------------------------
//
// Payment
//
// -------------------------------------------------------------------------
/// @notice Processes an incoming payment and sends it to the payment
/// splitter.
function _processPayment() internal {
paymentSplitter.sendValue(msg.value);
}
// -------------------------------------------------------------------------
//
// Metadata
//
// -------------------------------------------------------------------------
/// @notice Change tokenURI() base path.
/// @param uri The new base path (must not contain trailing slash)
function setBaseTokenURI(string calldata uri) external onlyOwner {
_baseTokenURI = uri;
}
/// @notice Returns the URI for token metadata.
function tokenURI(uint256 tokenId)
public
view
override
tokenExists(tokenId)
returns (string memory)
{
return
string(
abi.encodePacked(
_baseTokenURI,
"/",
Strings.toString(tokenId),
".json"
)
);
}
/// @notice Returns the seed of a token.
/// @dev The seed is computed from the seed of the batch in which the given
/// token was minted.
function tokenSeed(uint256 tokenId)
public
view
tokenExists(tokenId)
returns (bytes32)
{
uint24 batchSeed = _ownershipOf(tokenId).extraData;
return keccak256(abi.encodePacked(address(this), batchSeed, tokenId));
}
// -------------------------------------------------------------------------
//
// Owner
//
// -------------------------------------------------------------------------
/// @notice Toggle minting relevant flags.
function setDelegationRegistry(address newDelegationRegistry)
external
onlyOwner
{
delegateCash = IDelegationRegistry(newDelegationRegistry);
}
// -------------------------------------------------------------------------
//
// Operator filtering
//
// -------------------------------------------------------------------------
function setApprovalForAll(address operator, bool approved)
public
override
onlyAllowedOperatorApproval(operator)
{
super.setApprovalForAll(operator, approved);
}
function approve(address operator, uint256 tokenId)
public
override
onlyAllowedOperatorApproval(operator)
{
super.approve(operator, tokenId);
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public override onlyAllowedOperator(from) {
super.transferFrom(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public override onlyAllowedOperator(from) {
super.safeTransferFrom(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public override onlyAllowedOperator(from) {
super.safeTransferFrom(from, to, tokenId, data);
}
// -------------------------------------------------------------------------
//
// Internals
//
// -------------------------------------------------------------------------
/// @dev See {IERC165-supportsInterface}.
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721ACommon, ERC2981)
returns (bool)
{
return
ERC721ACommon.supportsInterface(interfaceId) ||
ERC2981.supportsInterface(interfaceId);
}
// -------------------------------------------------------------------------
//
// Errors
//
// -------------------------------------------------------------------------
error MintDisabled();
error TooManyMintsRequested();
error InsufficientTokensRemanining();
error InvalidPayment();
error OnlyEOA();
error WrongNumberOfReserveMints();
error SignatureAlreadyUsed();
error WrongMintingStage();
error NotAuthorized();
error TokenAlreadyPrepaid();
error PrepaymentDisabled();
error PrepaidMintDisabled();
}// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
interface IPaymentSplitterFactory {
/// @notice Deploys a minimal contract proxy to a PaymentSplitter.
function deploy(address[] memory payees, uint256[] memory shares)
external
returns (address);
/**
@notice Deploys a minimal contract proxy to a PaymentSplitter, at a
deterministic address.
@dev Use predictDeploymentAddress() with the same salt to predit the address
before calling deployDeterministic(). See OpenZeppelin's proxy/Clones.sol
for details and caveats, primarily that this will revert if a salt is
reused.
*/
function deployDeterministic(
bytes32 salt,
address[] memory payees,
uint256[] memory shares
) external returns (address);
/**
@notice Returns the address at which a new PaymentSplitter will be deployed
if using the same salt as passed to this function.
*/
function predictDeploymentAddress(bytes32 salt)
external
view
returns (address);
}// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
import "./IPaymentSplitterFactory.sol";
/**
@notice Convenience library for using ethier's PaymentSplitterFactory for cheap
deployment of OpenZeppelin PaymentSplitters via minimal proxy contracts. A
single factory contract is deployed on supported chains, the respective
addresses of which are determined via the chainid() and returned by this
library's instance() function.
*/
library PaymentSplitterDeployer {
/***
@notice Returns the ethier PaymentSplitterFactory instance for the current
chain.
*/
function instance() internal view returns (IPaymentSplitterFactory) {
address factory;
assembly {
switch chainid()
case 1 {
// mainnet
factory := 0xf034d6a4b1a64f0e6038632d87746ca24b79d325
}
case 5 {
// Görli
factory := 0x7F4Ae949da2eD37E0a4b37e0b15B22Ad5c94DE65
}
case 1337 {
// The geth SimulatedBackend iff used with the ethier
// factorytest package.
factory := 0xa516d2c64ED7Fe2004A93Bc123854B229F3Bb738
}
}
require(
factory != address(0),
"PaymentSplitterFactory: not deployed on current chain"
);
return IPaymentSplitterFactory(factory);
}
}// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
/**
@title SignatureChecker
@notice Additional functions for EnumerableSet.Addresset that require a valid
ECDSA signature of a standardized message, signed by any member of the set.
*/
library SignatureChecker {
using EnumerableSet for EnumerableSet.AddressSet;
/**
@notice Requires that the message has not been used previously and that the
recovered signer is contained in the signers AddressSet.
@dev Convenience wrapper for message generation + signature verification
+ marking message as used
@param signers Set of addresses from which signatures are accepted.
@param usedMessages Set of already-used messages.
@param signature ECDSA signature of message.
*/
function requireValidSignature(
EnumerableSet.AddressSet storage signers,
bytes memory data,
bytes calldata signature,
mapping(bytes32 => bool) storage usedMessages
) internal {
bytes32 message = generateMessage(data);
require(
!usedMessages[message],
"SignatureChecker: Message already used"
);
usedMessages[message] = true;
requireValidSignature(signers, message, signature);
}
/**
@notice Requires that the message has not been used previously and that the
recovered signer is contained in the signers AddressSet.
@dev Convenience wrapper for message generation + signature verification.
*/
function requireValidSignature(
EnumerableSet.AddressSet storage signers,
bytes memory data,
bytes calldata signature
) internal view {
bytes32 message = generateMessage(data);
requireValidSignature(signers, message, signature);
}
/**
@notice Requires that the message has not been used previously and that the
recovered signer is contained in the signers AddressSet.
@dev Convenience wrapper for message generation from address +
signature verification.
*/
function requireValidSignature(
EnumerableSet.AddressSet storage signers,
address a,
bytes calldata signature
) internal view {
bytes32 message = generateMessage(abi.encodePacked(a));
requireValidSignature(signers, message, signature);
}
/**
@notice Common validator logic, checking if the recovered signer is
contained in the signers AddressSet.
*/
function validSignature(
EnumerableSet.AddressSet storage signers,
bytes32 message,
bytes calldata signature
) internal view returns (bool) {
return signers.contains(ECDSA.recover(message, signature));
}
/**
@notice Requires that the recovered signer is contained in the signers
AddressSet.
@dev Convenience wrapper that reverts if the signature validation fails.
*/
function requireValidSignature(
EnumerableSet.AddressSet storage signers,
bytes32 message,
bytes calldata signature
) internal view {
require(
validSignature(signers, message, signature),
"SignatureChecker: Invalid signature"
);
}
/**
@notice Generates a message for a given data input that will be signed
off-chain using ECDSA.
@dev For multiple data fields, a standard concatenation using
`abi.encodePacked` is commonly used to build data.
*/
function generateMessage(bytes memory data)
internal
pure
returns (bytes32)
{
return ECDSA.toEthSignedMessageHash(data);
}
}// SPDX-License-Identifier: MIT
// Copyright (c) 2022 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
import "./ERC721APreApproval.sol";
import "../utils/OwnerPausable.sol";
/**
@notice An ERC721A contract with common functionality:
- OpenSea gas-free listings
- Pausable with toggling functions exposed to Owner only
*/
contract ERC721ACommon is ERC721APreApproval, OwnerPausable {
constructor(string memory name, string memory symbol)
ERC721A(name, symbol)
{} // solhint-disable-line no-empty-blocks
/// @notice Requires that the token exists.
modifier tokenExists(uint256 tokenId) {
require(ERC721A._exists(tokenId), "ERC721ACommon: Token doesn't exist");
_;
}
/// @notice Requires that msg.sender owns or is approved for the token.
modifier onlyApprovedOrOwner(uint256 tokenId) {
require(
_ownershipOf(tokenId).addr == _msgSender() ||
getApproved(tokenId) == _msgSender(),
"ERC721ACommon: Not approved nor owner"
);
_;
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual override {
require(!paused(), "ERC721ACommon: paused");
super._beforeTokenTransfers(from, to, startTokenId, quantity);
}
/// @notice Overrides supportsInterface as required by inheritance.
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721A)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
import "@openzeppelin/contracts/utils/Context.sol";
import "../thirdparty/opensea/OpenSeaGasFreeListing.sol";
import "erc721a/contracts/ERC721A.sol";
/// @notice Pre-approval of OpenSea proxies for gas-less listing
/// @dev This wrapper allows users to revoke the pre-approval of their
/// associated proxy and emits the corresponding events. This is necessary for
/// external tools to index approvals correctly and inform the user.
/// @dev The pre-approval is triggered on a per-wallet basis during the first
/// transfer transactions. It will only be enabled for wallets with an existing
/// proxy. Not having a proxy incurs a gas overhead.
/// @dev This wrapper optimizes for the following scenario:
/// - The majority of users already have a wyvern proxy
/// - Most of them want to transfer tokens via wyvern exchanges
abstract contract ERC721APreApproval is ERC721A, Context {
/// @dev It is important that Active remains at first position, since this
/// is the scenario that we are trying to optimize for.
enum State {
Active,
Inactive
}
/// @notice The state of the pre-approval for a given owner
mapping(address => State) private state;
/// @dev Returns true if either standard `isApprovedForAll()` or if the
/// `operator` is the OpenSea proxy for the `owner` provided the
/// pre-approval is active.
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
if (super.isApprovedForAll(owner, operator)) {
return true;
}
return
state[owner] == State.Active &&
OpenSeaGasFreeListing.isApprovedForAll(owner, operator);
}
/// @dev Uses the standard `setApprovalForAll` or toggles the pre-approval
/// state if `operator` is the OpenSea proxy for the sender.
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
address owner = _msgSender();
if (operator == OpenSeaGasFreeListing.proxyFor(owner)) {
state[owner] = approved ? State.Active : State.Inactive;
emit ApprovalForAll(owner, operator, approved);
} else {
super.setApprovalForAll(operator, approved);
}
}
/// @dev Checks if the receiver has an existing proxy. If not, the
/// pre-approval is disabled.
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual override {
super._beforeTokenTransfers(from, to, startTokenId, quantity);
// Exclude burns and inactive pre-approvals
if (to == address(0) || state[to] == State.Inactive) {
return;
}
address operator = OpenSeaGasFreeListing.proxyFor(to);
// Disable if `to` has no proxy
if (operator == address(0)) {
state[to] = State.Inactive;
return;
}
// Avoid emitting unnecessary events.
if (balanceOf(to) == 0) {
emit ApprovalForAll(to, operator, true);
}
}
}// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
// Inspired by BaseOpenSea by Simon Fremaux (@dievardump) but without the need
// to pass specific addresses depending on deployment network.
// https://gist.github.com/dievardump/483eb43bc6ed30b14f01e01842e3339b/
import "./ProxyRegistry.sol";
/// @notice Library to achieve gas-free listings on OpenSea.
library OpenSeaGasFreeListing {
/**
@notice Returns whether the operator is an OpenSea proxy for the owner, thus
allowing it to list without the token owner paying gas.
@dev ERC{721,1155}.isApprovedForAll should be overriden to also check if
this function returns true.
*/
function isApprovedForAll(address owner, address operator)
internal
view
returns (bool)
{
address proxy = proxyFor(owner);
return proxy != address(0) && proxy == operator;
}
/**
@notice Returns the OpenSea proxy address for the owner.
*/
function proxyFor(address owner) internal view returns (address) {
address registry;
uint256 chainId;
assembly {
chainId := chainid()
switch chainId
// Production networks are placed higher to minimise the number of
// checks performed and therefore reduce gas. By the same rationale,
// mainnet comes before Polygon as it's more expensive.
case 1 {
// mainnet
registry := 0xa5409ec958c83c3f309868babaca7c86dcb077c1
}
case 137 {
// polygon
registry := 0x58807baD0B376efc12F5AD86aAc70E78ed67deaE
}
case 4 {
// rinkeby
registry := 0xf57b2c51ded3a29e6891aba85459d600256cf317
}
case 80001 {
// mumbai
registry := 0xff7Ca10aF37178BdD056628eF42fD7F799fAc77c
}
case 1337 {
// The geth SimulatedBackend iff used with the ethier
// openseatest package. This is mocked as a Wyvern proxy as it's
// more complex than the 0x ones.
registry := 0xE1a2bbc877b29ADBC56D2659DBcb0ae14ee62071
}
}
// Unlike Wyvern, the registry itself is the proxy for all owners on 0x
// chains.
if (registry == address(0) || chainId == 137 || chainId == 80001) {
return registry;
}
return address(ProxyRegistry(registry).proxies(owner));
}
}// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
/// @notice A minimal interface describing OpenSea's Wyvern proxy registry.
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
/**
@dev This pattern of using an empty contract is cargo-culted directly from
OpenSea's example code. TODO: it's likely that the above mapping can be changed
to address => address without affecting anything, but further investigation is
needed (i.e. is there a subtle reason that OpenSea released it like this?).
*/
// solhint-disable-next-line no-empty-blocks
contract OwnableDelegateProxy {
}// SPDX-License-Identifier: MIT
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
/// @notice A Pausable contract that can only be toggled by the Owner.
contract OwnerPausable is Ownable, Pausable {
/// @notice Pauses the contract.
function pause() public onlyOwner {
Pausable._pause();
}
/// @notice Unpauses the contract.
function unpause() public onlyOwner {
Pausable._unpause();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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.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`, 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 Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @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 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);
/**
* @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;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s;
uint8 v;
assembly {
s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
v := add(shr(255, vs), 27)
}
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/structs/EnumerableSet.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
return _values(set._inner);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT
// Copyright 2021 David Huber (@cxkoda)
pragma solidity >=0.8.0 <0.9.0;
import "./IERC2981.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
/**
* @notice ERC2981 royalty info base contract
* @dev Implements `supportsInterface`
*/
abstract contract ERC2981 is IERC2981, ERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(IERC2981).interfaceId ||
super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
// Copyright 2021 David Huber (@cxkoda)
pragma solidity >=0.8.0 <0.9.0;
import "./ERC2981.sol";
/**
* @notice ERC2981 royalty info implementation for a single beneficiary
* receving a percentage of sales prices.
* @author David Huber (@cxkoda)
*/
contract ERC2981SinglePercentual is ERC2981 {
/**
* @dev The royalty percentage (in units of 0.01%)
*/
uint96 private _percentage;
/**
* @dev The address to receive the royalties
*/
address private _receiver;
/**
* @dev See {IERC2981-royaltyInfo}.
*/
function royaltyInfo(uint256, uint256 salePrice)
external
view
override
returns (address receiver, uint256 royaltyAmount)
{
royaltyAmount = (salePrice / 10000) * _percentage;
receiver = _receiver;
}
/**
* @dev Sets the royalty percentage (in units of 0.01%)
*/
function _setRoyaltyPercentage(uint96 percentage_) internal {
_percentage = percentage_;
}
/**
* @dev Sets the address to receive the royalties
*/
function _setRoyaltyReceiver(address receiver_) internal {
_receiver = receiver_;
}
}// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.17;
/**
* @title An immutable registry contract to be deployed as a standalone primitive
* @dev See EIP-5639, new project launches can read previous cold wallet -> hot wallet delegations
* from here and integrate those permissions into their flow
*/
interface IDelegationRegistry {
/// @notice Delegation type
enum DelegationType {
NONE,
ALL,
CONTRACT,
TOKEN
}
/// @notice Info about a single delegation, used for onchain enumeration
struct DelegationInfo {
DelegationType type_;
address vault;
address delegate;
address contract_;
uint256 tokenId;
}
/// @notice Info about a single contract-level delegation
struct ContractDelegation {
address contract_;
address delegate;
}
/// @notice Info about a single token-level delegation
struct TokenDelegation {
address contract_;
uint256 tokenId;
address delegate;
}
/// @notice Emitted when a user delegates their entire wallet
event DelegateForAll(address vault, address delegate, bool value);
/// @notice Emitted when a user delegates a specific contract
event DelegateForContract(
address vault,
address delegate,
address contract_,
bool value
);
/// @notice Emitted when a user delegates a specific token
event DelegateForToken(
address vault,
address delegate,
address contract_,
uint256 tokenId,
bool value
);
/// @notice Emitted when a user revokes all delegations
event RevokeAllDelegates(address vault);
/// @notice Emitted when a user revoes all delegations for a given delegate
event RevokeDelegate(address vault, address delegate);
/**
* ----------- WRITE -----------
*/
/**
* @notice Allow the delegate to act on your behalf for all contracts
* @param delegate The hotwallet to act on your behalf
* @param value Whether to enable or disable delegation for this address, true for setting and false for revoking
*/
function delegateForAll(address delegate, bool value) external;
/**
* @notice Allow the delegate to act on your behalf for a specific contract
* @param delegate The hotwallet to act on your behalf
* @param contract_ The address for the contract you're delegating
* @param value Whether to enable or disable delegation for this address, true for setting and false for revoking
*/
function delegateForContract(
address delegate,
address contract_,
bool value
) external;
/**
* @notice Allow the delegate to act on your behalf for a specific token
* @param delegate The hotwallet to act on your behalf
* @param contract_ The address for the contract you're delegating
* @param tokenId The token id for the token you're delegating
* @param value Whether to enable or disable delegation for this address, true for setting and false for revoking
*/
function delegateForToken(
address delegate,
address contract_,
uint256 tokenId,
bool value
) external;
/**
* @notice Revoke all delegates
*/
function revokeAllDelegates() external;
/**
* @notice Revoke a specific delegate for all their permissions
* @param delegate The hotwallet to revoke
*/
function revokeDelegate(address delegate) external;
/**
* @notice Remove yourself as a delegate for a specific vault
* @param vault The vault which delegated to the msg.sender, and should be removed
*/
function revokeSelf(address vault) external;
/**
* ----------- READ -----------
*/
/**
* @notice Returns all active delegations a given delegate is able to claim on behalf of
* @param delegate The delegate that you would like to retrieve delegations for
* @return info Array of DelegationInfo structs
*/
function getDelegationsByDelegate(address delegate)
external
view
returns (DelegationInfo[] memory);
/**
* @notice Returns an array of wallet-level delegates for a given vault
* @param vault The cold wallet who issued the delegation
* @return addresses Array of wallet-level delegates for a given vault
*/
function getDelegatesForAll(address vault)
external
view
returns (address[] memory);
/**
* @notice Returns an array of contract-level delegates for a given vault and contract
* @param vault The cold wallet who issued the delegation
* @param contract_ The address for the contract you're delegating
* @return addresses Array of contract-level delegates for a given vault and contract
*/
function getDelegatesForContract(address vault, address contract_)
external
view
returns (address[] memory);
/**
* @notice Returns an array of contract-level delegates for a given vault's token
* @param vault The cold wallet who issued the delegation
* @param contract_ The address for the contract holding the token
* @param tokenId The token id for the token you're delegating
* @return addresses Array of contract-level delegates for a given vault's token
*/
function getDelegatesForToken(
address vault,
address contract_,
uint256 tokenId
) external view returns (address[] memory);
/**
* @notice Returns all contract-level delegations for a given vault
* @param vault The cold wallet who issued the delegations
* @return delegations Array of ContractDelegation structs
*/
function getContractLevelDelegations(address vault)
external
view
returns (ContractDelegation[] memory delegations);
/**
* @notice Returns all token-level delegations for a given vault
* @param vault The cold wallet who issued the delegations
* @return delegations Array of TokenDelegation structs
*/
function getTokenLevelDelegations(address vault)
external
view
returns (TokenDelegation[] memory delegations);
/**
* @notice Returns true if the address is delegated to act on the entire vault
* @param delegate The hotwallet to act on your behalf
* @param vault The cold wallet who issued the delegation
*/
function checkDelegateForAll(address delegate, address vault)
external
view
returns (bool);
/**
* @notice Returns true if the address is delegated to act on your behalf for a token contract or an entire vault
* @param delegate The hotwallet to act on your behalf
* @param contract_ The address for the contract you're delegating
* @param vault The cold wallet who issued the delegation
*/
function checkDelegateForContract(
address delegate,
address vault,
address contract_
) external view returns (bool);
/**
* @notice Returns true if the address is delegated to act on your behalf for a specific token, the token's contract or an entire vault
* @param delegate The hotwallet to act on your behalf
* @param contract_ The address for the contract you're delegating
* @param tokenId The token id for the token you're delegating
* @param vault The cold wallet who issued the delegation
*/
function checkDelegateForToken(
address delegate,
address vault,
address contract_,
uint256 tokenId
) external view returns (bool);
}// SPDX-License-Identifier: None
pragma solidity >=0.8.0 <0.9.0;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard
* @author Taken from https://eips.ethereum.org/EIPS/eip-2981
*/
interface IERC2981 is IERC165 {
/**
* @notice Called with the sale price to determine how much royalty
* is owed and to whom.
* @param tokenId - the NFT asset queried for royalty information
* @param salePrice - the sale price of the NFT asset specified by _tokenId
* @return receiver - address of who should be sent the royalty payment
* @return royaltyAmount - the royalty payment amount for _salePrice
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import './IERC721A.sol';
/**
* @dev Interface of ERC721 token receiver.
*/
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @title ERC721A
*
* @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
* Non-Fungible Token Standard, including the Metadata extension.
* Optimized for lower gas during batch mints.
*
* Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
* starting from `_startTokenId()`.
*
* Assumptions:
*
* - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
* - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
*/
contract ERC721A is IERC721A {
// Reference type for token approval.
struct TokenApprovalRef {
address value;
}
// =============================================================
// CONSTANTS
// =============================================================
// 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 `Transfer` event signature is given by:
// `keccak256(bytes("Transfer(address,address,uint256)"))`.
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
// =============================================================
// STORAGE
// =============================================================
// The next token ID 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 => TokenApprovalRef) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// =============================================================
// CONSTRUCTOR
// =============================================================
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
// =============================================================
// TOKEN COUNTING OPERATIONS
// =============================================================
/**
* @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 virtual 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 virtual 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 virtual 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 virtual returns (uint256) {
return _burnCounter;
}
// =============================================================
// ADDRESS DATA OPERATIONS
// =============================================================
/**
* @dev Returns the number of tokens in `owner`'s account.
*/
function balanceOf(address owner) public view virtual 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 virtual {
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;
}
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
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: [ERC165](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.
}
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the token collection symbol.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
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 '';
}
// =============================================================
// OWNERSHIPS OPERATIONS
// =============================================================
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
/**
* @dev Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around over time.
*/
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
/**
* @dev Returns the unpacked `TokenOwnership` struct at `index`.
*/
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
/**
* @dev Initializes the ownership slot minted at `index` for efficiency purposes.
*/
function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
/**
* 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 initialized ownership slot
// (i.e. `ownership.addr != address(0) && ownership.burned == false`)
// before an unintialized ownership slot
// (i.e. `ownership.addr == address(0) && ownership.burned == false`)
// Hence, `curr` will not underflow.
//
// We can directly compare the packed value.
// If the address is zero, packed will be zero.
while (packed == 0) {
packed = _packedOwnerships[--curr];
}
return packed;
}
}
}
revert OwnerQueryForNonexistentToken();
}
/**
* @dev 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);
}
/**
* @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 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))
}
}
// =============================================================
// APPROVAL OPERATIONS
// =============================================================
/**
* @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) public virtual override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId].value;
}
/**
* @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) public virtual override {
if (operator == _msgSenderERC721A()) revert ApproveToCaller();
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
}
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @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. See {_mint}.
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return
_startTokenId() <= tokenId &&
tokenId < _currentIndex && // If within bounds,
_packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
}
/**
* @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
*/
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, _BITMASK_ADDRESS)
// Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
msgSender := and(msgSender, _BITMASK_ADDRESS)
// `msgSender == owner || msgSender == approvedAddress`.
result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
}
}
/**
* @dev Returns the storage slot and value for the approved address of `tokenId`.
*/
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
// The following is equivalent to `approvedAddress = _tokenApprovals[tokenId]`.
assembly {
approvedAddressSlot := tokenApproval.slot
approvedAddress := sload(approvedAddressSlot)
}
}
// =============================================================
// TRANSFER OPERATIONS
// =============================================================
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* 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
) public virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isSenderApprovedOrOwner(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 `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, '');
}
/**
* @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 memory _data
) public virtual override {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
/**
* @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 Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
*
* `from` - Previous owner of the given token ID.
* `to` - Target address that will receive the token.
* `tokenId` - Token ID to be transferred.
* `_data` - Optional data to send along with the call.
*
* Returns 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))
}
}
}
}
// =============================================================
// MINT OPERATIONS
// =============================================================
/**
* @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 virtual {
uint256 startTokenId = _currentIndex;
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 toMasked;
uint256 end = startTokenId + quantity;
// Use assembly to loop and emit the `Transfer` event for gas savings.
assembly {
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
toMasked := and(to, _BITMASK_ADDRESS)
// Emit the `Transfer` event.
log4(
0, // Start of data (0, since no data).
0, // End of data (0, since no data).
_TRANSFER_EVENT_SIGNATURE, // Signature.
0, // `address(0)`.
toMasked, // `to`.
startTokenId // `tokenId`.
)
for {
let tokenId := add(startTokenId, 1)
} iszero(eq(tokenId, end)) {
tokenId := add(tokenId, 1)
} {
// Emit the `Transfer` event. Similar to above.
log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
}
}
if (toMasked == 0) revert MintToZeroAddress();
_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 virtual {
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 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 virtual {
_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 Equivalent to `_safeMint(to, quantity, '')`.
*/
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, '');
}
// =============================================================
// BURN OPERATIONS
// =============================================================
/**
* @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) = _getApprovedSlotAndAddress(tokenId);
if (approvalCheck) {
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isSenderApprovedOrOwner(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++;
}
}
// =============================================================
// EXTRA DATA OPERATIONS
// =============================================================
/**
* @dev Directly sets the extra data for the ownership data `index`.
*/
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
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 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 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;
}
// =============================================================
// OTHER OPERATIONS
// =============================================================
/**
* @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 virtual returns (string memory str) {
assembly {
// The maximum value of a uint256 contains 78 digits (1 byte per digit),
// but we allocate 0x80 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: 0x20 + 3 * 0x20 = 0x80.
str := add(mload(0x40), 0x80)
// Update the free memory pointer to allocate.
mstore(0x40, str)
// Cache the end of the memory to calculate the length later.
let end := str
// We write the string from rightmost digit to leftmost digit.
// The following is essentially a do-while loop that also handles the zero case.
// prettier-ignore
for { let temp := value } 1 {} {
str := sub(str, 1)
// Write the character to the pointer.
// The ASCII index of the '0' character is 48.
mstore8(str, add(48, mod(temp, 10)))
// Keep dividing `temp` until zero.
temp := div(temp, 10)
// prettier-ignore
if iszero(temp) { break }
}
let length := sub(end, str)
// Move the pointer 32 bytes leftwards to make room for the length.
str := sub(str, 0x20)
// Store the length.
mstore(str, length)
}
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721A.
*/
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();
// =============================================================
// STRUCTS
// =============================================================
struct TokenOwnership {
// The address of the owner.
address addr;
// Stores 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 via {_extraData}.
uint24 extraData;
}
// =============================================================
// TOKEN COUNTERS
// =============================================================
/**
* @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() external view returns (uint256);
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 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`,
* 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,
bytes calldata data
) external;
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` 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](https://eips.ethereum.org/EIPS/eip-2309) standard.
*
* See {_mintERC2309} for more details.
*/
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import {OperatorFilterer} from "./OperatorFilterer.sol";
/**
* @title DefaultOperatorFilterer
* @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
*/
abstract contract DefaultOperatorFilterer is OperatorFilterer {
address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);
constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface IOperatorFilterRegistry {
function isOperatorAllowed(address registrant, address operator) external view returns (bool);
function register(address registrant) external;
function registerAndSubscribe(address registrant, address subscription) external;
function registerAndCopyEntries(address registrant, address registrantToCopy) external;
function unregister(address addr) external;
function updateOperator(address registrant, address operator, bool filtered) external;
function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
function subscribe(address registrant, address registrantToSubscribe) external;
function unsubscribe(address registrant, bool copyExistingEntries) external;
function subscriptionOf(address addr) external returns (address registrant);
function subscribers(address registrant) external returns (address[] memory);
function subscriberAt(address registrant, uint256 index) external returns (address);
function copyEntriesOf(address registrant, address registrantToCopy) external;
function isOperatorFiltered(address registrant, address operator) external returns (bool);
function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
function filteredOperators(address addr) external returns (address[] memory);
function filteredCodeHashes(address addr) external returns (bytes32[] memory);
function filteredOperatorAt(address registrant, uint256 index) external returns (address);
function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
function isRegistered(address addr) external returns (bool);
function codeHashOf(address addr) external returns (bytes32);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
/**
* @title OperatorFilterer
* @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
* registrant's entries in the OperatorFilterRegistry.
* @dev This smart contract is meant to be inherited by token contracts so they can use the following:
* - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
* - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
*/
abstract contract OperatorFilterer {
error OperatorNotAllowed(address operator);
IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);
constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
// If an inheriting token contract is deployed to a network without the registry deployed, the modifier
// will not revert, but the contract will need to be registered with the registry once it is deployed in
// order for the modifier to filter addresses.
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (subscribe) {
OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
} else {
if (subscriptionOrRegistrantToCopy != address(0)) {
OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
} else {
OPERATOR_FILTER_REGISTRY.register(address(this));
}
}
}
}
modifier onlyAllowedOperator(address from) virtual {
// Allow spending tokens from addresses with balance
// Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
// from an EOA.
if (from != msg.sender) {
_checkFilterOperator(msg.sender);
}
_;
}
modifier onlyAllowedOperatorApproval(address operator) virtual {
_checkFilterOperator(operator);
_;
}
function _checkFilterOperator(address operator) internal view virtual {
// Check registry code length to facilitate testing in environments without a deployed registry.
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
revert OperatorNotAllowed(operator);
}
}
}
}{
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"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":"address","name":"newOwner","type":"address"},{"internalType":"address","name":"signerEarlyAccess","type":"address"},{"internalType":"address","name":"signerPublic","type":"address"},{"internalType":"string","name":"baseTokenURI","type":"string"},{"components":[{"internalType":"uint64","name":"signedMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"publicMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"mintClosingTimestamp","type":"uint64"}],"internalType":"struct GmStudioADaydreamForLibby.MintConfig","name":"config","type":"tuple"},{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"},{"internalType":"uint256[]","name":"sharesRoyalties","type":"uint256[]"},{"internalType":"contract IERC721","name":"_gmToken","type":"address"}],"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":"InsufficientTokensRemanining","type":"error"},{"inputs":[],"name":"InvalidPayment","type":"error"},{"inputs":[],"name":"MintDisabled","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"OnlyEOA","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"PrepaidMintDisabled","type":"error"},{"inputs":[],"name":"PrepaymentDisabled","type":"error"},{"inputs":[],"name":"SignatureAlreadyUsed","type":"error"},{"inputs":[],"name":"TokenAlreadyPrepaid","type":"error"},{"inputs":[],"name":"TooManyMintsRequested","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"},{"inputs":[],"name":"WrongMintingStage","type":"error"},{"inputs":[],"name":"WrongNumberOfReserveMints","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":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_NUM_TOKENS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"availablePrepaidSpots","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum GmStudioADaydreamForLibby.MintingStage","name":"stage","type":"uint8"},{"internalType":"address[]","name":"delSigners","type":"address[]"},{"internalType":"address[]","name":"addSigners","type":"address[]"}],"name":"changeSigners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegateCash","outputs":[{"internalType":"contract IDelegationRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"getPrepayPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum GmStudioADaydreamForLibby.MintingStage","name":"stage","type":"uint8"}],"name":"getSigners","outputs":[{"internalType":"address[]","name":"signers","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gmToken","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"hasPrepaid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"mintConfig","outputs":[{"internalType":"uint64","name":"signedMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"publicMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"mintClosingTimestamp","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint16","name":"num","type":"uint16"},{"internalType":"uint16","name":"numMax","type":"uint16"},{"internalType":"uint128","name":"nonce","type":"uint128"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintEarlyAccess","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintEarlyAccessWithGMToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"num","type":"uint256"}],"name":"mintPrepaid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"num","type":"uint16"},{"internalType":"uint16","name":"numMax","type":"uint16"},{"internalType":"uint128","name":"nonce","type":"uint128"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint32","name":"num","type":"uint32"}],"internalType":"struct GmStudioADaydreamForLibby.ReserveReceiver[]","name":"receivers","type":"tuple[]"}],"name":"mintReserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"numEarlyAccessMintsFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numPrepaidUnminted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentSplitter","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentSplitterRoyalties","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"prePay","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"prepaidTokensUnminted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"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":[{"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":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newDelegationRegistry","type":"address"}],"name":"setDelegationRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"signedMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"publicMintOpeningTimestamp","type":"uint64"},{"internalType":"uint64","name":"mintClosingTimestamp","type":"uint64"}],"internalType":"struct GmStudioADaydreamForLibby.MintConfig","name":"config","type":"tuple"}],"name":"setMintConfig","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":"tokenSeed","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60c0604052600c80546001600160a01b0319166d76a84fef008cdabe6409d2fe638b1790553480156200003157600080fd5b506040516200496538038062004965833981016040819052620000549162000984565b60408051808201825260208082527f4120446179647265616d20466f72204c696262792062792067656e6c6967687481830152825180840190935260048352631051119360e21b90830152733cc6cdda760b79bafa08df41ecfa224f810dceb6916001919081816002620000c9838262000b2e565b506003620000d8828262000b2e565b50506000805550620000ea3362000460565b50506009805460ff60a01b191690556001600a556daaeb6d7670e522a718067333cd4e3b15620002435780156200019157604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200017257600080fd5b505af115801562000187573d6000803e3d6000fd5b5050505062000243565b6001600160a01b03821615620001e25760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000157565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200022957600080fd5b505af11580156200023e573d6000803e3d6000fd5b505050505b505062000260886014620004b260201b6200166d1790919060201c565b506200027c876016620004b260201b6200166d1790919060201c565b5060186200028b878262000b2e565b508451600e805460208089015160408a01516001600160401b039586166001600160801b031990941693909317680100000000000000009186169190910217600160801b600160c01b031916600160801b9490921693909302179055600d80546001600160a01b0319166001600160a01b0384161790556200031690620004d2811b6200168217901c565b6001600160a01b0316634f62f4d185856040518363ffffffff1660e01b81526004016200034592919062000bfa565b6020604051808303816000875af115801562000365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200038b919062000c82565b6001600160a01b0316608052620003ad620004d2602090811b6200168217901c565b6001600160a01b0316634f62f4d185846040518363ffffffff1660e01b8152600401620003dc92919062000bfa565b6020604051808303816000875af1158015620003fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000422919062000c82565b6001600160a01b031660a08190526c01000000000000000000000000026102ee17600b556200045189620005d2565b50505050505050505062000ca9565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000620004c9836001600160a01b038416620006a3565b90505b92915050565b6000804660018114620004f857600581146200051557610539811462000532576200054a565b73f034d6a4b1a64f0e6038632d87746ca24b79d32591506200054a565b737f4ae949da2ed37e0a4b37e0b15b22ad5c94de6591506200054a565b73a516d2c64ed7fe2004a93bc123854b229f3bb73891505b506001600160a01b038116620005cd5760405162461bcd60e51b815260206004820152603560248201527f5061796d656e7453706c6974746572466163746f72793a206e6f74206465706c60448201527f6f796564206f6e2063757272656e7420636861696e000000000000000000000060648201526084015b60405180910390fd5b919050565b6009546001600160a01b031633146200062e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620005c4565b6001600160a01b038116620006955760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620005c4565b620006a08162000460565b50565b6000818152600183016020526040812054620006ec57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620004cc565b506000620004cc565b6001600160a01b0381168114620006a057600080fd5b8051620005cd81620006f5565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562000759576200075962000718565b604052919050565b600082601f8301126200077357600080fd5b81516001600160401b038111156200078f576200078f62000718565b6020620007a5601f8301601f191682016200072e565b8281528582848701011115620007ba57600080fd5b60005b83811015620007da578581018301518282018401528201620007bd565b506000928101909101919091529392505050565b80516001600160401b0381168114620005cd57600080fd5b6000606082840312156200081957600080fd5b604051606081016001600160401b03811182821017156200083e576200083e62000718565b6040529050806200084f83620007ee565b81526200085f60208401620007ee565b60208201526200087260408401620007ee565b60408201525092915050565b60006001600160401b038211156200089a576200089a62000718565b5060051b60200190565b600082601f830112620008b657600080fd5b81516020620008cf620008c9836200087e565b6200072e565b82815260059290921b84018101918181019086841115620008ef57600080fd5b8286015b84811015620009175780516200090981620006f5565b8352918301918301620008f3565b509695505050505050565b600082601f8301126200093457600080fd5b8151602062000947620008c9836200087e565b82815260059290921b840181019181810190868411156200096757600080fd5b8286015b848110156200091757805183529183019183016200096b565b60008060008060008060008060006101608a8c031215620009a457600080fd5b620009af8a6200070b565b9850620009bf60208b016200070b565b9750620009cf60408b016200070b565b60608b01519097506001600160401b0380821115620009ed57600080fd5b620009fb8d838e0162000761565b975062000a0c8d60808e0162000806565b965060e08c015191508082111562000a2357600080fd5b62000a318d838e01620008a4565b95506101008c015191508082111562000a4957600080fd5b62000a578d838e0162000922565b94506101208c015191508082111562000a6f57600080fd5b5062000a7e8c828d0162000922565b92505062000a906101408b016200070b565b90509295985092959850929598565b600181811c9082168062000ab457607f821691505b60208210810362000ad557634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000b2957600081815260208120601f850160051c8101602086101562000b045750805b601f850160051c820191505b8181101562000b255782815560010162000b10565b5050505b505050565b81516001600160401b0381111562000b4a5762000b4a62000718565b62000b628162000b5b845462000a9f565b8462000adb565b602080601f83116001811462000b9a576000841562000b815750858301515b600019600386901b1c1916600185901b17855562000b25565b600085815260208120601f198616915b8281101562000bcb5788860151825594840194600190910190840162000baa565b508582101562000bea5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604080825283519082018190526000906020906060840190828701845b8281101562000c3e5781516001600160a01b03168452928401929084019060010162000c17565b5050508381038285015284518082528583019183019060005b8181101562000c755783518352928401929184019160010162000c57565b5090979650505050505050565b60006020828403121562000c9557600080fd5b815162000ca281620006f5565b9392505050565b60805160a051613c8f62000cd6600039600061072501526000818161088e01526121ee0152613c8f6000f3fe6080604052600436106102885760003560e01c8063718e6adb1161015a578063c002d23d116100c1578063d93908d21161007a578063d93908d2146107dc578063e7cc7244146107fc578063e985e9c51461085c578063ed4a6b0c1461087c578063ed92d4f7146108b0578063f2fde38b146108d057600080fd5b8063c002d23d14610747578063c3832fc514610763578063c5aff68414610776578063c615a7b214610789578063c770b9171461079c578063c87b56dd146107bc57600080fd5b806395d89b411161011357806395d89b4114610696578063a22cb465146106ab578063b3879f83146106cb578063b88d4fde146106e0578063bd2e4abd14610700578063bf964b4e1461071357600080fd5b8063718e6adb146105e257806371c3e9ab1461060d57806373aa9e94146106235780638456cb59146106435780638da5cb5b14610658578063948562951461067657600080fd5b806330176e13116101fe5780635f516836116101b75780635f5168361461052d5780636352211e1461054d5780636919cdc91461056d5780636b7813ee1461058d57806370a08231146105ad578063715018a6146105cd57600080fd5b806330176e1314610467578063312998d3146104875780633f4ba83a146104b757806341f43434146104cc57806342842e0e146104ee5780635c975abb1461050e57600080fd5b806318160ddd1161025057806318160ddd1461035e5780631cb1d8ee1461038157806323b872dd146103ae578063249c4b48146103ce57806328c5846f146103fb5780632a55205a1461042857600080fd5b806301ffc9a71461028d57806306fdde03146102c2578063081812fc146102e4578063095ea7b31461031c5780630ae9f4ae1461033e575b600080fd5b34801561029957600080fd5b506102ad6102a83660046130d4565b6108f0565b60405190151581526020015b60405180910390f35b3480156102ce57600080fd5b506102d7610910565b6040516102b99190613141565b3480156102f057600080fd5b506103046102ff366004613154565b6109a2565b6040516001600160a01b0390911681526020016102b9565b34801561032857600080fd5b5061033c610337366004613182565b6109e6565b005b34801561034a57600080fd5b5061033c6103593660046131ae565b6109ff565b34801561036a57600080fd5b50600154600054035b6040519081526020016102b9565b34801561038d57600080fd5b5061037361039c366004613222565b60116020526000908152604090205481565b3480156103ba57600080fd5b5061033c6103c936600461323f565b610b51565b3480156103da57600080fd5b506103ee6103e936600461328f565b610b76565b6040516102b991906132aa565b34801561040757600080fd5b50610373610416366004613154565b60126020526000908152604090205481565b34801561043457600080fd5b506104486104433660046132f7565b610c2d565b604080516001600160a01b0390931683526020830191909152016102b9565b34801561047357600080fd5b5061033c61048236600461335a565b610c76565b34801561049357600080fd5b506102ad6104a2366004613154565b60106020526000908152604090205460ff1681565b3480156104c357600080fd5b5061033c610cad565b3480156104d857600080fd5b506103046daaeb6d7670e522a718067333cd4e81565b3480156104fa57600080fd5b5061033c61050936600461323f565b610ce1565b34801561051a57600080fd5b50600954600160a01b900460ff166102ad565b34801561053957600080fd5b50610373610548366004613154565b610d06565b34801561055957600080fd5b50610304610568366004613154565b610d95565b34801561057957600080fd5b50600d54610304906001600160a01b031681565b34801561059957600080fd5b5061033c6105a836600461339b565b610da0565b3480156105b957600080fd5b506103736105c8366004613222565b610dd7565b3480156105d957600080fd5b5061033c610e25565b3480156105ee57600080fd5b506105f861022481565b60405163ffffffff90911681526020016102b9565b34801561061957600080fd5b50610373600f5481565b34801561062f57600080fd5b5061033c61063e366004613222565b610e59565b34801561064f57600080fd5b5061033c610ea5565b34801561066457600080fd5b506009546001600160a01b0316610304565b34801561068257600080fd5b50600c54610304906001600160a01b031681565b3480156106a257600080fd5b506102d7610ed7565b3480156106b757600080fd5b5061033c6106c63660046133bb565b610ee6565b3480156106d757600080fd5b50610373610efa565b3480156106ec57600080fd5b5061033c6106fb36600461340a565b610f22565b61033c61070e366004613512565b610f4f565b34801561071f57600080fd5b506103047f000000000000000000000000000000000000000000000000000000000000000081565b34801561075357600080fd5b50610373670214e8348c4f000081565b61033c6107713660046135dd565b610fdd565b61033c610784366004613154565b611175565b61033c610797366004613612565b61124a565b3480156107a857600080fd5b506103736107b73660046135dd565b6112cb565b3480156107c857600080fd5b506102d76107d7366004613154565b61137b565b3480156107e857600080fd5b5061033c6107f7366004613182565b6113d6565b34801561080857600080fd5b50600e54610832906001600160401b0380821691600160401b8104821691600160801b9091041683565b604080516001600160401b03948516815292841660208401529216918101919091526060016102b9565b34801561086857600080fd5b506102ad610877366004613687565b61147c565b34801561088857600080fd5b506103047f000000000000000000000000000000000000000000000000000000000000000081565b3480156108bc57600080fd5b5061033c6108cb3660046136b5565b6114fa565b3480156108dc57600080fd5b5061033c6108eb366004613222565b6115d5565b60006108fb8261176e565b8061090a575061090a82611779565b92915050565b60606002805461091f90613724565b80601f016020809104026020016040519081016040528092919081815260200182805461094b90613724565b80156109985780601f1061096d57610100808354040283529160200191610998565b820191906000526020600020905b81548152906001019060200180831161097b57829003601f168201915b5050505050905090565b60006109ad826117ae565b6109ca576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b816109f0816117d5565b6109fa838361188e565b505050565b6009546001600160a01b03163314610a325760405162461bcd60e51b8152600401610a2990613758565b60405180910390fd5b600d54600160a01b900460ff1615610a5d576040516317efbd6b60e01b815260040160405180910390fd5b600d805460ff60a01b1916600160a01b179055806000805b82811015610b2957848482818110610a8f57610a8f61378d565b9050604002016020016020810190610aa791906137a3565b610ab79063ffffffff16836137df565b9150610b19858583818110610ace57610ace61378d565b610ae49260206040909202019081019150613222565b868684818110610af657610af661378d565b9050604002016020016020810190610b0e91906137a3565b63ffffffff1661192e565b610b22816137f2565b9050610a75565b50601a8114610b4b576040516378e2ffa360e01b815260040160405180910390fd5b50505050565b826001600160a01b0381163314610b6b57610b6b336117d5565b610b4b848484611977565b60606000610b8383611b35565b90506000610b9082611b91565b9050806001600160401b03811115610baa57610baa6133f4565b604051908082528060200260200182016040528015610bd3578160200160208202803683370190505b50925060005b81811015610c2557610beb8382611b9b565b848281518110610bfd57610bfd61378d565b6001600160a01b0390921660209283029190910190910152610c1e816137f2565b9050610bd9565b505050919050565b600b5460009081906bffffffffffffffffffffffff16610c4f61271085613821565b610c599190613835565b600b54600160601b90046001600160a01b03169590945092505050565b6009546001600160a01b03163314610ca05760405162461bcd60e51b8152600401610a2990613758565b60186109fa828483613892565b6009546001600160a01b03163314610cd75760405162461bcd60e51b8152600401610a2990613758565b610cdf611ba7565b565b826001600160a01b0381163314610cfb57610cfb336117d5565b610b4b848484611c44565b600081610d12816117ae565b610d2e5760405162461bcd60e51b8152600401610a2990613951565b6000610d3984611c5f565b6060908101516040513090921b6001600160601b031916602083015260e881901b6001600160e81b0319166034830152603782018690529150605701604051602081830303815290604052805190602001209250505b50919050565b600061090a82611cd6565b6009546001600160a01b03163314610dca5760405162461bcd60e51b8152600401610a2990613758565b80600e6109fa82826139ac565b60006001600160a01b038216610e00576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6009546001600160a01b03163314610e4f5760405162461bcd60e51b8152600401610a2990613758565b610cdf6000611d3d565b6009546001600160a01b03163314610e835760405162461bcd60e51b8152600401610a2990613758565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b03163314610ecf5760405162461bcd60e51b8152600401610a2990613758565b610cdf611d8f565b60606003805461091f90613724565b81610ef0816117d5565b6109fa8383611e17565b600f54600090610f0d601a610224613a37565b63ffffffff16610f1d9190613a54565b905090565b836001600160a01b0381163314610f3c57610f3c336117d5565b610f4885858585611edc565b5050505050565b600e546001600160401b0316421080610f795750600e54600160401b90046001600160401b031642115b15610f97576040516317efbd6b60e01b815260040160405180910390fd5b610f9f611f20565b8561ffff161115610fc357604051630f196e0f60e21b815260040160405180910390fd5b610fd586868686868660146012611f7d565b505050505050565b600e546001600160401b0316421061100857604051631755d02b60e01b815260040160405180910390fd5b80600061101d670214e8348c4f000083613835565b9050611027610efa565b82111561104757604051630f196e0f60e21b815260040160405180910390fd5b6000805b8381101561110e578585828181106110655761106561378d565b90506020020135915061107833836120bb565b6110955760405163ea8e4eb560e01b815260040160405180910390fd5b60008281526010602052604090205460ff16156110c557604051630279aed760e21b815260040160405180910390fd5b6000828152601060205260409020805460ff1916600117905561036682106110fc576110f9670214e8348c4f000084613a54565b92505b80611106816137f2565b91505061104b565b5034821461112f5760405163078d696560e31b815260040160405180910390fd5b336000908152601160205260408120805485929061114e9084906137df565b9250508190555082600f600082825461116791906137df565b90915550610f4890506121e1565b600e546001600160401b031642108061119f5750600e54600160401b90046001600160401b031642115b156111bd576040516317efbd6b60e01b815260040160405180910390fd5b6111c5611f20565b6000036111e557604051630f196e0f60e21b815260040160405180910390fd5b6111ef33826120bb565b61120c5760405163ea8e4eb560e01b815260040160405180910390fd5b34670214e8348c4f0000146112345760405163078d696560e31b815260040160405180910390fd5b61123c6121e1565b61124733600161192e565b50565b600e54600160401b90046001600160401b031642108061127b5750600e54600160801b90046001600160401b031642115b15611299576040516317efbd6b60e01b815260040160405180910390fd5b3233146112b957604051639f8129d160e01b815260040160405180910390fd5b610f4833868686868660166013611f7d565b600081816112e1670214e8348c4f000083613835565b90506000805b83811015611370578686828181106113015761130161378d565b60209081029290920135600081815260109093526040909220549193505060ff161561134057604051630279aed760e21b815260040160405180910390fd5b610366821061135e5761135b670214e8348c4f000084613a54565b92505b80611368816137f2565b9150506112e7565b509095945050505050565b606081611387816117ae565b6113a35760405162461bcd60e51b8152600401610a2990613951565b60186113ae84612214565b6040516020016113bf929190613a67565b604051602081830303815290604052915050919050565b600e546001600160401b03164210156114025760405163d58fcb5f60e01b815260040160405180910390fd5b3360009081526011602052604090205481111561143257604051630f196e0f60e21b815260040160405180910390fd5b80600f60008282546114449190613a54565b90915550503360009081526011602052604081208054839290611468908490613a54565b909155506114789050828261192e565b5050565b6001600160a01b03808316600090815260076020908152604080832093851683529290529081205460ff16156114b45750600161090a565b6001600160a01b03831660009081526008602052604081205460ff1660018111156114e1576114e1613b0d565b1480156114f357506114f38383612314565b9392505050565b6009546001600160a01b031633146115245760405162461bcd60e51b8152600401610a2990613758565b600061152f86611b35565b905060005b8481101561157e5761156d8686838181106115515761155161378d565b90506020020160208101906115669190613222565b8390612353565b50611577816137f2565b9050611534565b5060005b828110156115cc576115bb84848381811061159f5761159f61378d565b90506020020160208101906115b49190613222565b839061166d565b506115c5816137f2565b9050611582565b50505050505050565b6009546001600160a01b031633146115ff5760405162461bcd60e51b8152600401610a2990613758565b6001600160a01b0381166116645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a29565b61124781611d3d565b60006114f3836001600160a01b038416612368565b60008046600181146116a457600581146116c05761053981146116dc576116f4565b73f034d6a4b1a64f0e6038632d87746ca24b79d32591506116f4565b737f4ae949da2ed37e0a4b37e0b15b22ad5c94de6591506116f4565b73a516d2c64ed7fe2004a93bc123854b229f3bb73891505b506001600160a01b0381166117695760405162461bcd60e51b815260206004820152603560248201527f5061796d656e7453706c6974746572466163746f72793a206e6f74206465706c60448201527437bcb2b21037b71031bab93932b73a1031b430b4b760591b6064820152608401610a29565b919050565b600061090a826123b7565b60006001600160e01b0319821663152a902d60e11b148061090a57506301ffc9a760e01b6001600160e01b031983161461090a565b600080548210801561090a575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b1561124757604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611842573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118669190613b23565b61124757604051633b79c77360e21b81526001600160a01b0382166004820152602401610a29565b600061189982610d95565b9050336001600160a01b038216146118d2576118b5813361147c565b6118d2576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600f5460005461022491839161194491906137df565b61194e91906137df565b111561196d57604051630f196e0f60e21b815260040160405180910390fd5b6114788282612405565b600061198282611cd6565b9050836001600160a01b0316816001600160a01b0316146119b55760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417611a02576119e5863361147c565b611a0257604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611a2957604051633a954ecd60e21b815260040160405180910390fd5b611a36868686600161253e565b8015611a4157600082555b6001600160a01b03808716600090815260056020526040808220805460001901905591871681522080546001019055611a9a85611a7f88828761259c565b600160e11b174260a01b176001600160a01b03919091161790565b600085815260046020526040812091909155600160e11b84169003611aef57600184016000818152600460205260408120549003611aed576000548114611aed5760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610fd5565b600080826001811115611b4a57611b4a613b0d565b03611b5757506014919050565b6001826001811115611b6b57611b6b613b0d565b03611b7857506016919050565b6040516327d0b10d60e01b815260040160405180910390fd5b600061090a825490565b60006114f383836125bf565b600954600160a01b900460ff16611bf75760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610a29565b6009805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6109fa83838360405180602001604052806000815250610f22565b60408051608081018252600080825260208201819052918101829052606081019190915261090a611c8f83611cd6565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b600081600054811015611d245760008181526004602052604081205490600160e01b82169003611d22575b806000036114f3575060001901600081815260046020526040902054611d01565b505b604051636f96cda160e11b815260040160405180910390fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600954600160a01b900460ff1615611ddc5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610a29565b6009805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611c273390565b33611e21816125e9565b6001600160a01b0316836001600160a01b031603611ed25781611e45576001611e48565b60005b6001600160a01b0382166000908152600860205260409020805460ff191660018381811115611e7957611e79613b0d565b0217905550826001600160a01b0316816001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3184604051611ec5911515815260200190565b60405180910390a3505050565b6109fa8383612740565b611ee7848484610b51565b6001600160a01b0383163b15610b4b57611f03848484846127d5565b610b4b576040516368d2bf6b60e11b815260040160405180910390fd5b600d546000908190600160a01b900460ff16611f3e5761020a611f4b565b611f4b601a61020a613b40565b63ffffffff169050600f54611f636001546000540390565b611f6d9083613a54565b611f779190613a54565b91505090565b34611f94670214e8348c4f000061ffff8a16613835565b14611fb25760405163078d696560e31b815260040160405180910390fd5b6040516001600160601b031930606090811b821660208401528a901b1660348201526001600160f01b031960f088901b1660488201526fffffffffffffffffffffffffffffffff19608087901b16604a82015260009061202390605a016040516020818303038152906040526128c0565b60008181526020849052604090205490915061ffff80891691612047918b166137df565b11156120665760405163342e754760e21b815260040160405180910390fd5b612072838287876128fb565b6000818152602083905260408120805461ffff8b1692906120949084906137df565b909155506120a290506121e1565b6120b0898961ffff1661192e565b505050505050505050565b600d546040516331a9108f60e11b81526004810183905260009182916001600160a01b0390911690636352211e90602401602060405180830381865afa158015612109573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212d9190613b5d565b9050836001600160a01b0316816001600160a01b03160361215257600191505061090a565b600c54600d54604051631574d39f60e31b81526001600160a01b038781166004830152848116602483015291821660448201526064810186905291169063aba69cf890608401602060405180830381865afa1580156121b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d99190613b23565b949350505050565b610cdf6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163461295f565b60608160000361223b5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612265578061224f816137f2565b915061225e9050600a83613821565b915061223f565b6000816001600160401b0381111561227f5761227f6133f4565b6040519080825280601f01601f1916602001820160405280156122a9576020820181803683370190505b5090505b84156121d9576122be600183613a54565b91506122cb600a86613b7a565b6122d69060306137df565b60f81b8183815181106122eb576122eb61378d565b60200101906001600160f81b031916908160001a90535061230d600a86613821565b94506122ad565b600080612320846125e9565b90506001600160a01b038116158015906121d95750826001600160a01b0316816001600160a01b03161491505092915050565b60006114f3836001600160a01b038416612a78565b60008181526001830160205260408120546123af5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561090a565b50600061090a565b60006301ffc9a760e01b6001600160e01b0319831614806123e857506380ac58cd60e01b6001600160e01b03198316145b8061090a5750506001600160e01b031916635b5e139f60e01b1490565b600080549082900361242a5760405163b562e8dd60e01b815260040160405180910390fd5b612437600084838561253e565b6001600160a01b0383166000908152600560205260408120805468010000000000000001850201905561248e90849061247190828161259c565b6001851460e11b174260a01b176001600160a01b03919091161790565b6000828152600460205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461251457808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a46001016124dc565b508160000361253557604051622e076360e81b815260040160405180910390fd5b60005550505050565b600954600160a01b900460ff16156125905760405162461bcd60e51b8152602060048201526015602482015274115490cdcc8c5050dbdb5b5bdb8e881c185d5cd959605a1b6044820152606401610a29565b610b4b84848484612b72565b600060e882811c906125af868684612c63565b62ffffff16901b95945050505050565b60008260000182815481106125d6576125d661378d565b9060005260206000200154905092915050565b60008046806001811461261e576089811461263a57600481146126565762013881811461267257610539811461268e576126a6565b73a5409ec958c83c3f309868babaca7c86dcb077c192506126a6565b7358807bad0b376efc12f5ad86aac70e78ed67deae92506126a6565b73f57b2c51ded3a29e6891aba85459d600256cf31792506126a6565b73ff7ca10af37178bdd056628ef42fd7f799fac77c92506126a6565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b03821615806126bd5750806089145b806126ca57508062013881145b156126d6575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa15801561271c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d99190613b5d565b336001600160a01b038316036127695760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061280a903390899088908890600401613b8e565b6020604051808303816000875af1925050508015612845575060408051601f3d908101601f1916820190925261284291810190613bcb565b60015b6128a3573d808015612873576040519150601f19603f3d011682016040523d82523d6000602084013e612878565b606091505b50805160000361289b576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b60006128cc8251612214565b826040516020016128de929190613be8565b604051602081830303815290604052805190602001209050919050565b61290784848484612c83565b610b4b5760405162461bcd60e51b815260206004820152602360248201527f5369676e6174757265436865636b65723a20496e76616c6964207369676e617460448201526275726560e81b6064820152608401610a29565b804710156129af5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a29565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146129fc576040519150601f19603f3d011682016040523d82523d6000602084013e612a01565b606091505b50509050806109fa5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610a29565b60008181526001830160205260408120548015612b61576000612a9c600183613a54565b8554909150600090612ab090600190613a54565b9050818114612b15576000866000018281548110612ad057612ad061378d565b9060005260206000200154905080876000018481548110612af357612af361378d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612b2657612b26613c43565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061090a565b600091505061090a565b5092915050565b6001600160a01b0383161580612bb4575060016001600160a01b03841660009081526008602052604090205460ff166001811115612bb257612bb2613b0d565b145b610b4b576000612bc3846125e9565b90506001600160a01b038116612bfc57506001600160a01b0383166000908152600860205260409020805460ff19166001179055610b4b565b612c0584610dd7565b600003610f4857806001600160a01b0316846001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c316001604051612c54911515815260200190565b60405180910390a35050505050565b60006001600160a01b038416612b6b57612c7c83612cd8565b90506114f3565b6000612ccf612cc88585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612d3892505050565b8690612d5c565b95945050505050565b60004244612ce7600143613a54565b6040805160208101949094528301919091524060608083019190915283901b6001600160601b03191660808201526094016040516020818303038152906040528051906020012060e81c9050919050565b6000806000612d478585612d7e565b91509150612d5481612dec565b509392505050565b6001600160a01b038116600090815260018301602052604081205415156114f3565b6000808251604103612db45760208301516040840151606085015160001a612da887828585612fa2565b94509450505050612de5565b8251604003612ddd5760208301516040840151612dd286838361308f565b935093505050612de5565b506000905060025b9250929050565b6000816004811115612e0057612e00613b0d565b03612e085750565b6001816004811115612e1c57612e1c613b0d565b03612e695760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a29565b6002816004811115612e7d57612e7d613b0d565b03612eca5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a29565b6003816004811115612ede57612ede613b0d565b03612f365760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a29565b6004816004811115612f4a57612f4a613b0d565b036112475760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a29565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612fd95750600090506003613086565b8460ff16601b14158015612ff157508460ff16601c14155b156130025750600090506004613086565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613056573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661307f57600060019250925050613086565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016130b087828885612fa2565b935093505050935093915050565b6001600160e01b03198116811461124757600080fd5b6000602082840312156130e657600080fd5b81356114f3816130be565b60005b8381101561310c5781810151838201526020016130f4565b50506000910152565b6000815180845261312d8160208601602086016130f1565b601f01601f19169290920160200192915050565b6020815260006114f36020830184613115565b60006020828403121561316657600080fd5b5035919050565b6001600160a01b038116811461124757600080fd5b6000806040838503121561319557600080fd5b82356131a08161316d565b946020939093013593505050565b600080602083850312156131c157600080fd5b82356001600160401b03808211156131d857600080fd5b818501915085601f8301126131ec57600080fd5b8135818111156131fb57600080fd5b8660208260061b850101111561321057600080fd5b60209290920196919550909350505050565b60006020828403121561323457600080fd5b81356114f38161316d565b60008060006060848603121561325457600080fd5b833561325f8161316d565b9250602084013561326f8161316d565b929592945050506040919091013590565b80356002811061176957600080fd5b6000602082840312156132a157600080fd5b6114f382613280565b6020808252825182820181905260009190848201906040850190845b818110156132eb5783516001600160a01b0316835292840192918401916001016132c6565b50909695505050505050565b6000806040838503121561330a57600080fd5b50508035926020909101359150565b60008083601f84011261332b57600080fd5b5081356001600160401b0381111561334257600080fd5b602083019150836020828501011115612de557600080fd5b6000806020838503121561336d57600080fd5b82356001600160401b0381111561338357600080fd5b61338f85828601613319565b90969095509350505050565b600060608284031215610d8f57600080fd5b801515811461124757600080fd5b600080604083850312156133ce57600080fd5b82356133d98161316d565b915060208301356133e9816133ad565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561342057600080fd5b843561342b8161316d565b9350602085013561343b8161316d565b92506040850135915060608501356001600160401b038082111561345e57600080fd5b818701915087601f83011261347257600080fd5b813581811115613484576134846133f4565b604051601f8201601f19908116603f011681019083821181831017156134ac576134ac6133f4565b816040528281528a60208487010111156134c557600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b803561ffff8116811461176957600080fd5b80356001600160801b038116811461176957600080fd5b60008060008060008060a0878903121561352b57600080fd5b86356135368161316d565b9550613544602088016134e9565b9450613552604088016134e9565b9350613560606088016134fb565b925060808701356001600160401b0381111561357b57600080fd5b61358789828a01613319565b979a9699509497509295939492505050565b60008083601f8401126135ab57600080fd5b5081356001600160401b038111156135c257600080fd5b6020830191508360208260051b8501011115612de557600080fd5b600080602083850312156135f057600080fd5b82356001600160401b0381111561360657600080fd5b61338f85828601613599565b60008060008060006080868803121561362a57600080fd5b613633866134e9565b9450613641602087016134e9565b935061364f604087016134fb565b925060608601356001600160401b0381111561366a57600080fd5b61367688828901613319565b969995985093965092949392505050565b6000806040838503121561369a57600080fd5b82356136a58161316d565b915060208301356133e98161316d565b6000806000806000606086880312156136cd57600080fd5b6136d686613280565b945060208601356001600160401b03808211156136f257600080fd5b6136fe89838a01613599565b9096509450604088013591508082111561371757600080fd5b5061367688828901613599565b600181811c9082168061373857607f821691505b602082108103610d8f57634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156137b557600080fd5b813563ffffffff811681146114f357600080fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561090a5761090a6137c9565b600060018201613804576138046137c9565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826138305761383061380b565b500490565b808202811582820484141761090a5761090a6137c9565b601f8211156109fa57600081815260208120601f850160051c810160208610156138735750805b601f850160051c820191505b81811015610fd55782815560010161387f565b6001600160401b038311156138a9576138a96133f4565b6138bd836138b78354613724565b8361384c565b6000601f8411600181146138f157600085156138d95750838201355b600019600387901b1c1916600186901b178355610f48565b600083815260209020601f19861690835b828110156139225786850135825560209485019460019092019101613902565b508682101561393f5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208082526022908201527f45524337323141436f6d6d6f6e3a20546f6b656e20646f65736e2774206578696040820152611cdd60f21b606082015260800190565b600081356001600160401b038116811461090a57600080fd5b6001600160401b036139bd83613993565b168154816001600160401b031982161783556fffffffffffffffff00000000000000006139ec60208601613993565b60401b1680836001600160801b03198416171784556001600160401b0360801b613a1860408701613993565b60801b16836001600160401b0360c01b84161782171784555050505050565b63ffffffff828116828216039080821115612b6b57612b6b6137c9565b8181038181111561090a5761090a6137c9565b6000808454613a7581613724565b60018281168015613a8d5760018114613aa257613ad1565b60ff1984168752821515830287019450613ad1565b8860005260208060002060005b85811015613ac85781548a820152908401908201613aaf565b50505082870194505b50602f60f81b845286519250613aed8382860160208a016130f1565b64173539b7b760d91b939092019182019290925260060195945050505050565b634e487b7160e01b600052602160045260246000fd5b600060208284031215613b3557600080fd5b81516114f3816133ad565b63ffffffff818116838216019080821115612b6b57612b6b6137c9565b600060208284031215613b6f57600080fd5b81516114f38161316d565b600082613b8957613b8961380b565b500690565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613bc190830184613115565b9695505050505050565b600060208284031215613bdd57600080fd5b81516114f3816130be565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008351613c2081601a8501602088016130f1565b835190830190613c3781601a8401602088016130f1565b01601a01949350505050565b634e487b7160e01b600052603160045260246000fdfea26469706673582212207f76b67d78ac8020303199d4553807937f3c45e54e1cdbd66e7530433d320e3864736f6c63430008110033000000000000000000000000edb7c032fef116163214fcdb6ca481e94794b1870000000000000000000000005312fa01617678dcf4940c66b3adb5a468bc7cef000000000000000000000000924ed53fc89c8a4aa21cfb4d7bda7aa2dc78e10a00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000064ff47900000000000000000000000000000000000000000000000000000000064ff55a00000000000000000000000000000000000000000000000000000000066e1daa000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000028000000000000000000000000036f4d96fe0d4eb33cdc2dc6c0bca15b9cdd0d648000000000000000000000000000000000000000000000000000000000000003f68747470733a2f2f6170692e676d73747564696f2e6172742f636f6c6c656374696f6e732f612d646179647265616d2d666f722d6c696262792f746f6b656e000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e1a4cb40a1d672bb7901b646bb18eb7b70bd59520000000000000000000000001606f991f5016ca0db131943139d58f7228ceef20000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000055000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x6080604052600436106102885760003560e01c8063718e6adb1161015a578063c002d23d116100c1578063d93908d21161007a578063d93908d2146107dc578063e7cc7244146107fc578063e985e9c51461085c578063ed4a6b0c1461087c578063ed92d4f7146108b0578063f2fde38b146108d057600080fd5b8063c002d23d14610747578063c3832fc514610763578063c5aff68414610776578063c615a7b214610789578063c770b9171461079c578063c87b56dd146107bc57600080fd5b806395d89b411161011357806395d89b4114610696578063a22cb465146106ab578063b3879f83146106cb578063b88d4fde146106e0578063bd2e4abd14610700578063bf964b4e1461071357600080fd5b8063718e6adb146105e257806371c3e9ab1461060d57806373aa9e94146106235780638456cb59146106435780638da5cb5b14610658578063948562951461067657600080fd5b806330176e13116101fe5780635f516836116101b75780635f5168361461052d5780636352211e1461054d5780636919cdc91461056d5780636b7813ee1461058d57806370a08231146105ad578063715018a6146105cd57600080fd5b806330176e1314610467578063312998d3146104875780633f4ba83a146104b757806341f43434146104cc57806342842e0e146104ee5780635c975abb1461050e57600080fd5b806318160ddd1161025057806318160ddd1461035e5780631cb1d8ee1461038157806323b872dd146103ae578063249c4b48146103ce57806328c5846f146103fb5780632a55205a1461042857600080fd5b806301ffc9a71461028d57806306fdde03146102c2578063081812fc146102e4578063095ea7b31461031c5780630ae9f4ae1461033e575b600080fd5b34801561029957600080fd5b506102ad6102a83660046130d4565b6108f0565b60405190151581526020015b60405180910390f35b3480156102ce57600080fd5b506102d7610910565b6040516102b99190613141565b3480156102f057600080fd5b506103046102ff366004613154565b6109a2565b6040516001600160a01b0390911681526020016102b9565b34801561032857600080fd5b5061033c610337366004613182565b6109e6565b005b34801561034a57600080fd5b5061033c6103593660046131ae565b6109ff565b34801561036a57600080fd5b50600154600054035b6040519081526020016102b9565b34801561038d57600080fd5b5061037361039c366004613222565b60116020526000908152604090205481565b3480156103ba57600080fd5b5061033c6103c936600461323f565b610b51565b3480156103da57600080fd5b506103ee6103e936600461328f565b610b76565b6040516102b991906132aa565b34801561040757600080fd5b50610373610416366004613154565b60126020526000908152604090205481565b34801561043457600080fd5b506104486104433660046132f7565b610c2d565b604080516001600160a01b0390931683526020830191909152016102b9565b34801561047357600080fd5b5061033c61048236600461335a565b610c76565b34801561049357600080fd5b506102ad6104a2366004613154565b60106020526000908152604090205460ff1681565b3480156104c357600080fd5b5061033c610cad565b3480156104d857600080fd5b506103046daaeb6d7670e522a718067333cd4e81565b3480156104fa57600080fd5b5061033c61050936600461323f565b610ce1565b34801561051a57600080fd5b50600954600160a01b900460ff166102ad565b34801561053957600080fd5b50610373610548366004613154565b610d06565b34801561055957600080fd5b50610304610568366004613154565b610d95565b34801561057957600080fd5b50600d54610304906001600160a01b031681565b34801561059957600080fd5b5061033c6105a836600461339b565b610da0565b3480156105b957600080fd5b506103736105c8366004613222565b610dd7565b3480156105d957600080fd5b5061033c610e25565b3480156105ee57600080fd5b506105f861022481565b60405163ffffffff90911681526020016102b9565b34801561061957600080fd5b50610373600f5481565b34801561062f57600080fd5b5061033c61063e366004613222565b610e59565b34801561064f57600080fd5b5061033c610ea5565b34801561066457600080fd5b506009546001600160a01b0316610304565b34801561068257600080fd5b50600c54610304906001600160a01b031681565b3480156106a257600080fd5b506102d7610ed7565b3480156106b757600080fd5b5061033c6106c63660046133bb565b610ee6565b3480156106d757600080fd5b50610373610efa565b3480156106ec57600080fd5b5061033c6106fb36600461340a565b610f22565b61033c61070e366004613512565b610f4f565b34801561071f57600080fd5b506103047f000000000000000000000000ad2c527467387d0958da065acb30ed56c961a7d681565b34801561075357600080fd5b50610373670214e8348c4f000081565b61033c6107713660046135dd565b610fdd565b61033c610784366004613154565b611175565b61033c610797366004613612565b61124a565b3480156107a857600080fd5b506103736107b73660046135dd565b6112cb565b3480156107c857600080fd5b506102d76107d7366004613154565b61137b565b3480156107e857600080fd5b5061033c6107f7366004613182565b6113d6565b34801561080857600080fd5b50600e54610832906001600160401b0380821691600160401b8104821691600160801b9091041683565b604080516001600160401b03948516815292841660208401529216918101919091526060016102b9565b34801561086857600080fd5b506102ad610877366004613687565b61147c565b34801561088857600080fd5b506103047f0000000000000000000000002779f10c6406d7821c26aacdf363385c0e0d8ba981565b3480156108bc57600080fd5b5061033c6108cb3660046136b5565b6114fa565b3480156108dc57600080fd5b5061033c6108eb366004613222565b6115d5565b60006108fb8261176e565b8061090a575061090a82611779565b92915050565b60606002805461091f90613724565b80601f016020809104026020016040519081016040528092919081815260200182805461094b90613724565b80156109985780601f1061096d57610100808354040283529160200191610998565b820191906000526020600020905b81548152906001019060200180831161097b57829003601f168201915b5050505050905090565b60006109ad826117ae565b6109ca576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b816109f0816117d5565b6109fa838361188e565b505050565b6009546001600160a01b03163314610a325760405162461bcd60e51b8152600401610a2990613758565b60405180910390fd5b600d54600160a01b900460ff1615610a5d576040516317efbd6b60e01b815260040160405180910390fd5b600d805460ff60a01b1916600160a01b179055806000805b82811015610b2957848482818110610a8f57610a8f61378d565b9050604002016020016020810190610aa791906137a3565b610ab79063ffffffff16836137df565b9150610b19858583818110610ace57610ace61378d565b610ae49260206040909202019081019150613222565b868684818110610af657610af661378d565b9050604002016020016020810190610b0e91906137a3565b63ffffffff1661192e565b610b22816137f2565b9050610a75565b50601a8114610b4b576040516378e2ffa360e01b815260040160405180910390fd5b50505050565b826001600160a01b0381163314610b6b57610b6b336117d5565b610b4b848484611977565b60606000610b8383611b35565b90506000610b9082611b91565b9050806001600160401b03811115610baa57610baa6133f4565b604051908082528060200260200182016040528015610bd3578160200160208202803683370190505b50925060005b81811015610c2557610beb8382611b9b565b848281518110610bfd57610bfd61378d565b6001600160a01b0390921660209283029190910190910152610c1e816137f2565b9050610bd9565b505050919050565b600b5460009081906bffffffffffffffffffffffff16610c4f61271085613821565b610c599190613835565b600b54600160601b90046001600160a01b03169590945092505050565b6009546001600160a01b03163314610ca05760405162461bcd60e51b8152600401610a2990613758565b60186109fa828483613892565b6009546001600160a01b03163314610cd75760405162461bcd60e51b8152600401610a2990613758565b610cdf611ba7565b565b826001600160a01b0381163314610cfb57610cfb336117d5565b610b4b848484611c44565b600081610d12816117ae565b610d2e5760405162461bcd60e51b8152600401610a2990613951565b6000610d3984611c5f565b6060908101516040513090921b6001600160601b031916602083015260e881901b6001600160e81b0319166034830152603782018690529150605701604051602081830303815290604052805190602001209250505b50919050565b600061090a82611cd6565b6009546001600160a01b03163314610dca5760405162461bcd60e51b8152600401610a2990613758565b80600e6109fa82826139ac565b60006001600160a01b038216610e00576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6009546001600160a01b03163314610e4f5760405162461bcd60e51b8152600401610a2990613758565b610cdf6000611d3d565b6009546001600160a01b03163314610e835760405162461bcd60e51b8152600401610a2990613758565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b03163314610ecf5760405162461bcd60e51b8152600401610a2990613758565b610cdf611d8f565b60606003805461091f90613724565b81610ef0816117d5565b6109fa8383611e17565b600f54600090610f0d601a610224613a37565b63ffffffff16610f1d9190613a54565b905090565b836001600160a01b0381163314610f3c57610f3c336117d5565b610f4885858585611edc565b5050505050565b600e546001600160401b0316421080610f795750600e54600160401b90046001600160401b031642115b15610f97576040516317efbd6b60e01b815260040160405180910390fd5b610f9f611f20565b8561ffff161115610fc357604051630f196e0f60e21b815260040160405180910390fd5b610fd586868686868660146012611f7d565b505050505050565b600e546001600160401b0316421061100857604051631755d02b60e01b815260040160405180910390fd5b80600061101d670214e8348c4f000083613835565b9050611027610efa565b82111561104757604051630f196e0f60e21b815260040160405180910390fd5b6000805b8381101561110e578585828181106110655761106561378d565b90506020020135915061107833836120bb565b6110955760405163ea8e4eb560e01b815260040160405180910390fd5b60008281526010602052604090205460ff16156110c557604051630279aed760e21b815260040160405180910390fd5b6000828152601060205260409020805460ff1916600117905561036682106110fc576110f9670214e8348c4f000084613a54565b92505b80611106816137f2565b91505061104b565b5034821461112f5760405163078d696560e31b815260040160405180910390fd5b336000908152601160205260408120805485929061114e9084906137df565b9250508190555082600f600082825461116791906137df565b90915550610f4890506121e1565b600e546001600160401b031642108061119f5750600e54600160401b90046001600160401b031642115b156111bd576040516317efbd6b60e01b815260040160405180910390fd5b6111c5611f20565b6000036111e557604051630f196e0f60e21b815260040160405180910390fd5b6111ef33826120bb565b61120c5760405163ea8e4eb560e01b815260040160405180910390fd5b34670214e8348c4f0000146112345760405163078d696560e31b815260040160405180910390fd5b61123c6121e1565b61124733600161192e565b50565b600e54600160401b90046001600160401b031642108061127b5750600e54600160801b90046001600160401b031642115b15611299576040516317efbd6b60e01b815260040160405180910390fd5b3233146112b957604051639f8129d160e01b815260040160405180910390fd5b610f4833868686868660166013611f7d565b600081816112e1670214e8348c4f000083613835565b90506000805b83811015611370578686828181106113015761130161378d565b60209081029290920135600081815260109093526040909220549193505060ff161561134057604051630279aed760e21b815260040160405180910390fd5b610366821061135e5761135b670214e8348c4f000084613a54565b92505b80611368816137f2565b9150506112e7565b509095945050505050565b606081611387816117ae565b6113a35760405162461bcd60e51b8152600401610a2990613951565b60186113ae84612214565b6040516020016113bf929190613a67565b604051602081830303815290604052915050919050565b600e546001600160401b03164210156114025760405163d58fcb5f60e01b815260040160405180910390fd5b3360009081526011602052604090205481111561143257604051630f196e0f60e21b815260040160405180910390fd5b80600f60008282546114449190613a54565b90915550503360009081526011602052604081208054839290611468908490613a54565b909155506114789050828261192e565b5050565b6001600160a01b03808316600090815260076020908152604080832093851683529290529081205460ff16156114b45750600161090a565b6001600160a01b03831660009081526008602052604081205460ff1660018111156114e1576114e1613b0d565b1480156114f357506114f38383612314565b9392505050565b6009546001600160a01b031633146115245760405162461bcd60e51b8152600401610a2990613758565b600061152f86611b35565b905060005b8481101561157e5761156d8686838181106115515761155161378d565b90506020020160208101906115669190613222565b8390612353565b50611577816137f2565b9050611534565b5060005b828110156115cc576115bb84848381811061159f5761159f61378d565b90506020020160208101906115b49190613222565b839061166d565b506115c5816137f2565b9050611582565b50505050505050565b6009546001600160a01b031633146115ff5760405162461bcd60e51b8152600401610a2990613758565b6001600160a01b0381166116645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a29565b61124781611d3d565b60006114f3836001600160a01b038416612368565b60008046600181146116a457600581146116c05761053981146116dc576116f4565b73f034d6a4b1a64f0e6038632d87746ca24b79d32591506116f4565b737f4ae949da2ed37e0a4b37e0b15b22ad5c94de6591506116f4565b73a516d2c64ed7fe2004a93bc123854b229f3bb73891505b506001600160a01b0381166117695760405162461bcd60e51b815260206004820152603560248201527f5061796d656e7453706c6974746572466163746f72793a206e6f74206465706c60448201527437bcb2b21037b71031bab93932b73a1031b430b4b760591b6064820152608401610a29565b919050565b600061090a826123b7565b60006001600160e01b0319821663152a902d60e11b148061090a57506301ffc9a760e01b6001600160e01b031983161461090a565b600080548210801561090a575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b1561124757604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611842573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118669190613b23565b61124757604051633b79c77360e21b81526001600160a01b0382166004820152602401610a29565b600061189982610d95565b9050336001600160a01b038216146118d2576118b5813361147c565b6118d2576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600f5460005461022491839161194491906137df565b61194e91906137df565b111561196d57604051630f196e0f60e21b815260040160405180910390fd5b6114788282612405565b600061198282611cd6565b9050836001600160a01b0316816001600160a01b0316146119b55760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417611a02576119e5863361147c565b611a0257604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611a2957604051633a954ecd60e21b815260040160405180910390fd5b611a36868686600161253e565b8015611a4157600082555b6001600160a01b03808716600090815260056020526040808220805460001901905591871681522080546001019055611a9a85611a7f88828761259c565b600160e11b174260a01b176001600160a01b03919091161790565b600085815260046020526040812091909155600160e11b84169003611aef57600184016000818152600460205260408120549003611aed576000548114611aed5760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610fd5565b600080826001811115611b4a57611b4a613b0d565b03611b5757506014919050565b6001826001811115611b6b57611b6b613b0d565b03611b7857506016919050565b6040516327d0b10d60e01b815260040160405180910390fd5b600061090a825490565b60006114f383836125bf565b600954600160a01b900460ff16611bf75760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610a29565b6009805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6109fa83838360405180602001604052806000815250610f22565b60408051608081018252600080825260208201819052918101829052606081019190915261090a611c8f83611cd6565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b600081600054811015611d245760008181526004602052604081205490600160e01b82169003611d22575b806000036114f3575060001901600081815260046020526040902054611d01565b505b604051636f96cda160e11b815260040160405180910390fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600954600160a01b900460ff1615611ddc5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610a29565b6009805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611c273390565b33611e21816125e9565b6001600160a01b0316836001600160a01b031603611ed25781611e45576001611e48565b60005b6001600160a01b0382166000908152600860205260409020805460ff191660018381811115611e7957611e79613b0d565b0217905550826001600160a01b0316816001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3184604051611ec5911515815260200190565b60405180910390a3505050565b6109fa8383612740565b611ee7848484610b51565b6001600160a01b0383163b15610b4b57611f03848484846127d5565b610b4b576040516368d2bf6b60e11b815260040160405180910390fd5b600d546000908190600160a01b900460ff16611f3e5761020a611f4b565b611f4b601a61020a613b40565b63ffffffff169050600f54611f636001546000540390565b611f6d9083613a54565b611f779190613a54565b91505090565b34611f94670214e8348c4f000061ffff8a16613835565b14611fb25760405163078d696560e31b815260040160405180910390fd5b6040516001600160601b031930606090811b821660208401528a901b1660348201526001600160f01b031960f088901b1660488201526fffffffffffffffffffffffffffffffff19608087901b16604a82015260009061202390605a016040516020818303038152906040526128c0565b60008181526020849052604090205490915061ffff80891691612047918b166137df565b11156120665760405163342e754760e21b815260040160405180910390fd5b612072838287876128fb565b6000818152602083905260408120805461ffff8b1692906120949084906137df565b909155506120a290506121e1565b6120b0898961ffff1661192e565b505050505050505050565b600d546040516331a9108f60e11b81526004810183905260009182916001600160a01b0390911690636352211e90602401602060405180830381865afa158015612109573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212d9190613b5d565b9050836001600160a01b0316816001600160a01b03160361215257600191505061090a565b600c54600d54604051631574d39f60e31b81526001600160a01b038781166004830152848116602483015291821660448201526064810186905291169063aba69cf890608401602060405180830381865afa1580156121b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d99190613b23565b949350505050565b610cdf6001600160a01b037f0000000000000000000000002779f10c6406d7821c26aacdf363385c0e0d8ba9163461295f565b60608160000361223b5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612265578061224f816137f2565b915061225e9050600a83613821565b915061223f565b6000816001600160401b0381111561227f5761227f6133f4565b6040519080825280601f01601f1916602001820160405280156122a9576020820181803683370190505b5090505b84156121d9576122be600183613a54565b91506122cb600a86613b7a565b6122d69060306137df565b60f81b8183815181106122eb576122eb61378d565b60200101906001600160f81b031916908160001a90535061230d600a86613821565b94506122ad565b600080612320846125e9565b90506001600160a01b038116158015906121d95750826001600160a01b0316816001600160a01b03161491505092915050565b60006114f3836001600160a01b038416612a78565b60008181526001830160205260408120546123af5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561090a565b50600061090a565b60006301ffc9a760e01b6001600160e01b0319831614806123e857506380ac58cd60e01b6001600160e01b03198316145b8061090a5750506001600160e01b031916635b5e139f60e01b1490565b600080549082900361242a5760405163b562e8dd60e01b815260040160405180910390fd5b612437600084838561253e565b6001600160a01b0383166000908152600560205260408120805468010000000000000001850201905561248e90849061247190828161259c565b6001851460e11b174260a01b176001600160a01b03919091161790565b6000828152600460205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461251457808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a46001016124dc565b508160000361253557604051622e076360e81b815260040160405180910390fd5b60005550505050565b600954600160a01b900460ff16156125905760405162461bcd60e51b8152602060048201526015602482015274115490cdcc8c5050dbdb5b5bdb8e881c185d5cd959605a1b6044820152606401610a29565b610b4b84848484612b72565b600060e882811c906125af868684612c63565b62ffffff16901b95945050505050565b60008260000182815481106125d6576125d661378d565b9060005260206000200154905092915050565b60008046806001811461261e576089811461263a57600481146126565762013881811461267257610539811461268e576126a6565b73a5409ec958c83c3f309868babaca7c86dcb077c192506126a6565b7358807bad0b376efc12f5ad86aac70e78ed67deae92506126a6565b73f57b2c51ded3a29e6891aba85459d600256cf31792506126a6565b73ff7ca10af37178bdd056628ef42fd7f799fac77c92506126a6565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b03821615806126bd5750806089145b806126ca57508062013881145b156126d6575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa15801561271c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d99190613b5d565b336001600160a01b038316036127695760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061280a903390899088908890600401613b8e565b6020604051808303816000875af1925050508015612845575060408051601f3d908101601f1916820190925261284291810190613bcb565b60015b6128a3573d808015612873576040519150601f19603f3d011682016040523d82523d6000602084013e612878565b606091505b50805160000361289b576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b60006128cc8251612214565b826040516020016128de929190613be8565b604051602081830303815290604052805190602001209050919050565b61290784848484612c83565b610b4b5760405162461bcd60e51b815260206004820152602360248201527f5369676e6174757265436865636b65723a20496e76616c6964207369676e617460448201526275726560e81b6064820152608401610a29565b804710156129af5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a29565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146129fc576040519150601f19603f3d011682016040523d82523d6000602084013e612a01565b606091505b50509050806109fa5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610a29565b60008181526001830160205260408120548015612b61576000612a9c600183613a54565b8554909150600090612ab090600190613a54565b9050818114612b15576000866000018281548110612ad057612ad061378d565b9060005260206000200154905080876000018481548110612af357612af361378d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612b2657612b26613c43565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061090a565b600091505061090a565b5092915050565b6001600160a01b0383161580612bb4575060016001600160a01b03841660009081526008602052604090205460ff166001811115612bb257612bb2613b0d565b145b610b4b576000612bc3846125e9565b90506001600160a01b038116612bfc57506001600160a01b0383166000908152600860205260409020805460ff19166001179055610b4b565b612c0584610dd7565b600003610f4857806001600160a01b0316846001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c316001604051612c54911515815260200190565b60405180910390a35050505050565b60006001600160a01b038416612b6b57612c7c83612cd8565b90506114f3565b6000612ccf612cc88585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612d3892505050565b8690612d5c565b95945050505050565b60004244612ce7600143613a54565b6040805160208101949094528301919091524060608083019190915283901b6001600160601b03191660808201526094016040516020818303038152906040528051906020012060e81c9050919050565b6000806000612d478585612d7e565b91509150612d5481612dec565b509392505050565b6001600160a01b038116600090815260018301602052604081205415156114f3565b6000808251604103612db45760208301516040840151606085015160001a612da887828585612fa2565b94509450505050612de5565b8251604003612ddd5760208301516040840151612dd286838361308f565b935093505050612de5565b506000905060025b9250929050565b6000816004811115612e0057612e00613b0d565b03612e085750565b6001816004811115612e1c57612e1c613b0d565b03612e695760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a29565b6002816004811115612e7d57612e7d613b0d565b03612eca5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a29565b6003816004811115612ede57612ede613b0d565b03612f365760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a29565b6004816004811115612f4a57612f4a613b0d565b036112475760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a29565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612fd95750600090506003613086565b8460ff16601b14158015612ff157508460ff16601c14155b156130025750600090506004613086565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613056573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661307f57600060019250925050613086565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016130b087828885612fa2565b935093505050935093915050565b6001600160e01b03198116811461124757600080fd5b6000602082840312156130e657600080fd5b81356114f3816130be565b60005b8381101561310c5781810151838201526020016130f4565b50506000910152565b6000815180845261312d8160208601602086016130f1565b601f01601f19169290920160200192915050565b6020815260006114f36020830184613115565b60006020828403121561316657600080fd5b5035919050565b6001600160a01b038116811461124757600080fd5b6000806040838503121561319557600080fd5b82356131a08161316d565b946020939093013593505050565b600080602083850312156131c157600080fd5b82356001600160401b03808211156131d857600080fd5b818501915085601f8301126131ec57600080fd5b8135818111156131fb57600080fd5b8660208260061b850101111561321057600080fd5b60209290920196919550909350505050565b60006020828403121561323457600080fd5b81356114f38161316d565b60008060006060848603121561325457600080fd5b833561325f8161316d565b9250602084013561326f8161316d565b929592945050506040919091013590565b80356002811061176957600080fd5b6000602082840312156132a157600080fd5b6114f382613280565b6020808252825182820181905260009190848201906040850190845b818110156132eb5783516001600160a01b0316835292840192918401916001016132c6565b50909695505050505050565b6000806040838503121561330a57600080fd5b50508035926020909101359150565b60008083601f84011261332b57600080fd5b5081356001600160401b0381111561334257600080fd5b602083019150836020828501011115612de557600080fd5b6000806020838503121561336d57600080fd5b82356001600160401b0381111561338357600080fd5b61338f85828601613319565b90969095509350505050565b600060608284031215610d8f57600080fd5b801515811461124757600080fd5b600080604083850312156133ce57600080fd5b82356133d98161316d565b915060208301356133e9816133ad565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561342057600080fd5b843561342b8161316d565b9350602085013561343b8161316d565b92506040850135915060608501356001600160401b038082111561345e57600080fd5b818701915087601f83011261347257600080fd5b813581811115613484576134846133f4565b604051601f8201601f19908116603f011681019083821181831017156134ac576134ac6133f4565b816040528281528a60208487010111156134c557600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b803561ffff8116811461176957600080fd5b80356001600160801b038116811461176957600080fd5b60008060008060008060a0878903121561352b57600080fd5b86356135368161316d565b9550613544602088016134e9565b9450613552604088016134e9565b9350613560606088016134fb565b925060808701356001600160401b0381111561357b57600080fd5b61358789828a01613319565b979a9699509497509295939492505050565b60008083601f8401126135ab57600080fd5b5081356001600160401b038111156135c257600080fd5b6020830191508360208260051b8501011115612de557600080fd5b600080602083850312156135f057600080fd5b82356001600160401b0381111561360657600080fd5b61338f85828601613599565b60008060008060006080868803121561362a57600080fd5b613633866134e9565b9450613641602087016134e9565b935061364f604087016134fb565b925060608601356001600160401b0381111561366a57600080fd5b61367688828901613319565b969995985093965092949392505050565b6000806040838503121561369a57600080fd5b82356136a58161316d565b915060208301356133e98161316d565b6000806000806000606086880312156136cd57600080fd5b6136d686613280565b945060208601356001600160401b03808211156136f257600080fd5b6136fe89838a01613599565b9096509450604088013591508082111561371757600080fd5b5061367688828901613599565b600181811c9082168061373857607f821691505b602082108103610d8f57634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156137b557600080fd5b813563ffffffff811681146114f357600080fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561090a5761090a6137c9565b600060018201613804576138046137c9565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826138305761383061380b565b500490565b808202811582820484141761090a5761090a6137c9565b601f8211156109fa57600081815260208120601f850160051c810160208610156138735750805b601f850160051c820191505b81811015610fd55782815560010161387f565b6001600160401b038311156138a9576138a96133f4565b6138bd836138b78354613724565b8361384c565b6000601f8411600181146138f157600085156138d95750838201355b600019600387901b1c1916600186901b178355610f48565b600083815260209020601f19861690835b828110156139225786850135825560209485019460019092019101613902565b508682101561393f5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208082526022908201527f45524337323141436f6d6d6f6e3a20546f6b656e20646f65736e2774206578696040820152611cdd60f21b606082015260800190565b600081356001600160401b038116811461090a57600080fd5b6001600160401b036139bd83613993565b168154816001600160401b031982161783556fffffffffffffffff00000000000000006139ec60208601613993565b60401b1680836001600160801b03198416171784556001600160401b0360801b613a1860408701613993565b60801b16836001600160401b0360c01b84161782171784555050505050565b63ffffffff828116828216039080821115612b6b57612b6b6137c9565b8181038181111561090a5761090a6137c9565b6000808454613a7581613724565b60018281168015613a8d5760018114613aa257613ad1565b60ff1984168752821515830287019450613ad1565b8860005260208060002060005b85811015613ac85781548a820152908401908201613aaf565b50505082870194505b50602f60f81b845286519250613aed8382860160208a016130f1565b64173539b7b760d91b939092019182019290925260060195945050505050565b634e487b7160e01b600052602160045260246000fd5b600060208284031215613b3557600080fd5b81516114f3816133ad565b63ffffffff818116838216019080821115612b6b57612b6b6137c9565b600060208284031215613b6f57600080fd5b81516114f38161316d565b600082613b8957613b8961380b565b500690565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613bc190830184613115565b9695505050505050565b600060208284031215613bdd57600080fd5b81516114f3816130be565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008351613c2081601a8501602088016130f1565b835190830190613c3781601a8401602088016130f1565b01601a01949350505050565b634e487b7160e01b600052603160045260246000fdfea26469706673582212207f76b67d78ac8020303199d4553807937f3c45e54e1cdbd66e7530433d320e3864736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000edb7c032fef116163214fcdb6ca481e94794b1870000000000000000000000005312fa01617678dcf4940c66b3adb5a468bc7cef000000000000000000000000924ed53fc89c8a4aa21cfb4d7bda7aa2dc78e10a00000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000064ff47900000000000000000000000000000000000000000000000000000000064ff55a00000000000000000000000000000000000000000000000000000000066e1daa000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000028000000000000000000000000036f4d96fe0d4eb33cdc2dc6c0bca15b9cdd0d648000000000000000000000000000000000000000000000000000000000000003f68747470733a2f2f6170692e676d73747564696f2e6172742f636f6c6c656374696f6e732f612d646179647265616d2d666f722d6c696262792f746f6b656e000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e1a4cb40a1d672bb7901b646bb18eb7b70bd59520000000000000000000000001606f991f5016ca0db131943139d58f7228ceef20000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000055000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : newOwner (address): 0xeDb7c032feF116163214FCDb6ca481E94794b187
Arg [1] : signerEarlyAccess (address): 0x5312fa01617678dCF4940c66b3adb5A468BC7Cef
Arg [2] : signerPublic (address): 0x924eD53fC89C8A4Aa21cFB4d7bda7aA2dC78e10A
Arg [3] : baseTokenURI (string): https://api.gmstudio.art/collections/a-daydream-for-libby/token
Arg [4] : config (tuple):
Arg [1] : signedMintOpeningTimestamp (uint64): 1694451600
Arg [2] : publicMintOpeningTimestamp (uint64): 1694455200
Arg [3] : mintClosingTimestamp (uint64): 1726077600
Arg [5] : payees (address[]): 0xe1a4cb40A1D672Bb7901b646Bb18Eb7B70BD5952,0x1606F991F5016CA0dB131943139d58f7228Ceef2
Arg [6] : shares (uint256[]): 15,85
Arg [7] : sharesRoyalties (uint256[]): 1,1
Arg [8] : _gmToken (address): 0x36F4D96Fe0D4Eb33cdC2dC6C0bCA15b9Cdd0d648
-----Encoded View---------------
23 Constructor Arguments found :
Arg [0] : 000000000000000000000000edb7c032fef116163214fcdb6ca481e94794b187
Arg [1] : 0000000000000000000000005312fa01617678dcf4940c66b3adb5a468bc7cef
Arg [2] : 000000000000000000000000924ed53fc89c8a4aa21cfb4d7bda7aa2dc78e10a
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [4] : 0000000000000000000000000000000000000000000000000000000064ff4790
Arg [5] : 0000000000000000000000000000000000000000000000000000000064ff55a0
Arg [6] : 0000000000000000000000000000000000000000000000000000000066e1daa0
Arg [7] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000280
Arg [10] : 00000000000000000000000036f4d96fe0d4eb33cdc2dc6c0bca15b9cdd0d648
Arg [11] : 000000000000000000000000000000000000000000000000000000000000003f
Arg [12] : 68747470733a2f2f6170692e676d73747564696f2e6172742f636f6c6c656374
Arg [13] : 696f6e732f612d646179647265616d2d666f722d6c696262792f746f6b656e00
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [15] : 000000000000000000000000e1a4cb40a1d672bb7901b646bb18eb7b70bd5952
Arg [16] : 0000000000000000000000001606f991f5016ca0db131943139d58f7228ceef2
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [18] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [19] : 0000000000000000000000000000000000000000000000000000000000000055
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [22] : 0000000000000000000000000000000000000000000000000000000000000001
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.