Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Overview
ETH Balance
0.4845 ETH
Eth Value
$880.28 (@ $1,816.87/ETH)More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 33 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 23364281 | 162 days ago | IN | 0 ETH | 0.00001158 | ||||
| Transfer Ownersh... | 23342866 | 165 days ago | IN | 0 ETH | 0.00000647 | ||||
| Air Drop | 23333030 | 166 days ago | IN | 0 ETH | 0.00112826 | ||||
| Mint Phase3 | 23333017 | 166 days ago | IN | 0.01023134 ETH | 0.00004125 | ||||
| Set End Time Pha... | 23333016 | 166 days ago | IN | 0 ETH | 0.0000734 | ||||
| Mint Phase3 | 23333010 | 166 days ago | IN | 0.01023134 ETH | 0.00022537 | ||||
| Mint Phase3 | 23333005 | 166 days ago | IN | 0.04092536 ETH | 0.00025887 | ||||
| Mint Phase3 | 23333005 | 166 days ago | IN | 0.04092536 ETH | 0.00039492 | ||||
| Mint Phase3 | 23333000 | 166 days ago | IN | 0.04092536 ETH | 0.0003272 | ||||
| Mint Phase3 | 23333000 | 166 days ago | IN | 0.04092536 ETH | 0.0003272 | ||||
| Mint Phase3 | 23332996 | 166 days ago | IN | 0.01023134 ETH | 0.00024094 | ||||
| Mint Phase3 | 23332995 | 166 days ago | IN | 0.04092536 ETH | 0.00040063 | ||||
| Mint Phase2 | 23332944 | 166 days ago | IN | 0.01023134 ETH | 0.00034108 | ||||
| Mint Phase2 | 23332939 | 166 days ago | IN | 0.01023134 ETH | 0.00014166 | ||||
| Mint Phase2 | 23332936 | 166 days ago | IN | 0.01023134 ETH | 0.00017927 | ||||
| Mint Phase2 | 23332897 | 166 days ago | IN | 0.04092536 ETH | 0.00029703 | ||||
| Mint Phase2 | 23332830 | 166 days ago | IN | 0.01023134 ETH | 0.00021278 | ||||
| Mint Phase2 | 23332817 | 166 days ago | IN | 0.04092536 ETH | 0.00024084 | ||||
| Mint Phase2 | 23332786 | 166 days ago | IN | 0.02046268 ETH | 0.00019268 | ||||
| Mint Phase2 | 23332778 | 166 days ago | IN | 0.01023134 ETH | 0.00019832 | ||||
| Mint Phase2 | 23332700 | 166 days ago | IN | 0.04092536 ETH | 0.00281085 | ||||
| Mint Phase1 | 23332691 | 166 days ago | IN | 0.01023134 ETH | 0.00003728 | ||||
| Mint Phase1 | 23332674 | 166 days ago | IN | 0.01023134 ETH | 0.00004082 | ||||
| Mint Phase1 | 23332574 | 166 days ago | IN | 0.01023134 ETH | 0.00002708 | ||||
| Mint Phase1 | 23332572 | 166 days ago | IN | 0.01023134 ETH | 0.00017986 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 23333010 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23333005 | 166 days ago | 0.00292536 ETH | ||||
| Transfer | 23333005 | 166 days ago | 0.00292536 ETH | ||||
| Transfer | 23333000 | 166 days ago | 0.00292536 ETH | ||||
| Transfer | 23333000 | 166 days ago | 0.00292536 ETH | ||||
| Transfer | 23332996 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332995 | 166 days ago | 0.00292536 ETH | ||||
| Transfer | 23332944 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332939 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332936 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332897 | 166 days ago | 0.00292536 ETH | ||||
| Transfer | 23332830 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332817 | 166 days ago | 0.00292536 ETH | ||||
| Transfer | 23332786 | 166 days ago | 0.00146268 ETH | ||||
| Transfer | 23332778 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332700 | 166 days ago | 0.00292536 ETH | ||||
| Transfer | 23332691 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332674 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332574 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332572 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332570 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332561 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332554 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332552 | 166 days ago | 0.00073134 ETH | ||||
| Transfer | 23332548 | 166 days ago | 0.00073134 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
PolyPicksAI
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 1000 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
import {ERC721A} from "erc721a/contracts/ERC721A.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol";
import {BitMaps} from "@openzeppelin/contracts/utils/structs/BitMaps.sol";
import {OperatorFilterer} from "closedsea/src/OperatorFilterer.sol";
import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
error MaxSupplyExceeded();
error PublicSaleClosed();
error TransfersLocked();
error NotAllowedByRegistry();
error RegistryNotSet();
error WrongWeiSent();
error MaxFeeExceeded();
error InputLengthsMismatch();
error InvalidMerkleProof();
error InvalidLaunchpadFee();
error InvalidLaunchpadFeeAddress();
error TransferFailed();
error PaymentTransferFailed();
error FeeTransferFailed();
error NotEnoughBalance();
error NotEnoughAllowance();
interface ICreatorToken {
event TransferValidatorUpdated(address oldValidator, address newValidator);
function getTransferValidator() external view returns (address validator);
function getTransferValidationFunction() external view
returns (bytes4 functionSignature, bool isViewFunction);
function setTransferValidator(address validator) external;
}
interface ITransferValidator {
function validateTransfer(address caller, address from, address to, uint256 tokenId) external view;
}
interface IRegistry {
function isAllowedOperator(address operator) external view returns (bool);
}
interface IERC20 {
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function isApprovedForAll(address owner, address spender) external view returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
}
contract PolyPicksAI is Ownable, OperatorFilterer, ERC2981, ERC721A, ICreatorToken {
// Transfer validator for royalty enforcement
address private _transferValidator;
bytes4 private constant VALIDATE_TRANSFER_SELECTOR = 0xcaee23ea;
// Launchpad Fee
uint256 public launchpadFee = 231340642155354;
uint256 public launchpadCutBps = 500;
address public launchpadFeeAddress = 0xbDb9e0b47a02C45E3b50973A18452DC23CE72697;
event LaunchpadFeeSent(address indexed feeAddress, uint256 feeAmount);
event TokenPaymentSent(address indexed recipient, uint256 amount);
using BitMaps for BitMaps.BitMap;
address public currency = 0x0000000000000000000000000000000000000000;
uint256 public maxSupply = 500;
bool public operatorFilteringEnabled = true;
bool public initialTransferLockOn = true;
bool public isRegistryActive;
address public registryAddress;
string private _baseTokenURI = "";
string private _placeHolderTokenURI = "https://mintify-launchpad.nyc3.cdn.digitaloceanspaces.com/2a6f13ab-1d7d-414e-b049-78d9c0d98677.webp";
// Phase 1 variables
uint256 public startTimePhase1 = 1757505600;
uint256 public endTimePhase1 = 1757507400;
uint256 public maxSupplyPhase1 = 0;
uint256 public totalSupplyPhase1;
uint256 public pricePhase1 = 10000000000000000;
uint256 public maxPerWalletPhase1 = 1;
bytes32 public merkleRootPhase1 = 0x3f7a809d9563f15e69a103391ad5b443fab9122da1cf28c97874041fbc983c26;
mapping(address => uint256) public walletMintsPhase1;
// Phase 2 variables
uint256 public startTimePhase2 = 1757507400;
uint256 public endTimePhase2 = 1757511000;
uint256 public maxSupplyPhase2 = 0;
uint256 public totalSupplyPhase2;
uint256 public pricePhase2 = 10000000000000000;
uint256 public maxPerWalletPhase2 = 4;
bytes32 public merkleRootPhase2 = 0x3f7a809d9563f15e69a103391ad5b443fab9122da1cf28c97874041fbc983c26;
mapping(address => uint256) public walletMintsPhase2;
// Phase 3 variables
uint256 public startTimePhase3 = 1757511000;
uint256 public endTimePhase3 = 1757683800;
uint256 public maxSupplyPhase3 = 0;
uint256 public totalSupplyPhase3;
uint256 public pricePhase3 = 10000000000000000;
uint256 public maxPerWalletPhase3 = 4;
bytes32 public merkleRootPhase3 = 0x0;
mapping(address => uint256) public walletMintsPhase3;
constructor() ERC721A("PolyPicksAI", "PICKS") Ownable(msg.sender) {
// Register operator filtering
_registerForOperatorFiltering();
// Set initial royalty
_setDefaultRoyalty(0x40598a99f1E3dF7293C272f143fBFeeB463D7197, 500);
}
// Phase 1 Mint
function mintPhase1(bytes32[] calldata merkleProof, uint256 quantity) external payable {
// Check if mint has started
if (startTimePhase1 != 0 && block.timestamp < startTimePhase1) {
revert PublicSaleClosed();
}
// Check if mint has ended
if (endTimePhase1 != 0 && block.timestamp > endTimePhase1) {
revert PublicSaleClosed();
}
// Check if the mint will exceed total max supply, if set.
if (maxSupply != 0 && totalSupply() + quantity > maxSupply) {
revert MaxSupplyExceeded();
}
// If phase max supply is set, check if it's exceeded
if (maxSupplyPhase1 != 0 && totalSupplyPhase1 + quantity > maxSupplyPhase1) {
revert MaxSupplyExceeded();
}
uint256 totalOrderPrice = (pricePhase1 + launchpadFee) * quantity;
// Check if the price is correct if native currency
if (currency == address(0)) {
if (msg.value != totalOrderPrice) {
revert WrongWeiSent();
}
}
else {
// Check if the user has enough balance and allowance if ERC20
IERC20 token = IERC20(currency);
if (token.balanceOf(msg.sender) < totalOrderPrice) {
revert NotEnoughBalance();
}
if (token.allowance(msg.sender, address(this)) < totalOrderPrice) {
revert NotEnoughAllowance();
}
}
// Check if the proof is set, and if it is valid
if (merkleRootPhase1 != bytes32(0)) {
// Using Merkle Tree
bytes32 node = keccak256(abi.encodePacked(msg.sender));
if (!MerkleProof.verify(merkleProof, merkleRootPhase1, node)) {
revert InvalidMerkleProof();
}
}
// Check if we have exceeded phase max per wallet if set.
if (maxPerWalletPhase1 != 0 && walletMintsPhase1[msg.sender] + quantity > maxPerWalletPhase1) {
revert MaxSupplyExceeded();
}
uint256 flatFees = 0;
// Get the Launchpad Flat Fee if set
if (launchpadFee != 0 && launchpadFeeAddress != address(0)) {
flatFees = launchpadFee * quantity;
}
// Get the Launchpad Percentage Fee if set
uint256 percentageFees = 0;
if (launchpadCutBps != 0 && launchpadFeeAddress != address(0)) {
percentageFees = (launchpadCutBps * (totalOrderPrice - flatFees)) / 10000;
}
// Send the fees
uint256 totalFees = flatFees + percentageFees;
if (totalFees != 0) {
_sendLaunchpadFee(totalFees);
}
// Transfer the payment if ERC20
if (currency != address(0) && totalOrderPrice > totalFees) {
_sendTokenPayment(address(this), totalOrderPrice - totalFees);
}
// Mint the tokens
walletMintsPhase1[msg.sender] += quantity;
totalSupplyPhase1 += quantity;
_mint(msg.sender, quantity);
}
// Phase 2 Mint
function mintPhase2(bytes32[] calldata merkleProof, uint256 quantity) external payable {
// Check if mint has started
if (startTimePhase2 != 0 && block.timestamp < startTimePhase2) {
revert PublicSaleClosed();
}
// Check if mint has ended
if (endTimePhase2 != 0 && block.timestamp > endTimePhase2) {
revert PublicSaleClosed();
}
// Check if the mint will exceed total max supply, if set.
if (maxSupply != 0 && totalSupply() + quantity > maxSupply) {
revert MaxSupplyExceeded();
}
// If phase max supply is set, check if it's exceeded
if (maxSupplyPhase2 != 0 && totalSupplyPhase2 + quantity > maxSupplyPhase2) {
revert MaxSupplyExceeded();
}
uint256 totalOrderPrice = (pricePhase2 + launchpadFee) * quantity;
// Check if the price is correct if native currency
if (currency == address(0)) {
if (msg.value != totalOrderPrice) {
revert WrongWeiSent();
}
}
else {
// Check if the user has enough balance and allowance if ERC20
IERC20 token = IERC20(currency);
if (token.balanceOf(msg.sender) < totalOrderPrice) {
revert NotEnoughBalance();
}
if (token.allowance(msg.sender, address(this)) < totalOrderPrice) {
revert NotEnoughAllowance();
}
}
// Check if the proof is set, and if it is valid
if (merkleRootPhase2 != bytes32(0)) {
// Using Merkle Tree
bytes32 node = keccak256(abi.encodePacked(msg.sender));
if (!MerkleProof.verify(merkleProof, merkleRootPhase2, node)) {
revert InvalidMerkleProof();
}
}
// Check if we have exceeded phase max per wallet if set.
if (maxPerWalletPhase2 != 0 && walletMintsPhase2[msg.sender] + quantity > maxPerWalletPhase2) {
revert MaxSupplyExceeded();
}
uint256 flatFees = 0;
// Get the Launchpad Flat Fee if set
if (launchpadFee != 0 && launchpadFeeAddress != address(0)) {
flatFees = launchpadFee * quantity;
}
// Get the Launchpad Percentage Fee if set
uint256 percentageFees = 0;
if (launchpadCutBps != 0 && launchpadFeeAddress != address(0)) {
percentageFees = (launchpadCutBps * (totalOrderPrice - flatFees)) / 10000;
}
// Send the fees
uint256 totalFees = flatFees + percentageFees;
if (totalFees != 0) {
_sendLaunchpadFee(totalFees);
}
// Transfer the payment if ERC20
if (currency != address(0) && totalOrderPrice > totalFees) {
_sendTokenPayment(address(this), totalOrderPrice - totalFees);
}
// Mint the tokens
walletMintsPhase2[msg.sender] += quantity;
totalSupplyPhase2 += quantity;
_mint(msg.sender, quantity);
}
// Phase 3 Mint
function mintPhase3(uint256 quantity) external payable {
// Check if mint has started
if (startTimePhase3 != 0 && block.timestamp < startTimePhase3) {
revert PublicSaleClosed();
}
// Check if mint has ended
if (endTimePhase3 != 0 && block.timestamp > endTimePhase3) {
revert PublicSaleClosed();
}
// Check if the mint will exceed total max supply, if set.
if (maxSupply != 0 && totalSupply() + quantity > maxSupply) {
revert MaxSupplyExceeded();
}
// If phase max supply is set, check if it's exceeded
if (maxSupplyPhase3 != 0 && totalSupplyPhase3 + quantity > maxSupplyPhase3) {
revert MaxSupplyExceeded();
}
uint256 totalOrderPrice = (pricePhase3 + launchpadFee) * quantity;
// Check if the price is correct if native currency
if (currency == address(0)) {
if (msg.value != totalOrderPrice) {
revert WrongWeiSent();
}
}
else {
// Check if the user has enough balance and allowance if ERC20
IERC20 token = IERC20(currency);
if (token.balanceOf(msg.sender) < totalOrderPrice) {
revert NotEnoughBalance();
}
if (token.allowance(msg.sender, address(this)) < totalOrderPrice) {
revert NotEnoughAllowance();
}
}
// Check if we have exceeded phase max per wallet if set.
if (maxPerWalletPhase3 != 0 && walletMintsPhase3[msg.sender] + quantity > maxPerWalletPhase3) {
revert MaxSupplyExceeded();
}
uint256 flatFees = 0;
// Get the Launchpad Flat Fee if set
if (launchpadFee != 0 && launchpadFeeAddress != address(0)) {
flatFees = launchpadFee * quantity;
}
// Get the Launchpad Percentage Fee if set
uint256 percentageFees = 0;
if (launchpadCutBps != 0 && launchpadFeeAddress != address(0)) {
percentageFees = (launchpadCutBps * (totalOrderPrice - flatFees)) / 10000;
}
// Send the fees
uint256 totalFees = flatFees + percentageFees;
if (totalFees != 0) {
_sendLaunchpadFee(totalFees);
}
// Transfer the payment if ERC20
if (currency != address(0) && totalOrderPrice > totalFees) {
_sendTokenPayment(address(this), totalOrderPrice - totalFees);
}
// Mint the tokens
walletMintsPhase3[msg.sender] += quantity;
totalSupplyPhase3 += quantity;
_mint(msg.sender, quantity);
}
// =========================================================================
// Owner Only Functions
// =========================================================================
// Owner airdrop
function airDrop(address[] memory users, uint256[] memory amounts) external onlyOwner {
// iterate over users and amounts
if (users.length != amounts.length) {
revert InputLengthsMismatch();
}
for (uint256 i; i < users.length;) {
if (maxSupply != 0 && totalSupply() + amounts[i] > maxSupply) {
revert MaxSupplyExceeded();
}
_mint(users[i], amounts[i]);
unchecked {
++i;
}
}
}
// Owner unrestricted mint
function ownerMint(address to, uint256 quantity) external onlyOwner {
if (maxSupply != 0 && totalSupply() + quantity > maxSupply) {
revert MaxSupplyExceeded();
}
_mint(to, quantity);
}
// Set max supply
function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
maxSupply = newMaxSupply;
}
// Withdraw Balance to owner
function withdraw() public onlyOwner {
(bool success, ) = payable(owner()).call{value: address(this).balance}("");
if (!success) {
revert TransferFailed();
}
}
// Withdraw Balance to Address
function withdrawTo(address payable _to) public onlyOwner {
(bool success, ) = payable(_to).call{value: address(this).balance}("");
if (!success) {
revert TransferFailed();
}
}
// Withdraw ERC20 to owner
function withdrawERC20(address tokenAddress) public onlyOwner {
IERC20 token = IERC20(tokenAddress);
uint256 balance = token.balanceOf(address(this));
if (balance == 0) {
revert TransferFailed();
}
bool success = token.transfer(owner(), balance);
if (!success) {
revert TransferFailed();
}
}
// Withdraw ERC20 to Address
function withdrawERC20To(address tokenAddress, address to) public onlyOwner {
IERC20 token = IERC20(tokenAddress);
uint256 balance = token.balanceOf(address(this));
if (balance == 0) {
revert TransferFailed();
}
bool success = token.transfer(to, balance);
if (!success) {
revert TransferFailed();
}
}
// Send Launchpad Flat Fee
function _sendLaunchpadFee(uint256 feeAmount) private {
if (feeAmount == 0) {
revert InvalidLaunchpadFee();
}
if (launchpadFeeAddress == address(0)) {
revert InvalidLaunchpadFeeAddress();
}
if (currency == address(0)) {
(bool success, ) = payable(launchpadFeeAddress).call{value: feeAmount}("");
if (!success) {
revert FeeTransferFailed();
}
}
else {
// Transfer the fee in the specified currency
IERC20 token = IERC20(currency);
try token.transferFrom(msg.sender, launchpadFeeAddress, feeAmount) {
// Success
} catch {
revert FeeTransferFailed();
}
}
emit LaunchpadFeeSent(launchpadFeeAddress, feeAmount);
}
// Send ERC20 Payment
function _sendTokenPayment(address recipient, uint256 amount) private {
if (amount == 0) {
revert PaymentTransferFailed();
}
if (recipient == address(0)) {
revert PaymentTransferFailed();
}
// Transfer the fee in the specified currency
IERC20 token = IERC20(currency);
try token.transferFrom(msg.sender, address(this), amount) {
// Success
} catch {
revert PaymentTransferFailed();
}
emit TokenPaymentSent(recipient, amount);
}
// Set the start time for the phase
function setStartTimePhase1(uint256 newStartTime) external onlyOwner {
startTimePhase1 = newStartTime;
}
// Set the end time for the phase
function setEndTimePhase1(uint256 newEndTime) external onlyOwner {
endTimePhase1 = newEndTime;
}
// Set the max supply for the phase
function setMaxSupplyPhase1(uint256 newMaxSupply) external onlyOwner {
maxSupplyPhase1 = newMaxSupply;
}
// Set max per wallet for the phase
function setMaxPerWalletPhase1(uint256 newMaxPerWallet) external onlyOwner {
maxPerWalletPhase1 = newMaxPerWallet;
}
// Set the price for the phase
function setPricePhase1(uint256 newPrice) external onlyOwner {
pricePhase1 = newPrice;
}
// Set the merkle root for the phase
function setMerkleRootPhase1(bytes32 newMerkleRoot) external onlyOwner {
merkleRootPhase1 = newMerkleRoot;
}// Set the start time for the phase
function setStartTimePhase2(uint256 newStartTime) external onlyOwner {
startTimePhase2 = newStartTime;
}
// Set the end time for the phase
function setEndTimePhase2(uint256 newEndTime) external onlyOwner {
endTimePhase2 = newEndTime;
}
// Set the max supply for the phase
function setMaxSupplyPhase2(uint256 newMaxSupply) external onlyOwner {
maxSupplyPhase2 = newMaxSupply;
}
// Set max per wallet for the phase
function setMaxPerWalletPhase2(uint256 newMaxPerWallet) external onlyOwner {
maxPerWalletPhase2 = newMaxPerWallet;
}
// Set the price for the phase
function setPricePhase2(uint256 newPrice) external onlyOwner {
pricePhase2 = newPrice;
}
// Set the merkle root for the phase
function setMerkleRootPhase2(bytes32 newMerkleRoot) external onlyOwner {
merkleRootPhase2 = newMerkleRoot;
}// Set the start time for the phase
function setStartTimePhase3(uint256 newStartTime) external onlyOwner {
startTimePhase3 = newStartTime;
}
// Set the end time for the phase
function setEndTimePhase3(uint256 newEndTime) external onlyOwner {
endTimePhase3 = newEndTime;
}
// Set the max supply for the phase
function setMaxSupplyPhase3(uint256 newMaxSupply) external onlyOwner {
maxSupplyPhase3 = newMaxSupply;
}
// Set max per wallet for the phase
function setMaxPerWalletPhase3(uint256 newMaxPerWallet) external onlyOwner {
maxPerWalletPhase3 = newMaxPerWallet;
}
// Set the price for the phase
function setPricePhase3(uint256 newPrice) external onlyOwner {
pricePhase3 = newPrice;
}
// Set the merkle root for the phase
function setMerkleRootPhase3(bytes32 newMerkleRoot) external onlyOwner {
merkleRootPhase3 = newMerkleRoot;
}
// =========================================================================
// ERC721A Misc
// =========================================================================
function _startTokenId() internal pure override returns (uint256) {
return 1;
}
// =========================================================================
// ICreatorToken Implementation
// =========================================================================
function getTransferValidator() external view override returns (address validator) {
return _transferValidator;
}
function getTransferValidationFunction() external pure override
returns (bytes4 functionSignature, bool isViewFunction) {
return (VALIDATE_TRANSFER_SELECTOR, true);
}
function setTransferValidator(address validator) external override onlyOwner {
address oldValidator = _transferValidator;
_transferValidator = validator;
emit TransferValidatorUpdated(oldValidator, validator);
}
// =========================================================================
// Operator filtering
// =========================================================================
function setApprovalForAll(address operator, bool approved)
public
override (ERC721A)
onlyAllowedOperatorApproval(operator)
{
if (initialTransferLockOn) {
revert TransfersLocked();
}
super.setApprovalForAll(operator, approved);
}
function approve(address operator, uint256 tokenId)
public
payable
override (ERC721A)
onlyAllowedOperatorApproval(operator)
{
if (initialTransferLockOn) {
revert TransfersLocked();
}
super.approve(operator, tokenId);
}
function transferFrom(address from, address to, uint256 tokenId)
public
payable
override (ERC721A)
onlyAllowedOperator(from)
{
super.transferFrom(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId)
public
payable
override (ERC721A)
onlyAllowedOperator(from)
{
super.safeTransferFrom(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
payable
override (ERC721A)
onlyAllowedOperator(from)
{
super.safeTransferFrom(from, to, tokenId, data);
}
function setOperatorFilteringEnabled(bool value) public onlyOwner {
operatorFilteringEnabled = value;
}
function _operatorFilteringEnabled() internal view override returns (bool) {
return operatorFilteringEnabled;
}
// =========================================================================
// Registry Check
// =========================================================================
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal override {
// Check transfer lock
if (initialTransferLockOn && from != address(0) && to != address(0)) {
revert TransfersLocked();
}
// Check your custom registry
if (!_isValidAgainstRegistry(msg.sender)) {
revert NotAllowedByRegistry();
}
// Add royalty enforcement validation (skip for minting)
if (from != address(0) && _transferValidator != address(0)) {
// For ERC721A batch transfers, validate each token
for (uint256 i = 0; i < quantity; i++) {
ITransferValidator(_transferValidator).validateTransfer(
msg.sender,
from,
to,
startTokenId + i
);
}
}
super._beforeTokenTransfers(from, to, startTokenId, quantity);
}
function _isValidAgainstRegistry(address operator)
internal
view
returns (bool)
{
if (isRegistryActive) {
IRegistry registry = IRegistry(registryAddress);
return registry.isAllowedOperator(operator);
}
return true;
}
function setIsRegistryActive(bool _isRegistryActive) external onlyOwner {
if (registryAddress == address(0)) revert RegistryNotSet();
isRegistryActive = _isRegistryActive;
}
function setRegistryAddress(address _registryAddress) external onlyOwner {
registryAddress = _registryAddress;
}
// =========================================================================
// ERC165
// =========================================================================
function supportsInterface(bytes4 interfaceId) public view override (ERC721A, ERC2981) returns (bool) {
return
interfaceId == type(ICreatorToken).interfaceId ||
ERC721A.supportsInterface(interfaceId) ||
ERC2981.supportsInterface(interfaceId);
}
// =========================================================================
// ERC2891
// =========================================================================
function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyOwner {
if (feeNumerator > 1000) {
revert MaxFeeExceeded();
}
_setDefaultRoyalty(receiver, feeNumerator);
}
function setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) external onlyOwner {
if (feeNumerator > 1000) {
revert MaxFeeExceeded();
}
_setTokenRoyalty(tokenId, receiver, feeNumerator);
}
// =========================================================================
// Metadata
// =========================================================================
function setBaseURI(string calldata baseURI) external onlyOwner {
_baseTokenURI = baseURI;
}
function setPlaceholderBaseURI(string calldata placeholderURI) external onlyOwner {
_placeHolderTokenURI = placeholderURI;
}
function _baseURI() internal view override returns (string memory) {
return _baseTokenURI;
}
function _placeHolderURI() internal view returns (string memory) {
return _placeHolderTokenURI;
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
string memory placeHolderURI = _placeHolderURI();
if (bytes(baseURI).length != 0) {
return string(abi.encodePacked(baseURI, "/", _toString(tokenId), ".json"));
}
if (bytes(placeHolderURI).length != 0) {
return placeHolderURI;
}
return "";
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// 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 {
// Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
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 packed) {
if (_startTokenId() <= tokenId) {
packed = _packedOwnerships[tokenId];
// If not burned.
if (packed & _BITMASK_BURNED == 0) {
// If the data at the starting slot does not exist, start the scan.
if (packed == 0) {
if (tokenId >= _currentIndex) revert OwnerQueryForNonexistentToken();
// 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, `tokenId` will not underflow.
//
// We can directly compare the packed value.
// If the address is zero, packed will be zero.
for (;;) {
unchecked {
packed = _packedOwnerships[--tokenId];
}
if (packed == 0) continue;
return packed;
}
}
// Otherwise, the data exists and is not burned. We can skip the scan.
// This is possible because we have already achieved the target condition.
// This saves 2143 gas on transfers of initialized tokens.
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. See {ERC721A-_approve}.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
*/
function approve(address to, uint256 tokenId) public payable virtual override {
_approve(to, tokenId, true);
}
/**
* @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 {
_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].value`.
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 payable 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 payable 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 payable 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.
// The duplicated `log4` removes an extra check and reduces stack juggling.
// The assembly, together with the surrounding Solidity code, have been
// delicately arranged to nudge the compiler into producing optimized opcodes.
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`.
)
// The `iszero(eq(,))` check ensures that large values of `quantity`
// that overflows uint256 will make the loop run out of gas.
// The compiler will optimize the `iszero` away for performance.
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, '');
}
// =============================================================
// APPROVAL OPERATIONS
// =============================================================
/**
* @dev Equivalent to `_approve(to, tokenId, false)`.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_approve(to, tokenId, false);
}
/**
* @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:
*
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function _approve(
address to,
uint256 tokenId,
bool approvalCheck
) internal virtual {
address owner = ownerOf(tokenId);
if (approvalCheck)
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
// =============================================================
// 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 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
// We will need 1 word for the trailing zeros padding, 1 word for the length,
// and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
let m := add(mload(0x40), 0xa0)
// Update the free memory pointer to allocate.
mstore(0x40, m)
// Assign the `str` to the end.
str := sub(m, 0x20)
// Zeroize the slot after the string.
mstore(str, 0)
// 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
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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 (last updated v5.1.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.20;
import {IERC2981} from "../../interfaces/IERC2981.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
*
* Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
* fee is specified in basis points by default.
*
* IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
* https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the ERC. Marketplaces are expected to
* voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
*/
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 tokenId => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1).
*/
error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator);
/**
* @dev The default royalty receiver is invalid.
*/
error ERC2981InvalidDefaultRoyaltyReceiver(address receiver);
/**
* @dev The royalty set for a specific `tokenId` is invalid (eg. (numerator / denominator) >= 1).
*/
error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator);
/**
* @dev The royalty receiver for `tokenId` is invalid.
*/
error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver);
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981
*/
function royaltyInfo(
uint256 tokenId,
uint256 salePrice
) public view virtual returns (address receiver, uint256 amount) {
RoyaltyInfo storage _royaltyInfo = _tokenRoyaltyInfo[tokenId];
address royaltyReceiver = _royaltyInfo.receiver;
uint96 royaltyFraction = _royaltyInfo.royaltyFraction;
if (royaltyReceiver == address(0)) {
royaltyReceiver = _defaultRoyaltyInfo.receiver;
royaltyFraction = _defaultRoyaltyInfo.royaltyFraction;
}
uint256 royaltyAmount = (salePrice * royaltyFraction) / _feeDenominator();
return (royaltyReceiver, royaltyAmount);
}
/**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
/**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
uint256 denominator = _feeDenominator();
if (feeNumerator > denominator) {
// Royalty fee will exceed the sale price
revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator);
}
if (receiver == address(0)) {
revert ERC2981InvalidDefaultRoyaltyReceiver(address(0));
}
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
/**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {
uint256 denominator = _feeDenominator();
if (feeNumerator > denominator) {
// Royalty fee will exceed the sale price
revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator);
}
if (receiver == address(0)) {
revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0));
}
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/BitMaps.sol)
pragma solidity ^0.8.20;
/**
* @dev Library for managing uint256 to bool mapping in a compact and efficient way, provided the keys are sequential.
* Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
*
* BitMaps pack 256 booleans across each bit of a single 256-bit slot of `uint256` type.
* Hence booleans corresponding to 256 _sequential_ indices would only consume a single slot,
* unlike the regular `bool` which would consume an entire slot for a single value.
*
* This results in gas savings in two ways:
*
* - Setting a zero value to non-zero only once every 256 times
* - Accessing the same warm slot for every 256 _sequential_ indices
*/
library BitMaps {
struct BitMap {
mapping(uint256 bucket => uint256) _data;
}
/**
* @dev Returns whether the bit at `index` is set.
*/
function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
uint256 bucket = index >> 8;
uint256 mask = 1 << (index & 0xff);
return bitmap._data[bucket] & mask != 0;
}
/**
* @dev Sets the bit at `index` to the boolean `value`.
*/
function setTo(BitMap storage bitmap, uint256 index, bool value) internal {
if (value) {
set(bitmap, index);
} else {
unset(bitmap, index);
}
}
/**
* @dev Sets the bit at `index`.
*/
function set(BitMap storage bitmap, uint256 index) internal {
uint256 bucket = index >> 8;
uint256 mask = 1 << (index & 0xff);
bitmap._data[bucket] |= mask;
}
/**
* @dev Unsets the bit at `index`.
*/
function unset(BitMap storage bitmap, uint256 index) internal {
uint256 bucket = index >> 8;
uint256 mask = 1 << (index & 0xff);
bitmap._data[bucket] &= ~mask;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Optimized and flexible operator filterer to abide to OpenSea's
/// mandatory on-chain royalty enforcement in order for new collections to
/// receive royalties.
/// For more information, see:
/// See: https://github.com/ProjectOpenSea/operator-filter-registry
abstract contract OperatorFilterer {
/// @dev The default OpenSea operator blocklist subscription.
address internal constant _DEFAULT_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
/// @dev The OpenSea operator filter registry.
address internal constant _OPERATOR_FILTER_REGISTRY = 0x000000000000AAeB6D7670E522A718067333cd4E;
/// @dev Registers the current contract to OpenSea's operator filter,
/// and subscribe to the default OpenSea operator blocklist.
/// Note: Will not revert nor update existing settings for repeated registration.
function _registerForOperatorFiltering() internal virtual {
_registerForOperatorFiltering(_DEFAULT_SUBSCRIPTION, true);
}
/// @dev Registers the current contract to OpenSea's operator filter.
/// Note: Will not revert nor update existing settings for repeated registration.
function _registerForOperatorFiltering(address subscriptionOrRegistrantToCopy, bool subscribe)
internal
virtual
{
/// @solidity memory-safe-assembly
assembly {
let functionSelector := 0x7d3e3dbe // `registerAndSubscribe(address,address)`.
// Clean the upper 96 bits of `subscriptionOrRegistrantToCopy` in case they are dirty.
subscriptionOrRegistrantToCopy := shr(96, shl(96, subscriptionOrRegistrantToCopy))
for {} iszero(subscribe) {} {
if iszero(subscriptionOrRegistrantToCopy) {
functionSelector := 0x4420e486 // `register(address)`.
break
}
functionSelector := 0xa0af2903 // `registerAndCopyEntries(address,address)`.
break
}
// Store the function selector.
mstore(0x00, shl(224, functionSelector))
// Store the `address(this)`.
mstore(0x04, address())
// Store the `subscriptionOrRegistrantToCopy`.
mstore(0x24, subscriptionOrRegistrantToCopy)
// Register into the registry.
if iszero(call(gas(), _OPERATOR_FILTER_REGISTRY, 0, 0x00, 0x44, 0x00, 0x04)) {
// If the function selector has not been overwritten,
// it is an out-of-gas error.
if eq(shr(224, mload(0x00)), functionSelector) {
// To prevent gas under-estimation.
revert(0, 0)
}
}
// Restore the part of the free memory pointer that was overwritten,
// which is guaranteed to be zero, because of Solidity's memory size limits.
mstore(0x24, 0)
}
}
/// @dev Modifier to guard a function and revert if the caller is a blocked operator.
modifier onlyAllowedOperator(address from) virtual {
if (from != msg.sender) {
if (!_isPriorityOperator(msg.sender)) {
if (_operatorFilteringEnabled()) _revertIfBlocked(msg.sender);
}
}
_;
}
/// @dev Modifier to guard a function from approving a blocked operator..
modifier onlyAllowedOperatorApproval(address operator) virtual {
if (!_isPriorityOperator(operator)) {
if (_operatorFilteringEnabled()) _revertIfBlocked(operator);
}
_;
}
/// @dev Helper function that reverts if the `operator` is blocked by the registry.
function _revertIfBlocked(address operator) private view {
/// @solidity memory-safe-assembly
assembly {
// Store the function selector of `isOperatorAllowed(address,address)`,
// shifted left by 6 bytes, which is enough for 8tb of memory.
// We waste 6-3 = 3 bytes to save on 6 runtime gas (PUSH1 0x224 SHL).
mstore(0x00, 0xc6171134001122334455)
// Store the `address(this)`.
mstore(0x1a, address())
// Store the `operator`.
mstore(0x3a, operator)
// `isOperatorAllowed` always returns true if it does not revert.
if iszero(staticcall(gas(), _OPERATOR_FILTER_REGISTRY, 0x16, 0x44, 0x00, 0x00)) {
// Bubble up the revert if the staticcall reverts.
returndatacopy(0x00, 0x00, returndatasize())
revert(0x00, returndatasize())
}
// We'll skip checking if `from` is inside the blacklist.
// Even though that can block transferring out of wrapper contracts,
// we don't want tokens to be stuck.
// Restore the part of the free memory pointer that was overwritten,
// which is guaranteed to be zero, if less than 8tb of memory is used.
mstore(0x3a, 0)
}
}
/// @dev For deriving contracts to override, so that operator filtering
/// can be turned on / off.
/// Returns true by default.
function _operatorFilteringEnabled() internal view virtual returns (bool) {
return true;
}
/// @dev For deriving contracts to override, so that preferred marketplaces can
/// skip operator filtering, helping users save gas.
/// Returns false for all inputs by default.
function _isPriorityOperator(address) internal view virtual returns (bool) {
return false;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MerkleProof.sol)
// This file was procedurally generated from scripts/generate/templates/MerkleProof.js.
pragma solidity ^0.8.20;
import {Hashes} from "./Hashes.sol";
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The tree and the proofs can be generated using our
* https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
* You will find a quickstart guide in the readme.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the Merkle tree could be reinterpreted as a leaf value.
* OpenZeppelin's JavaScript library generates Merkle trees that are safe
* against this attack out of the box.
*
* IMPORTANT: Consider memory side-effects when using custom hashing functions
* that access memory in an unsafe way.
*
* NOTE: This library supports proof verification for merkle trees built using
* custom _commutative_ hashing functions (i.e. `H(a, b) == H(b, a)`). Proving
* leaf inclusion in trees built using non-commutative hashing functions requires
* additional logic that is not supported by this library.
*/
library MerkleProof {
/**
*@dev The multiproof provided is not valid.
*/
error MerkleProofInvalidMultiproof();
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in memory with the default hashing function.
*/
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in memory with the default hashing function.
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in memory with a custom hashing function.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProof(proof, leaf, hasher) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in memory with a custom hashing function.
*/
function processProof(
bytes32[] memory proof,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = hasher(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with the default hashing function.
*/
function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with the default hashing function.
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with a custom hashing function.
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProofCalldata(proof, leaf, hasher) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with a custom hashing function.
*/
function processProofCalldata(
bytes32[] calldata proof,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = hasher(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in memory with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProof}.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in memory with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = Hashes.commutativeKeccak256(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in memory with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProof}.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProof(proof, proofFlags, leaves, hasher) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in memory with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = hasher(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in calldata with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProofCalldata}.
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in calldata with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = Hashes.commutativeKeccak256(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in calldata with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProofCalldata}.
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves, hasher) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in calldata with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = hasher(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// 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();
/**
* 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 payable;
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
/**
* @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 payable;
/**
* @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 payable;
/**
* @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
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*
* NOTE: ERC-2981 allows setting the royalty to 100% of the price. In that case all the price would be sent to the
* royalty receiver and 0 tokens to the seller. Contracts dealing with royalty should consider empty transfers.
*/
function royaltyInfo(
uint256 tokenId,
uint256 salePrice
) external view returns (address receiver, uint256 royaltyAmount);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC-165 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);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/Hashes.sol)
pragma solidity ^0.8.20;
/**
* @dev Library of standard hash functions.
*
* _Available since v5.1._
*/
library Hashes {
/**
* @dev Commutative Keccak256 hash of a sorted pair of bytes32. Frequently used when working with merkle proofs.
*
* NOTE: Equivalent to the `standardNodeHash` in our https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
*/
function commutativeKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32) {
return a < b ? efficientKeccak256(a, b) : efficientKeccak256(b, a);
}
/**
* @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory.
*/
function efficientKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32 value) {
assembly ("memory-safe") {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* 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[ERC 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);
}{
"remappings": [
"@rari-capital/solmate/=lib/solmate/",
"ds-test/=lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"murky/=lib/murky/src/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"solarray/=lib/solarray/src/",
"solady/=lib/solady/",
"seaport-sol/=lib/seaport-sol/",
"seaport-types/=lib/seaport-types/",
"seaport-core/=lib/seaport-core/",
"seaport/=contracts/",
"closedsea/=lib/closedsea/",
"erc721a/=lib/closedsea/lib/erc721a/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"erc721a-upgradeable/=lib/closedsea/lib/erc721a-upgradeable/contracts/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts-upgradeable/=lib/closedsea/lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"operator-filter-registry/=lib/closedsea/lib/operator-filter-registry/",
"solmate/=lib/solmate/src/"
],
"optimizer": {
"enabled": true,
"runs": 1000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[],"name":"FeeTransferFailed","type":"error"},{"inputs":[],"name":"InputLengthsMismatch","type":"error"},{"inputs":[],"name":"InvalidLaunchpadFee","type":"error"},{"inputs":[],"name":"InvalidLaunchpadFeeAddress","type":"error"},{"inputs":[],"name":"InvalidMerkleProof","type":"error"},{"inputs":[],"name":"MaxFeeExceeded","type":"error"},{"inputs":[],"name":"MaxSupplyExceeded","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotAllowedByRegistry","type":"error"},{"inputs":[],"name":"NotEnoughAllowance","type":"error"},{"inputs":[],"name":"NotEnoughBalance","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"PaymentTransferFailed","type":"error"},{"inputs":[],"name":"PublicSaleClosed","type":"error"},{"inputs":[],"name":"RegistryNotSet","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"TransfersLocked","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"WrongWeiSent","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":"feeAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"}],"name":"LaunchpadFeeSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenPaymentSent","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":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"airDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currency","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endTimePhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endTimePhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endTimePhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidationFunction","outputs":[{"internalType":"bytes4","name":"functionSignature","type":"bytes4"},{"internalType":"bool","name":"isViewFunction","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"address","name":"validator","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialTransferLockOn","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":"isRegistryActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchpadCutBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchpadFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchpadFeeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWalletPhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWalletPhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWalletPhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyPhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyPhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupplyPhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootPhase1","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootPhase2","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootPhase3","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintPhase1","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintPhase2","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mintPhase3","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorFilteringEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","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":"payable","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":"payable","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":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newEndTime","type":"uint256"}],"name":"setEndTimePhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newEndTime","type":"uint256"}],"name":"setEndTimePhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newEndTime","type":"uint256"}],"name":"setEndTimePhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isRegistryActive","type":"bool"}],"name":"setIsRegistryActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxPerWallet","type":"uint256"}],"name":"setMaxPerWalletPhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxPerWallet","type":"uint256"}],"name":"setMaxPerWalletPhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxPerWallet","type":"uint256"}],"name":"setMaxPerWalletPhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupplyPhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupplyPhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupplyPhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"setMerkleRootPhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"setMerkleRootPhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"setMerkleRootPhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setOperatorFilteringEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"placeholderURI","type":"string"}],"name":"setPlaceholderBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPricePhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPricePhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPricePhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registryAddress","type":"address"}],"name":"setRegistryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStartTime","type":"uint256"}],"name":"setStartTimePhase1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStartTime","type":"uint256"}],"name":"setStartTimePhase2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStartTime","type":"uint256"}],"name":"setStartTimePhase3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTimePhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTimePhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTimePhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupplyPhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupplyPhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupplyPhase3","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletMintsPhase1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletMintsPhase2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletMintsPhase3","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawERC20To","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
65d26730cc3b5a600c556101f4600d819055600e805473bdb9e0b47a02c45e3b50973a18452dc23ce726976001600160a01b031991821617909155600f805490911690556010556011805461ffff191661010117905560a06040525f608090815260129061006d908261040f565b506040518060a00160405280606381526020016145e160639139601390610094908261040f565b506368c168406014556368c16f486015555f601655662386f26fc1000060185560016019555f5160206146445f395f51905f525f1b601a556368c16f48601c556368c17d58601d555f601e55662386f26fc1000060205560046021555f5160206146445f395f51905f525f1b6022556368c17d586024556368c420586025555f602655662386f26fc1000060285560046029555f5f1b602a55348015610138575f5ffd5b50604080518082018252600b81526a506f6c795069636b73414960a81b602080830191909152825180840190935260058352645049434b5360d81b9083015290338061019e57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6101a7816101f6565b5060056101b4838261040f565b5060066101c1828261040f565b50506001600355506101d1610245565b6101f17340598a99f1e3df7293c272f143fbfeeb463d71976101f4610266565b6104c9565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610264733cc6cdda760b79bafa08df41ecfa224f810dceb66001610308565b565b6127106001600160601b0382168110156102a557604051636f483d0960e01b81526001600160601b038316600482015260248101829052604401610195565b6001600160a01b0383166102ce57604051635b6cc80560e11b81525f6004820152602401610195565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b6001600160a01b0390911690637d3e3dbe81610335578261032e5750634420e486610335565b5063a0af29035b8060e01b5f52306004528260245260045f60445f5f6daaeb6d7670e522a718067333cd4e5af161036e57805f5160e01c0361036e575f5ffd5b505f6024525050565b634e487b7160e01b5f52604160045260245ffd5b600181811c9082168061039f57607f821691505b6020821081036103bd57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561040a57805f5260205f20601f840160051c810160208510156103e85750805b601f840160051c820191505b81811015610407575f81556001016103f4565b50505b505050565b81516001600160401b0381111561042857610428610377565b61043c81610436845461038b565b846103c3565b6020601f82116001811461046e575f83156104575750848201515b5f19600385901b1c1916600184901b178455610407565b5f84815260208120601f198516915b8281101561049d578785015182556020948501946001909201910161047d565b50848210156104ba57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b61410b806104d65f395ff3fe6080604052600436106105b6575f3560e01c8063691ce970116102f0578063aa60bdd011610191578063d5abeb01116100e7578063e985e9c511610092578063f3f119f11161006d578063f3f119f114610f91578063f4f3b20014610fa6578063fb796e6c14610fc5575f5ffd5b8063e985e9c514610f05578063ed9aab5114610f4c578063f2fde38b14610f72575f5ffd5b8063e56e9ac0116100c2578063e56e9ac014610ebc578063e5a6b10f14610ed1578063e5e2a0f614610ef0575f5ffd5b8063d5abeb0114610e69578063e079e46114610e7e578063e1136b3d14610e9d575f5ffd5b8063b88d4fde11610147578063cafd705f11610122578063cafd705f14610e2a578063d1c026c914610e3f578063d2762b4614610e54575f5ffd5b8063b88d4fde14610dd9578063c3d923a614610dec578063c87b56dd14610e0b575f5ffd5b8063abd017ea11610177578063abd017ea14610d7c578063ac19701b14610d9b578063b7c0b8e814610dba575f5ffd5b8063aa60bdd014610d3e578063ab7b499314610d5d575f5ffd5b8063871215d41161024657806396db3e89116101fc578063a42c05ba116101d7578063a42c05ba14610cf5578063a9fc664e14610d0a578063aa0678ff14610d29575f5ffd5b806396db3e8914610c985780639e5f94a714610cb7578063a22cb46514610cd6575f5ffd5b80638e9a85f31161022c5780638e9a85f314610c5c57806395d89b4114610c7157806396ce3bfa14610c85575f5ffd5b8063871215d414610c2b5780638da5cb5b14610c40575f5ffd5b806372b0d90c116102a65780637d4b5a21116102815780637d4b5a2114610be45780637f371aa014610bf7578063858633f214610c0c575f5ffd5b806372b0d90c14610b9157806376ee015314610bb057806379544c8614610bcf575f5ffd5b806370a08231116102d657806370a0823114610b3f578063715018a614610b5e57806371be5e1414610b72575f5ffd5b8063691ce97014610b015780636f8b44b014610b20575f5ffd5b80633ccfd60b1161045a57806354389437116103b057806359a2f3bd116103665780636352211e116103415780636352211e14610aae57806364f52a1f14610acd57806365216a4114610ae2575f5ffd5b806359a2f3bd14610a6f5780635c1afecb14610a845780635d99a0cf14610a99575f5ffd5b806355f5f0661161039657806355f5f06614610a1257806355f804b314610a315780635944c75314610a50575f5ffd5b806354389437146109e8578063545b70b2146109fd575f5ffd5b8063462fed14116104105780634b21839e116103eb5780634b21839e146109955780634ed69eaf146109b45780634f115db1146109d3575f5ffd5b8063462fed141461093857806346fff98d14610957578063484b973c14610976575f5ffd5b806341d94c981161044057806341d94c98146108fd57806342842e0e1461091257806342b5e15c14610925575f5ffd5b80633ccfd60b146108d4578063406466a7146108e8575f5ffd5b806312b365101161050f578063251c21ec116104c557806330db1d5b116104a057806330db1d5b146108755780633bf30394146108945780633c6d5762146108a9575f5ffd5b8063251c21ec146107f95780632a55205a1461081857806330a0896514610856575f5ffd5b8063189ce8b1116104f5578063189ce8b1146107a857806321b8acd7146107c757806323b872dd146107e6575f5ffd5b806312b365101461076f57806318160ddd1461078d575f5ffd5b8063081812fc1161056f5780630c92b6311161054a5780630c92b631146106e55780630d4c1828146107045780630d705df61461072f575f5ffd5b8063081812fc1461067e578063095ea7b3146106b5578063098144d4146106c8575f5ffd5b806304634d8d1161059f57806304634d8d1461062757806306fdde03146106485780630759f2d814610669575f5ffd5b80630141a449146105ba57806301ffc9a7146105f8575b5f5ffd5b3480156105c5575f5ffd5b506105e56105d4366004613893565b602b6020525f908152604090205481565b6040519081526020015b60405180910390f35b348015610603575f5ffd5b506106176106123660046138c3565b610fde565b60405190151581526020016105ef565b348015610632575f5ffd5b506106466106413660046138f9565b611030565b005b348015610653575f5ffd5b5061065c611077565b6040516105ef919061395a565b348015610674575f5ffd5b506105e560165481565b348015610689575f5ffd5b5061069d61069836600461396c565b611107565b6040516001600160a01b0390911681526020016105ef565b6106466106c3366004613983565b611162565b3480156106d3575f5ffd5b50600b546001600160a01b031661069d565b3480156106f0575f5ffd5b506106466106ff36600461396c565b6111af565b34801561070f575f5ffd5b506105e561071e366004613893565b60236020525f908152604090205481565b34801561073a575f5ffd5b50604080517fcaee23ea00000000000000000000000000000000000000000000000000000000815260016020820152016105ef565b34801561077a575f5ffd5b5060115461061790610100900460ff1681565b348015610798575f5ffd5b50600454600354035f19016105e5565b3480156107b3575f5ffd5b506106466107c23660046139ad565b6111bc565b3480156107d2575f5ffd5b506106466107e136600461396c565b611303565b6106466107f43660046139e4565b611310565b348015610804575f5ffd5b5061064661081336600461396c565b611346565b348015610823575f5ffd5b50610837610832366004613a22565b611353565b604080516001600160a01b0390931683526020830191909152016105ef565b348015610861575f5ffd5b50600e5461069d906001600160a01b031681565b348015610880575f5ffd5b5061064661088f36600461396c565b6113e5565b34801561089f575f5ffd5b506105e5601e5481565b3480156108b4575f5ffd5b506105e56108c3366004613893565b601b6020525f908152604090205481565b3480156108df575f5ffd5b506106466113f2565b3480156108f3575f5ffd5b506105e560285481565b348015610908575f5ffd5b506105e560155481565b6106466109203660046139e4565b61146e565b61064661093336600461396c565b61149e565b348015610943575f5ffd5b5061064661095236600461396c565b611849565b348015610962575f5ffd5b50610646610971366004613a4f565b611856565b348015610981575f5ffd5b50610646610990366004613983565b6118c3565b3480156109a0575f5ffd5b506106466109af36600461396c565b61191b565b3480156109bf575f5ffd5b506106466109ce366004613a6a565b611928565b3480156109de575f5ffd5b506105e5601c5481565b3480156109f3575f5ffd5b506105e560245481565b348015610a08575f5ffd5b506105e560175481565b348015610a1d575f5ffd5b50610646610a2c36600461396c565b61193d565b348015610a3c575f5ffd5b50610646610a4b366004613a6a565b61194a565b348015610a5b575f5ffd5b50610646610a6a366004613ad8565b61195f565b348015610a7a575f5ffd5b506105e560215481565b348015610a8f575f5ffd5b506105e5601f5481565b348015610aa4575f5ffd5b506105e560205481565b348015610ab9575f5ffd5b5061069d610ac836600461396c565b6119a3565b348015610ad8575f5ffd5b506105e5601a5481565b348015610aed575f5ffd5b50610646610afc366004613be5565b6119ad565b348015610b0c575f5ffd5b50610646610b1b36600461396c565b611aa4565b348015610b2b575f5ffd5b50610646610b3a36600461396c565b611ab1565b348015610b4a575f5ffd5b506105e5610b59366004613893565b611abe565b348015610b69575f5ffd5b50610646611b24565b348015610b7d575f5ffd5b50610646610b8c36600461396c565b611b37565b348015610b9c575f5ffd5b50610646610bab366004613893565b611b44565b348015610bbb575f5ffd5b50610646610bca36600461396c565b611bbc565b348015610bda575f5ffd5b506105e5601d5481565b610646610bf2366004613caa565b611bc9565b348015610c02575f5ffd5b506105e560265481565b348015610c17575f5ffd5b50610646610c2636600461396c565b612017565b348015610c36575f5ffd5b506105e5600c5481565b348015610c4b575f5ffd5b505f546001600160a01b031661069d565b348015610c67575f5ffd5b506105e560275481565b348015610c7c575f5ffd5b5061065c612024565b610646610c93366004613caa565b612033565b348015610ca3575f5ffd5b50610646610cb236600461396c565b612468565b348015610cc2575f5ffd5b50610646610cd136600461396c565b612475565b348015610ce1575f5ffd5b50610646610cf0366004613d1f565b612482565b348015610d00575f5ffd5b506105e5602a5481565b348015610d15575f5ffd5b50610646610d24366004613893565b6124ca565b348015610d34575f5ffd5b506105e560145481565b348015610d49575f5ffd5b50610646610d5836600461396c565b612540565b348015610d68575f5ffd5b50610646610d77366004613893565b61254d565b348015610d87575f5ffd5b506011546106179062010000900460ff1681565b348015610da6575f5ffd5b50610646610db536600461396c565b612596565b348015610dc5575f5ffd5b50610646610dd4366004613a4f565b6125a3565b610646610de7366004613d4b565b6125be565b348015610df7575f5ffd5b50610646610e0636600461396c565b6125ef565b348015610e16575f5ffd5b5061065c610e2536600461396c565b6125fc565b348015610e35575f5ffd5b506105e560295481565b348015610e4a575f5ffd5b506105e560255481565b348015610e5f575f5ffd5b506105e5600d5481565b348015610e74575f5ffd5b506105e560105481565b348015610e89575f5ffd5b50610646610e9836600461396c565b6126b2565b348015610ea8575f5ffd5b50610646610eb736600461396c565b6126bf565b348015610ec7575f5ffd5b506105e560195481565b348015610edc575f5ffd5b50600f5461069d906001600160a01b031681565b348015610efb575f5ffd5b506105e560185481565b348015610f10575f5ffd5b50610617610f1f3660046139ad565b6001600160a01b039182165f908152600a6020908152604080832093909416825291909152205460ff1690565b348015610f57575f5ffd5b5060115461069d90630100000090046001600160a01b031681565b348015610f7d575f5ffd5b50610646610f8c366004613893565b6126cc565b348015610f9c575f5ffd5b506105e560225481565b348015610fb1575f5ffd5b50610646610fc0366004613893565b612724565b348015610fd0575f5ffd5b506011546106179060ff1681565b5f6001600160e01b031982167fad0d7f6c00000000000000000000000000000000000000000000000000000000148061101b575061101b82612867565b8061102a575061102a826128e6565b92915050565b611038612933565b6103e8816bffffffffffffffffffffffff1611156110695760405163f4df6ae560e01b815260040160405180910390fd5b6110738282612978565b5050565b60606005805461108690613e0d565b80601f01602080910402602001604051908101604052809291908181526020018280546110b290613e0d565b80156110fd5780601f106110d4576101008083540402835291602001916110fd565b820191905f5260205f20905b8154815290600101906020018083116110e057829003601f168201915b5050505050905090565b5f61111182612a5b565b611147576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505f908152600960205260409020546001600160a01b031690565b8160115460ff16156111775761117781612a8e565b601154610100900460ff16156111a0576040516336e278fd60e21b815260040160405180910390fd5b6111aa8383612acd565b505050565b6111b7612933565b602655565b6111c4612933565b6040516370a0823160e01b815230600482015282905f906001600160a01b038316906370a0823190602401602060405180830381865afa15801561120a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061122e9190613e45565b9050805f03611250576040516312171d8360e31b815260040160405180910390fd5b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152602482018390525f919084169063a9059cbb906044016020604051808303815f875af11580156112b8573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112dc9190613e5c565b9050806112fc576040516312171d8360e31b815260040160405180910390fd5b5050505050565b61130b612933565b602455565b826001600160a01b03811633146113355760115460ff16156113355761133533612a8e565b611340848484612ad9565b50505050565b61134e612933565b601455565b5f82815260026020526040812080548291906001600160a01b03811690600160a01b90046bffffffffffffffffffffffff16816113b05750506001546001600160a01b03811690600160a01b90046bffffffffffffffffffffffff165b5f6127106113cc6bffffffffffffffffffffffff841689613e8b565b6113d69190613ea2565b92989297509195505050505050565b6113ed612933565b602055565b6113fa612933565b5f80546040516001600160a01b039091169047908381818185875af1925050503d805f8114611444576040519150601f19603f3d011682016040523d82523d5f602084013e611449565b606091505b505090508061146b576040516312171d8360e31b815260040160405180910390fd5b50565b826001600160a01b03811633146114935760115460ff16156114935761149333612a8e565b611340848484612cde565b602454158015906114b0575060245442105b156114ce57604051636ea7008360e11b815260040160405180910390fd5b602554158015906114e0575060255442115b156114fe57604051636ea7008360e11b815260040160405180910390fd5b601054158015906115265750601054600454600354839190035f19016115249190613ec1565b115b1561154457604051638a164f6360e01b815260040160405180910390fd5b602654158015906115635750602654816027546115619190613ec1565b115b1561158157604051638a164f6360e01b815260040160405180910390fd5b5f81600c546028546115939190613ec1565b61159d9190613e8b565b600f549091506001600160a01b03166115d5578034146115d05760405163193e352b60e11b815260040160405180910390fd5b6116f1565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa15801561161f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116439190613e45565b10156116625760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa1580156116ac573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116d09190613e45565b10156116ef57604051634fd3af0760e01b815260040160405180910390fd5b505b6029541580159061171c5750602954335f908152602b602052604090205461171a908490613ec1565b115b1561173a57604051638a164f6360e01b815260040160405180910390fd5b600c545f90158015906117575750600e546001600160a01b031615155b1561176d5782600c5461176a9190613e8b565b90505b600d545f901580159061178a5750600e546001600160a01b031615155b156117b65761271061179c8385613ed4565b600d546117a99190613e8b565b6117b39190613ea2565b90505b5f6117c18284613ec1565b905080156117d2576117d281612cf8565b600f546001600160a01b0316158015906117eb57508084115b1561180357611803306117fe8387613ed4565b612ed7565b335f908152602b602052604081208054879290611821908490613ec1565b925050819055508460275f8282546118399190613ec1565b909155506112fc90503386612ff8565b611851612933565b602155565b61185e612933565b601154630100000090046001600160a01b03166118a7576040517fe048e71000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60118054911515620100000262ff000019909216919091179055565b6118cb612933565b601054158015906118f35750601054600454600354839190035f19016118f19190613ec1565b115b1561191157604051638a164f6360e01b815260040160405180910390fd5b6110738282612ff8565b611923612933565b601955565b611930612933565b60136111aa828483613f2b565b611945612933565b601a55565b611952612933565b60126111aa828483613f2b565b611967612933565b6103e8816bffffffffffffffffffffffff1611156119985760405163f4df6ae560e01b815260040160405180910390fd5b6111aa838383613130565b5f61102a82613231565b6119b5612933565b80518251146119f0576040517ffc4c603600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b82518110156111aa5760105415801590611a425750601054828281518110611a1c57611a1c613fe5565b6020026020010151611a366004546003545f199190030190565b611a409190613ec1565b115b15611a6057604051638a164f6360e01b815260040160405180910390fd5b611a9c838281518110611a7557611a75613fe5565b6020026020010151838381518110611a8f57611a8f613fe5565b6020026020010151612ff8565b6001016119f2565b611aac612933565b602555565b611ab9612933565b601055565b5f6001600160a01b038216611aff576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b03165f9081526008602052604090205467ffffffffffffffff1690565b611b2c612933565b611b355f6132b8565b565b611b3f612933565b602855565b611b4c612933565b5f816001600160a01b0316476040515f6040518083038185875af1925050503d805f8114611b95576040519150601f19603f3d011682016040523d82523d5f602084013e611b9a565b606091505b5050905080611073576040516312171d8360e31b815260040160405180910390fd5b611bc4612933565b602955565b60145415801590611bdb575060145442105b15611bf957604051636ea7008360e11b815260040160405180910390fd5b60155415801590611c0b575060155442115b15611c2957604051636ea7008360e11b815260040160405180910390fd5b60105415801590611c515750601054600454600354839190035f1901611c4f9190613ec1565b115b15611c6f57604051638a164f6360e01b815260040160405180910390fd5b60165415801590611c8e575060165481601754611c8c9190613ec1565b115b15611cac57604051638a164f6360e01b815260040160405180910390fd5b5f81600c54601854611cbe9190613ec1565b611cc89190613e8b565b600f549091506001600160a01b0316611d0057803414611cfb5760405163193e352b60e11b815260040160405180910390fd5b611e1c565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa158015611d4a573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d6e9190613e45565b1015611d8d5760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015611dd7573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611dfb9190613e45565b1015611e1a57604051634fd3af0760e01b815260040160405180910390fd5b505b601a5415611ebb576040516bffffffffffffffffffffffff193360601b1660208201525f90603401604051602081830303815290604052805190602001209050611e9c8585808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050601a549150849050613314565b611eb95760405163582f497d60e11b815260040160405180910390fd5b505b60195415801590611ee65750601954335f908152601b6020526040902054611ee4908490613ec1565b115b15611f0457604051638a164f6360e01b815260040160405180910390fd5b600c545f9015801590611f215750600e546001600160a01b031615155b15611f375782600c54611f349190613e8b565b90505b600d545f9015801590611f545750600e546001600160a01b031615155b15611f8057612710611f668385613ed4565b600d54611f739190613e8b565b611f7d9190613ea2565b90505b5f611f8b8284613ec1565b90508015611f9c57611f9c81612cf8565b600f546001600160a01b031615801590611fb557508084115b15611fc857611fc8306117fe8387613ed4565b335f908152601b602052604081208054879290611fe6908490613ec1565b925050819055508460175f828254611ffe9190613ec1565b9091555061200e90503386612ff8565b50505050505050565b61201f612933565b601655565b60606006805461108690613e0d565b601c54158015906120455750601c5442105b1561206357604051636ea7008360e11b815260040160405180910390fd5b601d54158015906120755750601d5442115b1561209357604051636ea7008360e11b815260040160405180910390fd5b601054158015906120bb5750601054600454600354839190035f19016120b99190613ec1565b115b156120d957604051638a164f6360e01b815260040160405180910390fd5b601e54158015906120f85750601e5481601f546120f69190613ec1565b115b1561211657604051638a164f6360e01b815260040160405180910390fd5b5f81600c546020546121289190613ec1565b6121329190613e8b565b600f549091506001600160a01b031661216a578034146121655760405163193e352b60e11b815260040160405180910390fd5b612286565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa1580156121b4573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906121d89190613e45565b10156121f75760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015612241573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122659190613e45565b101561228457604051634fd3af0760e01b815260040160405180910390fd5b505b60225415612325576040516bffffffffffffffffffffffff193360601b1660208201525f906034016040516020818303038152906040528051906020012090506123068585808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506022549150849050613314565b6123235760405163582f497d60e11b815260040160405180910390fd5b505b602154158015906123505750602154335f9081526023602052604090205461234e908490613ec1565b115b1561236e57604051638a164f6360e01b815260040160405180910390fd5b600c545f901580159061238b5750600e546001600160a01b031615155b156123a15782600c5461239e9190613e8b565b90505b600d545f90158015906123be5750600e546001600160a01b031615155b156123ea576127106123d08385613ed4565b600d546123dd9190613e8b565b6123e79190613ea2565b90505b5f6123f58284613ec1565b905080156124065761240681612cf8565b600f546001600160a01b03161580159061241f57508084115b1561243257612432306117fe8387613ed4565b335f9081526023602052604081208054879290612450908490613ec1565b9250508190555084601f5f828254611ffe9190613ec1565b612470612933565b602255565b61247d612933565b602a55565b8160115460ff16156124975761249781612a8e565b601154610100900460ff16156124c0576040516336e278fd60e21b815260040160405180910390fd5b6111aa8383613329565b6124d2612933565b600b80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff1983168117909355604080519190921680825260208201939093527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a15050565b612548612933565b601c55565b612555612933565b601180546001600160a01b039092166301000000027fffffffffffffffffff0000000000000000000000000000000000000000ffffff909216919091179055565b61259e612933565b601555565b6125ab612933565b6011805460ff1916911515919091179055565b836001600160a01b03811633146125e35760115460ff16156125e3576125e333612a8e565b6112fc85858585613394565b6125f7612933565b601e55565b606061260782612a5b565b61263d576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6126466133d8565b90505f6126516133e7565b905081515f1461268e5781612665856133f6565b604051602001612676929190614010565b60405160208183030381529060405292505050919050565b80511561269c579392505050565b505060408051602081019091525f815292915050565b6126ba612933565b601d55565b6126c7612933565b601855565b6126d4612933565b6001600160a01b03811661271b576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081525f60048201526024015b60405180910390fd5b61146b816132b8565b61272c612933565b6040516370a0823160e01b815230600482015281905f906001600160a01b038316906370a0823190602401602060405180830381865afa158015612772573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127969190613e45565b9050805f036127b8576040516312171d8360e31b815260040160405180910390fd5b5f826001600160a01b031663a9059cbb6127d95f546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303815f875af1158015612823573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128479190613e5c565b905080611340576040516312171d8360e31b815260040160405180910390fd5b5f6301ffc9a760e01b6001600160e01b0319831614806128b057507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b8061102a5750506001600160e01b0319167f5b5e139f000000000000000000000000000000000000000000000000000000001490565b5f6001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061102a57506301ffc9a760e01b6001600160e01b031983161461102a565b5f546001600160a01b03163314611b35576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401612712565b6127106bffffffffffffffffffffffff82168110156129da576040517f6f483d090000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff8316600482015260248101829052604401612712565b6001600160a01b038316612a1c576040517fb6d9900a0000000000000000000000000000000000000000000000000000000081525f6004820152602401612712565b50604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600155565b5f81600111158015612a6e575060035482105b801561102a5750505f90815260076020526040902054600160e01b161590565b69c61711340011223344555f5230601a5280603a525f5f604460166daaeb6d7670e522a718067333cd4e5afa612ac6573d5f5f3e3d5ffd5b5f603a5250565b61107382826001613439565b5f612ae382613231565b9050836001600160a01b0316816001600160a01b031614612b30576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8281526009602052604090208054338082146001600160a01b03881690911417612bb1576001600160a01b0386165f908152600a6020908152604080832033845290915290205460ff16612bb1576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516612bf1576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612bfe8686866001613520565b8015612c08575f82555b6001600160a01b038681165f9081526008602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260076020526040812091909155600160e11b84169003612c9557600184015f818152600760205260408120549003612c93576003548114612c93575f8181526007602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6111aa83838360405180602001604052805f8152506125be565b805f03612d31576040517f5e2a89dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e546001600160a01b0316612d73576040517fcd0081c200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f546001600160a01b0316612dfa57600e546040515f916001600160a01b03169083908381818185875af1925050503d805f8114612dcd576040519150601f19603f3d011682016040523d82523d5f602084013e612dd2565b606091505b5050905080612df457604051634033e4e360e01b815260040160405180910390fd5b50612e92565b600f54600e546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526044810184905291169081906323b872dd906064016020604051808303815f875af1925050508015612e72575060408051601f3d908101601f19168201909252612e6f91810190613e5c565b60015b612e8f57604051634033e4e360e01b815260040160405180910390fd5b50505b600e546040518281526001600160a01b03909116907f2b5dffd9914ddb43acdb6963bacf053a87bf9354300844f6339f17741e25145a9060200160405180910390a250565b805f03612ef757604051632ee66eed60e01b815260040160405180910390fd5b6001600160a01b038216612f1e57604051632ee66eed60e01b815260040160405180910390fd5b600f546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b039091169081906323b872dd906064016020604051808303815f875af1925050508015612f92575060408051601f3d908101601f19168201909252612f8f91810190613e5c565b60015b612faf57604051632ee66eed60e01b815260040160405180910390fd5b50826001600160a01b03167f5bfd86dd1dfba5846abf8c8ff49e529e997ac11be6a5ad81501ef4418f35968983604051612feb91815260200190565b60405180910390a2505050565b6003545f829003613035576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6130415f848385613520565b6001600160a01b0383165f8181526008602090815260408083208054680100000000000000018802019055848352600790915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b8181146130ed5780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f5fa46001016130b7565b50815f03613127576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035550505050565b6127106bffffffffffffffffffffffff8216811015613199576040517fdfd1fc1b000000000000000000000000000000000000000000000000000000008152600481018590526bffffffffffffffffffffffff8316602482015260448101829052606401612712565b6001600160a01b0383166131e2576040517f969f0852000000000000000000000000000000000000000000000000000000008152600481018590525f6024820152604401612712565b506040805180820182526001600160a01b0393841681526bffffffffffffffffffffffff92831660208083019182525f968752600290529190942093519051909116600160a01b029116179055565b5f8160011161329f57505f8181526007602052604081205490600160e01b8216900361329f57805f0361329a57600354821061328057604051636f96cda160e11b815260040160405180910390fd5b5b505f19015f818152600760205260409020548015613281575b919050565b604051636f96cda160e11b815260040160405180910390fd5b5f80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f82613320858461367c565b14949350505050565b335f818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61339f848484611310565b6001600160a01b0383163b15611340576133bb848484846136be565b611340576040516368d2bf6b60e11b815260040160405180910390fd5b60606012805461108690613e0d565b60606013805461108690613e0d565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a90048061340f5750819003601f19909101908152919050565b5f613443836119a3565b905081156134b757336001600160a01b038216146134b7576001600160a01b0381165f908152600a6020908152604080832033845290915290205460ff166134b7576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f83815260096020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b601154610100900460ff16801561353f57506001600160a01b03841615155b801561355357506001600160a01b03831615155b15613571576040516336e278fd60e21b815260040160405180910390fd5b61357a336137a5565b6135b0576040517f4c80d8be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416158015906135d25750600b546001600160a01b031615155b15613677575f5b8181101561367557600b546001600160a01b031663caee23ea3387876135ff8689613ec1565b6040516001600160e01b031960e087901b1681526001600160a01b03948516600482015292841660248401529216604482015260648101919091526084015f6040518083038186803b158015613653575f5ffd5b505afa158015613665573d5f5f3e3d5ffd5b5050600190920191506135d99050565b505b611340565b5f81815b84518110156136b6576136ac8286838151811061369f5761369f613fe5565b6020026020010151613856565b9150600101613680565b509392505050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a02906136f290339089908890889060040161407a565b6020604051808303815f875af192505050801561372c575060408051601f3d908101601f19168201909252613729918101906140ba565b60015b613788573d808015613759576040519150601f19603f3d011682016040523d82523d5f602084013e61375e565b606091505b5080515f03613780576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6011545f9062010000900460ff161561384e576011546040517fe18bc08a0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152630100000090920490911690819063e18bc08a90602401602060405180830381865afa158015613823573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906138479190613e5c565b9392505050565b506001919050565b5f818310613870575f828152602084905260409020613847565b505f9182526020526040902090565b6001600160a01b038116811461146b575f5ffd5b5f602082840312156138a3575f5ffd5b81356138478161387f565b6001600160e01b03198116811461146b575f5ffd5b5f602082840312156138d3575f5ffd5b8135613847816138ae565b80356bffffffffffffffffffffffff8116811461329a575f5ffd5b5f5f6040838503121561390a575f5ffd5b82356139158161387f565b9150613923602084016138de565b90509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f613847602083018461392c565b5f6020828403121561397c575f5ffd5b5035919050565b5f5f60408385031215613994575f5ffd5b823561399f8161387f565b946020939093013593505050565b5f5f604083850312156139be575f5ffd5b82356139c98161387f565b915060208301356139d98161387f565b809150509250929050565b5f5f5f606084860312156139f6575f5ffd5b8335613a018161387f565b92506020840135613a118161387f565b929592945050506040919091013590565b5f5f60408385031215613a33575f5ffd5b50508035926020909101359150565b801515811461146b575f5ffd5b5f60208284031215613a5f575f5ffd5b813561384781613a42565b5f5f60208385031215613a7b575f5ffd5b823567ffffffffffffffff811115613a91575f5ffd5b8301601f81018513613aa1575f5ffd5b803567ffffffffffffffff811115613ab7575f5ffd5b856020828401011115613ac8575f5ffd5b6020919091019590945092505050565b5f5f5f60608486031215613aea575f5ffd5b833592506020840135613afc8161387f565b9150613b0a604085016138de565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613b5057613b50613b13565b604052919050565b5f67ffffffffffffffff821115613b7157613b71613b13565b5060051b60200190565b5f82601f830112613b8a575f5ffd5b8135613b9d613b9882613b58565b613b27565b8082825260208201915060208360051b860101925085831115613bbe575f5ffd5b602085015b83811015613bdb578035835260209283019201613bc3565b5095945050505050565b5f5f60408385031215613bf6575f5ffd5b823567ffffffffffffffff811115613c0c575f5ffd5b8301601f81018513613c1c575f5ffd5b8035613c2a613b9882613b58565b8082825260208201915060208360051b850101925087831115613c4b575f5ffd5b6020840193505b82841015613c76578335613c658161387f565b825260209384019390910190613c52565b9450505050602083013567ffffffffffffffff811115613c94575f5ffd5b613ca085828601613b7b565b9150509250929050565b5f5f5f60408486031215613cbc575f5ffd5b833567ffffffffffffffff811115613cd2575f5ffd5b8401601f81018613613ce2575f5ffd5b803567ffffffffffffffff811115613cf8575f5ffd5b8660208260051b8401011115613d0c575f5ffd5b6020918201979096509401359392505050565b5f5f60408385031215613d30575f5ffd5b8235613d3b8161387f565b915060208301356139d981613a42565b5f5f5f5f60808587031215613d5e575f5ffd5b8435613d698161387f565b93506020850135613d798161387f565b925060408501359150606085013567ffffffffffffffff811115613d9b575f5ffd5b8501601f81018713613dab575f5ffd5b803567ffffffffffffffff811115613dc557613dc5613b13565b613dd8601f8201601f1916602001613b27565b818152886020838501011115613dec575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b600181811c90821680613e2157607f821691505b602082108103613e3f57634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215613e55575f5ffd5b5051919050565b5f60208284031215613e6c575f5ffd5b815161384781613a42565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761102a5761102a613e77565b5f82613ebc57634e487b7160e01b5f52601260045260245ffd5b500490565b8082018082111561102a5761102a613e77565b8181038181111561102a5761102a613e77565b601f8211156111aa57805f5260205f20601f840160051c81016020851015613f0c5750805b601f840160051c820191505b818110156112fc575f8155600101613f18565b67ffffffffffffffff831115613f4357613f43613b13565b613f5783613f518354613e0d565b83613ee7565b5f601f841160018114613f88575f8515613f715750838201355b5f19600387901b1c1916600186901b1783556112fc565b5f83815260208120601f198716915b82811015613fb75786850135825560209485019460019092019101613f97565b5086821015613fd3575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b5f52603260045260245ffd5b5f81518060208401855e5f93019283525090919050565b5f61401b8285613ff9565b7f2f00000000000000000000000000000000000000000000000000000000000000815261404b6001820185613ff9565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050195945050505050565b6001600160a01b03851681526001600160a01b0384166020820152826040820152608060608201525f6140b0608083018461392c565b9695505050505050565b5f602082840312156140ca575f5ffd5b8151613847816138ae56fea26469706673582212206d13b93a43ba7be4a90f1bff6dd012ee72c1e37e25c498e04d5b6f449f9174f164736f6c634300081c003368747470733a2f2f6d696e746966792d6c61756e63687061642e6e7963332e63646e2e6469676974616c6f6365616e7370616365732e636f6d2f32613666313361622d316437642d343134652d623034392d3738643963306439383637372e776562703f7a809d9563f15e69a103391ad5b443fab9122da1cf28c97874041fbc983c26
Deployed Bytecode
0x6080604052600436106105b6575f3560e01c8063691ce970116102f0578063aa60bdd011610191578063d5abeb01116100e7578063e985e9c511610092578063f3f119f11161006d578063f3f119f114610f91578063f4f3b20014610fa6578063fb796e6c14610fc5575f5ffd5b8063e985e9c514610f05578063ed9aab5114610f4c578063f2fde38b14610f72575f5ffd5b8063e56e9ac0116100c2578063e56e9ac014610ebc578063e5a6b10f14610ed1578063e5e2a0f614610ef0575f5ffd5b8063d5abeb0114610e69578063e079e46114610e7e578063e1136b3d14610e9d575f5ffd5b8063b88d4fde11610147578063cafd705f11610122578063cafd705f14610e2a578063d1c026c914610e3f578063d2762b4614610e54575f5ffd5b8063b88d4fde14610dd9578063c3d923a614610dec578063c87b56dd14610e0b575f5ffd5b8063abd017ea11610177578063abd017ea14610d7c578063ac19701b14610d9b578063b7c0b8e814610dba575f5ffd5b8063aa60bdd014610d3e578063ab7b499314610d5d575f5ffd5b8063871215d41161024657806396db3e89116101fc578063a42c05ba116101d7578063a42c05ba14610cf5578063a9fc664e14610d0a578063aa0678ff14610d29575f5ffd5b806396db3e8914610c985780639e5f94a714610cb7578063a22cb46514610cd6575f5ffd5b80638e9a85f31161022c5780638e9a85f314610c5c57806395d89b4114610c7157806396ce3bfa14610c85575f5ffd5b8063871215d414610c2b5780638da5cb5b14610c40575f5ffd5b806372b0d90c116102a65780637d4b5a21116102815780637d4b5a2114610be45780637f371aa014610bf7578063858633f214610c0c575f5ffd5b806372b0d90c14610b9157806376ee015314610bb057806379544c8614610bcf575f5ffd5b806370a08231116102d657806370a0823114610b3f578063715018a614610b5e57806371be5e1414610b72575f5ffd5b8063691ce97014610b015780636f8b44b014610b20575f5ffd5b80633ccfd60b1161045a57806354389437116103b057806359a2f3bd116103665780636352211e116103415780636352211e14610aae57806364f52a1f14610acd57806365216a4114610ae2575f5ffd5b806359a2f3bd14610a6f5780635c1afecb14610a845780635d99a0cf14610a99575f5ffd5b806355f5f0661161039657806355f5f06614610a1257806355f804b314610a315780635944c75314610a50575f5ffd5b806354389437146109e8578063545b70b2146109fd575f5ffd5b8063462fed14116104105780634b21839e116103eb5780634b21839e146109955780634ed69eaf146109b45780634f115db1146109d3575f5ffd5b8063462fed141461093857806346fff98d14610957578063484b973c14610976575f5ffd5b806341d94c981161044057806341d94c98146108fd57806342842e0e1461091257806342b5e15c14610925575f5ffd5b80633ccfd60b146108d4578063406466a7146108e8575f5ffd5b806312b365101161050f578063251c21ec116104c557806330db1d5b116104a057806330db1d5b146108755780633bf30394146108945780633c6d5762146108a9575f5ffd5b8063251c21ec146107f95780632a55205a1461081857806330a0896514610856575f5ffd5b8063189ce8b1116104f5578063189ce8b1146107a857806321b8acd7146107c757806323b872dd146107e6575f5ffd5b806312b365101461076f57806318160ddd1461078d575f5ffd5b8063081812fc1161056f5780630c92b6311161054a5780630c92b631146106e55780630d4c1828146107045780630d705df61461072f575f5ffd5b8063081812fc1461067e578063095ea7b3146106b5578063098144d4146106c8575f5ffd5b806304634d8d1161059f57806304634d8d1461062757806306fdde03146106485780630759f2d814610669575f5ffd5b80630141a449146105ba57806301ffc9a7146105f8575b5f5ffd5b3480156105c5575f5ffd5b506105e56105d4366004613893565b602b6020525f908152604090205481565b6040519081526020015b60405180910390f35b348015610603575f5ffd5b506106176106123660046138c3565b610fde565b60405190151581526020016105ef565b348015610632575f5ffd5b506106466106413660046138f9565b611030565b005b348015610653575f5ffd5b5061065c611077565b6040516105ef919061395a565b348015610674575f5ffd5b506105e560165481565b348015610689575f5ffd5b5061069d61069836600461396c565b611107565b6040516001600160a01b0390911681526020016105ef565b6106466106c3366004613983565b611162565b3480156106d3575f5ffd5b50600b546001600160a01b031661069d565b3480156106f0575f5ffd5b506106466106ff36600461396c565b6111af565b34801561070f575f5ffd5b506105e561071e366004613893565b60236020525f908152604090205481565b34801561073a575f5ffd5b50604080517fcaee23ea00000000000000000000000000000000000000000000000000000000815260016020820152016105ef565b34801561077a575f5ffd5b5060115461061790610100900460ff1681565b348015610798575f5ffd5b50600454600354035f19016105e5565b3480156107b3575f5ffd5b506106466107c23660046139ad565b6111bc565b3480156107d2575f5ffd5b506106466107e136600461396c565b611303565b6106466107f43660046139e4565b611310565b348015610804575f5ffd5b5061064661081336600461396c565b611346565b348015610823575f5ffd5b50610837610832366004613a22565b611353565b604080516001600160a01b0390931683526020830191909152016105ef565b348015610861575f5ffd5b50600e5461069d906001600160a01b031681565b348015610880575f5ffd5b5061064661088f36600461396c565b6113e5565b34801561089f575f5ffd5b506105e5601e5481565b3480156108b4575f5ffd5b506105e56108c3366004613893565b601b6020525f908152604090205481565b3480156108df575f5ffd5b506106466113f2565b3480156108f3575f5ffd5b506105e560285481565b348015610908575f5ffd5b506105e560155481565b6106466109203660046139e4565b61146e565b61064661093336600461396c565b61149e565b348015610943575f5ffd5b5061064661095236600461396c565b611849565b348015610962575f5ffd5b50610646610971366004613a4f565b611856565b348015610981575f5ffd5b50610646610990366004613983565b6118c3565b3480156109a0575f5ffd5b506106466109af36600461396c565b61191b565b3480156109bf575f5ffd5b506106466109ce366004613a6a565b611928565b3480156109de575f5ffd5b506105e5601c5481565b3480156109f3575f5ffd5b506105e560245481565b348015610a08575f5ffd5b506105e560175481565b348015610a1d575f5ffd5b50610646610a2c36600461396c565b61193d565b348015610a3c575f5ffd5b50610646610a4b366004613a6a565b61194a565b348015610a5b575f5ffd5b50610646610a6a366004613ad8565b61195f565b348015610a7a575f5ffd5b506105e560215481565b348015610a8f575f5ffd5b506105e5601f5481565b348015610aa4575f5ffd5b506105e560205481565b348015610ab9575f5ffd5b5061069d610ac836600461396c565b6119a3565b348015610ad8575f5ffd5b506105e5601a5481565b348015610aed575f5ffd5b50610646610afc366004613be5565b6119ad565b348015610b0c575f5ffd5b50610646610b1b36600461396c565b611aa4565b348015610b2b575f5ffd5b50610646610b3a36600461396c565b611ab1565b348015610b4a575f5ffd5b506105e5610b59366004613893565b611abe565b348015610b69575f5ffd5b50610646611b24565b348015610b7d575f5ffd5b50610646610b8c36600461396c565b611b37565b348015610b9c575f5ffd5b50610646610bab366004613893565b611b44565b348015610bbb575f5ffd5b50610646610bca36600461396c565b611bbc565b348015610bda575f5ffd5b506105e5601d5481565b610646610bf2366004613caa565b611bc9565b348015610c02575f5ffd5b506105e560265481565b348015610c17575f5ffd5b50610646610c2636600461396c565b612017565b348015610c36575f5ffd5b506105e5600c5481565b348015610c4b575f5ffd5b505f546001600160a01b031661069d565b348015610c67575f5ffd5b506105e560275481565b348015610c7c575f5ffd5b5061065c612024565b610646610c93366004613caa565b612033565b348015610ca3575f5ffd5b50610646610cb236600461396c565b612468565b348015610cc2575f5ffd5b50610646610cd136600461396c565b612475565b348015610ce1575f5ffd5b50610646610cf0366004613d1f565b612482565b348015610d00575f5ffd5b506105e5602a5481565b348015610d15575f5ffd5b50610646610d24366004613893565b6124ca565b348015610d34575f5ffd5b506105e560145481565b348015610d49575f5ffd5b50610646610d5836600461396c565b612540565b348015610d68575f5ffd5b50610646610d77366004613893565b61254d565b348015610d87575f5ffd5b506011546106179062010000900460ff1681565b348015610da6575f5ffd5b50610646610db536600461396c565b612596565b348015610dc5575f5ffd5b50610646610dd4366004613a4f565b6125a3565b610646610de7366004613d4b565b6125be565b348015610df7575f5ffd5b50610646610e0636600461396c565b6125ef565b348015610e16575f5ffd5b5061065c610e2536600461396c565b6125fc565b348015610e35575f5ffd5b506105e560295481565b348015610e4a575f5ffd5b506105e560255481565b348015610e5f575f5ffd5b506105e5600d5481565b348015610e74575f5ffd5b506105e560105481565b348015610e89575f5ffd5b50610646610e9836600461396c565b6126b2565b348015610ea8575f5ffd5b50610646610eb736600461396c565b6126bf565b348015610ec7575f5ffd5b506105e560195481565b348015610edc575f5ffd5b50600f5461069d906001600160a01b031681565b348015610efb575f5ffd5b506105e560185481565b348015610f10575f5ffd5b50610617610f1f3660046139ad565b6001600160a01b039182165f908152600a6020908152604080832093909416825291909152205460ff1690565b348015610f57575f5ffd5b5060115461069d90630100000090046001600160a01b031681565b348015610f7d575f5ffd5b50610646610f8c366004613893565b6126cc565b348015610f9c575f5ffd5b506105e560225481565b348015610fb1575f5ffd5b50610646610fc0366004613893565b612724565b348015610fd0575f5ffd5b506011546106179060ff1681565b5f6001600160e01b031982167fad0d7f6c00000000000000000000000000000000000000000000000000000000148061101b575061101b82612867565b8061102a575061102a826128e6565b92915050565b611038612933565b6103e8816bffffffffffffffffffffffff1611156110695760405163f4df6ae560e01b815260040160405180910390fd5b6110738282612978565b5050565b60606005805461108690613e0d565b80601f01602080910402602001604051908101604052809291908181526020018280546110b290613e0d565b80156110fd5780601f106110d4576101008083540402835291602001916110fd565b820191905f5260205f20905b8154815290600101906020018083116110e057829003601f168201915b5050505050905090565b5f61111182612a5b565b611147576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505f908152600960205260409020546001600160a01b031690565b8160115460ff16156111775761117781612a8e565b601154610100900460ff16156111a0576040516336e278fd60e21b815260040160405180910390fd5b6111aa8383612acd565b505050565b6111b7612933565b602655565b6111c4612933565b6040516370a0823160e01b815230600482015282905f906001600160a01b038316906370a0823190602401602060405180830381865afa15801561120a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061122e9190613e45565b9050805f03611250576040516312171d8360e31b815260040160405180910390fd5b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152602482018390525f919084169063a9059cbb906044016020604051808303815f875af11580156112b8573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112dc9190613e5c565b9050806112fc576040516312171d8360e31b815260040160405180910390fd5b5050505050565b61130b612933565b602455565b826001600160a01b03811633146113355760115460ff16156113355761133533612a8e565b611340848484612ad9565b50505050565b61134e612933565b601455565b5f82815260026020526040812080548291906001600160a01b03811690600160a01b90046bffffffffffffffffffffffff16816113b05750506001546001600160a01b03811690600160a01b90046bffffffffffffffffffffffff165b5f6127106113cc6bffffffffffffffffffffffff841689613e8b565b6113d69190613ea2565b92989297509195505050505050565b6113ed612933565b602055565b6113fa612933565b5f80546040516001600160a01b039091169047908381818185875af1925050503d805f8114611444576040519150601f19603f3d011682016040523d82523d5f602084013e611449565b606091505b505090508061146b576040516312171d8360e31b815260040160405180910390fd5b50565b826001600160a01b03811633146114935760115460ff16156114935761149333612a8e565b611340848484612cde565b602454158015906114b0575060245442105b156114ce57604051636ea7008360e11b815260040160405180910390fd5b602554158015906114e0575060255442115b156114fe57604051636ea7008360e11b815260040160405180910390fd5b601054158015906115265750601054600454600354839190035f19016115249190613ec1565b115b1561154457604051638a164f6360e01b815260040160405180910390fd5b602654158015906115635750602654816027546115619190613ec1565b115b1561158157604051638a164f6360e01b815260040160405180910390fd5b5f81600c546028546115939190613ec1565b61159d9190613e8b565b600f549091506001600160a01b03166115d5578034146115d05760405163193e352b60e11b815260040160405180910390fd5b6116f1565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa15801561161f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116439190613e45565b10156116625760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa1580156116ac573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116d09190613e45565b10156116ef57604051634fd3af0760e01b815260040160405180910390fd5b505b6029541580159061171c5750602954335f908152602b602052604090205461171a908490613ec1565b115b1561173a57604051638a164f6360e01b815260040160405180910390fd5b600c545f90158015906117575750600e546001600160a01b031615155b1561176d5782600c5461176a9190613e8b565b90505b600d545f901580159061178a5750600e546001600160a01b031615155b156117b65761271061179c8385613ed4565b600d546117a99190613e8b565b6117b39190613ea2565b90505b5f6117c18284613ec1565b905080156117d2576117d281612cf8565b600f546001600160a01b0316158015906117eb57508084115b1561180357611803306117fe8387613ed4565b612ed7565b335f908152602b602052604081208054879290611821908490613ec1565b925050819055508460275f8282546118399190613ec1565b909155506112fc90503386612ff8565b611851612933565b602155565b61185e612933565b601154630100000090046001600160a01b03166118a7576040517fe048e71000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60118054911515620100000262ff000019909216919091179055565b6118cb612933565b601054158015906118f35750601054600454600354839190035f19016118f19190613ec1565b115b1561191157604051638a164f6360e01b815260040160405180910390fd5b6110738282612ff8565b611923612933565b601955565b611930612933565b60136111aa828483613f2b565b611945612933565b601a55565b611952612933565b60126111aa828483613f2b565b611967612933565b6103e8816bffffffffffffffffffffffff1611156119985760405163f4df6ae560e01b815260040160405180910390fd5b6111aa838383613130565b5f61102a82613231565b6119b5612933565b80518251146119f0576040517ffc4c603600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b82518110156111aa5760105415801590611a425750601054828281518110611a1c57611a1c613fe5565b6020026020010151611a366004546003545f199190030190565b611a409190613ec1565b115b15611a6057604051638a164f6360e01b815260040160405180910390fd5b611a9c838281518110611a7557611a75613fe5565b6020026020010151838381518110611a8f57611a8f613fe5565b6020026020010151612ff8565b6001016119f2565b611aac612933565b602555565b611ab9612933565b601055565b5f6001600160a01b038216611aff576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b03165f9081526008602052604090205467ffffffffffffffff1690565b611b2c612933565b611b355f6132b8565b565b611b3f612933565b602855565b611b4c612933565b5f816001600160a01b0316476040515f6040518083038185875af1925050503d805f8114611b95576040519150601f19603f3d011682016040523d82523d5f602084013e611b9a565b606091505b5050905080611073576040516312171d8360e31b815260040160405180910390fd5b611bc4612933565b602955565b60145415801590611bdb575060145442105b15611bf957604051636ea7008360e11b815260040160405180910390fd5b60155415801590611c0b575060155442115b15611c2957604051636ea7008360e11b815260040160405180910390fd5b60105415801590611c515750601054600454600354839190035f1901611c4f9190613ec1565b115b15611c6f57604051638a164f6360e01b815260040160405180910390fd5b60165415801590611c8e575060165481601754611c8c9190613ec1565b115b15611cac57604051638a164f6360e01b815260040160405180910390fd5b5f81600c54601854611cbe9190613ec1565b611cc89190613e8b565b600f549091506001600160a01b0316611d0057803414611cfb5760405163193e352b60e11b815260040160405180910390fd5b611e1c565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa158015611d4a573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d6e9190613e45565b1015611d8d5760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015611dd7573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611dfb9190613e45565b1015611e1a57604051634fd3af0760e01b815260040160405180910390fd5b505b601a5415611ebb576040516bffffffffffffffffffffffff193360601b1660208201525f90603401604051602081830303815290604052805190602001209050611e9c8585808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050601a549150849050613314565b611eb95760405163582f497d60e11b815260040160405180910390fd5b505b60195415801590611ee65750601954335f908152601b6020526040902054611ee4908490613ec1565b115b15611f0457604051638a164f6360e01b815260040160405180910390fd5b600c545f9015801590611f215750600e546001600160a01b031615155b15611f375782600c54611f349190613e8b565b90505b600d545f9015801590611f545750600e546001600160a01b031615155b15611f8057612710611f668385613ed4565b600d54611f739190613e8b565b611f7d9190613ea2565b90505b5f611f8b8284613ec1565b90508015611f9c57611f9c81612cf8565b600f546001600160a01b031615801590611fb557508084115b15611fc857611fc8306117fe8387613ed4565b335f908152601b602052604081208054879290611fe6908490613ec1565b925050819055508460175f828254611ffe9190613ec1565b9091555061200e90503386612ff8565b50505050505050565b61201f612933565b601655565b60606006805461108690613e0d565b601c54158015906120455750601c5442105b1561206357604051636ea7008360e11b815260040160405180910390fd5b601d54158015906120755750601d5442115b1561209357604051636ea7008360e11b815260040160405180910390fd5b601054158015906120bb5750601054600454600354839190035f19016120b99190613ec1565b115b156120d957604051638a164f6360e01b815260040160405180910390fd5b601e54158015906120f85750601e5481601f546120f69190613ec1565b115b1561211657604051638a164f6360e01b815260040160405180910390fd5b5f81600c546020546121289190613ec1565b6121329190613e8b565b600f549091506001600160a01b031661216a578034146121655760405163193e352b60e11b815260040160405180910390fd5b612286565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa1580156121b4573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906121d89190613e45565b10156121f75760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015612241573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122659190613e45565b101561228457604051634fd3af0760e01b815260040160405180910390fd5b505b60225415612325576040516bffffffffffffffffffffffff193360601b1660208201525f906034016040516020818303038152906040528051906020012090506123068585808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506022549150849050613314565b6123235760405163582f497d60e11b815260040160405180910390fd5b505b602154158015906123505750602154335f9081526023602052604090205461234e908490613ec1565b115b1561236e57604051638a164f6360e01b815260040160405180910390fd5b600c545f901580159061238b5750600e546001600160a01b031615155b156123a15782600c5461239e9190613e8b565b90505b600d545f90158015906123be5750600e546001600160a01b031615155b156123ea576127106123d08385613ed4565b600d546123dd9190613e8b565b6123e79190613ea2565b90505b5f6123f58284613ec1565b905080156124065761240681612cf8565b600f546001600160a01b03161580159061241f57508084115b1561243257612432306117fe8387613ed4565b335f9081526023602052604081208054879290612450908490613ec1565b9250508190555084601f5f828254611ffe9190613ec1565b612470612933565b602255565b61247d612933565b602a55565b8160115460ff16156124975761249781612a8e565b601154610100900460ff16156124c0576040516336e278fd60e21b815260040160405180910390fd5b6111aa8383613329565b6124d2612933565b600b80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff1983168117909355604080519190921680825260208201939093527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a15050565b612548612933565b601c55565b612555612933565b601180546001600160a01b039092166301000000027fffffffffffffffffff0000000000000000000000000000000000000000ffffff909216919091179055565b61259e612933565b601555565b6125ab612933565b6011805460ff1916911515919091179055565b836001600160a01b03811633146125e35760115460ff16156125e3576125e333612a8e565b6112fc85858585613394565b6125f7612933565b601e55565b606061260782612a5b565b61263d576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6126466133d8565b90505f6126516133e7565b905081515f1461268e5781612665856133f6565b604051602001612676929190614010565b60405160208183030381529060405292505050919050565b80511561269c579392505050565b505060408051602081019091525f815292915050565b6126ba612933565b601d55565b6126c7612933565b601855565b6126d4612933565b6001600160a01b03811661271b576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081525f60048201526024015b60405180910390fd5b61146b816132b8565b61272c612933565b6040516370a0823160e01b815230600482015281905f906001600160a01b038316906370a0823190602401602060405180830381865afa158015612772573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127969190613e45565b9050805f036127b8576040516312171d8360e31b815260040160405180910390fd5b5f826001600160a01b031663a9059cbb6127d95f546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303815f875af1158015612823573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128479190613e5c565b905080611340576040516312171d8360e31b815260040160405180910390fd5b5f6301ffc9a760e01b6001600160e01b0319831614806128b057507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b8061102a5750506001600160e01b0319167f5b5e139f000000000000000000000000000000000000000000000000000000001490565b5f6001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061102a57506301ffc9a760e01b6001600160e01b031983161461102a565b5f546001600160a01b03163314611b35576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401612712565b6127106bffffffffffffffffffffffff82168110156129da576040517f6f483d090000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff8316600482015260248101829052604401612712565b6001600160a01b038316612a1c576040517fb6d9900a0000000000000000000000000000000000000000000000000000000081525f6004820152602401612712565b50604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600155565b5f81600111158015612a6e575060035482105b801561102a5750505f90815260076020526040902054600160e01b161590565b69c61711340011223344555f5230601a5280603a525f5f604460166daaeb6d7670e522a718067333cd4e5afa612ac6573d5f5f3e3d5ffd5b5f603a5250565b61107382826001613439565b5f612ae382613231565b9050836001600160a01b0316816001600160a01b031614612b30576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8281526009602052604090208054338082146001600160a01b03881690911417612bb1576001600160a01b0386165f908152600a6020908152604080832033845290915290205460ff16612bb1576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516612bf1576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612bfe8686866001613520565b8015612c08575f82555b6001600160a01b038681165f9081526008602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260076020526040812091909155600160e11b84169003612c9557600184015f818152600760205260408120549003612c93576003548114612c93575f8181526007602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6111aa83838360405180602001604052805f8152506125be565b805f03612d31576040517f5e2a89dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e546001600160a01b0316612d73576040517fcd0081c200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f546001600160a01b0316612dfa57600e546040515f916001600160a01b03169083908381818185875af1925050503d805f8114612dcd576040519150601f19603f3d011682016040523d82523d5f602084013e612dd2565b606091505b5050905080612df457604051634033e4e360e01b815260040160405180910390fd5b50612e92565b600f54600e546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526044810184905291169081906323b872dd906064016020604051808303815f875af1925050508015612e72575060408051601f3d908101601f19168201909252612e6f91810190613e5c565b60015b612e8f57604051634033e4e360e01b815260040160405180910390fd5b50505b600e546040518281526001600160a01b03909116907f2b5dffd9914ddb43acdb6963bacf053a87bf9354300844f6339f17741e25145a9060200160405180910390a250565b805f03612ef757604051632ee66eed60e01b815260040160405180910390fd5b6001600160a01b038216612f1e57604051632ee66eed60e01b815260040160405180910390fd5b600f546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b039091169081906323b872dd906064016020604051808303815f875af1925050508015612f92575060408051601f3d908101601f19168201909252612f8f91810190613e5c565b60015b612faf57604051632ee66eed60e01b815260040160405180910390fd5b50826001600160a01b03167f5bfd86dd1dfba5846abf8c8ff49e529e997ac11be6a5ad81501ef4418f35968983604051612feb91815260200190565b60405180910390a2505050565b6003545f829003613035576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6130415f848385613520565b6001600160a01b0383165f8181526008602090815260408083208054680100000000000000018802019055848352600790915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b8181146130ed5780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f5fa46001016130b7565b50815f03613127576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60035550505050565b6127106bffffffffffffffffffffffff8216811015613199576040517fdfd1fc1b000000000000000000000000000000000000000000000000000000008152600481018590526bffffffffffffffffffffffff8316602482015260448101829052606401612712565b6001600160a01b0383166131e2576040517f969f0852000000000000000000000000000000000000000000000000000000008152600481018590525f6024820152604401612712565b506040805180820182526001600160a01b0393841681526bffffffffffffffffffffffff92831660208083019182525f968752600290529190942093519051909116600160a01b029116179055565b5f8160011161329f57505f8181526007602052604081205490600160e01b8216900361329f57805f0361329a57600354821061328057604051636f96cda160e11b815260040160405180910390fd5b5b505f19015f818152600760205260409020548015613281575b919050565b604051636f96cda160e11b815260040160405180910390fd5b5f80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f82613320858461367c565b14949350505050565b335f818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61339f848484611310565b6001600160a01b0383163b15611340576133bb848484846136be565b611340576040516368d2bf6b60e11b815260040160405180910390fd5b60606012805461108690613e0d565b60606013805461108690613e0d565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a90048061340f5750819003601f19909101908152919050565b5f613443836119a3565b905081156134b757336001600160a01b038216146134b7576001600160a01b0381165f908152600a6020908152604080832033845290915290205460ff166134b7576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f83815260096020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b601154610100900460ff16801561353f57506001600160a01b03841615155b801561355357506001600160a01b03831615155b15613571576040516336e278fd60e21b815260040160405180910390fd5b61357a336137a5565b6135b0576040517f4c80d8be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416158015906135d25750600b546001600160a01b031615155b15613677575f5b8181101561367557600b546001600160a01b031663caee23ea3387876135ff8689613ec1565b6040516001600160e01b031960e087901b1681526001600160a01b03948516600482015292841660248401529216604482015260648101919091526084015f6040518083038186803b158015613653575f5ffd5b505afa158015613665573d5f5f3e3d5ffd5b5050600190920191506135d99050565b505b611340565b5f81815b84518110156136b6576136ac8286838151811061369f5761369f613fe5565b6020026020010151613856565b9150600101613680565b509392505050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a02906136f290339089908890889060040161407a565b6020604051808303815f875af192505050801561372c575060408051601f3d908101601f19168201909252613729918101906140ba565b60015b613788573d808015613759576040519150601f19603f3d011682016040523d82523d5f602084013e61375e565b606091505b5080515f03613780576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6011545f9062010000900460ff161561384e576011546040517fe18bc08a0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152630100000090920490911690819063e18bc08a90602401602060405180830381865afa158015613823573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906138479190613e5c565b9392505050565b506001919050565b5f818310613870575f828152602084905260409020613847565b505f9182526020526040902090565b6001600160a01b038116811461146b575f5ffd5b5f602082840312156138a3575f5ffd5b81356138478161387f565b6001600160e01b03198116811461146b575f5ffd5b5f602082840312156138d3575f5ffd5b8135613847816138ae565b80356bffffffffffffffffffffffff8116811461329a575f5ffd5b5f5f6040838503121561390a575f5ffd5b82356139158161387f565b9150613923602084016138de565b90509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f613847602083018461392c565b5f6020828403121561397c575f5ffd5b5035919050565b5f5f60408385031215613994575f5ffd5b823561399f8161387f565b946020939093013593505050565b5f5f604083850312156139be575f5ffd5b82356139c98161387f565b915060208301356139d98161387f565b809150509250929050565b5f5f5f606084860312156139f6575f5ffd5b8335613a018161387f565b92506020840135613a118161387f565b929592945050506040919091013590565b5f5f60408385031215613a33575f5ffd5b50508035926020909101359150565b801515811461146b575f5ffd5b5f60208284031215613a5f575f5ffd5b813561384781613a42565b5f5f60208385031215613a7b575f5ffd5b823567ffffffffffffffff811115613a91575f5ffd5b8301601f81018513613aa1575f5ffd5b803567ffffffffffffffff811115613ab7575f5ffd5b856020828401011115613ac8575f5ffd5b6020919091019590945092505050565b5f5f5f60608486031215613aea575f5ffd5b833592506020840135613afc8161387f565b9150613b0a604085016138de565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613b5057613b50613b13565b604052919050565b5f67ffffffffffffffff821115613b7157613b71613b13565b5060051b60200190565b5f82601f830112613b8a575f5ffd5b8135613b9d613b9882613b58565b613b27565b8082825260208201915060208360051b860101925085831115613bbe575f5ffd5b602085015b83811015613bdb578035835260209283019201613bc3565b5095945050505050565b5f5f60408385031215613bf6575f5ffd5b823567ffffffffffffffff811115613c0c575f5ffd5b8301601f81018513613c1c575f5ffd5b8035613c2a613b9882613b58565b8082825260208201915060208360051b850101925087831115613c4b575f5ffd5b6020840193505b82841015613c76578335613c658161387f565b825260209384019390910190613c52565b9450505050602083013567ffffffffffffffff811115613c94575f5ffd5b613ca085828601613b7b565b9150509250929050565b5f5f5f60408486031215613cbc575f5ffd5b833567ffffffffffffffff811115613cd2575f5ffd5b8401601f81018613613ce2575f5ffd5b803567ffffffffffffffff811115613cf8575f5ffd5b8660208260051b8401011115613d0c575f5ffd5b6020918201979096509401359392505050565b5f5f60408385031215613d30575f5ffd5b8235613d3b8161387f565b915060208301356139d981613a42565b5f5f5f5f60808587031215613d5e575f5ffd5b8435613d698161387f565b93506020850135613d798161387f565b925060408501359150606085013567ffffffffffffffff811115613d9b575f5ffd5b8501601f81018713613dab575f5ffd5b803567ffffffffffffffff811115613dc557613dc5613b13565b613dd8601f8201601f1916602001613b27565b818152886020838501011115613dec575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b600181811c90821680613e2157607f821691505b602082108103613e3f57634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215613e55575f5ffd5b5051919050565b5f60208284031215613e6c575f5ffd5b815161384781613a42565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761102a5761102a613e77565b5f82613ebc57634e487b7160e01b5f52601260045260245ffd5b500490565b8082018082111561102a5761102a613e77565b8181038181111561102a5761102a613e77565b601f8211156111aa57805f5260205f20601f840160051c81016020851015613f0c5750805b601f840160051c820191505b818110156112fc575f8155600101613f18565b67ffffffffffffffff831115613f4357613f43613b13565b613f5783613f518354613e0d565b83613ee7565b5f601f841160018114613f88575f8515613f715750838201355b5f19600387901b1c1916600186901b1783556112fc565b5f83815260208120601f198716915b82811015613fb75786850135825560209485019460019092019101613f97565b5086821015613fd3575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b5f52603260045260245ffd5b5f81518060208401855e5f93019283525090919050565b5f61401b8285613ff9565b7f2f00000000000000000000000000000000000000000000000000000000000000815261404b6001820185613ff9565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050195945050505050565b6001600160a01b03851681526001600160a01b0384166020820152826040820152608060608201525f6140b0608083018461392c565b9695505050505050565b5f602082840312156140ca575f5ffd5b8151613847816138ae56fea26469706673582212206d13b93a43ba7be4a90f1bff6dd012ee72c1e37e25c498e04d5b6f449f9174f164736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$880.28
Net Worth in ETH
0.4845
Token Allocations
ETH
100.00%
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $1,816.87 | 0.4845 | $880.28 |
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.