Source Code
Overview
ETH Balance
0.1080625 ETH
Eth Value
$304.53 (@ $2,818.07/ETH)More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 107 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Mint Phase3 | 23841694 | 31 mins ago | IN | 0.00283328 ETH | 0.00094709 | ||||
| Mint Phase3 | 23841311 | 1 hr ago | IN | 0.00283328 ETH | 0.00025369 | ||||
| Mint Phase3 | 23841188 | 2 hrs ago | IN | 0.00283328 ETH | 0.00036135 | ||||
| Mint Phase3 | 23841168 | 2 hrs ago | IN | 0.00283328 ETH | 0.00033396 | ||||
| Mint Phase3 | 23841159 | 2 hrs ago | IN | 0.00283328 ETH | 0.00008463 | ||||
| Mint Phase3 | 23841155 | 2 hrs ago | IN | 0.01416641 ETH | 0.00034534 | ||||
| Mint Phase3 | 23841152 | 2 hrs ago | IN | 0.00566656 ETH | 0.00012722 | ||||
| Mint Phase2 | 23841140 | 2 hrs ago | IN | 0.00158328 ETH | 0.00013851 | ||||
| Mint Phase2 | 23841137 | 2 hrs ago | IN | 0.00158328 ETH | 0.00013639 | ||||
| Mint Phase2 | 23841134 | 2 hrs ago | IN | 0.00316656 ETH | 0.00012828 | ||||
| Mint Phase2 | 23841130 | 2 hrs ago | IN | 0.00316656 ETH | 0.00039528 | ||||
| Mint Phase2 | 23841130 | 2 hrs ago | IN | 0.00316656 ETH | 0.000445 | ||||
| Mint Phase2 | 23841101 | 2 hrs ago | IN | 0.00158328 ETH | 0.00013107 | ||||
| Set Approval For... | 23841090 | 2 hrs ago | IN | 0 ETH | 0.00003905 | ||||
| Mint Phase2 | 23841088 | 2 hrs ago | IN | 0.00158328 ETH | 0.00015849 | ||||
| Mint Phase2 | 23841084 | 2 hrs ago | IN | 0.00158328 ETH | 0.00015974 | ||||
| Mint Phase2 | 23841074 | 2 hrs ago | IN | 0.00316656 ETH | 0.00013567 | ||||
| Mint Phase2 | 23841072 | 2 hrs ago | IN | 0.00316656 ETH | 0.00014187 | ||||
| Mint Phase2 | 23841065 | 2 hrs ago | IN | 0.00316656 ETH | 0.00013856 | ||||
| Mint Phase2 | 23841059 | 2 hrs ago | IN | 0.00158328 ETH | 0.00044753 | ||||
| Mint Phase2 | 23841054 | 2 hrs ago | IN | 0.00158328 ETH | 0.00012436 | ||||
| Mint Phase2 | 23841054 | 2 hrs ago | IN | 0.00158328 ETH | 0.00014018 | ||||
| Mint Phase2 | 23841044 | 2 hrs ago | IN | 0.00158328 ETH | 0.00015173 | ||||
| Mint Phase2 | 23841043 | 2 hrs ago | IN | 0.00158328 ETH | 0.00017351 | ||||
| Mint Phase2 | 23841036 | 2 hrs ago | IN | 0.00158328 ETH | 0.00009095 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 23841694 | 31 mins ago | 0.00045828 ETH | ||||
| Transfer | 23841311 | 1 hr ago | 0.00045828 ETH | ||||
| Transfer | 23841188 | 2 hrs ago | 0.00045828 ETH | ||||
| Transfer | 23841168 | 2 hrs ago | 0.00045828 ETH | ||||
| Transfer | 23841159 | 2 hrs ago | 0.00045828 ETH | ||||
| Transfer | 23841155 | 2 hrs ago | 0.00229141 ETH | ||||
| Transfer | 23841152 | 2 hrs ago | 0.00091656 ETH | ||||
| Transfer | 23841140 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841137 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841134 | 2 hrs ago | 0.00079156 ETH | ||||
| Transfer | 23841130 | 2 hrs ago | 0.00079156 ETH | ||||
| Transfer | 23841130 | 2 hrs ago | 0.00079156 ETH | ||||
| Transfer | 23841101 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841088 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841084 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841074 | 2 hrs ago | 0.00079156 ETH | ||||
| Transfer | 23841072 | 2 hrs ago | 0.00079156 ETH | ||||
| Transfer | 23841065 | 2 hrs ago | 0.00079156 ETH | ||||
| Transfer | 23841059 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841054 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841054 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841044 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841043 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841036 | 2 hrs ago | 0.00039578 ETH | ||||
| Transfer | 23841036 | 2 hrs ago | 0.00039578 ETH |
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
NullformOriginProtocol
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
prague 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 NullformOriginProtocol 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 = 333283340832209;
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 = 300;
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/6554c6d6-676f-476e-b3ad-cd50c93b8508.gif";
// Phase 1 variables
uint256 public startTimePhase1 = 1763649000;
uint256 public endTimePhase1 = 1763650800;
uint256 public maxSupplyPhase1 = 0;
uint256 public totalSupplyPhase1;
uint256 public pricePhase1 = 0;
uint256 public maxPerWalletPhase1 = 1;
bytes32 public merkleRootPhase1 = 0x747d6011557d3334549736d3adcb3192892d98cf0e7692f66b4ea4de9426ad1c;
mapping(address => uint256) public walletMintsPhase1;
// Phase 2 variables
uint256 public startTimePhase2 = 1763650800;
uint256 public endTimePhase2 = 1763652600;
uint256 public maxSupplyPhase2 = 0;
uint256 public totalSupplyPhase2;
uint256 public pricePhase2 = 1250000000000000;
uint256 public maxPerWalletPhase2 = 2;
bytes32 public merkleRootPhase2 = 0x8d0afbcccb17745572c63157c393afd6df33bc01c9f88d6113ccd53d1d55432f;
mapping(address => uint256) public walletMintsPhase2;
// Phase 3 variables
uint256 public startTimePhase3 = 1763652600;
uint256 public endTimePhase3 = 1763739000;
uint256 public maxSupplyPhase3 = 0;
uint256 public totalSupplyPhase3;
uint256 public pricePhase3 = 2500000000000000;
uint256 public maxPerWalletPhase3 = 5;
bytes32 public merkleRootPhase3 = 0x0;
mapping(address => uint256) public walletMintsPhase3;
constructor() ERC721A("NullformOriginProtocol", "NFORM") Ownable(msg.sender) {
// Register operator filtering
_registerForOperatorFiltering();
// Set initial royalty
_setDefaultRoyalty(0xaF11319b739F4398a50812008F887C280FE67156, 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);
}
// Break Transfer Lock
function breakLock() external onlyOwner {
initialTransferLockOn = false;
}
// 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": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "prague",
"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":"breakLock","outputs":[],"stateMutability":"nonpayable","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
66012f1e9323cdd1600c556101f4600d55600e805473bdb9e0b47a02c45e3b50973a18452dc23ce726976001600160a01b031991821617909155600f8054909116905561012c6010556011805461ffff191661010117905560a06040525f608090815260129061006f9082610442565b506040518060a00160405280606281526020016141bc606291396013906100969082610442565b5063691f25e860145563691f2cf06015555f6016555f60185560016019557f747d6011557d3334549736d3adcb3192892d98cf0e7692f66b4ea4de9426ad1c5f1b601a5563691f2cf0601c5563691f33f8601d555f601e55660470de4df8200060205560026021557f8d0afbcccb17745572c63157c393afd6df33bc01c9f88d6113ccd53d1d55432f5f1b60225563691f33f860245563692085786025555f6026556608e1bc9bf0400060285560056029555f5f1b602a55348015610159575f5ffd5b50604080518082018252601681527f4e756c6c666f726d4f726967696e50726f746f636f6c00000000000000000000602080830191909152825180840190935260058352644e464f524d60d81b908301529033806101d157604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6101da81610229565b5060056101e78382610442565b5060066101f48282610442565b5050600160035550610204610278565b61022473af11319b739f4398a50812008f887c280fe671566101f4610299565b6104fc565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610297733cc6cdda760b79bafa08df41ecfa224f810dceb6600161033b565b565b6127106001600160601b0382168110156102d857604051636f483d0960e01b81526001600160601b0383166004820152602481018290526044016101c8565b6001600160a01b03831661030157604051635b6cc80560e11b81525f60048201526024016101c8565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b6001600160a01b0390911690637d3e3dbe8161036857826103615750634420e486610368565b5063a0af29035b8060e01b5f52306004528260245260045f60445f5f6daaeb6d7670e522a718067333cd4e5af16103a157805f5160e01c036103a1575f5ffd5b505f6024525050565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806103d257607f821691505b6020821081036103f057634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561043d57805f5260205f20601f840160051c8101602085101561041b5750805b601f840160051c820191505b8181101561043a575f8155600101610427565b50505b505050565b81516001600160401b0381111561045b5761045b6103aa565b61046f8161046984546103be565b846103f6565b6020601f8211600181146104a1575f831561048a5750848201515b5f19600385901b1c1916600184901b17845561043a565b5f84815260208120601f198516915b828110156104d057878501518255602094850194600190920191016104b0565b50848210156104ed57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b613cb3806105095f395ff3fe6080604052600436106104d1575f3560e01c80636f8b44b011610278578063aa60bdd011610155578063d5abeb01116100c9578063e985e9c511610083578063e985e9c514610e14578063ed9aab5114610e33578063f2fde38b14610e59578063f3f119f114610e78578063f4f3b20014610e8d578063fb796e6c14610eac575f5ffd5b8063d5abeb0114610d78578063e079e46114610d8d578063e1136b3d14610dac578063e56e9ac014610dcb578063e5a6b10f14610de0578063e5e2a0f614610dff575f5ffd5b8063b88d4fde1161011a578063b88d4fde14610ce8578063c3d923a614610cfb578063c87b56dd14610d1a578063cafd705f14610d39578063d1c026c914610d4e578063d2762b4614610d63575f5ffd5b8063aa60bdd014610c4d578063ab7b499314610c6c578063abd017ea14610c8b578063ac19701b14610caa578063b7c0b8e814610cc9575f5ffd5b80638da5cb5b116101ec5780639e5f94a7116101b15780639e5f94a714610bb2578063a22cb46514610bd1578063a42c05ba14610bf0578063a70138c114610c05578063a9fc664e14610c19578063aa0678ff14610c38575f5ffd5b80638da5cb5b14610b3b5780638e9a85f314610b5757806395d89b4114610b6c57806396ce3bfa14610b8057806396db3e8914610b93575f5ffd5b806376ee01531161023d57806376ee015314610aab57806379544c8614610aca5780637d4b5a2114610adf5780637f371aa014610af2578063858633f214610b07578063871215d414610b26575f5ffd5b80636f8b44b014610a1b57806370a0823114610a3a578063715018a614610a5957806371be5e1414610a6d57806372b0d90c14610a8c575f5ffd5b80633ccfd60b116103b157806354389437116103255780635c1afecb116102df5780635c1afecb1461097f5780635d99a0cf146109945780636352211e146109a957806364f52a1f146109c857806365216a41146109dd578063691ce970146109fc575f5ffd5b806354389437146108e3578063545b70b2146108f857806355f5f0661461090d57806355f804b31461092c5780635944c7531461094b57806359a2f3bd1461096a575f5ffd5b8063462fed1411610376578063462fed141461083357806346fff98d14610852578063484b973c146108715780634b21839e146108905780634ed69eaf146108af5780634f115db1146108ce575f5ffd5b80633ccfd60b146107cf578063406466a7146107e357806341d94c98146107f857806342842e0e1461080d57806342b5e15c14610820575f5ffd5b806312b3651011610448578063251c21ec1161040d578063251c21ec146106f45780632a55205a1461071357806330a089651461075157806330db1d5b146107705780633bf303941461078f5780633c6d5762146107a4575f5ffd5b806312b365101461067157806318160ddd1461068f578063189ce8b1146106a357806321b8acd7146106c257806323b872dd146106e1575f5ffd5b8063081812fc11610499578063081812fc14610599578063095ea7b3146105d0578063098144d4146105e35780630c92b631146106005780630d4c18281461061f5780630d705df61461064a575f5ffd5b80630141a449146104d557806301ffc9a71461051357806304634d8d1461054257806306fdde03146105635780630759f2d814610584575b5f5ffd5b3480156104e0575f5ffd5b506105006104ef366004613478565b602b6020525f908152604090205481565b6040519081526020015b60405180910390f35b34801561051e575f5ffd5b5061053261052d3660046134a8565b610ec5565b604051901515815260200161050a565b34801561054d575f5ffd5b5061056161055c3660046134d9565b610efe565b005b34801561056e575f5ffd5b50610577610f40565b60405161050a919061353a565b34801561058f575f5ffd5b5061050060165481565b3480156105a4575f5ffd5b506105b86105b336600461354c565b610fd0565b6040516001600160a01b03909116815260200161050a565b6105616105de366004613563565b611012565b3480156105ee575f5ffd5b50600b546001600160a01b03166105b8565b34801561060b575f5ffd5b5061056161061a36600461354c565b61105f565b34801561062a575f5ffd5b50610500610639366004613478565b60236020525f908152604090205481565b348015610655575f5ffd5b506040805163657711f560e11b8152600160208201520161050a565b34801561067c575f5ffd5b5060115461053290610100900460ff1681565b34801561069a575f5ffd5b5061050061106c565b3480156106ae575f5ffd5b506105616106bd36600461358d565b611079565b3480156106cd575f5ffd5b506105616106dc36600461354c565b6111a7565b6105616106ef3660046135c4565b6111b4565b3480156106ff575f5ffd5b5061056161070e36600461354c565b6111ea565b34801561071e575f5ffd5b5061073261072d366004613602565b6111f7565b604080516001600160a01b03909316835260208301919091520161050a565b34801561075c575f5ffd5b50600e546105b8906001600160a01b031681565b34801561077b575f5ffd5b5061056161078a36600461354c565b61127a565b34801561079a575f5ffd5b50610500601e5481565b3480156107af575f5ffd5b506105006107be366004613478565b601b6020525f908152604090205481565b3480156107da575f5ffd5b50610561611287565b3480156107ee575f5ffd5b5061050060285481565b348015610803575f5ffd5b5061050060155481565b61056161081b3660046135c4565b611303565b61056161082e36600461354c565b611333565b34801561083e575f5ffd5b5061056161084d36600461354c565b6116da565b34801561085d575f5ffd5b5061056161086c36600461362f565b6116e7565b34801561087c575f5ffd5b5061056161088b366004613563565b61173b565b34801561089b575f5ffd5b506105616108aa36600461354c565b61178f565b3480156108ba575f5ffd5b506105616108c936600461364a565b61179c565b3480156108d9575f5ffd5b50610500601c5481565b3480156108ee575f5ffd5b5061050060245481565b348015610903575f5ffd5b5061050060175481565b348015610918575f5ffd5b5061056161092736600461354c565b6117b1565b348015610937575f5ffd5b5061056161094636600461364a565b6117be565b348015610956575f5ffd5b506105616109653660046136b8565b6117d3565b348015610975575f5ffd5b5061050060215481565b34801561098a575f5ffd5b50610500601f5481565b34801561099f575f5ffd5b5061050060205481565b3480156109b4575f5ffd5b506105b86109c336600461354c565b611812565b3480156109d3575f5ffd5b50610500601a5481565b3480156109e8575f5ffd5b506105616109f73660046137c5565b61181c565b348015610a07575f5ffd5b50610561610a1636600461354c565b6118f0565b348015610a26575f5ffd5b50610561610a3536600461354c565b6118fd565b348015610a45575f5ffd5b50610500610a54366004613478565b61190a565b348015610a64575f5ffd5b50610561611957565b348015610a78575f5ffd5b50610561610a8736600461354c565b61196a565b348015610a97575f5ffd5b50610561610aa6366004613478565b611977565b348015610ab6575f5ffd5b50610561610ac536600461354c565b6119ef565b348015610ad5575f5ffd5b50610500601d5481565b610561610aed36600461388a565b6119fc565b348015610afd575f5ffd5b5061050060265481565b348015610b12575f5ffd5b50610561610b2136600461354c565b611e46565b348015610b31575f5ffd5b50610500600c5481565b348015610b46575f5ffd5b505f546001600160a01b03166105b8565b348015610b62575f5ffd5b5061050060275481565b348015610b77575f5ffd5b50610577611e53565b610561610b8e36600461388a565b611e62565b348015610b9e575f5ffd5b50610561610bad36600461354c565b612293565b348015610bbd575f5ffd5b50610561610bcc36600461354c565b6122a0565b348015610bdc575f5ffd5b50610561610beb3660046138ff565b6122ad565b348015610bfb575f5ffd5b50610500602a5481565b348015610c10575f5ffd5b506105616122f5565b348015610c24575f5ffd5b50610561610c33366004613478565b61230a565b348015610c43575f5ffd5b5061050060145481565b348015610c58575f5ffd5b50610561610c6736600461354c565b612373565b348015610c77575f5ffd5b50610561610c86366004613478565b612380565b348015610c96575f5ffd5b506011546105329062010000900460ff1681565b348015610cb5575f5ffd5b50610561610cc436600461354c565b6123b4565b348015610cd4575f5ffd5b50610561610ce336600461362f565b6123c1565b610561610cf636600461392b565b6123dc565b348015610d06575f5ffd5b50610561610d1536600461354c565b61240d565b348015610d25575f5ffd5b50610577610d3436600461354c565b61241a565b348015610d44575f5ffd5b5061050060295481565b348015610d59575f5ffd5b5061050060255481565b348015610d6e575f5ffd5b50610500600d5481565b348015610d83575f5ffd5b5061050060105481565b348015610d98575f5ffd5b50610561610da736600461354c565b6124b7565b348015610db7575f5ffd5b50610561610dc636600461354c565b6124c4565b348015610dd6575f5ffd5b5061050060195481565b348015610deb575f5ffd5b50600f546105b8906001600160a01b031681565b348015610e0a575f5ffd5b5061050060185481565b348015610e1f575f5ffd5b50610532610e2e36600461358d565b6124d1565b348015610e3e575f5ffd5b506011546105b890630100000090046001600160a01b031681565b348015610e64575f5ffd5b50610561610e73366004613478565b6124fe565b348015610e83575f5ffd5b5061050060225481565b348015610e98575f5ffd5b50610561610ea7366004613478565b61253d565b348015610eb7575f5ffd5b506011546105329060ff1681565b5f6001600160e01b03198216632b435fdb60e21b1480610ee95750610ee982612680565b80610ef85750610ef8826126cd565b92915050565b610f06612701565b6103e8816001600160601b03161115610f325760405163f4df6ae560e01b815260040160405180910390fd5b610f3c828261272d565b5050565b606060058054610f4f906139ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610f7b906139ed565b8015610fc65780601f10610f9d57610100808354040283529160200191610fc6565b820191905f5260205f20905b815481529060010190602001808311610fa957829003601f168201915b5050505050905090565b5f610fda826127cf565b610ff7576040516333d1c03960e21b815260040160405180910390fd5b505f908152600960205260409020546001600160a01b031690565b8160115460ff16156110275761102781612802565b601154610100900460ff1615611050576040516336e278fd60e21b815260040160405180910390fd5b61105a8383612841565b505050565b611067612701565b602655565b600454600354035f190190565b611081612701565b6040516370a0823160e01b815230600482015282905f906001600160a01b038316906370a0823190602401602060405180830381865afa1580156110c7573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110eb9190613a25565b9050805f0361110d576040516312171d8360e31b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390525f919084169063a9059cbb906044016020604051808303815f875af115801561115c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111809190613a3c565b9050806111a0576040516312171d8360e31b815260040160405180910390fd5b5050505050565b6111af612701565b602455565b826001600160a01b03811633146111d95760115460ff16156111d9576111d933612802565b6111e484848461284d565b50505050565b6111f2612701565b601455565b5f82815260026020526040812080548291906001600160a01b03811690600160a01b90046001600160601b03168161124a5750506001546001600160a01b03811690600160a01b90046001600160601b03165b5f6127106112616001600160601b03841689613a6b565b61126b9190613a82565b92989297509195505050505050565b611282612701565b602055565b61128f612701565b5f80546040516001600160a01b039091169047908381818185875af1925050503d805f81146112d9576040519150601f19603f3d011682016040523d82523d5f602084013e6112de565b606091505b5050905080611300576040516312171d8360e31b815260040160405180910390fd5b50565b826001600160a01b03811633146113285760115460ff16156113285761132833612802565b6111e48484846129ea565b60245415801590611345575060245442105b1561136357604051636ea7008360e11b815260040160405180910390fd5b60255415801590611375575060255442115b1561139357604051636ea7008360e11b815260040160405180910390fd5b601054158015906113b75750601054816113ab61106c565b6113b59190613aa1565b115b156113d557604051638a164f6360e01b815260040160405180910390fd5b602654158015906113f45750602654816027546113f29190613aa1565b115b1561141257604051638a164f6360e01b815260040160405180910390fd5b5f81600c546028546114249190613aa1565b61142e9190613a6b565b600f549091506001600160a01b0316611466578034146114615760405163193e352b60e11b815260040160405180910390fd5b611582565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa1580156114b0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114d49190613a25565b10156114f35760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa15801561153d573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115619190613a25565b101561158057604051634fd3af0760e01b815260040160405180910390fd5b505b602954158015906115ad5750602954335f908152602b60205260409020546115ab908490613aa1565b115b156115cb57604051638a164f6360e01b815260040160405180910390fd5b600c545f90158015906115e85750600e546001600160a01b031615155b156115fe5782600c546115fb9190613a6b565b90505b600d545f901580159061161b5750600e546001600160a01b031615155b156116475761271061162d8385613ab4565b600d5461163a9190613a6b565b6116449190613a82565b90505b5f6116528284613aa1565b905080156116635761166381612a04565b600f546001600160a01b03161580159061167c57508084115b15611694576116943061168f8387613ab4565b612bb1565b335f908152602b6020526040812080548792906116b2908490613aa1565b925050819055508460275f8282546116ca9190613aa1565b909155506111a090503386612cd2565b6116e2612701565b602155565b6116ef612701565b601154630100000090046001600160a01b031661171f57604051630e048e7160e41b815260040160405180910390fd5b60118054911515620100000262ff000019909216919091179055565b611743612701565b6010541580159061176757506010548161175b61106c565b6117659190613aa1565b115b1561178557604051638a164f6360e01b815260040160405180910390fd5b610f3c8282612cd2565b611797612701565b601955565b6117a4612701565b601361105a828483613b0b565b6117b9612701565b601a55565b6117c6612701565b601261105a828483613b0b565b6117db612701565b6103e8816001600160601b031611156118075760405163f4df6ae560e01b815260040160405180910390fd5b61105a838383612dd7565b5f610ef882612e97565b611824612701565b805182511461184657604051637e26301b60e11b815260040160405180910390fd5b5f5b825181101561105a576010541580159061188e575060105482828151811061187257611872613bc5565b602002602001015161188261106c565b61188c9190613aa1565b115b156118ac57604051638a164f6360e01b815260040160405180910390fd5b6118e88382815181106118c1576118c1613bc5565b60200260200101518383815181106118db576118db613bc5565b6020026020010151612cd2565b600101611848565b6118f8612701565b602555565b611905612701565b601055565b5f6001600160a01b038216611932576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f9081526008602052604090205467ffffffffffffffff1690565b61195f612701565b6119685f612f1e565b565b611972612701565b602855565b61197f612701565b5f816001600160a01b0316476040515f6040518083038185875af1925050503d805f81146119c8576040519150601f19603f3d011682016040523d82523d5f602084013e6119cd565b606091505b5050905080610f3c576040516312171d8360e31b815260040160405180910390fd5b6119f7612701565b602955565b60145415801590611a0e575060145442105b15611a2c57604051636ea7008360e11b815260040160405180910390fd5b60155415801590611a3e575060155442115b15611a5c57604051636ea7008360e11b815260040160405180910390fd5b60105415801590611a80575060105481611a7461106c565b611a7e9190613aa1565b115b15611a9e57604051638a164f6360e01b815260040160405180910390fd5b60165415801590611abd575060165481601754611abb9190613aa1565b115b15611adb57604051638a164f6360e01b815260040160405180910390fd5b5f81600c54601854611aed9190613aa1565b611af79190613a6b565b600f549091506001600160a01b0316611b2f57803414611b2a5760405163193e352b60e11b815260040160405180910390fd5b611c4b565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa158015611b79573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b9d9190613a25565b1015611bbc5760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015611c06573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c2a9190613a25565b1015611c4957604051634fd3af0760e01b815260040160405180910390fd5b505b601a5415611cea576040516bffffffffffffffffffffffff193360601b1660208201525f90603401604051602081830303815290604052805190602001209050611ccb8585808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050601a549150849050612f6d565b611ce85760405163582f497d60e11b815260040160405180910390fd5b505b60195415801590611d155750601954335f908152601b6020526040902054611d13908490613aa1565b115b15611d3357604051638a164f6360e01b815260040160405180910390fd5b600c545f9015801590611d505750600e546001600160a01b031615155b15611d665782600c54611d639190613a6b565b90505b600d545f9015801590611d835750600e546001600160a01b031615155b15611daf57612710611d958385613ab4565b600d54611da29190613a6b565b611dac9190613a82565b90505b5f611dba8284613aa1565b90508015611dcb57611dcb81612a04565b600f546001600160a01b031615801590611de457508084115b15611df757611df73061168f8387613ab4565b335f908152601b602052604081208054879290611e15908490613aa1565b925050819055508460175f828254611e2d9190613aa1565b90915550611e3d90503386612cd2565b50505050505050565b611e4e612701565b601655565b606060068054610f4f906139ed565b601c5415801590611e745750601c5442105b15611e9257604051636ea7008360e11b815260040160405180910390fd5b601d5415801590611ea45750601d5442115b15611ec257604051636ea7008360e11b815260040160405180910390fd5b60105415801590611ee6575060105481611eda61106c565b611ee49190613aa1565b115b15611f0457604051638a164f6360e01b815260040160405180910390fd5b601e5415801590611f235750601e5481601f54611f219190613aa1565b115b15611f4157604051638a164f6360e01b815260040160405180910390fd5b5f81600c54602054611f539190613aa1565b611f5d9190613a6b565b600f549091506001600160a01b0316611f9557803414611f905760405163193e352b60e11b815260040160405180910390fd5b6120b1565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa158015611fdf573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120039190613a25565b10156120225760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa15801561206c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120909190613a25565b10156120af57604051634fd3af0760e01b815260040160405180910390fd5b505b60225415612150576040516bffffffffffffffffffffffff193360601b1660208201525f906034016040516020818303038152906040528051906020012090506121318585808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506022549150849050612f6d565b61214e5760405163582f497d60e11b815260040160405180910390fd5b505b6021541580159061217b5750602154335f90815260236020526040902054612179908490613aa1565b115b1561219957604051638a164f6360e01b815260040160405180910390fd5b600c545f90158015906121b65750600e546001600160a01b031615155b156121cc5782600c546121c99190613a6b565b90505b600d545f90158015906121e95750600e546001600160a01b031615155b15612215576127106121fb8385613ab4565b600d546122089190613a6b565b6122129190613a82565b90505b5f6122208284613aa1565b905080156122315761223181612a04565b600f546001600160a01b03161580159061224a57508084115b1561225d5761225d3061168f8387613ab4565b335f908152602360205260408120805487929061227b908490613aa1565b9250508190555084601f5f828254611e2d9190613aa1565b61229b612701565b602255565b6122a8612701565b602a55565b8160115460ff16156122c2576122c281612802565b601154610100900460ff16156122eb576040516336e278fd60e21b815260040160405180910390fd5b61105a8383612f82565b6122fd612701565b6011805461ff0019169055565b612312612701565b600b80546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a15050565b61237b612701565b601c55565b612388612701565b601180546001600160a01b039092166301000000026301000000600160b81b0319909216919091179055565b6123bc612701565b601555565b6123c9612701565b6011805460ff1916911515919091179055565b836001600160a01b03811633146124015760115460ff16156124015761240133612802565b6111a085858585612fed565b612415612701565b601e55565b6060612425826127cf565b61244257604051630a14c4b560e41b815260040160405180910390fd5b5f61244b613031565b90505f612456613040565b905081515f14612493578161246a8561304f565b60405160200161247b929190613bf0565b60405160208183030381529060405292505050919050565b8051156124a1579392505050565b505060408051602081019091525f815292915050565b6124bf612701565b601d55565b6124cc612701565b601855565b6001600160a01b039182165f908152600a6020908152604080832093909416825291909152205460ff1690565b612506612701565b6001600160a01b03811661253457604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61130081612f1e565b612545612701565b6040516370a0823160e01b815230600482015281905f906001600160a01b038316906370a0823190602401602060405180830381865afa15801561258b573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125af9190613a25565b9050805f036125d1576040516312171d8360e31b815260040160405180910390fd5b5f826001600160a01b031663a9059cbb6125f25f546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303815f875af115801561263c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126609190613a3c565b9050806111e4576040516312171d8360e31b815260040160405180910390fd5b5f6301ffc9a760e01b6001600160e01b0319831614806126b057506380ac58cd60e01b6001600160e01b03198316145b80610ef85750506001600160e01b031916635b5e139f60e01b1490565b5f6001600160e01b0319821663152a902d60e11b1480610ef857506301ffc9a760e01b6001600160e01b0319831614610ef8565b5f546001600160a01b031633146119685760405163118cdaa760e01b815233600482015260240161252b565b6127106001600160601b03821681101561276c57604051636f483d0960e01b81526001600160601b03831660048201526024810182905260440161252b565b6001600160a01b03831661279557604051635b6cc80560e11b81525f600482015260240161252b565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b5f816001111580156127e2575060035482105b8015610ef85750505f90815260076020526040902054600160e01b161590565b69c61711340011223344555f5230601a5280603a525f5f604460166daaeb6d7670e522a718067333cd4e5afa61283a573d5f5f3e3d5ffd5b5f603a5250565b610f3c82826001613092565b5f61285782612e97565b9050836001600160a01b0316816001600160a01b03161461288a5760405162a1148160e81b815260040160405180910390fd5b5f8281526009602052604090208054338082146001600160a01b038816909114176128d6576128b986336124d1565b6128d657604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166128fd57604051633a954ecd60e21b815260040160405180910390fd5b61290a8686866001613137565b8015612914575f82555b6001600160a01b038681165f9081526008602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260076020526040812091909155600160e11b841690036129a157600184015f81815260076020526040812054900361299f57600354811461299f575f8181526007602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b61105a83838360405180602001604052805f8152506123dc565b805f03612a2457604051635e2a89dd60e01b815260040160405180910390fd5b600e546001600160a01b0316612a4d5760405163668040e160e11b815260040160405180910390fd5b600f546001600160a01b0316612ad457600e546040515f916001600160a01b03169083908381818185875af1925050503d805f8114612aa7576040519150601f19603f3d011682016040523d82523d5f602084013e612aac565b606091505b5050905080612ace57604051634033e4e360e01b815260040160405180910390fd5b50612b6c565b600f54600e546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526044810184905291169081906323b872dd906064016020604051808303815f875af1925050508015612b4c575060408051601f3d908101601f19168201909252612b4991810190613a3c565b60015b612b6957604051634033e4e360e01b815260040160405180910390fd5b50505b600e546040518281526001600160a01b03909116907f2b5dffd9914ddb43acdb6963bacf053a87bf9354300844f6339f17741e25145a9060200160405180910390a250565b805f03612bd157604051632ee66eed60e01b815260040160405180910390fd5b6001600160a01b038216612bf857604051632ee66eed60e01b815260040160405180910390fd5b600f546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b039091169081906323b872dd906064016020604051808303815f875af1925050508015612c6c575060408051601f3d908101601f19168201909252612c6991810190613a3c565b60015b612c8957604051632ee66eed60e01b815260040160405180910390fd5b50826001600160a01b03167f5bfd86dd1dfba5846abf8c8ff49e529e997ac11be6a5ad81501ef4418f35968983604051612cc591815260200190565b60405180910390a2505050565b6003545f829003612cf65760405163b562e8dd60e01b815260040160405180910390fd5b612d025f848385613137565b6001600160a01b0383165f8181526008602090815260408083208054680100000000000000018802019055848352600790915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612dae5780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f5fa4600101612d78565b50815f03612dce57604051622e076360e81b815260040160405180910390fd5b60035550505050565b6127106001600160601b038216811015612e1d5760405163dfd1fc1b60e01b8152600481018590526001600160601b03831660248201526044810182905260640161252b565b6001600160a01b038316612e4d57604051634b4f842960e11b8152600481018590525f602482015260440161252b565b506040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182525f968752600290529190942093519051909116600160a01b029116179055565b5f81600111612f0557505f8181526007602052604081205490600160e01b82169003612f0557805f03612f00576003548210612ee657604051636f96cda160e11b815260040160405180910390fd5b5b505f19015f818152600760205260409020548015612ee7575b919050565b604051636f96cda160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f82612f79858461327a565b14949350505050565b335f818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b612ff88484846111b4565b6001600160a01b0383163b156111e457613014848484846132bc565b6111e4576040516368d2bf6b60e11b815260040160405180910390fd5b606060128054610f4f906139ed565b606060138054610f4f906139ed565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806130685750819003601f19909101908152919050565b5f61309c83611812565b905081156130db57336001600160a01b038216146130db576130be81336124d1565b6130db576040516367d9dca160e11b815260040160405180910390fd5b5f8381526009602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b601154610100900460ff16801561315657506001600160a01b03841615155b801561316a57506001600160a01b03831615155b15613188576040516336e278fd60e21b815260040160405180910390fd5b613191336133a3565b6131ae576040516326406c5f60e11b815260040160405180910390fd5b6001600160a01b038416158015906131d05750600b546001600160a01b031615155b15613275575f5b8181101561327357600b546001600160a01b031663caee23ea3387876131fd8689613aa1565b6040516001600160e01b031960e087901b1681526001600160a01b03948516600482015292841660248401529216604482015260648101919091526084015f6040518083038186803b158015613251575f5ffd5b505afa158015613263573d5f5f3e3d5ffd5b5050600190920191506131d79050565b505b6111e4565b5f81815b84518110156132b4576132aa8286838151811061329d5761329d613bc5565b602002602001015161343b565b915060010161327e565b509392505050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a02906132f0903390899088908890600401613c26565b6020604051808303815f875af192505050801561332a575060408051601f3d908101601f1916820190925261332791810190613c62565b60015b613386573d808015613357576040519150601f19603f3d011682016040523d82523d5f602084013e61335c565b606091505b5080515f0361337e576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6011545f9062010000900460ff1615613433576011546040516370c5e04560e11b81526001600160a01b038481166004830152630100000090920490911690819063e18bc08a90602401602060405180830381865afa158015613408573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061342c9190613a3c565b9392505050565b506001919050565b5f818310613455575f82815260208490526040902061342c565b505f9182526020526040902090565b6001600160a01b0381168114611300575f5ffd5b5f60208284031215613488575f5ffd5b813561342c81613464565b6001600160e01b031981168114611300575f5ffd5b5f602082840312156134b8575f5ffd5b813561342c81613493565b80356001600160601b0381168114612f00575f5ffd5b5f5f604083850312156134ea575f5ffd5b82356134f581613464565b9150613503602084016134c3565b90509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61342c602083018461350c565b5f6020828403121561355c575f5ffd5b5035919050565b5f5f60408385031215613574575f5ffd5b823561357f81613464565b946020939093013593505050565b5f5f6040838503121561359e575f5ffd5b82356135a981613464565b915060208301356135b981613464565b809150509250929050565b5f5f5f606084860312156135d6575f5ffd5b83356135e181613464565b925060208401356135f181613464565b929592945050506040919091013590565b5f5f60408385031215613613575f5ffd5b50508035926020909101359150565b8015158114611300575f5ffd5b5f6020828403121561363f575f5ffd5b813561342c81613622565b5f5f6020838503121561365b575f5ffd5b823567ffffffffffffffff811115613671575f5ffd5b8301601f81018513613681575f5ffd5b803567ffffffffffffffff811115613697575f5ffd5b8560208284010111156136a8575f5ffd5b6020919091019590945092505050565b5f5f5f606084860312156136ca575f5ffd5b8335925060208401356136dc81613464565b91506136ea604085016134c3565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613730576137306136f3565b604052919050565b5f67ffffffffffffffff821115613751576137516136f3565b5060051b60200190565b5f82601f83011261376a575f5ffd5b813561377d61377882613738565b613707565b8082825260208201915060208360051b86010192508583111561379e575f5ffd5b602085015b838110156137bb5780358352602092830192016137a3565b5095945050505050565b5f5f604083850312156137d6575f5ffd5b823567ffffffffffffffff8111156137ec575f5ffd5b8301601f810185136137fc575f5ffd5b803561380a61377882613738565b8082825260208201915060208360051b85010192508783111561382b575f5ffd5b6020840193505b8284101561385657833561384581613464565b825260209384019390910190613832565b9450505050602083013567ffffffffffffffff811115613874575f5ffd5b6138808582860161375b565b9150509250929050565b5f5f5f6040848603121561389c575f5ffd5b833567ffffffffffffffff8111156138b2575f5ffd5b8401601f810186136138c2575f5ffd5b803567ffffffffffffffff8111156138d8575f5ffd5b8660208260051b84010111156138ec575f5ffd5b6020918201979096509401359392505050565b5f5f60408385031215613910575f5ffd5b823561391b81613464565b915060208301356135b981613622565b5f5f5f5f6080858703121561393e575f5ffd5b843561394981613464565b9350602085013561395981613464565b925060408501359150606085013567ffffffffffffffff81111561397b575f5ffd5b8501601f8101871361398b575f5ffd5b803567ffffffffffffffff8111156139a5576139a56136f3565b6139b8601f8201601f1916602001613707565b8181528860208385010111156139cc575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b600181811c90821680613a0157607f821691505b602082108103613a1f57634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215613a35575f5ffd5b5051919050565b5f60208284031215613a4c575f5ffd5b815161342c81613622565b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610ef857610ef8613a57565b5f82613a9c57634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115610ef857610ef8613a57565b81810381811115610ef857610ef8613a57565b601f82111561105a57805f5260205f20601f840160051c81016020851015613aec5750805b601f840160051c820191505b818110156111a0575f8155600101613af8565b67ffffffffffffffff831115613b2357613b236136f3565b613b3783613b3183546139ed565b83613ac7565b5f601f841160018114613b68575f8515613b515750838201355b5f19600387901b1c1916600186901b1783556111a0565b5f83815260208120601f198716915b82811015613b975786850135825560209485019460019092019101613b77565b5086821015613bb3575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b5f52603260045260245ffd5b5f81518060208401855e5f93019283525090919050565b5f613bfb8285613bd9565b602f60f81b8152613c0f6001820185613bd9565b64173539b7b760d91b815260050195945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613c589083018461350c565b9695505050505050565b5f60208284031215613c72575f5ffd5b815161342c8161349356fea2646970667358221220aadb609a048e15959e0a915bc41c4d7583fd94afac0dac6153e8098ec5a5892564736f6c634300081c003368747470733a2f2f6d696e746966792d6c61756e63687061642e6e7963332e63646e2e6469676974616c6f6365616e7370616365732e636f6d2f36353534633664362d363736662d343736652d623361642d6364353063393362383530382e676966
Deployed Bytecode
0x6080604052600436106104d1575f3560e01c80636f8b44b011610278578063aa60bdd011610155578063d5abeb01116100c9578063e985e9c511610083578063e985e9c514610e14578063ed9aab5114610e33578063f2fde38b14610e59578063f3f119f114610e78578063f4f3b20014610e8d578063fb796e6c14610eac575f5ffd5b8063d5abeb0114610d78578063e079e46114610d8d578063e1136b3d14610dac578063e56e9ac014610dcb578063e5a6b10f14610de0578063e5e2a0f614610dff575f5ffd5b8063b88d4fde1161011a578063b88d4fde14610ce8578063c3d923a614610cfb578063c87b56dd14610d1a578063cafd705f14610d39578063d1c026c914610d4e578063d2762b4614610d63575f5ffd5b8063aa60bdd014610c4d578063ab7b499314610c6c578063abd017ea14610c8b578063ac19701b14610caa578063b7c0b8e814610cc9575f5ffd5b80638da5cb5b116101ec5780639e5f94a7116101b15780639e5f94a714610bb2578063a22cb46514610bd1578063a42c05ba14610bf0578063a70138c114610c05578063a9fc664e14610c19578063aa0678ff14610c38575f5ffd5b80638da5cb5b14610b3b5780638e9a85f314610b5757806395d89b4114610b6c57806396ce3bfa14610b8057806396db3e8914610b93575f5ffd5b806376ee01531161023d57806376ee015314610aab57806379544c8614610aca5780637d4b5a2114610adf5780637f371aa014610af2578063858633f214610b07578063871215d414610b26575f5ffd5b80636f8b44b014610a1b57806370a0823114610a3a578063715018a614610a5957806371be5e1414610a6d57806372b0d90c14610a8c575f5ffd5b80633ccfd60b116103b157806354389437116103255780635c1afecb116102df5780635c1afecb1461097f5780635d99a0cf146109945780636352211e146109a957806364f52a1f146109c857806365216a41146109dd578063691ce970146109fc575f5ffd5b806354389437146108e3578063545b70b2146108f857806355f5f0661461090d57806355f804b31461092c5780635944c7531461094b57806359a2f3bd1461096a575f5ffd5b8063462fed1411610376578063462fed141461083357806346fff98d14610852578063484b973c146108715780634b21839e146108905780634ed69eaf146108af5780634f115db1146108ce575f5ffd5b80633ccfd60b146107cf578063406466a7146107e357806341d94c98146107f857806342842e0e1461080d57806342b5e15c14610820575f5ffd5b806312b3651011610448578063251c21ec1161040d578063251c21ec146106f45780632a55205a1461071357806330a089651461075157806330db1d5b146107705780633bf303941461078f5780633c6d5762146107a4575f5ffd5b806312b365101461067157806318160ddd1461068f578063189ce8b1146106a357806321b8acd7146106c257806323b872dd146106e1575f5ffd5b8063081812fc11610499578063081812fc14610599578063095ea7b3146105d0578063098144d4146105e35780630c92b631146106005780630d4c18281461061f5780630d705df61461064a575f5ffd5b80630141a449146104d557806301ffc9a71461051357806304634d8d1461054257806306fdde03146105635780630759f2d814610584575b5f5ffd5b3480156104e0575f5ffd5b506105006104ef366004613478565b602b6020525f908152604090205481565b6040519081526020015b60405180910390f35b34801561051e575f5ffd5b5061053261052d3660046134a8565b610ec5565b604051901515815260200161050a565b34801561054d575f5ffd5b5061056161055c3660046134d9565b610efe565b005b34801561056e575f5ffd5b50610577610f40565b60405161050a919061353a565b34801561058f575f5ffd5b5061050060165481565b3480156105a4575f5ffd5b506105b86105b336600461354c565b610fd0565b6040516001600160a01b03909116815260200161050a565b6105616105de366004613563565b611012565b3480156105ee575f5ffd5b50600b546001600160a01b03166105b8565b34801561060b575f5ffd5b5061056161061a36600461354c565b61105f565b34801561062a575f5ffd5b50610500610639366004613478565b60236020525f908152604090205481565b348015610655575f5ffd5b506040805163657711f560e11b8152600160208201520161050a565b34801561067c575f5ffd5b5060115461053290610100900460ff1681565b34801561069a575f5ffd5b5061050061106c565b3480156106ae575f5ffd5b506105616106bd36600461358d565b611079565b3480156106cd575f5ffd5b506105616106dc36600461354c565b6111a7565b6105616106ef3660046135c4565b6111b4565b3480156106ff575f5ffd5b5061056161070e36600461354c565b6111ea565b34801561071e575f5ffd5b5061073261072d366004613602565b6111f7565b604080516001600160a01b03909316835260208301919091520161050a565b34801561075c575f5ffd5b50600e546105b8906001600160a01b031681565b34801561077b575f5ffd5b5061056161078a36600461354c565b61127a565b34801561079a575f5ffd5b50610500601e5481565b3480156107af575f5ffd5b506105006107be366004613478565b601b6020525f908152604090205481565b3480156107da575f5ffd5b50610561611287565b3480156107ee575f5ffd5b5061050060285481565b348015610803575f5ffd5b5061050060155481565b61056161081b3660046135c4565b611303565b61056161082e36600461354c565b611333565b34801561083e575f5ffd5b5061056161084d36600461354c565b6116da565b34801561085d575f5ffd5b5061056161086c36600461362f565b6116e7565b34801561087c575f5ffd5b5061056161088b366004613563565b61173b565b34801561089b575f5ffd5b506105616108aa36600461354c565b61178f565b3480156108ba575f5ffd5b506105616108c936600461364a565b61179c565b3480156108d9575f5ffd5b50610500601c5481565b3480156108ee575f5ffd5b5061050060245481565b348015610903575f5ffd5b5061050060175481565b348015610918575f5ffd5b5061056161092736600461354c565b6117b1565b348015610937575f5ffd5b5061056161094636600461364a565b6117be565b348015610956575f5ffd5b506105616109653660046136b8565b6117d3565b348015610975575f5ffd5b5061050060215481565b34801561098a575f5ffd5b50610500601f5481565b34801561099f575f5ffd5b5061050060205481565b3480156109b4575f5ffd5b506105b86109c336600461354c565b611812565b3480156109d3575f5ffd5b50610500601a5481565b3480156109e8575f5ffd5b506105616109f73660046137c5565b61181c565b348015610a07575f5ffd5b50610561610a1636600461354c565b6118f0565b348015610a26575f5ffd5b50610561610a3536600461354c565b6118fd565b348015610a45575f5ffd5b50610500610a54366004613478565b61190a565b348015610a64575f5ffd5b50610561611957565b348015610a78575f5ffd5b50610561610a8736600461354c565b61196a565b348015610a97575f5ffd5b50610561610aa6366004613478565b611977565b348015610ab6575f5ffd5b50610561610ac536600461354c565b6119ef565b348015610ad5575f5ffd5b50610500601d5481565b610561610aed36600461388a565b6119fc565b348015610afd575f5ffd5b5061050060265481565b348015610b12575f5ffd5b50610561610b2136600461354c565b611e46565b348015610b31575f5ffd5b50610500600c5481565b348015610b46575f5ffd5b505f546001600160a01b03166105b8565b348015610b62575f5ffd5b5061050060275481565b348015610b77575f5ffd5b50610577611e53565b610561610b8e36600461388a565b611e62565b348015610b9e575f5ffd5b50610561610bad36600461354c565b612293565b348015610bbd575f5ffd5b50610561610bcc36600461354c565b6122a0565b348015610bdc575f5ffd5b50610561610beb3660046138ff565b6122ad565b348015610bfb575f5ffd5b50610500602a5481565b348015610c10575f5ffd5b506105616122f5565b348015610c24575f5ffd5b50610561610c33366004613478565b61230a565b348015610c43575f5ffd5b5061050060145481565b348015610c58575f5ffd5b50610561610c6736600461354c565b612373565b348015610c77575f5ffd5b50610561610c86366004613478565b612380565b348015610c96575f5ffd5b506011546105329062010000900460ff1681565b348015610cb5575f5ffd5b50610561610cc436600461354c565b6123b4565b348015610cd4575f5ffd5b50610561610ce336600461362f565b6123c1565b610561610cf636600461392b565b6123dc565b348015610d06575f5ffd5b50610561610d1536600461354c565b61240d565b348015610d25575f5ffd5b50610577610d3436600461354c565b61241a565b348015610d44575f5ffd5b5061050060295481565b348015610d59575f5ffd5b5061050060255481565b348015610d6e575f5ffd5b50610500600d5481565b348015610d83575f5ffd5b5061050060105481565b348015610d98575f5ffd5b50610561610da736600461354c565b6124b7565b348015610db7575f5ffd5b50610561610dc636600461354c565b6124c4565b348015610dd6575f5ffd5b5061050060195481565b348015610deb575f5ffd5b50600f546105b8906001600160a01b031681565b348015610e0a575f5ffd5b5061050060185481565b348015610e1f575f5ffd5b50610532610e2e36600461358d565b6124d1565b348015610e3e575f5ffd5b506011546105b890630100000090046001600160a01b031681565b348015610e64575f5ffd5b50610561610e73366004613478565b6124fe565b348015610e83575f5ffd5b5061050060225481565b348015610e98575f5ffd5b50610561610ea7366004613478565b61253d565b348015610eb7575f5ffd5b506011546105329060ff1681565b5f6001600160e01b03198216632b435fdb60e21b1480610ee95750610ee982612680565b80610ef85750610ef8826126cd565b92915050565b610f06612701565b6103e8816001600160601b03161115610f325760405163f4df6ae560e01b815260040160405180910390fd5b610f3c828261272d565b5050565b606060058054610f4f906139ed565b80601f0160208091040260200160405190810160405280929190818152602001828054610f7b906139ed565b8015610fc65780601f10610f9d57610100808354040283529160200191610fc6565b820191905f5260205f20905b815481529060010190602001808311610fa957829003601f168201915b5050505050905090565b5f610fda826127cf565b610ff7576040516333d1c03960e21b815260040160405180910390fd5b505f908152600960205260409020546001600160a01b031690565b8160115460ff16156110275761102781612802565b601154610100900460ff1615611050576040516336e278fd60e21b815260040160405180910390fd5b61105a8383612841565b505050565b611067612701565b602655565b600454600354035f190190565b611081612701565b6040516370a0823160e01b815230600482015282905f906001600160a01b038316906370a0823190602401602060405180830381865afa1580156110c7573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110eb9190613a25565b9050805f0361110d576040516312171d8360e31b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390525f919084169063a9059cbb906044016020604051808303815f875af115801561115c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111809190613a3c565b9050806111a0576040516312171d8360e31b815260040160405180910390fd5b5050505050565b6111af612701565b602455565b826001600160a01b03811633146111d95760115460ff16156111d9576111d933612802565b6111e484848461284d565b50505050565b6111f2612701565b601455565b5f82815260026020526040812080548291906001600160a01b03811690600160a01b90046001600160601b03168161124a5750506001546001600160a01b03811690600160a01b90046001600160601b03165b5f6127106112616001600160601b03841689613a6b565b61126b9190613a82565b92989297509195505050505050565b611282612701565b602055565b61128f612701565b5f80546040516001600160a01b039091169047908381818185875af1925050503d805f81146112d9576040519150601f19603f3d011682016040523d82523d5f602084013e6112de565b606091505b5050905080611300576040516312171d8360e31b815260040160405180910390fd5b50565b826001600160a01b03811633146113285760115460ff16156113285761132833612802565b6111e48484846129ea565b60245415801590611345575060245442105b1561136357604051636ea7008360e11b815260040160405180910390fd5b60255415801590611375575060255442115b1561139357604051636ea7008360e11b815260040160405180910390fd5b601054158015906113b75750601054816113ab61106c565b6113b59190613aa1565b115b156113d557604051638a164f6360e01b815260040160405180910390fd5b602654158015906113f45750602654816027546113f29190613aa1565b115b1561141257604051638a164f6360e01b815260040160405180910390fd5b5f81600c546028546114249190613aa1565b61142e9190613a6b565b600f549091506001600160a01b0316611466578034146114615760405163193e352b60e11b815260040160405180910390fd5b611582565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa1580156114b0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114d49190613a25565b10156114f35760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa15801561153d573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115619190613a25565b101561158057604051634fd3af0760e01b815260040160405180910390fd5b505b602954158015906115ad5750602954335f908152602b60205260409020546115ab908490613aa1565b115b156115cb57604051638a164f6360e01b815260040160405180910390fd5b600c545f90158015906115e85750600e546001600160a01b031615155b156115fe5782600c546115fb9190613a6b565b90505b600d545f901580159061161b5750600e546001600160a01b031615155b156116475761271061162d8385613ab4565b600d5461163a9190613a6b565b6116449190613a82565b90505b5f6116528284613aa1565b905080156116635761166381612a04565b600f546001600160a01b03161580159061167c57508084115b15611694576116943061168f8387613ab4565b612bb1565b335f908152602b6020526040812080548792906116b2908490613aa1565b925050819055508460275f8282546116ca9190613aa1565b909155506111a090503386612cd2565b6116e2612701565b602155565b6116ef612701565b601154630100000090046001600160a01b031661171f57604051630e048e7160e41b815260040160405180910390fd5b60118054911515620100000262ff000019909216919091179055565b611743612701565b6010541580159061176757506010548161175b61106c565b6117659190613aa1565b115b1561178557604051638a164f6360e01b815260040160405180910390fd5b610f3c8282612cd2565b611797612701565b601955565b6117a4612701565b601361105a828483613b0b565b6117b9612701565b601a55565b6117c6612701565b601261105a828483613b0b565b6117db612701565b6103e8816001600160601b031611156118075760405163f4df6ae560e01b815260040160405180910390fd5b61105a838383612dd7565b5f610ef882612e97565b611824612701565b805182511461184657604051637e26301b60e11b815260040160405180910390fd5b5f5b825181101561105a576010541580159061188e575060105482828151811061187257611872613bc5565b602002602001015161188261106c565b61188c9190613aa1565b115b156118ac57604051638a164f6360e01b815260040160405180910390fd5b6118e88382815181106118c1576118c1613bc5565b60200260200101518383815181106118db576118db613bc5565b6020026020010151612cd2565b600101611848565b6118f8612701565b602555565b611905612701565b601055565b5f6001600160a01b038216611932576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f9081526008602052604090205467ffffffffffffffff1690565b61195f612701565b6119685f612f1e565b565b611972612701565b602855565b61197f612701565b5f816001600160a01b0316476040515f6040518083038185875af1925050503d805f81146119c8576040519150601f19603f3d011682016040523d82523d5f602084013e6119cd565b606091505b5050905080610f3c576040516312171d8360e31b815260040160405180910390fd5b6119f7612701565b602955565b60145415801590611a0e575060145442105b15611a2c57604051636ea7008360e11b815260040160405180910390fd5b60155415801590611a3e575060155442115b15611a5c57604051636ea7008360e11b815260040160405180910390fd5b60105415801590611a80575060105481611a7461106c565b611a7e9190613aa1565b115b15611a9e57604051638a164f6360e01b815260040160405180910390fd5b60165415801590611abd575060165481601754611abb9190613aa1565b115b15611adb57604051638a164f6360e01b815260040160405180910390fd5b5f81600c54601854611aed9190613aa1565b611af79190613a6b565b600f549091506001600160a01b0316611b2f57803414611b2a5760405163193e352b60e11b815260040160405180910390fd5b611c4b565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa158015611b79573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b9d9190613a25565b1015611bbc5760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa158015611c06573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c2a9190613a25565b1015611c4957604051634fd3af0760e01b815260040160405180910390fd5b505b601a5415611cea576040516bffffffffffffffffffffffff193360601b1660208201525f90603401604051602081830303815290604052805190602001209050611ccb8585808060200260200160405190810160405280939291908181526020018383602002808284375f9201919091525050601a549150849050612f6d565b611ce85760405163582f497d60e11b815260040160405180910390fd5b505b60195415801590611d155750601954335f908152601b6020526040902054611d13908490613aa1565b115b15611d3357604051638a164f6360e01b815260040160405180910390fd5b600c545f9015801590611d505750600e546001600160a01b031615155b15611d665782600c54611d639190613a6b565b90505b600d545f9015801590611d835750600e546001600160a01b031615155b15611daf57612710611d958385613ab4565b600d54611da29190613a6b565b611dac9190613a82565b90505b5f611dba8284613aa1565b90508015611dcb57611dcb81612a04565b600f546001600160a01b031615801590611de457508084115b15611df757611df73061168f8387613ab4565b335f908152601b602052604081208054879290611e15908490613aa1565b925050819055508460175f828254611e2d9190613aa1565b90915550611e3d90503386612cd2565b50505050505050565b611e4e612701565b601655565b606060068054610f4f906139ed565b601c5415801590611e745750601c5442105b15611e9257604051636ea7008360e11b815260040160405180910390fd5b601d5415801590611ea45750601d5442115b15611ec257604051636ea7008360e11b815260040160405180910390fd5b60105415801590611ee6575060105481611eda61106c565b611ee49190613aa1565b115b15611f0457604051638a164f6360e01b815260040160405180910390fd5b601e5415801590611f235750601e5481601f54611f219190613aa1565b115b15611f4157604051638a164f6360e01b815260040160405180910390fd5b5f81600c54602054611f539190613aa1565b611f5d9190613a6b565b600f549091506001600160a01b0316611f9557803414611f905760405163193e352b60e11b815260040160405180910390fd5b6120b1565b600f546040516370a0823160e01b81523360048201526001600160a01b0390911690829082906370a0823190602401602060405180830381865afa158015611fdf573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120039190613a25565b10156120225760405163569d45cf60e11b815260040160405180910390fd5b604051636eb1769f60e11b815233600482015230602482015282906001600160a01b0383169063dd62ed3e90604401602060405180830381865afa15801561206c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120909190613a25565b10156120af57604051634fd3af0760e01b815260040160405180910390fd5b505b60225415612150576040516bffffffffffffffffffffffff193360601b1660208201525f906034016040516020818303038152906040528051906020012090506121318585808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506022549150849050612f6d565b61214e5760405163582f497d60e11b815260040160405180910390fd5b505b6021541580159061217b5750602154335f90815260236020526040902054612179908490613aa1565b115b1561219957604051638a164f6360e01b815260040160405180910390fd5b600c545f90158015906121b65750600e546001600160a01b031615155b156121cc5782600c546121c99190613a6b565b90505b600d545f90158015906121e95750600e546001600160a01b031615155b15612215576127106121fb8385613ab4565b600d546122089190613a6b565b6122129190613a82565b90505b5f6122208284613aa1565b905080156122315761223181612a04565b600f546001600160a01b03161580159061224a57508084115b1561225d5761225d3061168f8387613ab4565b335f908152602360205260408120805487929061227b908490613aa1565b9250508190555084601f5f828254611e2d9190613aa1565b61229b612701565b602255565b6122a8612701565b602a55565b8160115460ff16156122c2576122c281612802565b601154610100900460ff16156122eb576040516336e278fd60e21b815260040160405180910390fd5b61105a8383612f82565b6122fd612701565b6011805461ff0019169055565b612312612701565b600b80546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a15050565b61237b612701565b601c55565b612388612701565b601180546001600160a01b039092166301000000026301000000600160b81b0319909216919091179055565b6123bc612701565b601555565b6123c9612701565b6011805460ff1916911515919091179055565b836001600160a01b03811633146124015760115460ff16156124015761240133612802565b6111a085858585612fed565b612415612701565b601e55565b6060612425826127cf565b61244257604051630a14c4b560e41b815260040160405180910390fd5b5f61244b613031565b90505f612456613040565b905081515f14612493578161246a8561304f565b60405160200161247b929190613bf0565b60405160208183030381529060405292505050919050565b8051156124a1579392505050565b505060408051602081019091525f815292915050565b6124bf612701565b601d55565b6124cc612701565b601855565b6001600160a01b039182165f908152600a6020908152604080832093909416825291909152205460ff1690565b612506612701565b6001600160a01b03811661253457604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61130081612f1e565b612545612701565b6040516370a0823160e01b815230600482015281905f906001600160a01b038316906370a0823190602401602060405180830381865afa15801561258b573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125af9190613a25565b9050805f036125d1576040516312171d8360e31b815260040160405180910390fd5b5f826001600160a01b031663a9059cbb6125f25f546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303815f875af115801561263c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126609190613a3c565b9050806111e4576040516312171d8360e31b815260040160405180910390fd5b5f6301ffc9a760e01b6001600160e01b0319831614806126b057506380ac58cd60e01b6001600160e01b03198316145b80610ef85750506001600160e01b031916635b5e139f60e01b1490565b5f6001600160e01b0319821663152a902d60e11b1480610ef857506301ffc9a760e01b6001600160e01b0319831614610ef8565b5f546001600160a01b031633146119685760405163118cdaa760e01b815233600482015260240161252b565b6127106001600160601b03821681101561276c57604051636f483d0960e01b81526001600160601b03831660048201526024810182905260440161252b565b6001600160a01b03831661279557604051635b6cc80560e11b81525f600482015260240161252b565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b5f816001111580156127e2575060035482105b8015610ef85750505f90815260076020526040902054600160e01b161590565b69c61711340011223344555f5230601a5280603a525f5f604460166daaeb6d7670e522a718067333cd4e5afa61283a573d5f5f3e3d5ffd5b5f603a5250565b610f3c82826001613092565b5f61285782612e97565b9050836001600160a01b0316816001600160a01b03161461288a5760405162a1148160e81b815260040160405180910390fd5b5f8281526009602052604090208054338082146001600160a01b038816909114176128d6576128b986336124d1565b6128d657604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0385166128fd57604051633a954ecd60e21b815260040160405180910390fd5b61290a8686866001613137565b8015612914575f82555b6001600160a01b038681165f9081526008602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260076020526040812091909155600160e11b841690036129a157600184015f81815260076020526040812054900361299f57600354811461299f575f8181526007602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b61105a83838360405180602001604052805f8152506123dc565b805f03612a2457604051635e2a89dd60e01b815260040160405180910390fd5b600e546001600160a01b0316612a4d5760405163668040e160e11b815260040160405180910390fd5b600f546001600160a01b0316612ad457600e546040515f916001600160a01b03169083908381818185875af1925050503d805f8114612aa7576040519150601f19603f3d011682016040523d82523d5f602084013e612aac565b606091505b5050905080612ace57604051634033e4e360e01b815260040160405180910390fd5b50612b6c565b600f54600e546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526044810184905291169081906323b872dd906064016020604051808303815f875af1925050508015612b4c575060408051601f3d908101601f19168201909252612b4991810190613a3c565b60015b612b6957604051634033e4e360e01b815260040160405180910390fd5b50505b600e546040518281526001600160a01b03909116907f2b5dffd9914ddb43acdb6963bacf053a87bf9354300844f6339f17741e25145a9060200160405180910390a250565b805f03612bd157604051632ee66eed60e01b815260040160405180910390fd5b6001600160a01b038216612bf857604051632ee66eed60e01b815260040160405180910390fd5b600f546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b039091169081906323b872dd906064016020604051808303815f875af1925050508015612c6c575060408051601f3d908101601f19168201909252612c6991810190613a3c565b60015b612c8957604051632ee66eed60e01b815260040160405180910390fd5b50826001600160a01b03167f5bfd86dd1dfba5846abf8c8ff49e529e997ac11be6a5ad81501ef4418f35968983604051612cc591815260200190565b60405180910390a2505050565b6003545f829003612cf65760405163b562e8dd60e01b815260040160405180910390fd5b612d025f848385613137565b6001600160a01b0383165f8181526008602090815260408083208054680100000000000000018802019055848352600790915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612dae5780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f5fa4600101612d78565b50815f03612dce57604051622e076360e81b815260040160405180910390fd5b60035550505050565b6127106001600160601b038216811015612e1d5760405163dfd1fc1b60e01b8152600481018590526001600160601b03831660248201526044810182905260640161252b565b6001600160a01b038316612e4d57604051634b4f842960e11b8152600481018590525f602482015260440161252b565b506040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182525f968752600290529190942093519051909116600160a01b029116179055565b5f81600111612f0557505f8181526007602052604081205490600160e01b82169003612f0557805f03612f00576003548210612ee657604051636f96cda160e11b815260040160405180910390fd5b5b505f19015f818152600760205260409020548015612ee7575b919050565b604051636f96cda160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f82612f79858461327a565b14949350505050565b335f818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b612ff88484846111b4565b6001600160a01b0383163b156111e457613014848484846132bc565b6111e4576040516368d2bf6b60e11b815260040160405180910390fd5b606060128054610f4f906139ed565b606060138054610f4f906139ed565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806130685750819003601f19909101908152919050565b5f61309c83611812565b905081156130db57336001600160a01b038216146130db576130be81336124d1565b6130db576040516367d9dca160e11b815260040160405180910390fd5b5f8381526009602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b601154610100900460ff16801561315657506001600160a01b03841615155b801561316a57506001600160a01b03831615155b15613188576040516336e278fd60e21b815260040160405180910390fd5b613191336133a3565b6131ae576040516326406c5f60e11b815260040160405180910390fd5b6001600160a01b038416158015906131d05750600b546001600160a01b031615155b15613275575f5b8181101561327357600b546001600160a01b031663caee23ea3387876131fd8689613aa1565b6040516001600160e01b031960e087901b1681526001600160a01b03948516600482015292841660248401529216604482015260648101919091526084015f6040518083038186803b158015613251575f5ffd5b505afa158015613263573d5f5f3e3d5ffd5b5050600190920191506131d79050565b505b6111e4565b5f81815b84518110156132b4576132aa8286838151811061329d5761329d613bc5565b602002602001015161343b565b915060010161327e565b509392505050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a02906132f0903390899088908890600401613c26565b6020604051808303815f875af192505050801561332a575060408051601f3d908101601f1916820190925261332791810190613c62565b60015b613386573d808015613357576040519150601f19603f3d011682016040523d82523d5f602084013e61335c565b606091505b5080515f0361337e576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6011545f9062010000900460ff1615613433576011546040516370c5e04560e11b81526001600160a01b038481166004830152630100000090920490911690819063e18bc08a90602401602060405180830381865afa158015613408573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061342c9190613a3c565b9392505050565b506001919050565b5f818310613455575f82815260208490526040902061342c565b505f9182526020526040902090565b6001600160a01b0381168114611300575f5ffd5b5f60208284031215613488575f5ffd5b813561342c81613464565b6001600160e01b031981168114611300575f5ffd5b5f602082840312156134b8575f5ffd5b813561342c81613493565b80356001600160601b0381168114612f00575f5ffd5b5f5f604083850312156134ea575f5ffd5b82356134f581613464565b9150613503602084016134c3565b90509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61342c602083018461350c565b5f6020828403121561355c575f5ffd5b5035919050565b5f5f60408385031215613574575f5ffd5b823561357f81613464565b946020939093013593505050565b5f5f6040838503121561359e575f5ffd5b82356135a981613464565b915060208301356135b981613464565b809150509250929050565b5f5f5f606084860312156135d6575f5ffd5b83356135e181613464565b925060208401356135f181613464565b929592945050506040919091013590565b5f5f60408385031215613613575f5ffd5b50508035926020909101359150565b8015158114611300575f5ffd5b5f6020828403121561363f575f5ffd5b813561342c81613622565b5f5f6020838503121561365b575f5ffd5b823567ffffffffffffffff811115613671575f5ffd5b8301601f81018513613681575f5ffd5b803567ffffffffffffffff811115613697575f5ffd5b8560208284010111156136a8575f5ffd5b6020919091019590945092505050565b5f5f5f606084860312156136ca575f5ffd5b8335925060208401356136dc81613464565b91506136ea604085016134c3565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613730576137306136f3565b604052919050565b5f67ffffffffffffffff821115613751576137516136f3565b5060051b60200190565b5f82601f83011261376a575f5ffd5b813561377d61377882613738565b613707565b8082825260208201915060208360051b86010192508583111561379e575f5ffd5b602085015b838110156137bb5780358352602092830192016137a3565b5095945050505050565b5f5f604083850312156137d6575f5ffd5b823567ffffffffffffffff8111156137ec575f5ffd5b8301601f810185136137fc575f5ffd5b803561380a61377882613738565b8082825260208201915060208360051b85010192508783111561382b575f5ffd5b6020840193505b8284101561385657833561384581613464565b825260209384019390910190613832565b9450505050602083013567ffffffffffffffff811115613874575f5ffd5b6138808582860161375b565b9150509250929050565b5f5f5f6040848603121561389c575f5ffd5b833567ffffffffffffffff8111156138b2575f5ffd5b8401601f810186136138c2575f5ffd5b803567ffffffffffffffff8111156138d8575f5ffd5b8660208260051b84010111156138ec575f5ffd5b6020918201979096509401359392505050565b5f5f60408385031215613910575f5ffd5b823561391b81613464565b915060208301356135b981613622565b5f5f5f5f6080858703121561393e575f5ffd5b843561394981613464565b9350602085013561395981613464565b925060408501359150606085013567ffffffffffffffff81111561397b575f5ffd5b8501601f8101871361398b575f5ffd5b803567ffffffffffffffff8111156139a5576139a56136f3565b6139b8601f8201601f1916602001613707565b8181528860208385010111156139cc575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b600181811c90821680613a0157607f821691505b602082108103613a1f57634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215613a35575f5ffd5b5051919050565b5f60208284031215613a4c575f5ffd5b815161342c81613622565b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610ef857610ef8613a57565b5f82613a9c57634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115610ef857610ef8613a57565b81810381811115610ef857610ef8613a57565b601f82111561105a57805f5260205f20601f840160051c81016020851015613aec5750805b601f840160051c820191505b818110156111a0575f8155600101613af8565b67ffffffffffffffff831115613b2357613b236136f3565b613b3783613b3183546139ed565b83613ac7565b5f601f841160018114613b68575f8515613b515750838201355b5f19600387901b1c1916600186901b1783556111a0565b5f83815260208120601f198716915b82811015613b975786850135825560209485019460019092019101613b77565b5086821015613bb3575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b5f52603260045260245ffd5b5f81518060208401855e5f93019283525090919050565b5f613bfb8285613bd9565b602f60f81b8152613c0f6001820185613bd9565b64173539b7b760d91b815260050195945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613c589083018461350c565b9695505050505050565b5f60208284031215613c72575f5ffd5b815161342c8161349356fea2646970667358221220aadb609a048e15959e0a915bc41c4d7583fd94afac0dac6153e8098ec5a5892564736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $2,818.07 | 0.1081 | $304.53 |
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.