Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 290 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Safe Transfer Fr... | 23645306 | 14 days ago | IN | 0 ETH | 0.00000411 | ||||
| Safe Transfer Fr... | 23645288 | 14 days ago | IN | 0 ETH | 0.00000757 | ||||
| Batch Burn | 23431090 | 44 days ago | IN | 0 ETH | 0.00018948 | ||||
| Burn | 23332700 | 58 days ago | IN | 0 ETH | 0.00163757 | ||||
| Batch Burn | 23264486 | 68 days ago | IN | 0 ETH | 0.00075376 | ||||
| Batch Burn | 23240970 | 71 days ago | IN | 0 ETH | 0.00016207 | ||||
| Burn | 23071145 | 95 days ago | IN | 0 ETH | 0.00001661 | ||||
| Batch Burn | 22994646 | 105 days ago | IN | 0 ETH | 0.00054039 | ||||
| Burn | 22933895 | 114 days ago | IN | 0 ETH | 0.00107453 | ||||
| Batch Burn | 22836874 | 127 days ago | IN | 0 ETH | 0.00058945 | ||||
| Burn | 22819769 | 130 days ago | IN | 0 ETH | 0.00012875 | ||||
| Batch Burn | 22473582 | 178 days ago | IN | 0 ETH | 0.00049135 | ||||
| Batch Burn | 22470544 | 179 days ago | IN | 0 ETH | 0.00018901 | ||||
| Batch Burn | 22470492 | 179 days ago | IN | 0 ETH | 0.00061221 | ||||
| Burn | 22461199 | 180 days ago | IN | 0 ETH | 0.00108466 | ||||
| Burn | 22443665 | 182 days ago | IN | 0 ETH | 0.00011527 | ||||
| Burn | 22437484 | 183 days ago | IN | 0 ETH | 0.00017342 | ||||
| Burn | 22426302 | 185 days ago | IN | 0 ETH | 0.00008921 | ||||
| Transfer From | 22246337 | 210 days ago | IN | 0 ETH | 0.00016266 | ||||
| Transfer From | 22246335 | 210 days ago | IN | 0 ETH | 0.00026115 | ||||
| Transfer From | 22237277 | 211 days ago | IN | 0 ETH | 0.00015115 | ||||
| Transfer From | 22237277 | 211 days ago | IN | 0 ETH | 0.00021239 | ||||
| Burn | 22122891 | 227 days ago | IN | 0 ETH | 0.00006439 | ||||
| Batch Burn | 22101846 | 230 days ago | IN | 0 ETH | 0.00012008 | ||||
| Burn | 22053818 | 237 days ago | IN | 0 ETH | 0.00008523 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
To
|
|||
|---|---|---|---|---|---|---|---|
| Deposit | 21658929 | 292 days ago | 0.63905208 ETH | ||||
| Deposit | 21658859 | 292 days ago | 1.67687174 ETH | ||||
| Deposit | 21658789 | 292 days ago | 1.67394139 ETH | ||||
| Deposit | 21658758 | 292 days ago | 1.67394139 ETH | ||||
| Deposit | 21658643 | 292 days ago | 0.16601003 ETH | ||||
| Deposit | 21656064 | 292 days ago | 0.01791511 ETH | ||||
| Deposit | 21655869 | 293 days ago | 0.03231726 ETH | ||||
| Deposit | 21654317 | 293 days ago | 0.18161547 ETH | ||||
| Deposit | 21644654 | 294 days ago | 0.02019012 ETH | ||||
| Deposit | 21644648 | 294 days ago | 0.06063571 ETH | ||||
| Deposit | 21644587 | 294 days ago | 0.202063 ETH | ||||
| Deposit | 21637766 | 295 days ago | 0.21364742 ETH | ||||
| Deposit | 21632798 | 296 days ago | 0.02248901 ETH | ||||
| Deposit | 21625497 | 297 days ago | 0.14260789 ETH | ||||
| Deposit | 21625015 | 297 days ago | 0.10705362 ETH | ||||
| Deposit | 21619560 | 298 days ago | 0.42333526 ETH | ||||
| Deposit | 21618719 | 298 days ago | 0.41644767 ETH | ||||
| Deposit | 21592271 | 301 days ago | 0.02092521 ETH | ||||
| Deposit | 21592160 | 301 days ago | 0.04176843 ETH | ||||
| Deposit | 21590035 | 302 days ago | 0.02026374 ETH | ||||
| Deposit | 21568180 | 305 days ago | 0.68465324 ETH | ||||
| Deposit | 21548998 | 307 days ago | 0.0510355 ETH | ||||
| Deposit | 21546099 | 308 days ago | 0.16122446 ETH | ||||
| Deposit | 21532775 | 310 days ago | 0.24050159 ETH | ||||
| Deposit | 21517322 | 312 days ago | 0.57747976 ETH |
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
StaxNFT
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.26;
import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/interfaces/IERC165.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "erc721a/contracts/ERC721A.sol";
import "./interfaces/IWETH9.sol";
import "./interfaces/IStax.sol";
import "./interfaces/IStaxVault.sol";
import "./lib/constants.sol";
/// @title Stax NFT Contract
contract StaxNFT is ERC721A, Ownable2Step, IERC165 {
using SafeERC20 for IERC20;
using Strings for uint8;
// -------------------------- STATE VARIABLES -------------------------- //
address public immutable STAX;
address public STAX_BANK;
address public STAX_VAULT;
string public contractURI;
string public baseURI;
/// @notice Total multipliers of all existing tokens.
/// @dev Used in cycle reward calculation of the Stax Vault contract.
uint256 public multiplierPool;
/// @notice Timestamp in seconds of the presale end date.
uint256 public presaleEnd;
/// @notice Does TitanX get sent directly to Stax Bank.
bool public directTransfer;
/// @notice Current NFT cycle.
/// @dev Used in distribution of rewards in Stax Vault contract.
uint32 public currentCycle = 1;
/// @notice Packed data per each NFT.
/// @dev Includes: Tier, Multiplier, Mint Cycle, Burn Cycle, Owner at the time of burn.
mapping(uint256 => uint256) private _packedTokenData;
// ------------------------------- EVENTS ------------------------------ //
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
event ContractURIUpdated();
// ------------------------------- ERRORS ------------------------------ //
error SaleInactive();
error Cooldown();
error ZeroInput();
error ZeroAddress();
error IncorrectTier();
error Unauthorized();
error Prohibited();
error DataQueryForNonexistentToken();
error TWAP();
// ------------------------------ MODIFIERS ---------------------------- //
modifier onlySale() {
if (!isSaleActive()) revert SaleInactive();
_;
}
modifier onlyToken() {
if (msg.sender != STAX) revert Unauthorized();
_;
}
modifier onlyVault() {
if (msg.sender != STAX_VAULT) revert Unauthorized();
_;
}
// ----------------------------- CONSTRUCTOR --------------------------- //
constructor(address _owner, string memory _contractURI, string memory __baseURI, address _stax)
ERC721A("Stax", "STAX")
Ownable(_owner)
{
if (_stax == address(0)) revert ZeroAddress();
if (bytes(_contractURI).length == 0) revert ZeroInput();
if (bytes(__baseURI).length == 0) revert ZeroInput();
contractURI = _contractURI;
baseURI = __baseURI;
STAX = _stax;
}
// --------------------------- PUBLIC FUNCTIONS ------------------------ //
/// @notice Mints NFTs using TitanX tokens during the presale.
/// @param tieredNfts List of NFTs to mint, represented by their tier number.
function mintWithTitanX(uint8[] calldata tieredNfts) public onlySale {
uint256 amount = tieredNfts.length;
(uint256 titanXPool, uint256 ampPool) = _processNftTiers(tieredNfts, amount);
IERC20 titanX = IERC20(TITANX);
address receiver = directTransfer ? STAX_BANK : STAX;
titanX.safeTransferFrom(msg.sender, receiver, titanXPool);
if (ampPool > 0) titanX.safeTransferFrom(msg.sender, STAX_VAULT, ampPool);
_mint(msg.sender, tieredNfts.length);
}
/// @notice Mints NFTs using Ethereum during the presale.
/// @param tieredNfts List of NFTs to mint, represented by their tier number.
/// @param deadline Deadline for the transaction.
/// @dev Refunds TitanX if the amount swapped is greater than the price.
function mintWithEth(uint8[] calldata tieredNfts, uint256 deadline) public payable onlySale {
uint256 amount = tieredNfts.length;
(uint256 titanXPool, uint256 ampPool) = _processNftTiers(tieredNfts, amount);
_swapETHForTitanX(titanXPool + ampPool, deadline);
IERC20 titanX = IERC20(TITANX);
address receiver = directTransfer ? STAX_BANK : STAX;
titanX.safeTransfer(receiver, titanXPool);
if (ampPool > 0) titanX.safeTransfer(STAX_VAULT, ampPool);
_mint(msg.sender, tieredNfts.length);
}
/// @notice Burns singe NFT token ID from the owner, stores burn cycle, and claims backing.
/// @param tokenId Token ID to burn.
function burn(uint256 tokenId) external {
if (ownerOf(tokenId) != msg.sender) revert Unauthorized();
uint256 claimAmount = _processTokenIdBurn(tokenId, msg.sender);
_burn(tokenId);
IStax(STAX).handleBackingClaim(claimAmount, msg.sender);
}
/// @notice Burns provided NFT token IDs from the owner, stores burn cycle, and claims backing.
/// @param tokenIds Token IDs to burn.
function batchBurn(uint256[] calldata tokenIds) external {
uint256 amount = tokenIds.length;
if (amount == 0) revert ZeroInput();
uint256 totalClaimAmount;
for (uint256 i = 0; i < amount; i++) {
uint256 tokenId = tokenIds[i];
if (ownerOf(tokenId) != msg.sender) revert Unauthorized();
totalClaimAmount += _processTokenIdBurn(tokenId, msg.sender);
_burn(tokenId);
}
IStax(STAX).handleBackingClaim(totalClaimAmount, msg.sender);
}
/// @notice Updates the current cycle.
/// @return cycle Cycle that has been finalized.
/// @return totalMultipliers Total multiplier pool for the finalized cycle.
/// @dev Only callable by Holder Vault contract.
function updateCycle() external onlyVault returns (uint32 cycle, uint256 totalMultipliers) {
cycle = currentCycle++;
totalMultipliers = multiplierPool;
}
// ----------------------- ADMINISTRATIVE FUNCTIONS -------------------- //
/// @notice Sets the Stax Protocol addresses.
/// @param _staxVault The address of the Holder Vault contract.
/// @param _staxBank The address of the Stax Bank contract.
function setProtocolAddresses(address _staxVault, address _staxBank) external onlyToken {
STAX_VAULT = _staxVault;
STAX_BANK = _staxBank;
}
/// @notice Enables direct transfers of TitanX to Stax Bank contract.
function setDirectTransfer() external onlyToken {
directTransfer = true;
}
/// @notice Starts the presale with a specific end date.
/// @param _presaleEnd The timestamp when the presale will end.
/// @dev Can only be called by the Stax contract.
function startMint(uint256 _presaleEnd) external onlyToken {
presaleEnd = _presaleEnd;
}
/// @notice Sets the contract-level metadata URI.
/// @param _uri The URI of the contract metadata.
function setContractURI(string memory _uri) external onlyOwner {
if (bytes(_uri).length == 0) revert ZeroInput();
contractURI = _uri;
emit ContractURIUpdated();
}
/// @notice Sets NFTs base URI.
/// @param _uri The base URI string.
function setBaseURI(string memory _uri) external onlyOwner {
if (bytes(_uri).length == 0) revert ZeroInput();
baseURI = _uri;
emit BatchMetadataUpdate(1, type(uint256).max);
}
// ---------------------------- VIEW FUNCTIONS ------------------------- //
/// @notice Returns if token mint is currently active.
function isSaleActive() public view returns (bool) {
return presaleEnd > block.timestamp;
}
/// @notice Returns the total number of NFTs per tier.
/// @param start Token ID to start with.
/// @param end Token ID to stop at (not included).
/// @return total An array where each index corresponds to the total NFTs for a specific tier.
/// @dev Should not be called by contracts.
function getTotalNftsPerTiers(uint256 start, uint256 end) external view returns (uint256[] memory total) {
uint256 totalTokenIds = _nextTokenId();
if (end > totalTokenIds) end = totalTokenIds;
total = new uint256[](12);
for (uint256 tokenId = start; tokenId < end; tokenId++) {
if (_exists(tokenId)) {
total[_getNftTier(_packedTokenData[tokenId]) - 1]++;
}
}
}
/// @notice Returns token IDs owned by a specific account.
/// @param account The address of the token owner.
/// @param start Token ID to start with.
/// @param end Token ID to stop at (not included).
/// @return tokenIds An array of token IDs owned by the account.
/// @dev Should not be called by contracts.
function tokenIdsOf(address account, uint256 start, uint256 end) external view returns (uint256[] memory tokenIds) {
uint256 totalTokenIds = _nextTokenId();
if (end > totalTokenIds) end = totalTokenIds;
uint256 userBalance = balanceOf(account);
uint256[] memory _tokenIds = new uint256[](userBalance);
if (userBalance == 0) return _tokenIds;
uint256 counter;
for (uint256 tokenId = start; tokenId < end; tokenId++) {
if (_exists(tokenId) && ownerOf(tokenId) == account) {
_tokenIds[counter] = tokenId;
counter++;
if (counter == userBalance) return _tokenIds;
}
}
tokenIds = new uint256[](counter);
for (uint64 i = 0; i < counter; i++) {
tokenIds[i] = _tokenIds[i];
}
}
/// @notice Returns the total number of NFTs burned.
function totalBurned() external view returns (uint256) {
return _totalBurned();
}
/// @notice Returns the packed data for Token IDs of the owner.
/// @param tokenId Array of Token IDs to query.
/// @param account Owner of token IDs.
/// @return data Array of packed data for corresponding token IDs.
/// @dev Returns zero address if not burned.
function getPackedTokenData(uint256 tokenId, address account) external view returns (uint256, uint32) {
uint256 tokenData = _packedTokenData[tokenId];
if (_getBurnCycle(tokenData) == 0) {
if (ownerOf(tokenId) != account) revert Unauthorized();
} else {
if (_getBurnAddress(tokenData) != account) revert Unauthorized();
}
return (tokenData, currentCycle);
}
/// @notice Returns the packed data for Token IDs of the owner.
/// @param tokenIds Array of Token IDs to query.
/// @param account Owner of token IDs.
/// @return data Array of packed data for corresponding token IDs.
/// @dev Returns zero address if not burned.
function batchGetPackedTokenData(uint256[] memory tokenIds, address account)
external
view
returns (uint256[] memory data, uint32)
{
data = new uint256[](tokenIds.length);
for (uint256 i = 0; i < tokenIds.length; i++) {
uint256 tokenId = tokenIds[i];
uint256 tokenData = _packedTokenData[tokenId];
if (_getBurnCycle(tokenData) == 0) {
if (ownerOf(tokenId) != account) revert Unauthorized();
} else {
if (_getBurnAddress(tokenData) != account) revert Unauthorized();
}
data[i] = tokenData;
}
return (data, currentCycle);
}
/// @notice Returns the decoded data for Token IDs.
/// @param tokenIds Array of Token IDs to query.
/// @return tiers Array of tiers for corresponding token IDs.
/// @return multipliers Array of multipliers for corresponding token IDs.
/// @return mintCycles Array of mint cycle IDs for corresponding token IDs.
/// @return burnCycles Array of burn cycle IDs for corresponding token IDs.
/// @return burnAddresses Array of burn wallet addresses of the owners who burned the token for corresponding token IDs.
/// @dev Returns zero address if not burned.
function batchGetTokenData(uint256[] memory tokenIds)
external
view
returns (
uint8[] memory tiers,
uint16[] memory multipliers,
uint32[] memory mintCycles,
uint32[] memory burnCycles,
address[] memory burnAddresses
)
{
tiers = new uint8[](tokenIds.length);
multipliers = new uint16[](tokenIds.length);
mintCycles = new uint32[](tokenIds.length);
burnCycles = new uint32[](tokenIds.length);
burnAddresses = new address[](tokenIds.length);
for (uint256 i = 0; i < tokenIds.length; i++) {
uint256 tokenId = tokenIds[i];
uint256 tokenData = _packedTokenData[tokenId];
tiers[i] = _getNftTier(tokenData);
multipliers[i] = _getMultiplier(tokenData);
uint32 mintCycle = _getMintCycle(tokenData);
if (mintCycle == 0) revert DataQueryForNonexistentToken();
mintCycles[i] = mintCycle;
burnCycles[i] = _getBurnCycle(tokenData);
burnAddresses[i] = _getBurnAddress(tokenData);
}
}
/// @notice Returns a tier number for a specific token ID.
/// @param tokenId Token ID of the token.
/// @return Tier of the NFT.
function getNftTier(uint256 tokenId) public view returns (uint8) {
uint256 packedData = _packedTokenData[tokenId];
return _getNftTier(packedData);
}
/// @notice Returns a multiplier for a specific token ID.
/// @param tokenId Token ID of the token.
/// @return Multiplier of the NFT.
function getMultiplier(uint256 tokenId) public view returns (uint64) {
uint256 packedData = _packedTokenData[tokenId];
return _getMultiplier(packedData);
}
/// @notice Returns Cycle ID of when the token ID was minted.
/// @param tokenId Token ID of the token.
/// @return Cycle ID when NFT was minted.
function getMintCycle(uint256 tokenId) public view returns (uint64) {
uint256 packedData = _packedTokenData[tokenId];
return _getMintCycle(packedData);
}
/// @notice Returns Cycle ID of when the token ID was burned.
/// @param tokenId Token ID of the token.
/// @return Cycle ID when NFT was burned.
/// @dev Returns 0 if not burned.
function getBurnCycle(uint256 tokenId) public view returns (uint64) {
uint256 packedData = _packedTokenData[tokenId];
return _getBurnCycle(packedData);
}
/// @notice Returns the wallet address of the owner that burned the Token ID.
/// @param tokenId Token ID of the token.
/// @return Wallet address of the owner.
/// @dev Returns zero address if not burned.
function getBurnAddress(uint256 tokenId) public view returns (address) {
uint256 packedData = _packedTokenData[tokenId];
return _getBurnAddress(packedData);
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
return string(abi.encodePacked(baseURI, getNftTier(tokenId).toString(), ".json"));
}
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721A) returns (bool) {
return interfaceId == INTERFACE_ID_ERC165 || interfaceId == INTERFACE_ID_ERC721
|| interfaceId == INTERFACE_ID_ERC721Metadata || super.supportsInterface(interfaceId);
}
// -------------------------- INTERNAL FUNCTIONS ----------------------- //
function _startTokenId() internal view virtual override returns (uint256) {
return 1;
}
function _processNftTiers(uint8[] calldata tieredNfts, uint256 amount)
internal
returns (uint256 titanXPool, uint256 amplificationPool)
{
if (amount == 0) revert ZeroInput();
uint256 currentIndex = _nextTokenId();
for (uint256 i = 0; i < amount; i++) {
uint8 tier = tieredNfts[i];
(uint256 price, uint256 amplifier, uint16 multiplier) = _getTierMintInfo(tier);
_setNftMintData(currentIndex + i, tier, multiplier, currentCycle);
unchecked {
multiplierPool += multiplier;
titanXPool += price;
amplificationPool += amplifier;
}
}
}
function _processTokenIdBurn(uint256 tokenId, address burnAddress) internal returns (uint256 backing) {
uint256 packedData = _packedTokenData[tokenId];
uint32 mintCycle = _getMintCycle(packedData);
if (mintCycle + NFT_CLAIM_COOLDOWN > currentCycle) revert Cooldown();
multiplierPool -= _getMultiplier(packedData);
backing = _getTierBacking(_getNftTier(packedData));
packedData =
(packedData & ~(BITMASK_BURN_CYCLE << BITPOS_BURN_CYCLE)) & ~(BITMASK_BURN_ADDRESS << BITPOS_BURN_ADDRESS);
packedData |= (uint256(currentCycle) << BITPOS_BURN_CYCLE);
packedData |= (uint256(uint160(burnAddress)) << BITPOS_BURN_ADDRESS);
_packedTokenData[tokenId] = packedData;
}
function _getTierMintInfo(uint8 tier) internal pure returns (uint256 price, uint256 amplifier, uint16 multiplier) {
if (tier == 0 || tier > 12) revert IncorrectTier();
if (tier < 5) {
price = COMMON_BASE_PRICE;
multiplier = COMMON_BASE_MULTIPLIER;
} else if (tier < 9) {
price = RARE_BASE_PRICE;
multiplier = RARE_BASE_MULTIPLIER;
} else {
price = LEGENDARY_BASE_PRICE;
multiplier = LEGENDARY_BASE_MULTIPLIER;
}
uint8 modulo = tier % 4;
if (modulo == 0) {
multiplier *= 2;
amplifier = price / 2;
} else if (modulo == 3) {
multiplier = multiplier * 14 / 10;
amplifier = price / 5;
} else if (modulo == 2) {
multiplier = multiplier * 12 / 10;
amplifier = price / 10;
}
}
function _getTierBacking(uint8 tier) internal pure returns (uint256) {
if (tier < 5) {
return COMMON_BASE_PRICE;
} else if (tier < 9) {
return RARE_BASE_PRICE;
} else {
return LEGENDARY_BASE_PRICE;
}
}
function _getNftTier(uint256 packedData) internal pure returns (uint8) {
return uint8(packedData & BITMASK_NFT_TIER);
}
function _getMultiplier(uint256 packedData) internal pure returns (uint16) {
return uint16((packedData >> BITPOS_MULTIPLIER) & BITMASK_MULTIPLIER);
}
function _getMintCycle(uint256 packedData) internal pure returns (uint32) {
return uint32((packedData >> BITPOS_MINT_CYCLE) & BITMASK_MINT_CYCLE);
}
function _getBurnCycle(uint256 packedData) internal pure returns (uint32) {
return uint32((packedData >> BITPOS_BURN_CYCLE) & BITMASK_BURN_CYCLE);
}
function _getBurnAddress(uint256 packedData) internal pure returns (address) {
return address(uint160((packedData >> BITPOS_BURN_ADDRESS) & BITMASK_BURN_ADDRESS));
}
function _setNftMintData(uint256 tokenId, uint8 nftTier, uint16 multiplier, uint32 mintCycle) internal {
uint256 packedData = _packMintData(nftTier, multiplier, mintCycle);
_packedTokenData[tokenId] = packedData;
}
function _packMintData(uint8 nftTier, uint16 multiplier, uint32 mintCycle) internal pure returns (uint256) {
return (uint256(nftTier) << BITPOS_NFT_TIER) | uint256(multiplier) << BITPOS_MULTIPLIER
| (uint256(mintCycle) << BITPOS_MINT_CYCLE);
}
function _swapETHForTitanX(uint256 minAmountOut, uint256 deadline) internal {
IWETH9(WETH9).deposit{value: msg.value}();
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter.ExactInputSingleParams({
tokenIn: WETH9,
tokenOut: TITANX,
fee: POOL_FEE_1PERCENT,
recipient: address(this),
deadline: deadline,
amountIn: msg.value,
amountOutMinimum: minAmountOut,
sqrtPriceLimitX96: 0
});
IERC20(WETH9).safeIncreaseAllowance(UNISWAP_V3_ROUTER, msg.value);
uint256 amountOut = ISwapRouter(UNISWAP_V3_ROUTER).exactInputSingle(params);
if (amountOut > minAmountOut) {
IERC20(TITANX).safeTransfer(msg.sender, amountOut - minAmountOut);
}
}
}// 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.0.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.20;
import {Ownable} from "./Ownable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success,) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(address target, bool success, bytes memory returndata)
internal
view
returns (bytes memory)
{
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// 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.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
uint256 localValue = value;
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = HEX_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
* representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
/// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
/// @dev In the implementation you must pay the pool tokens owed for the swap.
/// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
/// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
/// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
/// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
/// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
/// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
/// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes calldata data) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;
import "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol";
/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback {
struct ExactInputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another token
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
/// @return amountOut The amount of the received token
function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);
struct ExactInputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
/// @return amountOut The amount of the received token
function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);
struct ExactOutputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps as little as possible of one token for `amountOut` of another token
/// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
/// @return amountIn The amount of the input token
function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);
struct ExactOutputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
}
/// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
/// @return amountIn The amount of the input token
function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
interface IStax {
function handleBackingClaim(uint256 amount, address receiver) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface IStaxVault {
function setProtocolAddresses(address _staxNft, address _staxBank) external;
function handleStartPresale() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
interface ITitanOnBurn {
function onBurn(address user, uint256 amount) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/interfaces/IERC20.sol";
/// @title Interface for WETH9
interface IWETH9 is IERC20 {
/// @notice Deposit ether to get wrapped ether
function deposit() external payable;
/// @notice Withdraw wrapped ether to get ether
function withdraw(uint256) external;
}// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.26; import "../interfaces/ITitanOnBurn.sol"; import "@openzeppelin/contracts/interfaces/IERC20.sol"; // ===================== Contract Addresses ===================================== address constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address constant TITANX = 0xF19308F923582A6f7c465e5CE7a9Dc1BEC6665B1; address constant X28 = 0x5c47902c8C80779CB99235E42C354E53F38C3B0d; address constant HYPER = 0xE2cfD7a01ec63875cd9Da6C7c1B7025166c2fA2F; address constant HELIOS = 0x2614f29C39dE46468A921Fd0b41fdd99A01f2EDf; address constant BLAZE = 0xfcd7cceE4071aA4ecFAC1683b7CC0aFeCAF42A36; address constant FLUX = 0xBFDE5ac4f5Adb419A931a5bF64B0f3BB5a623d06; address constant E280 = 0xe9A53C43a0B58706e67341C4055de861e29Ee943; address constant BLAZE_STAKING = 0xBc0043bc5b0c394D9d05d49768f9548F8CF9587b; address constant FLUX_STAKING = 0xd605a87187563C94c577a6E57e4a36eC8433B9aE; address constant TITANX_WETH_POOL = 0xc45A81BC23A64eA556ab4CdF08A86B61cdcEEA8b; address constant TITANX_X28_POOL = 0x99f60479da6A49D55eBA34893958cdAACc710eE9; address constant TITANX_HYPER_POOL = 0x14d725edB1299fF560d96f42462f0234B65B00AF; address constant TITANX_HELIOS_POOL = 0x2C83C54C5612BfD62a78124D4A0eA001278a689c; address constant INFERNO = 0x00F116ac0c304C570daAA68FA6c30a86A04B5C5F; address constant TITANX_INFERNO_POOL = 0x1E90B67149e688DfB95fD73Acacd8ADefd16d88D; address constant INFERNO_FLUX_POOL = 0x09848D115e085942E6fa9D85b6B6C73fb0E63CB1; // ===================== MINT =================================================== uint256 constant PRESALE_LENGTH = 28 days; uint256 constant COOLDOWN_PERIOD = 48 hours; uint256 constant LP_POOL_SIZE = 200_000_000_000 ether; uint8 constant PERCENTAGE_BASE = 100; uint16 constant BPS_BASE = 100_00; uint256 constant COMMON_BASE_PRICE = 100_000_000 ether; uint256 constant RARE_BASE_PRICE = 1_000_000_000 ether; uint256 constant LEGENDARY_BASE_PRICE = 10_000_000_000 ether; uint16 constant COMMON_BASE_MULTIPLIER = 10; uint16 constant RARE_BASE_MULTIPLIER = 100; uint16 constant LEGENDARY_BASE_MULTIPLIER = 1000; // ===================== NFT =================================================== uint8 constant NFT_CLAIM_COOLDOWN = 2; uint256 constant BITPOS_NFT_TIER = 0; uint256 constant BITMASK_NFT_TIER = (1 << 8) - 1; uint256 constant BITPOS_MULTIPLIER = 8; uint256 constant BITMASK_MULTIPLIER = (1 << 16) - 1; uint256 constant BITPOS_MINT_CYCLE = 24; uint256 constant BITMASK_MINT_CYCLE = (1 << 32) - 1; uint256 constant BITPOS_BURN_CYCLE = 56; uint256 constant BITMASK_BURN_CYCLE = (1 << 32) - 1; uint256 constant BITPOS_BURN_ADDRESS = 88; uint256 constant BITMASK_BURN_ADDRESS = (1 << 160) - 1; // ===================== VAULT ================================================== uint256 constant CYCLE_COOLDOWN = 9 days; uint16 constant BANK_ALLOCATION_BPS = 80_00; uint64 constant GENESIS_BASE_BPS = 8_00 * uint64(BPS_BASE); uint64 constant HOLDER_BASE_BPS = 10_00 * uint64(BPS_BASE); uint64 constant DIANOND_BASE_BPS = 2_00 * uint64(BPS_BASE); uint16 constant DIAMOND_HAND_PAYOUT_BPS = 8_00; uint16 constant CYCLE_COMPOUND_REDUCTION = 2_00; // ===================== UNISWAP Interface ====================================== address constant UNISWAP_V2_FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; address constant UNISWAP_V2_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address constant UNISWAP_V3_ROUTER = 0xE592427A0AEce92De3Edee1F18E0157C05861564; uint24 constant POOL_FEE_1PERCENT = 10000; // ===================== Interface IDs ========================================== bytes4 constant INTERFACE_ID_ERC165 = 0x01ffc9a7; bytes4 constant INTERFACE_ID_ERC20 = type(IERC20).interfaceId; bytes4 constant INTERFACE_ID_ERC721 = 0x80ac58cd; bytes4 constant INTERFACE_ID_ERC721Metadata = 0x5b5e139f; bytes4 constant INTERFACE_ID_ITITANONBURN = type(ITitanOnBurn).interfaceId;
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// 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()`.
*
* The `_sequentialUpTo()` function can be overriden to enable spot mints
* (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`.
*
* 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;
// The amount of tokens minted above `_sequentialUpTo()`.
// We call these spot mints (i.e. non-sequential mints).
uint256 private _spotMinted;
// =============================================================
// CONSTRUCTOR
// =============================================================
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector);
}
// =============================================================
// TOKEN COUNTING OPERATIONS
// =============================================================
/**
* @dev Returns the starting token ID for sequential mints.
*
* Override this function to change the starting token ID for sequential mints.
*
* Note: The value returned must never change after any tokens have been minted.
*/
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev Returns the maximum token ID (inclusive) for sequential mints.
*
* Override this function to return a value less than 2**256 - 1,
* but greater than `_startTokenId()`, to enable spot (non-sequential) mints.
*
* Note: The value returned must never change after any tokens have been minted.
*/
function _sequentialUpTo() internal view virtual returns (uint256) {
return type(uint256).max;
}
/**
* @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 result) {
// Counter underflow is impossible as `_burnCounter` cannot be incremented
// more than `_currentIndex + _spotMinted - _startTokenId()` times.
unchecked {
// With spot minting, the intermediate `result` can be temporarily negative,
// and the computation must be unchecked.
result = _currentIndex - _burnCounter - _startTokenId();
if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;
}
}
/**
* @dev Returns the total amount of tokens minted in the contract.
*/
function _totalMinted() internal view virtual returns (uint256 result) {
// Counter underflow is impossible as `_currentIndex` does not decrement,
// and it is initialized to `_startTokenId()`.
unchecked {
result = _currentIndex - _startTokenId();
if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;
}
}
/**
* @dev Returns the total number of tokens burned.
*/
function _totalBurned() internal view virtual returns (uint256) {
return _burnCounter;
}
/**
* @dev Returns the total number of tokens that are spot-minted.
*/
function _totalSpotMinted() internal view virtual returns (uint256) {
return _spotMinted;
}
// =============================================================
// 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.selector);
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.selector);
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 Returns whether the ownership slot at `index` is initialized.
* An uninitialized slot does not necessarily mean that the slot has no owner.
*/
function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) {
return _packedOwnerships[index] != 0;
}
/**
* @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);
}
}
/**
* @dev Returns the packed ownership data of `tokenId`.
*/
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {
if (_startTokenId() <= tokenId) {
packed = _packedOwnerships[tokenId];
if (tokenId > _sequentialUpTo()) {
if (_packedOwnershipExists(packed)) return packed;
_revert(OwnerQueryForNonexistentToken.selector);
}
// If the data at the starting slot does not exist, start the scan.
if (packed == 0) {
if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector);
// 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;
if (packed & _BITMASK_BURNED == 0) return packed;
// Otherwise, the token is burned, and we must revert.
// This handles the case of batch burned tokens, where only the burned bit
// of the starting slot is set, and remaining slots are left uninitialized.
_revert(OwnerQueryForNonexistentToken.selector);
}
}
// Otherwise, the data exists and 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.
// If the token is not burned, return `packed`. Otherwise, revert.
if (packed & _BITMASK_BURNED == 0) return packed;
}
_revert(OwnerQueryForNonexistentToken.selector);
}
/**
* @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.selector);
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 result) {
if (_startTokenId() <= tokenId) {
if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]);
if (tokenId < _currentIndex) {
uint256 packed;
while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId;
result = packed & _BITMASK_BURNED == 0;
}
}
}
/**
* @dev Returns whether `packed` represents a token that exists.
*/
function _packedOwnershipExists(uint256 packed) private pure returns (bool result) {
assembly {
// The following is equivalent to `owner != address(0) && burned == false`.
// Symbolically tested.
result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_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);
// Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));
if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);
(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.selector);
}
_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;
}
}
}
}
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
assembly {
// 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.
from, // `from`.
toMasked, // `to`.
tokenId // `tokenId`.
)
}
if (toMasked == 0) _revert(TransferToZeroAddress.selector);
_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.selector);
}
}
}
/**
* @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.selector);
}
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.selector);
_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:
// - `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));
// Updates:
// - `balance += quantity`.
// - `numberMinted += quantity`.
//
// We can directly add to the `balance` and `numberMinted`.
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
if (toMasked == 0) _revert(MintToZeroAddress.selector);
uint256 end = startTokenId + quantity;
uint256 tokenId = startTokenId;
if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);
do {
assembly {
// 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`.
tokenId // `tokenId`.
)
}
// The `!=` check ensures that large values of `quantity`
// that overflows uint256 will make the loop run out of gas.
} while (++tokenId != end);
_currentIndex = end;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* This function is intended for efficient minting only during contract creation.
*
* It emits only one {ConsecutiveTransfer} as defined in
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
* instead of a sequence of {Transfer} event(s).
*
* Calling this function outside of contract creation WILL make your contract
* non-compliant with the ERC721 standard.
* For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
* {ConsecutiveTransfer} event is only permissible during contract creation.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {ConsecutiveTransfer} event.
*/
function _mintERC2309(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (to == address(0)) _revert(MintToZeroAddress.selector);
if (quantity == 0) _revert(MintZeroQuantity.selector);
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector);
_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));
if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);
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.selector);
}
} while (index < end);
// This prevents reentrancy to `_safeMint`.
// It does not prevent reentrancy to `_safeMintSpot`.
if (_currentIndex != end) revert();
}
}
}
/**
* @dev Equivalent to `_safeMint(to, quantity, '')`.
*/
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, "");
}
/**
* @dev Mints a single token at `tokenId`.
*
* Note: A spot-minted `tokenId` that has been burned can be re-minted again.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` must be greater than `_sequentialUpTo()`.
* - `tokenId` must not exist.
*
* Emits a {Transfer} event for each mint.
*/
function _mintSpot(address to, uint256 tokenId) internal virtual {
if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector);
uint256 prevOwnershipPacked = _packedOwnerships[tokenId];
if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector);
_beforeTokenTransfers(address(0), to, tokenId, 1);
// Overflows are incredibly unrealistic.
// The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1.
// `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1.
unchecked {
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `true` (as `quantity == 1`).
_packedOwnerships[tokenId] =
_packOwnershipData(to, _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked));
// Updates:
// - `balance += 1`.
// - `numberMinted += 1`.
//
// We can directly add to the `balance` and `numberMinted`.
_packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1;
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
if (toMasked == 0) _revert(MintToZeroAddress.selector);
assembly {
// 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`.
tokenId // `tokenId`.
)
}
++_spotMinted;
}
_afterTokenTransfers(address(0), to, tokenId, 1);
}
/**
* @dev Safely mints a single token at `tokenId`.
*
* Note: A spot-minted `tokenId` that has been burned can be re-minted again.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}.
* - `tokenId` must be greater than `_sequentialUpTo()`.
* - `tokenId` must not exist.
*
* See {_mintSpot}.
*
* Emits a {Transfer} event.
*/
function _safeMintSpot(address to, uint256 tokenId, bytes memory _data) internal virtual {
_mintSpot(to, tokenId);
unchecked {
if (to.code.length != 0) {
uint256 currentSpotMinted = _spotMinted;
if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) {
_revert(TransferToNonERC721ReceiverImplementer.selector);
}
// This prevents reentrancy to `_safeMintSpot`.
// It does not prevent reentrancy to `_safeMint`.
if (_spotMinted != currentSpotMinted) revert();
}
}
}
/**
* @dev Equivalent to `_safeMintSpot(to, tokenId, '')`.
*/
function _safeMintSpot(address to, uint256 tokenId) internal virtual {
_safeMintSpot(to, tokenId, "");
}
// =============================================================
// 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 && _msgSenderERC721A() != owner) {
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
_revert(ApprovalCallerNotOwnerNorApproved.selector);
}
}
_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.selector);
}
}
_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 + _spotMinted` 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.selector);
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)
}
}
/**
* @dev For more efficient reverts.
*/
function _revert(bytes4 errorSelector) internal pure {
assembly {
mstore(0x00, errorSelector)
revert(0x00, 0x04)
}
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// 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();
/**
* `_sequentialUpTo()` must be greater than `_startTokenId()`.
*/
error SequentialUpToTooSmall();
/**
* The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`.
*/
error SequentialMintExceedsLimit();
/**
* Spot minting requires a `tokenId` greater than `_sequentialUpTo()`.
*/
error SpotMintTokenIdTooSmall();
/**
* Cannot mint over a token that already exists.
*/
error TokenAlreadyExists();
/**
* The feature is not compatible with spot mints.
*/
error NotCompatibleWithSpotMints();
// =============================================================
// 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);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"viaIR": true,
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_contractURI","type":"string"},{"internalType":"string","name":"__baseURI","type":"string"},{"internalType":"address","name":"_stax","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"Cooldown","type":"error"},{"inputs":[],"name":"DataQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"IncorrectTier","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotCompatibleWithSpotMints","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":"Prohibited","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"SaleInactive","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"TWAP","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroInput","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":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","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":[],"name":"ContractURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"STAX","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAX_BANK","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAX_VAULT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","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":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"account","type":"address"}],"name":"batchGetPackedTokenData","outputs":[{"internalType":"uint256[]","name":"data","type":"uint256[]"},{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchGetTokenData","outputs":[{"internalType":"uint8[]","name":"tiers","type":"uint8[]"},{"internalType":"uint16[]","name":"multipliers","type":"uint16[]"},{"internalType":"uint32[]","name":"mintCycles","type":"uint32[]"},{"internalType":"uint32[]","name":"burnCycles","type":"uint32[]"},{"internalType":"address[]","name":"burnAddresses","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentCycle","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"directTransfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getBurnAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getBurnCycle","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMintCycle","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getNftTier","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"getPackedTokenData","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"getTotalNftsPerTiers","outputs":[{"internalType":"uint256[]","name":"total","type":"uint256[]"}],"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":"isSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"tieredNfts","type":"uint8[]"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"mintWithEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"tieredNfts","type":"uint8[]"}],"name":"mintWithTitanX","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"multiplierPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","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":"_uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setDirectTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staxVault","type":"address"},{"internalType":"address","name":"_staxBank","type":"address"}],"name":"setProtocolAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_presaleEnd","type":"uint256"}],"name":"startMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"tokenIdsOf","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"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":"totalBurned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"result","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":[],"name":"updateCycle","outputs":[{"internalType":"uint32","name":"cycle","type":"uint32"},{"internalType":"uint256","name":"totalMultipliers","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a0604052346100d15761391680380380610019816100ec565b9283398101906080818303126100d15761003281610116565b60208201519091906001600160401b0381116100d1578361005491830161012a565b60408201516001600160401b0381116100d157606061007b6100889661008293860161012a565b9301610116565b9261051a565b6040516131ce908161074882396080518181816108b80152818161121901528181611472015281816116140152818161188801528181611c0501528181611d9d01526120860152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b0381118382101761011157604052565b6100d6565b51906001600160a01b03821682036100d157565b81601f820112156100d1578051906001600160401b03821161011157610159601f8301601f19166020016100ec565b92828452602083830101116100d15760005b82811061018057505060206000918301015290565b8060208092840101518282870101520161016b565b90600182811c921680156101c5575b60208310146101af57565b634e487b7160e01b600052602260045260246000fd5b91607f16916101a4565b601f81116101db575050565b60026000526020600020906020601f840160051c83019310610218575b601f0160051c01905b81811061020c575050565b60008155600101610201565b90915081906101f8565b601f821161022f57505050565b6000526020600020906020601f840160051c8301931061026a575b601f0160051c01905b81811061025e575050565b60008155600101610253565b909150819061024a565b80519091906001600160401b0381116101115761029d81610296600d54610195565b600d610222565b602092601f82116001146102df576102cf929382916000926102d4575b50508160011b916000199060031b1c19161790565b600d55565b0151905038806102ba565b600d600052601f198216937fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb59160005b868110610346575083600195961061032d575b505050811b01600d55565b015160001960f88460031b161c19169055388080610322565b9192602060018192868501518155019401920161030f565b80519091906001600160401b0381116101115761038781610380600e54610195565b600e610222565b602092601f82116001146103bd576103b8929382916000926102d45750508160011b916000199060031b1c19161790565b600e55565b600e600052601f198216937fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd9160005b868110610424575083600195961061040b575b505050811b01600e55565b015160001960f88460031b161c19169055388080610400565b919260206001819286850151815501940192016103ed565b80519091906001600160401b038111610111576104658161045e600354610195565b6003610222565b602092601f821160011461049b57610496929382916000926102d45750508160011b916000199060031b1c19161790565b600355565b6003600052601f198216937fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9160005b86811061050257508360019596106104e9575b505050811b01600355565b015160001960f88460031b161c191690553880806104de565b919260206001819286850151815501940192016104cb565b61055d90929192604061054661052f826100ec565b9160048352630a6e8c2f60e31b60208401526100ec565b9160048352630a6a882b60e31b60208401526105c9565b61057461010064ffffffff00196011541617601155565b6001600160a01b038316156105b8578151156105a7578051156105a75761059d6105a292610274565b61035e565b608052565b63af458c0760e01b60005260046000fd5b63d92e233d60e01b60005260046000fd5b815191939290916001600160401b038111610111576105f2816105ed600254610195565b6101cf565b6020601f82116001146106695790806106279261062f9596976000926102d45750508160011b916000199060031b1c19161790565b60025561043c565b6106396001600055565b6001600160a01b0381161561065357610651906106f3565b565b631e4fbdf760e01b600090815260045260246000fd5b6002600052601f198216957f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9660005b8181106106db57509161062f959697918460019594106106c2575b505050811b0160025561043c565b015160001960f88460031b161c191690553880806106b4565b83830151895560019098019760209384019301610699565b600a80546001600160a01b0319908116909155600980549182166001600160a01b0393841690811790915591167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a356fe6080604052600436101561001257600080fd5b60003560e01c8062be36561461033657806301ffc9a71461033157806306fdde031461032c578063081812fc14610327578063095ea7b314610322578063179397f71461031d57806318160ddd14610318578063229f3e291461031357806323b872dd1461030e57806326a24575146103095780632c9b72a71461030457806342842e0e146102ff57806342966c68146102fa578063493d5dfe146102f55780634beb7797146102f057806355f804b3146102eb578063564566a8146102e65780636173b4ed146102e15780636352211e146102dc578063651c5434146102d75780636c0360eb146102d257806370a08231146102cd578063715018a6146102c857806379ba5097146102c35780638da5cb5b146102be57806390f73d3c146102b9578063938e3d7b146102b457806395d89b41146102af5780639bfcbd6f146102aa5780639d77126d146102a5578063a22cb465146102a0578063adf8252d1461029b578063b88d4fde14610296578063bab2f55214610291578063c465a8dc1461028c578063c467366a14610287578063c65af62214610282578063c87b56dd1461027d578063cb0a443314610278578063d89135cd14610273578063d9e146001461026e578063dc8e92ea14610269578063de96cd1c14610264578063e30c39781461025f578063e8a3d4851461025a578063e985e9c514610255578063ebb7868714610250578063f1bf9a371461024b578063f2fde38b146102465763fa7272141461024157600080fd5b612126565b6120b9565b612070565b612033565b611fd6565b611f2e565b611f05565b611e47565b611d76565b611c6b565b611c29565b611b95565b61198d565b61191b565b611673565b6115fe565b6115d7565b61157d565b61154a565b6114b9565b61145f565b61143c565b611394565b611278565b6111f5565b6111cc565b611142565b6110db565b6110b0565b611008565b610fb0565b610f81565b610ed2565b610eb2565b610d6a565b610b74565b610949565b610863565b61083e565b6107ff565b610785565b610771565b610719565b6106f2565b6106c9565b6105fc565b61057d565b6104a4565b610386565b61034b565b600091031261034657565b600080fd5b3461034657600036600319011261034657600c546040516001600160a01b039091168152602090f35b6001600160e01b031981160361034657565b34610346576020366003190112610346576103e86004356103a681610374565b6001600160e01b0319166301ffc9a760e01b8114908115908282610437575b8315610426575b83156103ec575b50506040519115158252509081906020820190565b0390f35b925090610415575b8115610404575b503880806103d3565b635b5e139f60e01b149050386103fb565b6380ac58cd60e01b811491506103f4565b635b5e139f60e01b821493506103cc565b6380ac58cd60e01b821493506103c5565b60005b83811061045b5750506000910152565b818101518382015260200161044b565b9060209161048481518092818552858086019101610448565b601f01601f1916010190565b9060206104a192818152019061046b565b90565b346103465760003660031901126103465760405160006002546104c681610fce565b808452906001811690811561055957506001146104fa575b6103e8836104ee8185038261098e565b60405191829182610490565b600260009081527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace939250905b80821061053f575090915081016020016104ee6104de565b919260018160209254838588010152019101909291610527565b60ff191660208086019190915291151560051b840190910191506104ee90506104de565b346103465760203660031901126103465760043561059a816126ab565b156105bf576000526006602052602060018060a01b0360406000205416604051908152f35b6333d1c03960e21b60005260046000fd5b600435906001600160a01b038216820361034657565b602435906001600160a01b038216820361034657565b6040366003190112610346576106106105d0565b602435906001600160a01b036106258361274e565b1690813303610697575b61066681610647856000526006602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b0316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4005b600082815260076020908152604080832033845290915290205460ff1661062f576367d9dca160e11b60005260046000fd5b3461034657600036600319011261034657600b546040516001600160a01b039091168152602090f35b34610346576000366003190112610346576000546001546040519103600019018152602090f35b34610346576000366003190112610346576020601054604051908152f35b6060906003190112610346576004356001600160a01b038116810361034657906024356001600160a01b0381168103610346579060443590565b61078361077d36610737565b9161215b565b005b34610346576020366003190112610346576004356000526012602052602063ffffffff60406000205460381c16604051908152f35b906020808351928381520192019060005b8181106107d85750505090565b82518452602093840193909201916001016107cb565b9060206104a19281815201906107ba565b34610346576060366003190112610346576103e861082a61081e6105d0565b602435604435916123d4565b6040519182916020835260208301906107ba565b61078361084a36610737565b906040519261085a60208561098e565b600084526125ac565b34610346576020366003190112610346576004356108926108866108868361274e565b6001600160a01b031690565b336001600160a01b0390911603610939576108b66108b033836127e3565b91612db9565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316803b156103465760405163c55bf03960e01b815260048101839052336024820152906000908290818381604481015b03925af180156109345761091f57005b8061092e60006107839361098e565b8061033b565b6124c0565b6282b42960e81b60005260046000fd5b34610346576020366003190112610346576004356000526012602052602060ff60406000205416604051908152f35b634e487b7160e01b600052604160045260246000fd5b90601f801991011681019081106001600160401b038211176109af57604052565b610978565b604051906109c46101008361098e565b565b6001600160401b0381116109af5760051b60200190565b9080601f830112156103465781356109f4816109c6565b92610a02604051948561098e565b81845260208085019260051b82010192831161034657602001905b828210610a2a5750505090565b8135815260209182019101610a1d565b906020808351928381520192019060005b818110610a585750505090565b825161ffff16845260209384019390920191600101610a4b565b906020808351928381520192019060005b818110610a905750505090565b825163ffffffff16845260209384019390920191600101610a83565b906020808351928381520192019060005b818110610aca5750505090565b82516001600160a01b0316845260209384019390920191600101610abd565b9391959492909560a0850160a086528751809152602060c0870198019060005b818110610b5b57505050610b4d9291610b3188610b3f93886104a19a9b0360208a0152610a3a565b908682036040880152610a72565b908482036060860152610a72565b916080818403910152610aac565b825160ff168a526020998a019990920191600101610b09565b34610346576020366003190112610346576004356001600160401b03811161034657610ba49036906004016109dd565b610bae8151612331565b90610bb98151612331565b91610bc48251612331565b92610bcf8351612331565b610bd98451612331565b9160005b8551811015610cc957610c04610bf38288612379565b516000526012602052604060002090565b5490610c1f60ff8316610c178389612379565b9060ff169052565b610c3e600883901c61ffff16610c358386612379565b9061ffff169052565b63ffffffff601883901c16918215610cb857610c99610cb291610c72600195610c67868e612379565b9063ffffffff169052565b610c8a603882901c63ffffffff16610c67868a612379565b60581c6001600160a01b031690565b610ca38388612379565b6001600160a01b039091169052565b01610bdd565b6377dfd02960e11b60005260046000fd5b50946103e893945060405195869586610ae9565b6001600160401b0381116109af57601f01601f191660200190565b929192610d0482610cdd565b91610d12604051938461098e565b829481845281830111610346578281602093846000960137010152565b602060031982011261034657600435906001600160401b0382116103465780602383011215610346578160246104a193600401359101610cf8565b3461034657610d7836610d2f565b610d806128be565b805115610ea15780516001600160401b0381116109af57610dab81610da6600e54610fce565b6124cc565b602091601f8211600114610e2057610ddb9260009183610e15575b50508160011b916000199060031b1c19161790565b600e555b604080516001815260001960208201527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c9190a1005b015190503880610dc6565b600e600052601f198216927fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd9160005b858110610e8957508360019510610e70575b505050811b01600e55610ddf565b015160001960f88460031b161c19169055388080610e62565b91926020600181928685015181550194019201610e50565b63af458c0760e01b60005260046000fd5b346103465760003660031901126103465760206010546040519042108152f35b3461034657604036600319011261034657600435602435600054808211610f79575b50610efd61230e565b915b818110610f1457604051806103e885826107ee565b610f1d816126ab565b610f2a575b600101610eff565b80600052601260205260001960ff60406000205416019060ff8211610f745760019160ff16610f6c610f65610f5f8388612379565b516123a8565b9186612379565b529050610f22565b612392565b905038610ef4565b346103465760203660031901126103465760206001600160a01b03610fa760043561274e565b16604051908152f35b34610346576000366003190112610346576020600f54604051908152f35b90600182811c92168015610ffe575b6020831014610fe857565b634e487b7160e01b600052602260045260246000fd5b91607f1691610fdd565b34610346576000366003190112610346576040516000600e5461102a81610fce565b80845290600181169081156105595750600114611051576103e8836104ee8185038261098e565b600e60009081527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd939250905b808210611096575090915081016020016104ee6104de565b91926001816020925483858801015201910190929161107e565b346103465760203660031901126103465760206110d36110ce6105d0565b612572565b604051908152f35b34610346576000366003190112610346576110f46128be565b600a80546001600160a01b03199081169091556009805491821690556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461034657600036600319011261034657600a54336001600160a01b03909116036111b757600a80546001600160a01b0319908116909155600980543392811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b63118cdaa760e01b6000523360045260246000fd5b34610346576000366003190112610346576009546040516001600160a01b039091168152602090f35b346103465760403660031901126103465761120e6105d0565b6112166105e6565b907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361093957600c80546001600160a01b039283166001600160a01b031991821617909155600b8054939092169216919091179055005b346103465761128636610d2f565b61128e6128be565b805115610ea15780516001600160401b0381116109af576112b9816112b4600d54610fce565b61251f565b602091601f8211600114611313576112e89260009183610e155750508160011b916000199060031b1c19161790565b600d555b7fa5d4097edda6d87cb9329af83fb3712ef77eeb13738ffe43cc35a4ce305ad962600080a1005b600d600052601f198216927fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb59160005b85811061137c57508360019510611363575b505050811b01600d556112ec565b015160001960f88460031b161c19169055388080611355565b91926020600181928685015181550194019201611343565b346103465760003660031901126103465760405160006003546113b681610fce565b808452906001811690811561055957506001146113dd576103e8836104ee8185038261098e565b600360009081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b808210611422575090915081016020016104ee6104de565b91926001816020925483858801015201910190929161140a565b3461034657600036600319011261034657602060ff601154166040519015158152f35b34610346576000366003190112610346577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163303610939576011805460ff19166001179055005b8015150361034657565b34610346576040366003190112610346576114d26105d0565b602435906114df826114af565b3360009081526007602090815260408083206001600160a01b038516845290915290209115159160ff1981541660ff841617905560405191825260018060a01b0316907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b34610346576020366003190112610346576004356000526012602052602061ffff60406000205460081c16604051908152f35b6080366003190112610346576115916105d0565b6115996105e6565b90604435606435926001600160401b0384116103465736602385011215610346576115d1610783943690602481600401359101610cf8565b926125ac565b3461034657600036600319011261034657602063ffffffff60115460081c16604051908152f35b34610346576000366003190112610346576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9181601f84011215610346578235916001600160401b038311610346576020808501948460051b01011161034657565b6040366003190112610346576004356001600160401b0381116103465761169e903690600401611643565b6024359160105442101561190a5781806116b7926129ef565b909281840193848111610f745773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23b1561034657604051630d0e30db60e41b8152916000836004813473c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25af190811561093457611804936020926118f5575b506117276109b4565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281529073f19308f923582a6f7c465e5ce7a9dc1bec6665b182840152612710604083015230606083015260808201523460a08201528660c0820152600060e082015261178734612f17565b6040805163414bf38960e01b815282516001600160a01b0390811660048301526020840151811660248301529183015162ffffff1660448201526060830151821660648201526080830151608482015260a083015160a482015260c083015160c482015260e0909201511660e48201529283908190610104820190565b0381600073e592427a0aece92de3edee1f18e0157c058615645af1948515610934576107839561185d936000916118c6575b508181116118ac575b505060115460ff161561188657600b546001600160a01b0316612bed565b8061186a575b5033612c40565b600c5461188091906001600160a01b0316612bed565b38611863565b7f0000000000000000000000000000000000000000000000000000000000000000612bed565b6118bf916118b9916127d6565b33612bed565b388061183f565b6118e8915060203d6020116118ee575b6118e0818361098e565b810190612bde565b38611836565b503d6118d6565b8061092e60006119049361098e565b3861171e565b630fe219dd60e21b60005260046000fd5b3461034657600036600319011261034657600c546001600160a01b031633036109395760115463ffffffff8160081c169063ffffffff8214610f745764ffffffff0019166001820160081b64ffffffff001617601155600f546040805163ffffffff9093168352602083019190915290f35b34610346576020366003190112610346576004356119aa816126ab565b15611b5657600052601260205260ff604060002054168060009172184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b821015611b33575b806d04ee2d6d415b85acef8100000000600a921015611b17575b662386f26fc10000811015611b02575b6305f5e100811015611af0575b612710811015611ae0575b6064811015611ad1575b1015611ac6575b611a736021611a4760018501612d0b565b938401015b60001901916f181899199a1a9b1b9c1cb0b131b232b360811b600a82061a8353600a900490565b908115611a8357611a7390611a4c565b6040516103e8906104ee81611ab8611aa788611aa1602085016125fb565b90612684565b64173539b7b760d91b815260050190565b03601f19810183528261098e565b600190910190611a36565b60029060649004930192611a2f565b6004906127109004930192611a25565b6008906305f5e1009004930192611a1a565b601090662386f26fc100009004930192611a0d565b6020906d04ee2d6d415b85acef810000000090049301926119fd565b506040915072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b81046119e3565b630a14c4b560e41b60005260046000fd5b602060031982011261034657600435906001600160401b03821161034657611b9191600401611643565b9091565b3461034657611ba336611b67565b60105442101561190a57611be0611bbe8280610783956129ef565b919060ff60115416600014611c0357600b546001600160a01b03165b33612d33565b80611bec575033612c40565b600c5461188091906001600160a01b031633612d33565b7f0000000000000000000000000000000000000000000000000000000000000000611bda565b34610346576000366003190112610346576020600154604051908152f35b9063ffffffff611c646020929594956040855260408501906107ba565b9416910152565b34610346576040366003190112610346576004356001600160401b03811161034657611c9b9036906004016109dd565b611ca36105e6565b90611cae8151612331565b9160005b8251811015611d5857611cc58184612379565b5190611cdb826000526012602052604060002090565b5491611cf5603884901c63ffffffff165b63ffffffff1690565b611d2f57610886610886611d089261274e565b6001600160a01b03848116911603610939576001915b611d288287612379565b5201611cb2565b50605882901c6001600160a01b03166001600160a01b0384811691160361093957600191611d1e565b601154849060081c63ffffffff16906103e860405192839283611c47565b3461034657611d8436611b67565b908115610ea157906000916000915b808310611df857837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316803b156103465760405163c55bf03960e01b8152600481018390523360248201529060009082908183816044810161090f565b909192611e0684838561269b565b359333611e1b6108866108866108868961274e565b0361093957611e3f611e39600193611e3333896127e3565b906125ee565b95612db9565b019190611d93565b3461034657604036600319011261034657600435611e636105e6565b8160005260126020526040600020549163ffffffff611e898463ffffffff9060381c1690565b16611ed457610886610886611e9d9261274e565b6001600160a01b03918216911603610939575b60115460081c63ffffffff166040805192835263ffffffff91909116602083015290f35b50605882901c6001600160a01b03166001600160a01b03908116911614611eb0576282b42960e81b60005260046000fd5b3461034657600036600319011261034657600a546040516001600160a01b039091168152602090f35b34610346576000366003190112610346576040516000600d54611f5081610fce565b80845290600181169081156105595750600114611f77576103e8836104ee8185038261098e565b600d60009081527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5939250905b808210611fbc575090915081016020016104ee6104de565b919260018160209254838588010152019101909291611fa4565b3461034657604036600319011261034657602060ff612027611ff66105d0565b611ffe6105e6565b6001600160a01b0391821660009081526007865260408082209290931681526020919091522090565b54166040519015158152f35b346103465760203660031901126103465760043560009081526012602090815260409182902054915160589290921c6001600160a01b0316825290f35b34610346576020366003190112610346576004357f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361093957601055005b34610346576020366003190112610346576120d26105d0565b6120da6128be565b600a80546001600160a01b0319166001600160a01b039283169081179091556009549091167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700600080a3005b34610346576020366003190112610346576004356000526012602052602063ffffffff60406000205460181c16604051908152f35b91906121668261274e565b6001600160a01b0393841693811684900361230957600083815260066020526040902080546121a86001600160a01b03871633908114908314171590565b1590565b6122bb575b6122b1575b506001600160a01b038416600090815260056020526040902080546000190190556001600160a01b0382166000908152600560205260409020805460010190556001600160a01b0382164260a01b17600160e11b1761221b846000526004602052604060002090565b55600160e11b811615612267575b506001600160a01b03169182907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a41561226257565b61271c565b6001830161227f816000526004602052604060002090565b541561228c575b50612229565b6000548114612286576122a9906000526004602052604060002090565b553880612286565b60009055386121b2565b6122ff6121a46122f8336122e18a60018060a01b03166000526007602052604060002090565b9060018060a01b0316600052602052604060002090565b5460ff1690565b156121ad5761270b565b6126fb565b6040516101a09190612320838261098e565b600c815291601f1901366020840137565b9061233b826109c6565b612348604051918261098e565b8281528092612359601f19916109c6565b0190602036910137565b634e487b7160e01b600052603260045260246000fd5b805182101561238d5760209160051b010190565b612363565b634e487b7160e01b600052601160045260246000fd5b6000198114610f745760010190565b6001600160401b03166001600160401b038114610f745760010190565b92916000548082116124b8575b506123eb84612572565b6123f481612331565b94811561244e576000935b838110612454575050505061241381612331565b9260005b6001600160401b038116908382101561244e578161244361243b6124499486612379565b519188612379565b526123b7565b612417565b50505050565b61245d816126ab565b80612495575b612470575b6001016123ff565b938085612480612486938a612379565b526123a8565b93828503612468575050505050565b506124a56108866108868361274e565b6001600160a01b03838116911614612463565b9050386123e1565b6040513d6000823e3d90fd5b601f81116124d8575050565b600e6000526020600020906020601f840160051c83019310612515575b601f0160051c01905b818110612509575050565b600081556001016124fe565b90915081906124f5565b601f811161252b575050565b600d6000526020600020906020601f840160051c83019310612568575b601f0160051c01905b81811061255c575050565b60008155600101612551565b9091508190612548565b6001600160a01b0316801561259b5760005260056020526001600160401b036040600020541690565b6323d3ad8160e21b60005260046000fd5b9291906125ba82828661215b565b803b6125c65750505050565b6125cf93612948565b156125dd573880808061244e565b6368d2bf6b60e11b60005260046000fd5b91908201809211610f7457565b600e546000929161260b82610fce565b91600181169081156126725750600114612623575050565b600e600090815292935090917fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd5b83821061265e5750500190565b600181602092548486015201910190612651565b60ff1916825250811515909102019150565b9061269760209282815194859201610448565b0190565b919081101561238d5760051b0190565b9060009180600111156126bb5750565b60005481106126c75750565b9091505b806000526004602052604060002054806126ef57508015610f7457600019016126cb565b600160e01b1615919050565b62a1148160e81b60005260046000fd5b632ce44b5f60e11b60005260046000fd5b633a954ecd60e21b60005260046000fd5b636f96cda160e11b60005260046000fd5b622e076360e81b60005260046000fd5b8060011161272d5761276a816000526004602052604060002090565b549081156127815750600160e01b811661272d5790565b905060005481101561272d575b600019016000818152600460205260409020549081156127b75750600160e01b811661272d5790565b905061278e565b63ffffffff60029116019063ffffffff8211610f7457565b91908203918211610f7457565b9190916127fa816000526012602052604060002090565b549261280e63ffffffff8560181c166127be565b63ffffffff612829611cec60115463ffffffff9060081c1690565b9116116128ad576128aa9061285061284b61ffff600888901c16600f546127d6565b600f55565b61285c60ff8616612d75565b94612873611cec60115463ffffffff9060081c1690565b60381b9066ffffffffffffff60ff60f81b01161790600160581b600160f81b039060581b1617916000526012602052604060002090565b55565b63b0782df760e01b60005260046000fd5b6009546001600160a01b031633036111b757565b9081602091031261034657516104a181610374565b6001600160a01b0391821681529116602082015260408101919091526080606082018190526104a19291019061046b565b3d15612943573d9061292982610cdd565b91612937604051938461098e565b82523d6000602084013e565b606090565b906020926000612971959360405196879586948593630a85bd0160e11b855233600486016128e7565b03926001600160a01b03165af1600091816129be575b506129a857612994612918565b8051156129a357805190602001fd5b6125dd565b6001600160e01b031916630a85bd0160e11b1490565b6129e191925060203d6020116129e8575b6129d9818361098e565b8101906128d2565b9038612987565b503d6129cf565b9290916000936000938215610ea157600092919254906000935b838510612a17575050505050565b909192939596612a2887848461269b565b359060ff821691828103610346576000928381158015612bd4575b612bc557509160019391836005899510600014612b8e57508a6a52b7d2dcc80cd2e400000093600a905b6003841680612afe575050612ae6612af09361ffff93612a8f612aa294612f00565b938491612a9c8a60011c90565b9a6125ee565b91612ab660115463ffffffff9060081c1690565b9266ffffffff00000060ff92939462ffff0092600052601260205260181b169360081b1691161717604060002055565b16600f5401600f55565b019801960193929190612a09565b60038103612b39575050612ae6612af09361ffff93612b2d612b22612aa295612ee9565b61ffff600a91160490565b93849160058a04612a9c565b90969193929190600214612b5e575b61ffff9284612aa2612af09694612ae6946125ee565b9550612ae661ffff92612aa292612b7a612b22612af097612ed2565b600a89049990965091945092509050612b48565b60091115612bad578a6b033b2e3c9fd0803ce800000093606490612a6d565b8a6b204fce5e3e25026110000000936103e890612a6d565b63f8e309e360e01b8152600490fd5b50600c8211612a43565b90816020910312610346575190565b60405163a9059cbb60e01b60208201526001600160a01b03909116602482015260448101919091526109c490612c268160648101611ab8565b73f19308f923582a6f7c465e5ce7a9dc1bec6665b16130c9565b600054908215612cfa576001600160a01b0381164260a01b6001851460e11b1717612c75836000526004602052604060002090565b556001600160a01b031660008181526005602052604090208054680100000000000000018502019055918215612cf5578101909260015b15612ce0575b60008484827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4612cac565b9260010192818403612cb25792509050600055565b61273e565b63b562e8dd60e01b60005260046000fd5b90612d1582610cdd565b612d22604051918261098e565b8281528092612359601f1991610cdd565b6040516323b872dd60e01b60208201526001600160a01b039182166024820152911660448201526064808201929092529081526109c490612c2660848261098e565b60ff166005811015612d9157506a52b7d2dcc80cd2e400000090565b60091115612da9576b033b2e3c9fd0803ce800000090565b6b204fce5e3e2502611000000090565b6000612dc48261274e565b600083815260066020526040902080546001600160a01b038316929190612ec9575b506001600160a01b038216600090815260056020526040902080546fffffffffffffffffffffffffffffffff01905560008481526004602052604090206001600160a01b0383164260a01b17600360e01b179055600160e11b811615612e80575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a46109c4612e7b60015460010190565b600155565b60018401612e98816000526004602052604060002090565b5415612ea5575b50612e47565b83548114612e9f57612ec1906000526004602052604060002090565b553880612e9f565b83905538612de6565b61ffff600c9116029061ffff8216918203610f7457565b61ffff600e9116029061ffff8216918203610f7457565b60011b906201fffe61fffe831692168203610f7457565b604051636eb1769f60e11b815230600482015273e592427a0aece92de3edee1f18e0157c0586156460248201529060208260448173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25afa91821561093457600092613093575b508101809111610f745760405163095ea7b360e01b6020820190815273e592427a0aece92de3edee1f18e0157c058615646024830181905260448084019490945292825273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29061300a90612fda60648561098e565b83516001600160a01b03841691600091829182855af190612ff9612918565b82613061575b508161305a57501590565b61301357505050565b60405163095ea7b360e01b60208201526001600160a01b039093166024840152600060448401526109c4926130559061304f8160648101611ab8565b826130c9565b6130c9565b3b15919050565b80519192508115918215613079575b50509038612fff565b61308c92506020809183010191016130b4565b3880613070565b6130ad91925060203d6020116118ee576118e0818361098e565b9038612f71565b9081602091031261034657516104a1816114af565b6000806130f29260018060a01b03169360208151910182865af16130eb612918565b9083613137565b805190811515918261311c575b50506131085750565b635274afe760e01b60005260045260246000fd5b61312f92506020809183010191016130b4565b1538806130ff565b9061315d575080511561314c57805190602001fd5b630a12f52160e11b60005260046000fd5b8151158061318f575b61316e575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561316656fea2646970667358221220218e869d9d942885dbda6142bdbb51f355143799f4ec6b14bff640d3371bce4c64736f6c634300081a0033000000000000000000000000eb430c15ff72fec66f382e6905e2dcb88a805c51000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001000000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d0000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b7265696473676574716f6c706b64626f746a6a666670746c683479347977786c726379756d346a6f786e6f6f7173707879656f663261340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656964346637763667726a7a37736371747a6e6a616f366461616e6468796f6761687663686a3468676274616874726b3578767370342f0000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c8062be36561461033657806301ffc9a71461033157806306fdde031461032c578063081812fc14610327578063095ea7b314610322578063179397f71461031d57806318160ddd14610318578063229f3e291461031357806323b872dd1461030e57806326a24575146103095780632c9b72a71461030457806342842e0e146102ff57806342966c68146102fa578063493d5dfe146102f55780634beb7797146102f057806355f804b3146102eb578063564566a8146102e65780636173b4ed146102e15780636352211e146102dc578063651c5434146102d75780636c0360eb146102d257806370a08231146102cd578063715018a6146102c857806379ba5097146102c35780638da5cb5b146102be57806390f73d3c146102b9578063938e3d7b146102b457806395d89b41146102af5780639bfcbd6f146102aa5780639d77126d146102a5578063a22cb465146102a0578063adf8252d1461029b578063b88d4fde14610296578063bab2f55214610291578063c465a8dc1461028c578063c467366a14610287578063c65af62214610282578063c87b56dd1461027d578063cb0a443314610278578063d89135cd14610273578063d9e146001461026e578063dc8e92ea14610269578063de96cd1c14610264578063e30c39781461025f578063e8a3d4851461025a578063e985e9c514610255578063ebb7868714610250578063f1bf9a371461024b578063f2fde38b146102465763fa7272141461024157600080fd5b612126565b6120b9565b612070565b612033565b611fd6565b611f2e565b611f05565b611e47565b611d76565b611c6b565b611c29565b611b95565b61198d565b61191b565b611673565b6115fe565b6115d7565b61157d565b61154a565b6114b9565b61145f565b61143c565b611394565b611278565b6111f5565b6111cc565b611142565b6110db565b6110b0565b611008565b610fb0565b610f81565b610ed2565b610eb2565b610d6a565b610b74565b610949565b610863565b61083e565b6107ff565b610785565b610771565b610719565b6106f2565b6106c9565b6105fc565b61057d565b6104a4565b610386565b61034b565b600091031261034657565b600080fd5b3461034657600036600319011261034657600c546040516001600160a01b039091168152602090f35b6001600160e01b031981160361034657565b34610346576020366003190112610346576103e86004356103a681610374565b6001600160e01b0319166301ffc9a760e01b8114908115908282610437575b8315610426575b83156103ec575b50506040519115158252509081906020820190565b0390f35b925090610415575b8115610404575b503880806103d3565b635b5e139f60e01b149050386103fb565b6380ac58cd60e01b811491506103f4565b635b5e139f60e01b821493506103cc565b6380ac58cd60e01b821493506103c5565b60005b83811061045b5750506000910152565b818101518382015260200161044b565b9060209161048481518092818552858086019101610448565b601f01601f1916010190565b9060206104a192818152019061046b565b90565b346103465760003660031901126103465760405160006002546104c681610fce565b808452906001811690811561055957506001146104fa575b6103e8836104ee8185038261098e565b60405191829182610490565b600260009081527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace939250905b80821061053f575090915081016020016104ee6104de565b919260018160209254838588010152019101909291610527565b60ff191660208086019190915291151560051b840190910191506104ee90506104de565b346103465760203660031901126103465760043561059a816126ab565b156105bf576000526006602052602060018060a01b0360406000205416604051908152f35b6333d1c03960e21b60005260046000fd5b600435906001600160a01b038216820361034657565b602435906001600160a01b038216820361034657565b6040366003190112610346576106106105d0565b602435906001600160a01b036106258361274e565b1690813303610697575b61066681610647856000526006602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b0316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4005b600082815260076020908152604080832033845290915290205460ff1661062f576367d9dca160e11b60005260046000fd5b3461034657600036600319011261034657600b546040516001600160a01b039091168152602090f35b34610346576000366003190112610346576000546001546040519103600019018152602090f35b34610346576000366003190112610346576020601054604051908152f35b6060906003190112610346576004356001600160a01b038116810361034657906024356001600160a01b0381168103610346579060443590565b61078361077d36610737565b9161215b565b005b34610346576020366003190112610346576004356000526012602052602063ffffffff60406000205460381c16604051908152f35b906020808351928381520192019060005b8181106107d85750505090565b82518452602093840193909201916001016107cb565b9060206104a19281815201906107ba565b34610346576060366003190112610346576103e861082a61081e6105d0565b602435604435916123d4565b6040519182916020835260208301906107ba565b61078361084a36610737565b906040519261085a60208561098e565b600084526125ac565b34610346576020366003190112610346576004356108926108866108868361274e565b6001600160a01b031690565b336001600160a01b0390911603610939576108b66108b033836127e3565b91612db9565b7f0000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d6001600160a01b0316803b156103465760405163c55bf03960e01b815260048101839052336024820152906000908290818381604481015b03925af180156109345761091f57005b8061092e60006107839361098e565b8061033b565b6124c0565b6282b42960e81b60005260046000fd5b34610346576020366003190112610346576004356000526012602052602060ff60406000205416604051908152f35b634e487b7160e01b600052604160045260246000fd5b90601f801991011681019081106001600160401b038211176109af57604052565b610978565b604051906109c46101008361098e565b565b6001600160401b0381116109af5760051b60200190565b9080601f830112156103465781356109f4816109c6565b92610a02604051948561098e565b81845260208085019260051b82010192831161034657602001905b828210610a2a5750505090565b8135815260209182019101610a1d565b906020808351928381520192019060005b818110610a585750505090565b825161ffff16845260209384019390920191600101610a4b565b906020808351928381520192019060005b818110610a905750505090565b825163ffffffff16845260209384019390920191600101610a83565b906020808351928381520192019060005b818110610aca5750505090565b82516001600160a01b0316845260209384019390920191600101610abd565b9391959492909560a0850160a086528751809152602060c0870198019060005b818110610b5b57505050610b4d9291610b3188610b3f93886104a19a9b0360208a0152610a3a565b908682036040880152610a72565b908482036060860152610a72565b916080818403910152610aac565b825160ff168a526020998a019990920191600101610b09565b34610346576020366003190112610346576004356001600160401b03811161034657610ba49036906004016109dd565b610bae8151612331565b90610bb98151612331565b91610bc48251612331565b92610bcf8351612331565b610bd98451612331565b9160005b8551811015610cc957610c04610bf38288612379565b516000526012602052604060002090565b5490610c1f60ff8316610c178389612379565b9060ff169052565b610c3e600883901c61ffff16610c358386612379565b9061ffff169052565b63ffffffff601883901c16918215610cb857610c99610cb291610c72600195610c67868e612379565b9063ffffffff169052565b610c8a603882901c63ffffffff16610c67868a612379565b60581c6001600160a01b031690565b610ca38388612379565b6001600160a01b039091169052565b01610bdd565b6377dfd02960e11b60005260046000fd5b50946103e893945060405195869586610ae9565b6001600160401b0381116109af57601f01601f191660200190565b929192610d0482610cdd565b91610d12604051938461098e565b829481845281830111610346578281602093846000960137010152565b602060031982011261034657600435906001600160401b0382116103465780602383011215610346578160246104a193600401359101610cf8565b3461034657610d7836610d2f565b610d806128be565b805115610ea15780516001600160401b0381116109af57610dab81610da6600e54610fce565b6124cc565b602091601f8211600114610e2057610ddb9260009183610e15575b50508160011b916000199060031b1c19161790565b600e555b604080516001815260001960208201527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c9190a1005b015190503880610dc6565b600e600052601f198216927fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd9160005b858110610e8957508360019510610e70575b505050811b01600e55610ddf565b015160001960f88460031b161c19169055388080610e62565b91926020600181928685015181550194019201610e50565b63af458c0760e01b60005260046000fd5b346103465760003660031901126103465760206010546040519042108152f35b3461034657604036600319011261034657600435602435600054808211610f79575b50610efd61230e565b915b818110610f1457604051806103e885826107ee565b610f1d816126ab565b610f2a575b600101610eff565b80600052601260205260001960ff60406000205416019060ff8211610f745760019160ff16610f6c610f65610f5f8388612379565b516123a8565b9186612379565b529050610f22565b612392565b905038610ef4565b346103465760203660031901126103465760206001600160a01b03610fa760043561274e565b16604051908152f35b34610346576000366003190112610346576020600f54604051908152f35b90600182811c92168015610ffe575b6020831014610fe857565b634e487b7160e01b600052602260045260246000fd5b91607f1691610fdd565b34610346576000366003190112610346576040516000600e5461102a81610fce565b80845290600181169081156105595750600114611051576103e8836104ee8185038261098e565b600e60009081527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd939250905b808210611096575090915081016020016104ee6104de565b91926001816020925483858801015201910190929161107e565b346103465760203660031901126103465760206110d36110ce6105d0565b612572565b604051908152f35b34610346576000366003190112610346576110f46128be565b600a80546001600160a01b03199081169091556009805491821690556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461034657600036600319011261034657600a54336001600160a01b03909116036111b757600a80546001600160a01b0319908116909155600980543392811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b63118cdaa760e01b6000523360045260246000fd5b34610346576000366003190112610346576009546040516001600160a01b039091168152602090f35b346103465760403660031901126103465761120e6105d0565b6112166105e6565b907f0000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d6001600160a01b0316330361093957600c80546001600160a01b039283166001600160a01b031991821617909155600b8054939092169216919091179055005b346103465761128636610d2f565b61128e6128be565b805115610ea15780516001600160401b0381116109af576112b9816112b4600d54610fce565b61251f565b602091601f8211600114611313576112e89260009183610e155750508160011b916000199060031b1c19161790565b600d555b7fa5d4097edda6d87cb9329af83fb3712ef77eeb13738ffe43cc35a4ce305ad962600080a1005b600d600052601f198216927fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb59160005b85811061137c57508360019510611363575b505050811b01600d556112ec565b015160001960f88460031b161c19169055388080611355565b91926020600181928685015181550194019201611343565b346103465760003660031901126103465760405160006003546113b681610fce565b808452906001811690811561055957506001146113dd576103e8836104ee8185038261098e565b600360009081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b939250905b808210611422575090915081016020016104ee6104de565b91926001816020925483858801015201910190929161140a565b3461034657600036600319011261034657602060ff601154166040519015158152f35b34610346576000366003190112610346577f0000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d6001600160a01b03163303610939576011805460ff19166001179055005b8015150361034657565b34610346576040366003190112610346576114d26105d0565b602435906114df826114af565b3360009081526007602090815260408083206001600160a01b038516845290915290209115159160ff1981541660ff841617905560405191825260018060a01b0316907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b34610346576020366003190112610346576004356000526012602052602061ffff60406000205460081c16604051908152f35b6080366003190112610346576115916105d0565b6115996105e6565b90604435606435926001600160401b0384116103465736602385011215610346576115d1610783943690602481600401359101610cf8565b926125ac565b3461034657600036600319011261034657602063ffffffff60115460081c16604051908152f35b34610346576000366003190112610346576040517f0000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d6001600160a01b03168152602090f35b9181601f84011215610346578235916001600160401b038311610346576020808501948460051b01011161034657565b6040366003190112610346576004356001600160401b0381116103465761169e903690600401611643565b6024359160105442101561190a5781806116b7926129ef565b909281840193848111610f745773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23b1561034657604051630d0e30db60e41b8152916000836004813473c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25af190811561093457611804936020926118f5575b506117276109b4565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281529073f19308f923582a6f7c465e5ce7a9dc1bec6665b182840152612710604083015230606083015260808201523460a08201528660c0820152600060e082015261178734612f17565b6040805163414bf38960e01b815282516001600160a01b0390811660048301526020840151811660248301529183015162ffffff1660448201526060830151821660648201526080830151608482015260a083015160a482015260c083015160c482015260e0909201511660e48201529283908190610104820190565b0381600073e592427a0aece92de3edee1f18e0157c058615645af1948515610934576107839561185d936000916118c6575b508181116118ac575b505060115460ff161561188657600b546001600160a01b0316612bed565b8061186a575b5033612c40565b600c5461188091906001600160a01b0316612bed565b38611863565b7f0000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d612bed565b6118bf916118b9916127d6565b33612bed565b388061183f565b6118e8915060203d6020116118ee575b6118e0818361098e565b810190612bde565b38611836565b503d6118d6565b8061092e60006119049361098e565b3861171e565b630fe219dd60e21b60005260046000fd5b3461034657600036600319011261034657600c546001600160a01b031633036109395760115463ffffffff8160081c169063ffffffff8214610f745764ffffffff0019166001820160081b64ffffffff001617601155600f546040805163ffffffff9093168352602083019190915290f35b34610346576020366003190112610346576004356119aa816126ab565b15611b5657600052601260205260ff604060002054168060009172184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b821015611b33575b806d04ee2d6d415b85acef8100000000600a921015611b17575b662386f26fc10000811015611b02575b6305f5e100811015611af0575b612710811015611ae0575b6064811015611ad1575b1015611ac6575b611a736021611a4760018501612d0b565b938401015b60001901916f181899199a1a9b1b9c1cb0b131b232b360811b600a82061a8353600a900490565b908115611a8357611a7390611a4c565b6040516103e8906104ee81611ab8611aa788611aa1602085016125fb565b90612684565b64173539b7b760d91b815260050190565b03601f19810183528261098e565b600190910190611a36565b60029060649004930192611a2f565b6004906127109004930192611a25565b6008906305f5e1009004930192611a1a565b601090662386f26fc100009004930192611a0d565b6020906d04ee2d6d415b85acef810000000090049301926119fd565b506040915072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b81046119e3565b630a14c4b560e41b60005260046000fd5b602060031982011261034657600435906001600160401b03821161034657611b9191600401611643565b9091565b3461034657611ba336611b67565b60105442101561190a57611be0611bbe8280610783956129ef565b919060ff60115416600014611c0357600b546001600160a01b03165b33612d33565b80611bec575033612c40565b600c5461188091906001600160a01b031633612d33565b7f0000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d611bda565b34610346576000366003190112610346576020600154604051908152f35b9063ffffffff611c646020929594956040855260408501906107ba565b9416910152565b34610346576040366003190112610346576004356001600160401b03811161034657611c9b9036906004016109dd565b611ca36105e6565b90611cae8151612331565b9160005b8251811015611d5857611cc58184612379565b5190611cdb826000526012602052604060002090565b5491611cf5603884901c63ffffffff165b63ffffffff1690565b611d2f57610886610886611d089261274e565b6001600160a01b03848116911603610939576001915b611d288287612379565b5201611cb2565b50605882901c6001600160a01b03166001600160a01b0384811691160361093957600191611d1e565b601154849060081c63ffffffff16906103e860405192839283611c47565b3461034657611d8436611b67565b908115610ea157906000916000915b808310611df857837f0000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d6001600160a01b0316803b156103465760405163c55bf03960e01b8152600481018390523360248201529060009082908183816044810161090f565b909192611e0684838561269b565b359333611e1b6108866108866108868961274e565b0361093957611e3f611e39600193611e3333896127e3565b906125ee565b95612db9565b019190611d93565b3461034657604036600319011261034657600435611e636105e6565b8160005260126020526040600020549163ffffffff611e898463ffffffff9060381c1690565b16611ed457610886610886611e9d9261274e565b6001600160a01b03918216911603610939575b60115460081c63ffffffff166040805192835263ffffffff91909116602083015290f35b50605882901c6001600160a01b03166001600160a01b03908116911614611eb0576282b42960e81b60005260046000fd5b3461034657600036600319011261034657600a546040516001600160a01b039091168152602090f35b34610346576000366003190112610346576040516000600d54611f5081610fce565b80845290600181169081156105595750600114611f77576103e8836104ee8185038261098e565b600d60009081527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5939250905b808210611fbc575090915081016020016104ee6104de565b919260018160209254838588010152019101909291611fa4565b3461034657604036600319011261034657602060ff612027611ff66105d0565b611ffe6105e6565b6001600160a01b0391821660009081526007865260408082209290931681526020919091522090565b54166040519015158152f35b346103465760203660031901126103465760043560009081526012602090815260409182902054915160589290921c6001600160a01b0316825290f35b34610346576020366003190112610346576004357f0000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d6001600160a01b0316330361093957601055005b34610346576020366003190112610346576120d26105d0565b6120da6128be565b600a80546001600160a01b0319166001600160a01b039283169081179091556009549091167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700600080a3005b34610346576020366003190112610346576004356000526012602052602063ffffffff60406000205460181c16604051908152f35b91906121668261274e565b6001600160a01b0393841693811684900361230957600083815260066020526040902080546121a86001600160a01b03871633908114908314171590565b1590565b6122bb575b6122b1575b506001600160a01b038416600090815260056020526040902080546000190190556001600160a01b0382166000908152600560205260409020805460010190556001600160a01b0382164260a01b17600160e11b1761221b846000526004602052604060002090565b55600160e11b811615612267575b506001600160a01b03169182907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a41561226257565b61271c565b6001830161227f816000526004602052604060002090565b541561228c575b50612229565b6000548114612286576122a9906000526004602052604060002090565b553880612286565b60009055386121b2565b6122ff6121a46122f8336122e18a60018060a01b03166000526007602052604060002090565b9060018060a01b0316600052602052604060002090565b5460ff1690565b156121ad5761270b565b6126fb565b6040516101a09190612320838261098e565b600c815291601f1901366020840137565b9061233b826109c6565b612348604051918261098e565b8281528092612359601f19916109c6565b0190602036910137565b634e487b7160e01b600052603260045260246000fd5b805182101561238d5760209160051b010190565b612363565b634e487b7160e01b600052601160045260246000fd5b6000198114610f745760010190565b6001600160401b03166001600160401b038114610f745760010190565b92916000548082116124b8575b506123eb84612572565b6123f481612331565b94811561244e576000935b838110612454575050505061241381612331565b9260005b6001600160401b038116908382101561244e578161244361243b6124499486612379565b519188612379565b526123b7565b612417565b50505050565b61245d816126ab565b80612495575b612470575b6001016123ff565b938085612480612486938a612379565b526123a8565b93828503612468575050505050565b506124a56108866108868361274e565b6001600160a01b03838116911614612463565b9050386123e1565b6040513d6000823e3d90fd5b601f81116124d8575050565b600e6000526020600020906020601f840160051c83019310612515575b601f0160051c01905b818110612509575050565b600081556001016124fe565b90915081906124f5565b601f811161252b575050565b600d6000526020600020906020601f840160051c83019310612568575b601f0160051c01905b81811061255c575050565b60008155600101612551565b9091508190612548565b6001600160a01b0316801561259b5760005260056020526001600160401b036040600020541690565b6323d3ad8160e21b60005260046000fd5b9291906125ba82828661215b565b803b6125c65750505050565b6125cf93612948565b156125dd573880808061244e565b6368d2bf6b60e11b60005260046000fd5b91908201809211610f7457565b600e546000929161260b82610fce565b91600181169081156126725750600114612623575050565b600e600090815292935090917fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd5b83821061265e5750500190565b600181602092548486015201910190612651565b60ff1916825250811515909102019150565b9061269760209282815194859201610448565b0190565b919081101561238d5760051b0190565b9060009180600111156126bb5750565b60005481106126c75750565b9091505b806000526004602052604060002054806126ef57508015610f7457600019016126cb565b600160e01b1615919050565b62a1148160e81b60005260046000fd5b632ce44b5f60e11b60005260046000fd5b633a954ecd60e21b60005260046000fd5b636f96cda160e11b60005260046000fd5b622e076360e81b60005260046000fd5b8060011161272d5761276a816000526004602052604060002090565b549081156127815750600160e01b811661272d5790565b905060005481101561272d575b600019016000818152600460205260409020549081156127b75750600160e01b811661272d5790565b905061278e565b63ffffffff60029116019063ffffffff8211610f7457565b91908203918211610f7457565b9190916127fa816000526012602052604060002090565b549261280e63ffffffff8560181c166127be565b63ffffffff612829611cec60115463ffffffff9060081c1690565b9116116128ad576128aa9061285061284b61ffff600888901c16600f546127d6565b600f55565b61285c60ff8616612d75565b94612873611cec60115463ffffffff9060081c1690565b60381b9066ffffffffffffff60ff60f81b01161790600160581b600160f81b039060581b1617916000526012602052604060002090565b55565b63b0782df760e01b60005260046000fd5b6009546001600160a01b031633036111b757565b9081602091031261034657516104a181610374565b6001600160a01b0391821681529116602082015260408101919091526080606082018190526104a19291019061046b565b3d15612943573d9061292982610cdd565b91612937604051938461098e565b82523d6000602084013e565b606090565b906020926000612971959360405196879586948593630a85bd0160e11b855233600486016128e7565b03926001600160a01b03165af1600091816129be575b506129a857612994612918565b8051156129a357805190602001fd5b6125dd565b6001600160e01b031916630a85bd0160e11b1490565b6129e191925060203d6020116129e8575b6129d9818361098e565b8101906128d2565b9038612987565b503d6129cf565b9290916000936000938215610ea157600092919254906000935b838510612a17575050505050565b909192939596612a2887848461269b565b359060ff821691828103610346576000928381158015612bd4575b612bc557509160019391836005899510600014612b8e57508a6a52b7d2dcc80cd2e400000093600a905b6003841680612afe575050612ae6612af09361ffff93612a8f612aa294612f00565b938491612a9c8a60011c90565b9a6125ee565b91612ab660115463ffffffff9060081c1690565b9266ffffffff00000060ff92939462ffff0092600052601260205260181b169360081b1691161717604060002055565b16600f5401600f55565b019801960193929190612a09565b60038103612b39575050612ae6612af09361ffff93612b2d612b22612aa295612ee9565b61ffff600a91160490565b93849160058a04612a9c565b90969193929190600214612b5e575b61ffff9284612aa2612af09694612ae6946125ee565b9550612ae661ffff92612aa292612b7a612b22612af097612ed2565b600a89049990965091945092509050612b48565b60091115612bad578a6b033b2e3c9fd0803ce800000093606490612a6d565b8a6b204fce5e3e25026110000000936103e890612a6d565b63f8e309e360e01b8152600490fd5b50600c8211612a43565b90816020910312610346575190565b60405163a9059cbb60e01b60208201526001600160a01b03909116602482015260448101919091526109c490612c268160648101611ab8565b73f19308f923582a6f7c465e5ce7a9dc1bec6665b16130c9565b600054908215612cfa576001600160a01b0381164260a01b6001851460e11b1717612c75836000526004602052604060002090565b556001600160a01b031660008181526005602052604090208054680100000000000000018502019055918215612cf5578101909260015b15612ce0575b60008484827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4612cac565b9260010192818403612cb25792509050600055565b61273e565b63b562e8dd60e01b60005260046000fd5b90612d1582610cdd565b612d22604051918261098e565b8281528092612359601f1991610cdd565b6040516323b872dd60e01b60208201526001600160a01b039182166024820152911660448201526064808201929092529081526109c490612c2660848261098e565b60ff166005811015612d9157506a52b7d2dcc80cd2e400000090565b60091115612da9576b033b2e3c9fd0803ce800000090565b6b204fce5e3e2502611000000090565b6000612dc48261274e565b600083815260066020526040902080546001600160a01b038316929190612ec9575b506001600160a01b038216600090815260056020526040902080546fffffffffffffffffffffffffffffffff01905560008481526004602052604090206001600160a01b0383164260a01b17600360e01b179055600160e11b811615612e80575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a46109c4612e7b60015460010190565b600155565b60018401612e98816000526004602052604060002090565b5415612ea5575b50612e47565b83548114612e9f57612ec1906000526004602052604060002090565b553880612e9f565b83905538612de6565b61ffff600c9116029061ffff8216918203610f7457565b61ffff600e9116029061ffff8216918203610f7457565b60011b906201fffe61fffe831692168203610f7457565b604051636eb1769f60e11b815230600482015273e592427a0aece92de3edee1f18e0157c0586156460248201529060208260448173c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25afa91821561093457600092613093575b508101809111610f745760405163095ea7b360e01b6020820190815273e592427a0aece92de3edee1f18e0157c058615646024830181905260448084019490945292825273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29061300a90612fda60648561098e565b83516001600160a01b03841691600091829182855af190612ff9612918565b82613061575b508161305a57501590565b61301357505050565b60405163095ea7b360e01b60208201526001600160a01b039093166024840152600060448401526109c4926130559061304f8160648101611ab8565b826130c9565b6130c9565b3b15919050565b80519192508115918215613079575b50509038612fff565b61308c92506020809183010191016130b4565b3880613070565b6130ad91925060203d6020116118ee576118e0818361098e565b9038612f71565b9081602091031261034657516104a1816114af565b6000806130f29260018060a01b03169360208151910182865af16130eb612918565b9083613137565b805190811515918261311c575b50506131085750565b635274afe760e01b60005260045260246000fd5b61312f92506020809183010191016130b4565b1538806130ff565b9061315d575080511561314c57805190602001fd5b630a12f52160e11b60005260046000fd5b8151158061318f575b61316e575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561316656fea2646970667358221220218e869d9d942885dbda6142bdbb51f355143799f4ec6b14bff640d3371bce4c64736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000eb430c15ff72fec66f382e6905e2dcb88a805c51000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001000000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d0000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b7265696473676574716f6c706b64626f746a6a666670746c683479347977786c726379756d346a6f786e6f6f7173707879656f663261340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656964346637763667726a7a37736371747a6e6a616f366461616e6468796f6761687663686a3468676274616874726b3578767370342f0000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _owner (address): 0xeB430C15Ff72feC66f382E6905e2DCB88a805C51
Arg [1] : _contractURI (string): ipfs://bafkreidsgetqolpkdbotjjffptlh4y4ywxlrcyum4joxnooqspxyeof2a4
Arg [2] : __baseURI (string): ipfs://bafybeid4f7v6grjz7scqtznjao6daandhyogahvchj4hgbtahtrk5xvsp4/
Arg [3] : _stax (address): 0x4bd0F1886010253a18BBb401a788d8972c155b9d
-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 000000000000000000000000eb430c15ff72fec66f382e6905e2dcb88a805c51
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [3] : 0000000000000000000000004bd0f1886010253a18bbb401a788d8972c155b9d
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000042
Arg [5] : 697066733a2f2f6261666b7265696473676574716f6c706b64626f746a6a6666
Arg [6] : 70746c683479347977786c726379756d346a6f786e6f6f7173707879656f6632
Arg [7] : 6134000000000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [9] : 697066733a2f2f6261667962656964346637763667726a7a37736371747a6e6a
Arg [10] : 616f366461616e6468796f6761687663686a3468676274616874726b35787673
Arg [11] : 70342f0000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.