Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 164 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 23162283 | 193 days ago | IN | 0 ETH | 0.00000481 | ||||
| Set Approval For... | 23162283 | 193 days ago | IN | 0 ETH | 0.00000845 | ||||
| Set Approval For... | 23021938 | 212 days ago | IN | 0 ETH | 0.00010668 | ||||
| Set Approval For... | 22879558 | 232 days ago | IN | 0 ETH | 0.00010591 | ||||
| Set Approval For... | 22315258 | 311 days ago | IN | 0 ETH | 0.00001996 | ||||
| Set Approval For... | 21156645 | 473 days ago | IN | 0 ETH | 0.00050873 | ||||
| Set Approval For... | 20752593 | 529 days ago | IN | 0 ETH | 0.00007068 | ||||
| Set Approval For... | 20654150 | 543 days ago | IN | 0 ETH | 0.00002524 | ||||
| Set Approval For... | 20651619 | 543 days ago | IN | 0 ETH | 0.00005494 | ||||
| Set Approval For... | 20500383 | 564 days ago | IN | 0 ETH | 0.00008737 | ||||
| Set Approval For... | 20253470 | 599 days ago | IN | 0 ETH | 0.00007713 | ||||
| Wl Mint | 19885084 | 650 days ago | IN | 0.019 ETH | 0.00171166 | ||||
| Wl Mint | 19881707 | 651 days ago | IN | 0.019 ETH | 0.00191531 | ||||
| Safe Transfer Fr... | 19858682 | 654 days ago | IN | 0 ETH | 0.00025507 | ||||
| Set Approval For... | 19826028 | 659 days ago | IN | 0 ETH | 0.00040275 | ||||
| Safe Transfer Fr... | 19508838 | 703 days ago | IN | 0 ETH | 0.00109662 | ||||
| Set Approval For... | 19293172 | 733 days ago | IN | 0 ETH | 0.00144018 | ||||
| Safe Transfer Fr... | 19278939 | 735 days ago | IN | 0 ETH | 0.00360505 | ||||
| Safe Transfer Fr... | 19238706 | 741 days ago | IN | 0 ETH | 0.00187578 | ||||
| Update NFT | 19109357 | 759 days ago | IN | 0 ETH | 0.0027474 | ||||
| Transfer From | 19107877 | 759 days ago | IN | 0 ETH | 0.00102119 | ||||
| Wl Mint | 19094804 | 761 days ago | IN | 0.022 ETH | 0.00335576 | ||||
| Safe Transfer Fr... | 19062686 | 766 days ago | IN | 0 ETH | 0.00130057 | ||||
| Safe Transfer Fr... | 18954722 | 781 days ago | IN | 0 ETH | 0.00262098 | ||||
| Wl Mint | 18952286 | 781 days ago | IN | 0.022 ETH | 0.00324454 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 19885084 | 650 days ago | 0.019 ETH | ||||
| Transfer | 19881707 | 651 days ago | 0.019 ETH | ||||
| Transfer | 19094804 | 761 days ago | 0.022 ETH | ||||
| Transfer | 18952286 | 781 days ago | 0.022 ETH | ||||
| Transfer | 18944880 | 782 days ago | 0.025 ETH | ||||
| Transfer | 18924338 | 785 days ago | 0.0255 ETH | ||||
| Transfer | 18924338 | 785 days ago | 0.0045 ETH | ||||
| Transfer | 18898767 | 789 days ago | 0.019 ETH | ||||
| Transfer | 18897778 | 789 days ago | 0.0255 ETH | ||||
| Transfer | 18897778 | 789 days ago | 0.0045 ETH | ||||
| Transfer | 18894332 | 789 days ago | 0.095 ETH | ||||
| Transfer | 18873798 | 792 days ago | 0.025 ETH | ||||
| Transfer | 18871917 | 792 days ago | 0.025 ETH | ||||
| Transfer | 18869561 | 793 days ago | 0.025 ETH | ||||
| Transfer | 18863319 | 794 days ago | 0.038 ETH | ||||
| Transfer | 18861374 | 794 days ago | 0.03 ETH | ||||
| Transfer | 18861219 | 794 days ago | 0.0255 ETH | ||||
| Transfer | 18861219 | 794 days ago | 0.0045 ETH | ||||
| Transfer | 18859448 | 794 days ago | 0.019 ETH | ||||
| Transfer | 18859347 | 794 days ago | 0.057 ETH | ||||
| Transfer | 18859328 | 794 days ago | 0.048 ETH | ||||
| Transfer | 18854878 | 795 days ago | 0.025 ETH | ||||
| Transfer | 18851476 | 795 days ago | 0.022 ETH | ||||
| Transfer | 18851341 | 795 days ago | 0.025 ETH | ||||
| Transfer | 18848292 | 796 days ago | 0.0255 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
HoodyGang
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./IHoody.sol";
import "./IHoodySign.sol";
interface IHoodyTraits {
function useTraitsForUpdateNFT(uint16[] memory, uint16[] memory) external;
}
contract HoodyGang is ERC721Enumerable, IHoody, Ownable {
enum WLTYPE {
OG,
BB,
CWL,
FCFS
}
enum PHASE {
BEFORE,
FIRST,
SECOND,
PUBLIC
}
address public hoodySign;
address public hoodyTraits;
address public hoodyMigrate;
string public baseURI;
uint256 public PUBLIC_PRICE = 0.03 ether;
mapping(PHASE => mapping(WLTYPE => uint256[3])) public WL_PRICES;
mapping(address => mapping(PHASE => mapping(WLTYPE => uint16)))
public WL_AMOUNTS;
uint256 public referReward;
uint256 public constant MaxMintNumber = 6666;
uint16 public batchNumber = 10;
uint256 public newMintNumber;
uint256 public migrateNumber = 6666;
address public communityWallet = 0xfbEDD27832f02e2FfB4f52c03AF51e77D4f53DB3;
mapping(uint256 => string) private tokenURIs;
mapping(uint256 => bool) public isOG;
mapping(address => bool) public isReferral;
mapping(address => bool) public isNotFirstMint;
mapping(PHASE => uint256) public phaseStartTime;
mapping(WLTYPE => bytes32) public wlRoots;
event SetHoody(uint256 tokenID, string tokenURI);
event MigrateOG(
address holder,
uint256 tokenID,
uint256 ogID,
string tokenURI
);
modifier onlyMigrate() {
require(
msg.sender == hoodyMigrate,
"Only HoodyMigrate can call this function."
);
_;
}
constructor(
uint256 _referReward
) ERC721("Hoody Gang", "HG") Ownable(msg.sender) {
referReward = _referReward;
WL_PRICES[PHASE.FIRST][WLTYPE.OG][0] = 0.013 ether;
WL_PRICES[PHASE.FIRST][WLTYPE.OG][1] = 0.01 ether;
WL_PRICES[PHASE.FIRST][WLTYPE.BB][0] = 0.016 ether;
WL_PRICES[PHASE.FIRST][WLTYPE.BB][1] = 0.013 ether;
WL_PRICES[PHASE.FIRST][WLTYPE.CWL][0] = 0.019 ether;
WL_PRICES[PHASE.FIRST][WLTYPE.CWL][1] = 0.016 ether;
WL_PRICES[PHASE.SECOND][WLTYPE.OG][0] = 0.016 ether;
WL_PRICES[PHASE.SECOND][WLTYPE.OG][1] = 0.013 ether;
WL_PRICES[PHASE.SECOND][WLTYPE.BB][0] = 0.019 ether;
WL_PRICES[PHASE.SECOND][WLTYPE.BB][1] = 0.016 ether;
WL_PRICES[PHASE.SECOND][WLTYPE.CWL][0] = 0.022 ether;
WL_PRICES[PHASE.SECOND][WLTYPE.CWL][1] = 0.019 ether;
WL_PRICES[PHASE.SECOND][WLTYPE.FCFS][0] = 0.025 ether;
WL_PRICES[PHASE.SECOND][WLTYPE.FCFS][0] = 0.022 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.OG][0] = 0.019 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.OG][1] = 0.016 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.OG][2] = 0.022 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.BB][0] = 0.022 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.BB][1] = 0.019 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.BB][2] = 0.025 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.CWL][0] = 0.025 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.CWL][1] = 0.022 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.CWL][2] = 0.028 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.FCFS][0] = 0.028 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.FCFS][1] = 0.025 ether;
WL_PRICES[PHASE.PUBLIC][WLTYPE.FCFS][2] = 0.03 ether;
}
function wlMint(
uint16 _amount,
WLTYPE _wlType,
bytes32[] memory _proof
) external payable {
PHASE currentPhase = getCurrentPhase();
require(currentPhase != PHASE.BEFORE, "Can't mint for now.");
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(
MerkleProof.verify(_proof, wlRoots[_wlType], leaf),
"Invalid Proof"
);
(uint16 availableAmount, uint256 price) = getAvailableWLAmountAndPrice(
msg.sender,
currentPhase,
_wlType
);
require(_amount <= availableAmount, "Exceed available amounts.");
require(msg.value == price * _amount, "Insufficient amount!");
if (!isNotFirstMint[msg.sender]) isNotFirstMint[msg.sender] = true;
WL_AMOUNTS[msg.sender][currentPhase][_wlType] += _amount;
hoodyMint(msg.sender, uint8(_amount));
}
function getAvailableWLAmountAndPrice(
address _holder,
PHASE _currentPhase,
WLTYPE _wlType
) public view returns (uint16, uint256) {
uint16 currentAmount = WL_AMOUNTS[_holder][_currentPhase][_wlType];
if (_currentPhase == PHASE.FIRST && _wlType == WLTYPE.FCFS)
return (0, 0);
if (currentAmount < batchNumber)
return (
batchNumber - currentAmount,
WL_PRICES[_currentPhase][_wlType][0]
);
else if (currentAmount < 2 * batchNumber)
return (
2 * batchNumber - currentAmount,
WL_PRICES[_currentPhase][_wlType][1]
);
else {
if (_currentPhase == PHASE.PUBLIC)
return (100, WL_PRICES[_currentPhase][_wlType][2]);
else return (0, 0);
}
}
function publicMint(address _refer, uint8 _amount) public payable {
mint(msg.sender, _refer, _amount);
}
function crossMint(address _to, uint8 _amount) external payable {
mint(_to, communityWallet, _amount);
}
function mint(address _to, address _refer, uint8 _amount) internal {
require(
block.timestamp > phaseStartTime[PHASE.PUBLIC],
"Can't pubic mint for now!"
);
require(
msg.value == PUBLIC_PRICE * _amount,
"Not enough amount for mint!"
);
require(
isReferral[_refer] || _refer == communityWallet,
"Invalid referral address!"
);
if (!isNotFirstMint[_to]) {
isNotFirstMint[_to] = true;
payable(_refer).transfer(referReward * _amount);
}
hoodyMint(_to, _amount);
}
function treasureMint(
address[] memory _wList,
uint8[] memory _amounts
) external onlyOwner {
require(_wList.length == _amounts.length, "Invalid Params Length!");
for (uint i; i < _wList.length; i++) {
hoodyMint(_wList[i], _amounts[i]);
}
}
function hoodyMint(address _minter, uint8 _amount) private {
require(
newMintNumber + _amount <= MaxMintNumber,
"Reach out max number!"
);
payable(owner()).transfer(address(this).balance);
setReferral();
for (uint i; i < _amount; i++) {
newMintNumber += 1;
_mint(_minter, newMintNumber);
tokenURIs[newMintNumber] = string(
abi.encodePacked(
baseURI,
"/",
Strings.toString(newMintNumber),
".json"
)
);
emit SetHoody(newMintNumber, tokenURIs[newMintNumber]);
}
}
function ogMigrate(uint256 _ogID, string memory _uri) external onlyMigrate {
migrateNumber += 1;
_mint(tx.origin, migrateNumber);
tokenURIs[migrateNumber] = _uri;
setReferral();
if (!isNotFirstMint[tx.origin]) isNotFirstMint[tx.origin] = true;
isOG[migrateNumber] = true;
emit MigrateOG(tx.origin, migrateNumber, _ogID, _uri);
}
function updatePublicPrice(uint256 _price) external onlyOwner {
PUBLIC_PRICE = _price;
}
function setReferral() internal {
if (!isReferral[tx.origin]) isReferral[tx.origin] = true;
}
function buildingBlockFreeMint(uint8 _amount) external onlyMigrate {
hoodyMint(tx.origin, _amount);
}
function getCurrentPhase() public view returns (PHASE) {
if (block.timestamp < phaseStartTime[PHASE.FIRST]) return PHASE.BEFORE;
else if (block.timestamp < phaseStartTime[PHASE.SECOND])
return PHASE.FIRST;
else if (block.timestamp < phaseStartTime[PHASE.PUBLIC])
return PHASE.SECOND;
else return PHASE.PUBLIC;
}
function approve(
address to,
uint256 tokenId
) public override(ERC721, IERC721) {
_approve(to, tokenId, tx.origin);
}
function updateNFT(
uint256 _tokenId,
string memory _uri,
uint16[] memory _oldTraits,
uint16[] memory _newTraits,
bytes memory _signature
) external {
require(
ownerOf(_tokenId) == msg.sender,
"You are not the token Owner!"
);
require(!isOG[_tokenId], "Can't update OG!");
uint16[] memory traits = new uint16[](
_oldTraits.length + _newTraits.length
);
uint8 index = 0;
for (uint i = 0; i < _oldTraits.length; i++) {
traits[index] = _oldTraits[i];
index++;
}
for (uint i = 0; i < _newTraits.length; i++) {
traits[index] = _newTraits[i];
index++;
}
require(
IHoodySign(hoodySign).verifyForTraits(
msg.sender,
string(abi.encodePacked(_uri, Strings.toString(_tokenId))),
traits,
_signature
),
"Invalid Signature"
);
IHoodySign(hoodySign).increaseNonce(msg.sender);
IHoodyTraits(hoodyTraits).useTraitsForUpdateNFT(_oldTraits, _newTraits);
tokenURIs[_tokenId] = _uri;
emit SetHoody(_tokenId, _uri);
}
function setWLRoot(WLTYPE _type, bytes32 _root) external onlyOwner {
wlRoots[_type] = _root;
}
function setLaunchTime(uint256 _time) external onlyOwner {
phaseStartTime[PHASE.FIRST] = _time;
phaseStartTime[PHASE.SECOND] = _time + 2 hours;
phaseStartTime[PHASE.PUBLIC] = _time + 4 hours;
}
function setHoodyMigrate(address _hoodyMigrate) external onlyOwner {
hoodyMigrate = _hoodyMigrate;
}
function setBaseURI(string memory _baseURI) external onlyOwner {
baseURI = _baseURI;
}
function setRewardValues(uint256 _referReward) external onlyOwner {
referReward = _referReward;
}
function setHoodyTraits(address _hoodyTraits) external onlyOwner {
hoodyTraits = _hoodyTraits;
}
function setHoodySign(address _hoodySign) external onlyOwner {
hoodySign = _hoodySign;
}
function setCommunityWallet(address _community) external onlyOwner {
communityWallet = _community;
}
function tokenURI(
uint256 tokenId
) public view override returns (string memory) {
require(ownerOf(tokenId) != address(0), "Token does not exist");
return tokenURIs[tokenId];
}
}// 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) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.20;
import {IERC721} from "./IERC721.sol";
import {IERC721Receiver} from "./IERC721Receiver.sol";
import {IERC721Metadata} from "./extensions/IERC721Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {Strings} from "../../utils/Strings.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
mapping(uint256 tokenId => address) private _owners;
mapping(address owner => uint256) private _balances;
mapping(uint256 tokenId => address) private _tokenApprovals;
mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual returns (uint256) {
if (owner == address(0)) {
revert ERC721InvalidOwner(address(0));
}
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual returns (address) {
return _requireOwned(tokenId);
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual returns (string memory) {
_requireOwned(tokenId);
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : "";
}
/**
* @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, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual {
_approve(to, tokenId, _msgSender());
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual returns (address) {
_requireOwned(tokenId);
return _getApproved(tokenId);
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual {
if (to == address(0)) {
revert ERC721InvalidReceiver(address(0));
}
// Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists
// (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.
address previousOwner = _update(to, tokenId, _msgSender());
if (previousOwner != from) {
revert ERC721IncorrectOwner(from, tokenId, previousOwner);
}
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {
transferFrom(from, to, tokenId);
_checkOnERC721Received(from, to, tokenId, data);
}
/**
* @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
*
* IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the
* core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances
* consistent with ownership. The invariant to preserve is that for any address `a` the value returned by
* `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.
*/
function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
return _owners[tokenId];
}
/**
* @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.
*/
function _getApproved(uint256 tokenId) internal view virtual returns (address) {
return _tokenApprovals[tokenId];
}
/**
* @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in
* particular (ignoring whether it is owned by `owner`).
*
* WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
* assumption.
*/
function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {
return
spender != address(0) &&
(owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);
}
/**
* @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.
* Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets
* the `spender` for the specific `tokenId`.
*
* WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
* assumption.
*/
function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {
if (!_isAuthorized(owner, spender, tokenId)) {
if (owner == address(0)) {
revert ERC721NonexistentToken(tokenId);
} else {
revert ERC721InsufficientApproval(spender, tokenId);
}
}
}
/**
* @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
*
* NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that
* a uint256 would ever overflow from increments when these increments are bounded to uint128 values.
*
* WARNING: Increasing an account's balance using this function tends to be paired with an override of the
* {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership
* remain consistent with one another.
*/
function _increaseBalance(address account, uint128 value) internal virtual {
unchecked {
_balances[account] += value;
}
}
/**
* @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner
* (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.
*
* The `auth` argument is optional. If the value passed is non 0, then this function will check that
* `auth` is either the owner of the token, or approved to operate on the token (by the owner).
*
* Emits a {Transfer} event.
*
* NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.
*/
function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {
address from = _ownerOf(tokenId);
// Perform (optional) operator check
if (auth != address(0)) {
_checkAuthorized(from, auth, tokenId);
}
// Execute the update
if (from != address(0)) {
// Clear approval. No need to re-authorize or emit the Approval event
_approve(address(0), tokenId, address(0), false);
unchecked {
_balances[from] -= 1;
}
}
if (to != address(0)) {
unchecked {
_balances[to] += 1;
}
}
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
return from;
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal {
if (to == address(0)) {
revert ERC721InvalidReceiver(address(0));
}
address previousOwner = _update(to, tokenId, address(0));
if (previousOwner != address(0)) {
revert ERC721InvalidSender(address(0));
}
}
/**
* @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
_mint(to, tokenId);
_checkOnERC721Received(address(0), to, tokenId, data);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
* This is an internal function that does not check if the sender is authorized to operate on the token.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal {
address previousOwner = _update(address(0), tokenId, address(0));
if (previousOwner == address(0)) {
revert ERC721NonexistentToken(tokenId);
}
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(address from, address to, uint256 tokenId) internal {
if (to == address(0)) {
revert ERC721InvalidReceiver(address(0));
}
address previousOwner = _update(to, tokenId, address(0));
if (previousOwner == address(0)) {
revert ERC721NonexistentToken(tokenId);
} else if (previousOwner != from) {
revert ERC721IncorrectOwner(from, tokenId, previousOwner);
}
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients
* are aware of the ERC721 standard to prevent tokens from being forever locked.
*
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is like {safeTransferFrom} in the sense that it invokes
* {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `tokenId` token must exist and be owned by `from`.
* - `to` cannot be the zero address.
* - `from` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(address from, address to, uint256 tokenId) internal {
_safeTransfer(from, to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
_transfer(from, to, tokenId);
_checkOnERC721Received(from, to, tokenId, data);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is
* either the owner of the token, or approved to operate on all tokens held by this owner.
*
* Emits an {Approval} event.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address to, uint256 tokenId, address auth) internal {
_approve(to, tokenId, auth, true);
}
/**
* @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not
* emitted in the context of transfers.
*/
function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {
// Avoid reading the owner unless necessary
if (emitEvent || auth != address(0)) {
address owner = _requireOwned(tokenId);
// We do not use _isAuthorized because single-token approvals should not be able to call approve
if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {
revert ERC721InvalidApprover(auth);
}
if (emitEvent) {
emit Approval(owner, to, tokenId);
}
}
_tokenApprovals[tokenId] = to;
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Requirements:
* - operator can't be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
if (operator == address(0)) {
revert ERC721InvalidOperator(operator);
}
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).
* Returns the owner.
*
* Overrides to ownership logic should be done to {_ownerOf}.
*/
function _requireOwned(uint256 tokenId) internal view returns (address) {
address owner = _ownerOf(tokenId);
if (owner == address(0)) {
revert ERC721NonexistentToken(tokenId);
}
return owner;
}
/**
* @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the
* recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param data bytes optional data to send along with the call
*/
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private {
if (to.code.length > 0) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
if (retval != IERC721Receiver.onERC721Received.selector) {
revert ERC721InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
revert ERC721InvalidReceiver(to);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.20;
import {ERC721} from "../ERC721.sol";
import {IERC721Enumerable} from "./IERC721Enumerable.sol";
import {IERC165} from "../../../utils/introspection/ERC165.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds enumerability
* of all the token ids in the contract as well as all token ids owned by each account.
*
* CAUTION: `ERC721` extensions that implement custom `balanceOf` logic, such as `ERC721Consecutive`,
* interfere with enumerability and should not be used together with `ERC721Enumerable`.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;
mapping(uint256 tokenId => uint256) private _ownedTokensIndex;
uint256[] private _allTokens;
mapping(uint256 tokenId => uint256) private _allTokensIndex;
/**
* @dev An `owner`'s token query was out of bounds for `index`.
*
* NOTE: The owner being `address(0)` indicates a global out of bounds index.
*/
error ERC721OutOfBoundsIndex(address owner, uint256 index);
/**
* @dev Batch mint is not allowed.
*/
error ERC721EnumerableForbiddenBatchMint();
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {
if (index >= balanceOf(owner)) {
revert ERC721OutOfBoundsIndex(owner, index);
}
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual returns (uint256) {
if (index >= totalSupply()) {
revert ERC721OutOfBoundsIndex(address(0), index);
}
return _allTokens[index];
}
/**
* @dev See {ERC721-_update}.
*/
function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {
address previousOwner = super._update(to, tokenId, auth);
if (previousOwner == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (previousOwner != to) {
_removeTokenFromOwnerEnumeration(previousOwner, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (previousOwner != to) {
_addTokenToOwnerEnumeration(to, tokenId);
}
return previousOwner;
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = balanceOf(to) - 1;
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = balanceOf(from);
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
/**
* See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch
*/
function _increaseBalance(address account, uint128 amount) internal virtual override {
if (amount > 0) {
revert ERC721EnumerableForbiddenBatchMint();
}
super._increaseBalance(account, amount);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.20;
import {IERC721} from "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.20;
import {IERC721} from "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
* {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.20;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be
* reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.20;
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The tree and the proofs can be generated using our
* https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
* You will find a quickstart guide in the readme.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the Merkle tree could be reinterpreted as a leaf value.
* OpenZeppelin's JavaScript library generates Merkle trees that are safe
* against this attack out of the box.
*/
library MerkleProof {
/**
*@dev The multiproof provided is not valid.
*/
error MerkleProofInvalidMultiproof();
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Calldata version of {verify}
*/
function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Calldata version of {processProof}
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Calldata version of {multiProofVerify}
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofLen = proof.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
if (leavesLen + proofLen != totalHashes + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
if (proofPos != proofLen) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[totalHashes - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Calldata version of {processMultiProof}.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofLen = proof.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
if (leavesLen + proofLen != totalHashes + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
if (proofPos != proofLen) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[totalHashes - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Sorts the pair (a, b) and hashes the result.
*/
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
/**
* @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory.
*/
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.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: MIT
pragma solidity ^0.8.19;
interface IHoody {
enum HoodyGangRarity {
Common,
Rare,
Legendary
}
enum HoodyTraitRarity {
Common,
Rare,
Legendary
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "./IHoody.sol";
interface IHoodySign is IHoody {
function verifyForTraits(
address,
string memory,
uint16[] memory,
bytes memory
) external view returns (bool);
function verifyForStake(
address,
uint256[] memory,
HoodyGangRarity[] memory,
bytes memory
) external view returns (bool);
function verifyForMigrate(
address,
uint256,
string memory,
bytes memory
) external view returns (bool);
function increaseNonce(address) external;
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"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":"uint256","name":"_referReward","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ERC721EnumerableForbiddenBatchMint","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"ERC721OutOfBoundsIndex","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","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":"address","name":"holder","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ogID","type":"uint256"},{"indexed":false,"internalType":"string","name":"tokenURI","type":"string"}],"name":"MigrateOG","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenID","type":"uint256"},{"indexed":false,"internalType":"string","name":"tokenURI","type":"string"}],"name":"SetHoody","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":"MaxMintNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUBLIC_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"enum HoodyGang.PHASE","name":"","type":"uint8"},{"internalType":"enum HoodyGang.WLTYPE","name":"","type":"uint8"}],"name":"WL_AMOUNTS","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum HoodyGang.PHASE","name":"","type":"uint8"},{"internalType":"enum HoodyGang.WLTYPE","name":"","type":"uint8"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"WL_PRICES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"batchNumber","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_amount","type":"uint8"}],"name":"buildingBlockFreeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"communityWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint8","name":"_amount","type":"uint8"}],"name":"crossMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_holder","type":"address"},{"internalType":"enum HoodyGang.PHASE","name":"_currentPhase","type":"uint8"},{"internalType":"enum HoodyGang.WLTYPE","name":"_wlType","type":"uint8"}],"name":"getAvailableWLAmountAndPrice","outputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentPhase","outputs":[{"internalType":"enum HoodyGang.PHASE","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hoodyMigrate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hoodySign","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hoodyTraits","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isNotFirstMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isOG","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isReferral","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"migrateNumber","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":"newMintNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ogID","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"ogMigrate","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"enum HoodyGang.PHASE","name":"","type":"uint8"}],"name":"phaseStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_refer","type":"address"},{"internalType":"uint8","name":"_amount","type":"uint8"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"referReward","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_community","type":"address"}],"name":"setCommunityWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_hoodyMigrate","type":"address"}],"name":"setHoodyMigrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_hoodySign","type":"address"}],"name":"setHoodySign","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_hoodyTraits","type":"address"}],"name":"setHoodyTraits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_time","type":"uint256"}],"name":"setLaunchTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_referReward","type":"uint256"}],"name":"setRewardValues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum HoodyGang.WLTYPE","name":"_type","type":"uint8"},{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"setWLRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","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":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_wList","type":"address[]"},{"internalType":"uint8[]","name":"_amounts","type":"uint8[]"}],"name":"treasureMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"uint16[]","name":"_oldTraits","type":"uint16[]"},{"internalType":"uint16[]","name":"_newTraits","type":"uint16[]"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"updateNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"updatePublicPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_amount","type":"uint16"},{"internalType":"enum HoodyGang.WLTYPE","name":"_wlType","type":"uint8"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"wlMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"enum HoodyGang.WLTYPE","name":"","type":"uint8"}],"name":"wlRoots","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6080604052666a94d74f430000600f556013805461ffff1916600a179055611a0a601555601680546001600160a01b03191673fbedd27832f02e2ffb4f52c03af51e77d4f53db31790553480156200005657600080fd5b50604051620040363803806200403683398101604081905262000079916200055a565b336040518060400160405280600a815260200169486f6f64792047616e6760b01b81525060405180604001604052806002815260200161484760f01b8152508160009081620000c9919062000619565b506001620000d8828262000619565b5050506001600160a01b0381166200010a57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620001158162000508565b50601255662e2f6e5e1480007f3f0de5f588fbef817ef65b9f218ab58bb698b8aa57f27a1374050e494f1c6787819055662386f26fc100007f3f0de5f588fbef817ef65b9f218ab58bb698b8aa57f27a1374050e494f1c6788556638d7ea4c6800007f1061b5517c6e1813fa4a07d1613ee4384e750538d69c4513a8df591da5f938ac8190557f1061b5517c6e1813fa4a07d1613ee4384e750538d69c4513a8df591da5f938ad829055664380663abb80007f35ac6e3f5d662ce5e5646170c540f4363ae8e58a5f27a153e746ced9ed5d3a6a8190557f35ac6e3f5d662ce5e5646170c540f4363ae8e58a5f27a153e746ced9ed5d3a6b8290557f15041b2867670cf9e2cf8bd80a0d50e85b9da89e71f8f9f42a5bd8359c3f9c858290557f15041b2867670cf9e2cf8bd80a0d50e85b9da89e71f8f9f42a5bd8359c3f9c86929092557f94f5a4615a99a786e5f98c4eeb7fed01abb2ca6847cca402adc57e3f61e8b8578290557f94f5a4615a99a786e5f98c4eeb7fed01abb2ca6847cca402adc57e3f61e8b858819055664e28e2290f00007f3e22aba1abb747000726bbdaf7b6f6b581a8044a0b8c87e3a7dab47bdb2d9cb58190557f3e22aba1abb747000726bbdaf7b6f6b581a8044a0b8c87e3a7dab47bdb2d9cb68390557fdbe4e24770d296076e9d255f64f0f560a2e62f5a24b27c720de249547c15863b8190557fc0db5c43c6ea210a089c77a8cac42f02eaa84c55baca05ffb5e2c11c9a9fb3d98390557fc0db5c43c6ea210a089c77a8cac42f02eaa84c55baca05ffb5e2c11c9a9fb3da919091557fc0db5c43c6ea210a089c77a8cac42f02eaa84c55baca05ffb5e2c11c9a9fb3db8190557fb3edd0d534d647cffdae9f1294f11ad21f3fcf2814bea44c92bbb8d384a57d9e6020527f25d4e0890eb5e9ea44140051123066041cac4821099ecf9c2df365b263a357e88190557f25d4e0890eb5e9ea44140051123066041cac4821099ecf9c2df365b263a357e9919091556658d15e176280007f25d4e0890eb5e9ea44140051123066041cac4821099ecf9c2df365b263a357ea8190557f39310e0bc5b48e969d2ae6d8199228412f38a5a7e2a887dc8dbac70a0c00e53c8190557f39310e0bc5b48e969d2ae6d8199228412f38a5a7e2a887dc8dbac70a0c00e53d91909155666379da05b600007f39310e0bc5b48e969d2ae6d8199228412f38a5a7e2a887dc8dbac70a0c00e53e81905560036000527f727222e605b161903a1d94f4c4ba65d8f868ffb46c709f8714da2fb894daf1c4557f727222e605b161903a1d94f4c4ba65d8f868ffb46c709f8714da2fb894daf1c555666a94d74f4300007f727222e605b161903a1d94f4c4ba65d8f868ffb46c709f8714da2fb894daf1c655620006e5565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000602082840312156200056d57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200059f57607f821691505b602082108103620005c057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200061457600081815260208120601f850160051c81016020861015620005ef5750805b601f850160051c820191505b818110156200061057828155600101620005fb565b5050505b505050565b81516001600160401b0381111562000635576200063562000574565b6200064d816200064684546200058a565b84620005c6565b602080601f8311600181146200068557600084156200066c5750858301515b600019600386901b1c1916600185901b17855562000610565b600085815260208120601f198616915b82811015620006b65788860151825594840194600190910190840162000695565b5085821015620006d55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61394180620006f56000396000f3fe6080604052600436106103505760003560e01c806385d6bb81116101c6578063b03ef28c116100f7578063d36f8e1c11610095578063e920ac1c1161006f578063e920ac1c14610a09578063e985e9c514610a29578063f2fde38b14610a49578063f8ed5b4614610a6957600080fd5b8063d36f8e1c1461099c578063d669fea2146109d6578063e9030bd0146109e957600080fd5b8063bdf82b15116100d1578063bdf82b1514610926578063c5f8489f14610946578063c75748391461095c578063c87b56dd1461097c57600080fd5b8063b03ef28c146108bb578063b88d4fde146108eb578063ba8730651461090b57600080fd5b806395d89b4111610164578063a22cb4651161013e578063a22cb46514610846578063a3a40ea514610866578063a727dd4d14610888578063a964ce2f146108a857600080fd5b806395d89b41146107f15780639c75c1f0146108065780639ff46e741461082657600080fd5b80638da5cb5b116101a05780638da5cb5b146107735780638f33501d14610791578063923037d5146107b1578063952cfe5b146107d157600080fd5b806385d6bb81146107135780638b7a2955146107335780638cd63d621461076057600080fd5b8063476a1ef8116102a0578063687cd4ac1161023e578063715018a611610218578063715018a6146106b25780637b0a6445146106c75780637be9a414146106dd5780637dc8c671146106fd57600080fd5b8063687cd4ac1461065d5780636c0360eb1461067d57806370a082311461069257600080fd5b806360181c021161027a57806360181c02146105b2578063611f3f10146105d25780636352211e146105e8578063685d341b1461060857600080fd5b8063476a1ef8146105525780634f6ccce71461057257806355f804b31461059257600080fd5b806318160ddd1161030d57806326a55071116102e757806326a55071146104b55780632f745c59146104e25780633eee4d221461050257806342842e0e1461053257600080fd5b806318160ddd146104465780631ff7edab1461046557806323b872dd1461049557600080fd5b806301ffc9a71461035557806306fdde031461038a578063081812fc146103ac578063095ea7b3146103e4578063120b402f1461040657806316e0a20014610426575b600080fd5b34801561036157600080fd5b50610375610370366004612b9d565b610a7f565b60405190151581526020015b60405180910390f35b34801561039657600080fd5b5061039f610aaa565b6040516103819190612c0a565b3480156103b857600080fd5b506103cc6103c7366004612c1d565b610b3c565b6040516001600160a01b039091168152602001610381565b3480156103f057600080fd5b506104046103ff366004612c52565b610b65565b005b34801561041257600080fd5b50610404610421366004612c8d565b610b74565b34801561043257600080fd5b50610404610441366004612c1d565b610bb4565b34801561045257600080fd5b506008545b604051908152602001610381565b34801561047157600080fd5b50610375610480366004612ca8565b60196020526000908152604090205460ff1681565b3480156104a157600080fd5b506104046104b0366004612cc3565b610bc1565b3480156104c157600080fd5b506104576104d0366004612d0c565b601c6020526000908152604090205481565b3480156104ee57600080fd5b506104576104fd366004612c52565b610c4c565b34801561050e57600080fd5b5061037561051d366004612ca8565b601a6020526000908152604090205460ff1681565b34801561053e57600080fd5b5061040461054d366004612cc3565b610cb1565b34801561055e57600080fd5b5061040461056d366004612ca8565b610cd1565b34801561057e57600080fd5b5061045761058d366004612c1d565b610cfb565b34801561059e57600080fd5b506104046105ad366004612de0565b610d54565b3480156105be57600080fd5b506104046105cd366004612ca8565b610d68565b3480156105de57600080fd5b50610457600f5481565b3480156105f457600080fd5b506103cc610603366004612c1d565b610d92565b34801561061457600080fd5b5061064a610623366004612e15565b601160209081526000938452604080852082529284528284209052825290205461ffff1681565b60405161ffff9091168152602001610381565b34801561066957600080fd5b50610457610678366004612e5e565b610d9d565b34801561068957600080fd5b5061039f610dcf565b34801561069e57600080fd5b506104576106ad366004612ca8565b610e5d565b3480156106be57600080fd5b50610404610ea5565b3480156106d357600080fd5b5061045760125481565b3480156106e957600080fd5b50600b546103cc906001600160a01b031681565b34801561070957600080fd5b50610457611a0a81565b34801561071f57600080fd5b5061040461072e366004612ca8565b610eb9565b34801561073f57600080fd5b5061045761074e366004612d0c565b601b6020526000908152604090205481565b61040461076e366004612e9f565b610ee3565b34801561077f57600080fd5b50600a546001600160a01b03166103cc565b34801561079d57600080fd5b506104046107ac366004612f7a565b610efb565b3480156107bd57600080fd5b50600d546103cc906001600160a01b031681565b3480156107dd57600080fd5b50600c546103cc906001600160a01b031681565b3480156107fd57600080fd5b5061039f6112db565b34801561081257600080fd5b50610404610821366004612c1d565b6112ea565b34801561083257600080fd5b50610404610841366004612c1d565b6112f7565b34801561085257600080fd5b5061040461086136600461303f565b6113a0565b34801561087257600080fd5b5061087b6113ab565b604051610381919061308c565b34801561089457600080fd5b506104046108a3366004612ca8565b61145e565b6104046108b6366004612e9f565b611488565b3480156108c757600080fd5b506103756108d6366004612c1d565b60186020526000908152604090205460ff1681565b3480156108f757600080fd5b506104046109063660046130b4565b611493565b34801561091757600080fd5b5060135461064a9061ffff1681565b34801561093257600080fd5b5061040461094136600461311c565b6114aa565b34801561095257600080fd5b5061045760145481565b34801561096857600080fd5b506016546103cc906001600160a01b031681565b34801561098857600080fd5b5061039f610997366004612c1d565b6114ef565b3480156109a857600080fd5b506109bc6109b7366004612e15565b6115e7565b6040805161ffff9093168352602083019190915201610381565b6104046109e436600461313a565b6118ac565b3480156109f557600080fd5b50610404610a043660046131f0565b611b6d565b348015610a1557600080fd5b50610404610a24366004613299565b611c74565b348015610a3557600080fd5b50610375610a4436600461334f565b611d20565b348015610a5557600080fd5b50610404610a64366004612ca8565b611d4e565b348015610a7557600080fd5b5061045760155481565b60006001600160e01b0319821663780e9d6360e01b1480610aa45750610aa482611d89565b92915050565b606060008054610ab990613379565b80601f0160208091040260200160405190810160405280929190818152602001828054610ae590613379565b8015610b325780601f10610b0757610100808354040283529160200191610b32565b820191906000526020600020905b815481529060010190602001808311610b1557829003601f168201915b5050505050905090565b6000610b4782611dd9565b506000828152600460205260409020546001600160a01b0316610aa4565b610b70828232611e12565b5050565b600d546001600160a01b03163314610ba75760405162461bcd60e51b8152600401610b9e906133b3565b60405180910390fd5b610bb13282611e1f565b50565b610bbc611f93565b600f55565b6001600160a01b038216610beb57604051633250574960e11b815260006004820152602401610b9e565b6000610bf8838333611fc0565b9050836001600160a01b0316816001600160a01b031614610c46576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610b9e565b50505050565b6000610c5783610e5d565b8210610c885760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610b9e565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610ccc83838360405180602001604052806000815250611493565b505050565b610cd9611f93565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610d0660085490565b8210610d2f5760405163295f44f760e21b81526000600482015260248101839052604401610b9e565b60088281548110610d4257610d426133fc565b90600052602060002001549050919050565b610d5c611f93565b600e610b708282613460565b610d70611f93565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610aa482611dd9565b60106020528260005260406000206020528160005260406000208160038110610dc557600080fd5b0154925083915050565b600e8054610ddc90613379565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0890613379565b8015610e555780601f10610e2a57610100808354040283529160200191610e55565b820191906000526020600020905b815481529060010190602001808311610e3857829003601f168201915b505050505081565b60006001600160a01b038216610e89576040516322718ad960e21b815260006004820152602401610b9e565b506001600160a01b031660009081526003602052604090205490565b610ead611f93565b610eb76000612095565b565b610ec1611f93565b601680546001600160a01b0319166001600160a01b0392909216919091179055565b601654610b709083906001600160a01b0316836120e7565b33610f0586610d92565b6001600160a01b031614610f5b5760405162461bcd60e51b815260206004820152601c60248201527f596f7520617265206e6f742074686520746f6b656e204f776e657221000000006044820152606401610b9e565b60008581526018602052604090205460ff1615610fad5760405162461bcd60e51b815260206004820152601060248201526f43616e277420757064617465204f472160801b6044820152606401610b9e565b600082518451610fbd9190613536565b67ffffffffffffffff811115610fd557610fd5612d29565b604051908082528060200260200182016040528015610ffe578160200160208202803683370190505b5090506000805b855181101561107057858181518110611020576110206133fc565b6020026020010151838360ff168151811061103d5761103d6133fc565b61ffff909216602092830291909101909101528161105a81613549565b925050808061106890613568565b915050611005565b5060005b84518110156110df5784818151811061108f5761108f6133fc565b6020026020010151838360ff16815181106110ac576110ac6133fc565b61ffff90921660209283029190910190910152816110c981613549565b92505080806110d790613568565b915050611074565b50600b546001600160a01b03166371c61fe833886110fc8b6122d1565b60405160200161110d929190613581565b60405160208183030381529060405285876040518563ffffffff1660e01b815260040161113d94939291906135ef565b602060405180830381865afa15801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e9190613644565b6111be5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964205369676e617475726560781b6044820152606401610b9e565b600b54604051632091ea5f60e21b81523360048201526001600160a01b0390911690638247a97c90602401600060405180830381600087803b15801561120357600080fd5b505af1158015611217573d6000803e3d6000fd5b5050600c546040516357d2190560e11b81526001600160a01b03909116925063afa4320a915061124d9088908890600401613661565b600060405180830381600087803b15801561126757600080fd5b505af115801561127b573d6000803e3d6000fd5b505050600088815260176020526040902090506112988782613460565b507fa13c7319ba5bef599d5611d38d4f27f9538a61ec10d8d6d779d4a90209b713f187876040516112ca92919061368f565b60405180910390a150505050505050565b606060018054610ab990613379565b6112f2611f93565b601255565b6112ff611f93565b6001600052601b6020527f9fafca4c9c0d5c2cbf85f49fd8ab8212430ce78c2a0cb75b51e0f9c4f9ace00381905561133981611c20613536565b6002600052601b6020527f1dd2f4b94a51cfb409e6e317a497f7cfd9013960a1c723f830c49c05a25f08a55561137181613840613536565b6003600052601b6020527f804a3d0621e73505f5f0c57c922f3e57d6b48e175551184eb12f80d7b4a9c7835550565b610b70338383612364565b60016000908152601b6020527f9fafca4c9c0d5c2cbf85f49fd8ab8212430ce78c2a0cb75b51e0f9c4f9ace003544210156113e65750600090565b6002600052601b6020527f1dd2f4b94a51cfb409e6e317a497f7cfd9013960a1c723f830c49c05a25f08a55442101561141f5750600190565b6003600052601b6020527f804a3d0621e73505f5f0c57c922f3e57d6b48e175551184eb12f80d7b4a9c783544210156114585750600290565b50600390565b611466611f93565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b610b703383836120e7565b61149e848484610bc1565b610c4684848484612403565b6114b2611f93565b80601c60008460038111156114c9576114c9613076565b60038111156114da576114da613076565b81526020810191909152604001600020555050565b606060006114fc83610d92565b6001600160a01b0316036115495760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610b9e565b6000828152601760205260409020805461156290613379565b80601f016020809104026020016040519081016040528092919081815260200182805461158e90613379565b80156115db5780601f106115b0576101008083540402835291602001916115db565b820191906000526020600020905b8154815290600101906020018083116115be57829003601f168201915b50505050509050919050565b6001600160a01b0383166000908152601160205260408120819081908186600381111561161657611616613076565b600381111561162757611627613076565b8152602001908152602001600020600085600381111561164957611649613076565b600381111561165a5761165a613076565b815260208101919091526040016000205461ffff169050600185600381111561168557611685613076565b1480156116a3575060038460038111156116a1576116a1613076565b145b156116b55760008092509250506118a4565b60135461ffff908116908216101561175f576013546116d990829061ffff166136a8565b601060008760038111156116ef576116ef613076565b600381111561170057611700613076565b8152602001908152602001600020600086600381111561172257611722613076565b600381111561173357611733613076565b8152602001908152602001600020600060038110611753576117536133fc565b015492509250506118a4565b6013546117719061ffff1660026136ca565b61ffff168161ffff16101561180f5760135481906117949061ffff1660026136ca565b61179e91906136a8565b601060008760038111156117b4576117b4613076565b60038111156117c5576117c5613076565b815260200190815260200160002060008660038111156117e7576117e7613076565b60038111156117f8576117f8613076565b815260208101919091526040016000206001611753565b600385600381111561182357611823613076565b0361189b5760646010600087600381111561184057611840613076565b600381111561185157611851613076565b8152602001908152602001600020600086600381111561187357611873613076565b600381111561188457611884613076565b815260208101919091526040016000206002611753565b60008092509250505b935093915050565b60006118b66113ab565b905060008160038111156118cc576118cc613076565b0361190f5760405162461bcd60e51b815260206004820152601360248201527221b0b713ba1036b4b73a103337b9103737bb9760691b6044820152606401610b9e565b6040516bffffffffffffffffffffffff193360601b16602082015260009060340160405160208183030381529060405280519060200120905061198883601c600087600381111561196257611962613076565b600381111561197357611973613076565b8152602001908152602001600020548361252c565b6119c45760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210283937b7b360991b6044820152606401610b9e565b6000806119d23385886115e7565b915091508161ffff168761ffff161115611a2e5760405162461bcd60e51b815260206004820152601960248201527f45786365656420617661696c61626c6520616d6f756e74732e000000000000006044820152606401610b9e565b611a3c61ffff8816826136f0565b3414611a815760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e7420616d6f756e742160601b6044820152606401610b9e565b336000908152601a602052604090205460ff16611ab357336000908152601a60205260409020805460ff191660011790555b3360009081526011602052604081208891866003811115611ad657611ad6613076565b6003811115611ae757611ae7613076565b81526020019081526020016000206000886003811115611b0957611b09613076565b6003811115611b1a57611b1a613076565b8152602081019190915260400160009081208054909190611b4090849061ffff16613707565b92506101000a81548161ffff021916908361ffff160217905550611b643388611e1f565b50505050505050565b600d546001600160a01b03163314611b975760405162461bcd60e51b8152600401610b9e906133b3565b600160156000828254611baa9190613536565b92505081905550611bbd32601554612542565b6015546000908152601760205260409020611bd88282613460565b50611be16125a7565b326000908152601a602052604090205460ff16611c1357326000908152601a60205260409020805460ff191660011790555b6015805460009081526018602052604090819020805460ff19166001179055905490517feed395fde3485138737c2a1a567470a4d692b16aa2fec46a6f5d2de44b4b29b591611c689132919086908690613722565b60405180910390a15050565b611c7c611f93565b8051825114611cc65760405162461bcd60e51b8152602060048201526016602482015275496e76616c696420506172616d73204c656e6774682160501b6044820152606401610b9e565b60005b8251811015610ccc57611d0e838281518110611ce757611ce76133fc565b6020026020010151838381518110611d0157611d016133fc565b6020026020010151611e1f565b80611d1881613568565b915050611cc9565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b611d56611f93565b6001600160a01b038116611d8057604051631e4fbdf760e01b815260006004820152602401610b9e565b610bb181612095565b60006001600160e01b031982166380ac58cd60e01b1480611dba57506001600160e01b03198216635b5e139f60e01b145b80610aa457506301ffc9a760e01b6001600160e01b0319831614610aa4565b6000818152600260205260408120546001600160a01b031680610aa457604051637e27328960e01b815260048101849052602401610b9e565b610ccc83838360016125da565b611a0a8160ff16601454611e339190613536565b1115611e795760405162461bcd60e51b81526020600482015260156024820152745265616368206f7574206d6178206e756d6265722160581b6044820152606401610b9e565b600a546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015611eb2573d6000803e3d6000fd5b50611ebb6125a7565b60005b8160ff16811015610ccc57600160146000828254611edc9190613536565b92505081905550611eef83601454612542565b600e611efc6014546122d1565b604051602001611f0d929190613759565b60408051601f19818403018152918152601454600090815260176020522090611f369082613460565b506014546000818152601760205260409081902090517fa13c7319ba5bef599d5611d38d4f27f9538a61ec10d8d6d779d4a90209b713f192611f799290916137ff565b60405180910390a180611f8b81613568565b915050611ebe565b600a546001600160a01b03163314610eb75760405163118cdaa760e01b8152336004820152602401610b9e565b600080611fce8585856126e0565b90506001600160a01b03811661202b5761202684600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61204e565b846001600160a01b0316816001600160a01b03161461204e5761204e81856127d9565b6001600160a01b03851661206a576120658461286a565b61208d565b846001600160a01b0316816001600160a01b03161461208d5761208d8585612919565b949350505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6003600052601b6020527f804a3d0621e73505f5f0c57c922f3e57d6b48e175551184eb12f80d7b4a9c7835442116121615760405162461bcd60e51b815260206004820152601960248201527f43616e2774207075626963206d696e7420666f72206e6f7721000000000000006044820152606401610b9e565b8060ff16600f5461217291906136f0565b34146121c05760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f75676820616d6f756e7420666f72206d696e742100000000006044820152606401610b9e565b6001600160a01b03821660009081526019602052604090205460ff16806121f457506016546001600160a01b038381169116145b6122405760405162461bcd60e51b815260206004820152601960248201527f496e76616c696420726566657272616c206164647265737321000000000000006044820152606401610b9e565b6001600160a01b0383166000908152601a602052604090205460ff166122c7576001600160a01b038084166000908152601a60205260409020805460ff19166001179055601254908316906108fc9061229d9060ff8516906136f0565b6040518115909202916000818181858888f193505050501580156122c5573d6000803e3d6000fd5b505b610ccc8382611e1f565b606060006122de83612969565b600101905060008167ffffffffffffffff8111156122fe576122fe612d29565b6040519080825280601f01601f191660200182016040528015612328576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461233257509392505050565b6001600160a01b03821661239657604051630b61174360e31b81526001600160a01b0383166004820152602401610b9e565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c4657604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290612445903390889087908790600401613892565b6020604051808303816000875af1925050508015612480575060408051601f3d908101601f1916820190925261247d918101906138c5565b60015b6124e9573d8080156124ae576040519150601f19603f3d011682016040523d82523d6000602084013e6124b3565b606091505b5080516000036124e157604051633250574960e11b81526001600160a01b0385166004820152602401610b9e565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461252557604051633250574960e11b81526001600160a01b0385166004820152602401610b9e565b5050505050565b6000826125398584612a41565b14949350505050565b6001600160a01b03821661256c57604051633250574960e11b815260006004820152602401610b9e565b600061257a83836000611fc0565b90506001600160a01b03811615610ccc576040516339e3563760e11b815260006004820152602401610b9e565b3260009081526019602052604090205460ff16610eb757326000908152601960205260409020805460ff19166001179055565b80806125ee57506001600160a01b03821615155b156126b05760006125fe84611dd9565b90506001600160a01b0383161580159061262a5750826001600160a01b0316816001600160a01b031614155b801561263d575061263b8184611d20565b155b156126665760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610b9e565b81156126ae5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152600260205260408120546001600160a01b039081169083161561270d5761270d818486612a8e565b6001600160a01b0381161561274b5761272a6000856000806125da565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161561277a576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006127e483610e5d565b600083815260076020526040902054909150808214612837576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061287c906001906138e2565b600083815260096020526040812054600880549394509092849081106128a4576128a46133fc565b9060005260206000200154905080600883815481106128c5576128c56133fc565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806128fd576128fd6138f5565b6001900381819060005260206000200160009055905550505050565b6000600161292684610e5d565b61293091906138e2565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106129a85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106129d4576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106129f257662386f26fc10000830492506010015b6305f5e1008310612a0a576305f5e100830492506008015b6127108310612a1e57612710830492506004015b60648310612a30576064830492506002015b600a8310610aa45760010192915050565b600081815b8451811015612a8657612a7282868381518110612a6557612a656133fc565b6020026020010151612af2565b915080612a7e81613568565b915050612a46565b509392505050565b612a99838383612b24565b610ccc576001600160a01b038316612ac757604051637e27328960e01b815260048101829052602401610b9e565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610b9e565b6000818310612b0e576000828152602084905260409020612b1d565b60008381526020839052604090205b9392505050565b60006001600160a01b0383161580159061208d5750826001600160a01b0316846001600160a01b03161480612b5e5750612b5e8484611d20565b8061208d5750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b031981168114610bb157600080fd5b600060208284031215612baf57600080fd5b8135612b1d81612b87565b60005b83811015612bd5578181015183820152602001612bbd565b50506000910152565b60008151808452612bf6816020860160208601612bba565b601f01601f19169290920160200192915050565b602081526000612b1d6020830184612bde565b600060208284031215612c2f57600080fd5b5035919050565b80356001600160a01b0381168114612c4d57600080fd5b919050565b60008060408385031215612c6557600080fd5b612c6e83612c36565b946020939093013593505050565b803560ff81168114612c4d57600080fd5b600060208284031215612c9f57600080fd5b612b1d82612c7c565b600060208284031215612cba57600080fd5b612b1d82612c36565b600080600060608486031215612cd857600080fd5b612ce184612c36565b9250612cef60208501612c36565b9150604084013590509250925092565b60048110610bb157600080fd5b600060208284031215612d1e57600080fd5b8135612b1d81612cff565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612d6857612d68612d29565b604052919050565b600082601f830112612d8157600080fd5b813567ffffffffffffffff811115612d9b57612d9b612d29565b612dae601f8201601f1916602001612d3f565b818152846020838601011115612dc357600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215612df257600080fd5b813567ffffffffffffffff811115612e0957600080fd5b61208d84828501612d70565b600080600060608486031215612e2a57600080fd5b612e3384612c36565b92506020840135612e4381612cff565b91506040840135612e5381612cff565b809150509250925092565b600080600060608486031215612e7357600080fd5b8335612e7e81612cff565b92506020840135612e8e81612cff565b929592945050506040919091013590565b60008060408385031215612eb257600080fd5b612ebb83612c36565b9150612ec960208401612c7c565b90509250929050565b600067ffffffffffffffff821115612eec57612eec612d29565b5060051b60200190565b803561ffff81168114612c4d57600080fd5b600082601f830112612f1957600080fd5b81356020612f2e612f2983612ed2565b612d3f565b82815260059290921b84018101918181019086841115612f4d57600080fd5b8286015b84811015612f6f57612f6281612ef6565b8352918301918301612f51565b509695505050505050565b600080600080600060a08688031215612f9257600080fd5b85359450602086013567ffffffffffffffff80821115612fb157600080fd5b612fbd89838a01612d70565b95506040880135915080821115612fd357600080fd5b612fdf89838a01612f08565b94506060880135915080821115612ff557600080fd5b61300189838a01612f08565b9350608088013591508082111561301757600080fd5b5061302488828901612d70565b9150509295509295909350565b8015158114610bb157600080fd5b6000806040838503121561305257600080fd5b61305b83612c36565b9150602083013561306b81613031565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600483106130ae57634e487b7160e01b600052602160045260246000fd5b91905290565b600080600080608085870312156130ca57600080fd5b6130d385612c36565b93506130e160208601612c36565b925060408501359150606085013567ffffffffffffffff81111561310457600080fd5b61311087828801612d70565b91505092959194509250565b6000806040838503121561312f57600080fd5b8235612c6e81612cff565b60008060006060848603121561314f57600080fd5b61315884612ef6565b925060208085013561316981612cff565b9250604085013567ffffffffffffffff81111561318557600080fd5b8501601f8101871361319657600080fd5b80356131a4612f2982612ed2565b81815260059190911b820183019083810190898311156131c357600080fd5b928401925b828410156131e1578335825292840192908401906131c8565b80955050505050509250925092565b6000806040838503121561320357600080fd5b82359150602083013567ffffffffffffffff81111561322157600080fd5b61322d85828601612d70565b9150509250929050565b600082601f83011261324857600080fd5b81356020613258612f2983612ed2565b82815260059290921b8401810191818101908684111561327757600080fd5b8286015b84811015612f6f5761328c81612c7c565b835291830191830161327b565b600080604083850312156132ac57600080fd5b823567ffffffffffffffff808211156132c457600080fd5b818501915085601f8301126132d857600080fd5b813560206132e8612f2983612ed2565b82815260059290921b8401810191818101908984111561330757600080fd5b948201945b8386101561332c5761331d86612c36565b8252948201949082019061330c565b9650508601359250508082111561334257600080fd5b5061322d85828601613237565b6000806040838503121561336257600080fd5b61336b83612c36565b9150612ec960208401612c36565b600181811c9082168061338d57607f821691505b6020821081036133ad57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526029908201527f4f6e6c7920486f6f64794d6967726174652063616e2063616c6c207468697320604082015268333ab731ba34b7b71760b91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b601f821115610ccc57600081815260208120601f850160051c810160208610156134395750805b601f850160051c820191505b8181101561345857828155600101613445565b505050505050565b815167ffffffffffffffff81111561347a5761347a612d29565b61348e816134888454613379565b84613412565b602080601f8311600181146134c357600084156134ab5750858301515b600019600386901b1c1916600185901b178555613458565b600085815260208120601f198616915b828110156134f2578886015182559484019460019091019084016134d3565b50858210156135105787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b80820180821115610aa457610aa4613520565b600060ff821660ff810361355f5761355f613520565b60010192915050565b60006001820161357a5761357a613520565b5060010190565b60008351613593818460208801612bba565b8351908301906135a7818360208801612bba565b01949350505050565b600081518084526020808501945080840160005b838110156135e457815161ffff16875295820195908201906001016135c4565b509495945050505050565b6001600160a01b038516815260806020820181905260009061361390830186612bde565b828103604084015261362581866135b0565b905082810360608401526136398185612bde565b979650505050505050565b60006020828403121561365657600080fd5b8151612b1d81613031565b60408152600061367460408301856135b0565b828103602084015261368681856135b0565b95945050505050565b82815260406020820152600061208d6040830184612bde565b61ffff8281168282160390808211156136c3576136c3613520565b5092915050565b61ffff8181168382160280821691908281146136e8576136e8613520565b505092915050565b8082028115828204841417610aa457610aa4613520565b61ffff8181168382160190808211156136c3576136c3613520565b60018060a01b038516815283602082015282604082015260806060820152600061374f6080830184612bde565b9695505050505050565b600080845461376781613379565b6001828116801561377f5760018114613794576137c3565b60ff19841687528215158302870194506137c3565b8860005260208060002060005b858110156137ba5781548a8201529084019082016137a1565b50505082870194505b50602f60f81b8452865192506137df8382860160208a01612bba565b64173539b7b760d91b939092019182019290925260060195945050505050565b828152600060206040818401526000845461381981613379565b806040870152606060018084166000811461383b576001811461385557613883565b60ff1985168984015283151560051b890183019550613883565b896000528660002060005b8581101561387b5781548b8201860152908301908801613860565b8a0184019650505b50939998505050505050505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061374f90830184612bde565b6000602082840312156138d757600080fd5b8151612b1d81612b87565b81810381811115610aa457610aa4613520565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220cc428e0d50158f17641936a449ac38a7d7ba4958681c263bba12b1a18745588164736f6c63430008140033000000000000000000000000000000000000000000000000000ffcb9e57d4000
Deployed Bytecode
0x6080604052600436106103505760003560e01c806385d6bb81116101c6578063b03ef28c116100f7578063d36f8e1c11610095578063e920ac1c1161006f578063e920ac1c14610a09578063e985e9c514610a29578063f2fde38b14610a49578063f8ed5b4614610a6957600080fd5b8063d36f8e1c1461099c578063d669fea2146109d6578063e9030bd0146109e957600080fd5b8063bdf82b15116100d1578063bdf82b1514610926578063c5f8489f14610946578063c75748391461095c578063c87b56dd1461097c57600080fd5b8063b03ef28c146108bb578063b88d4fde146108eb578063ba8730651461090b57600080fd5b806395d89b4111610164578063a22cb4651161013e578063a22cb46514610846578063a3a40ea514610866578063a727dd4d14610888578063a964ce2f146108a857600080fd5b806395d89b41146107f15780639c75c1f0146108065780639ff46e741461082657600080fd5b80638da5cb5b116101a05780638da5cb5b146107735780638f33501d14610791578063923037d5146107b1578063952cfe5b146107d157600080fd5b806385d6bb81146107135780638b7a2955146107335780638cd63d621461076057600080fd5b8063476a1ef8116102a0578063687cd4ac1161023e578063715018a611610218578063715018a6146106b25780637b0a6445146106c75780637be9a414146106dd5780637dc8c671146106fd57600080fd5b8063687cd4ac1461065d5780636c0360eb1461067d57806370a082311461069257600080fd5b806360181c021161027a57806360181c02146105b2578063611f3f10146105d25780636352211e146105e8578063685d341b1461060857600080fd5b8063476a1ef8146105525780634f6ccce71461057257806355f804b31461059257600080fd5b806318160ddd1161030d57806326a55071116102e757806326a55071146104b55780632f745c59146104e25780633eee4d221461050257806342842e0e1461053257600080fd5b806318160ddd146104465780631ff7edab1461046557806323b872dd1461049557600080fd5b806301ffc9a71461035557806306fdde031461038a578063081812fc146103ac578063095ea7b3146103e4578063120b402f1461040657806316e0a20014610426575b600080fd5b34801561036157600080fd5b50610375610370366004612b9d565b610a7f565b60405190151581526020015b60405180910390f35b34801561039657600080fd5b5061039f610aaa565b6040516103819190612c0a565b3480156103b857600080fd5b506103cc6103c7366004612c1d565b610b3c565b6040516001600160a01b039091168152602001610381565b3480156103f057600080fd5b506104046103ff366004612c52565b610b65565b005b34801561041257600080fd5b50610404610421366004612c8d565b610b74565b34801561043257600080fd5b50610404610441366004612c1d565b610bb4565b34801561045257600080fd5b506008545b604051908152602001610381565b34801561047157600080fd5b50610375610480366004612ca8565b60196020526000908152604090205460ff1681565b3480156104a157600080fd5b506104046104b0366004612cc3565b610bc1565b3480156104c157600080fd5b506104576104d0366004612d0c565b601c6020526000908152604090205481565b3480156104ee57600080fd5b506104576104fd366004612c52565b610c4c565b34801561050e57600080fd5b5061037561051d366004612ca8565b601a6020526000908152604090205460ff1681565b34801561053e57600080fd5b5061040461054d366004612cc3565b610cb1565b34801561055e57600080fd5b5061040461056d366004612ca8565b610cd1565b34801561057e57600080fd5b5061045761058d366004612c1d565b610cfb565b34801561059e57600080fd5b506104046105ad366004612de0565b610d54565b3480156105be57600080fd5b506104046105cd366004612ca8565b610d68565b3480156105de57600080fd5b50610457600f5481565b3480156105f457600080fd5b506103cc610603366004612c1d565b610d92565b34801561061457600080fd5b5061064a610623366004612e15565b601160209081526000938452604080852082529284528284209052825290205461ffff1681565b60405161ffff9091168152602001610381565b34801561066957600080fd5b50610457610678366004612e5e565b610d9d565b34801561068957600080fd5b5061039f610dcf565b34801561069e57600080fd5b506104576106ad366004612ca8565b610e5d565b3480156106be57600080fd5b50610404610ea5565b3480156106d357600080fd5b5061045760125481565b3480156106e957600080fd5b50600b546103cc906001600160a01b031681565b34801561070957600080fd5b50610457611a0a81565b34801561071f57600080fd5b5061040461072e366004612ca8565b610eb9565b34801561073f57600080fd5b5061045761074e366004612d0c565b601b6020526000908152604090205481565b61040461076e366004612e9f565b610ee3565b34801561077f57600080fd5b50600a546001600160a01b03166103cc565b34801561079d57600080fd5b506104046107ac366004612f7a565b610efb565b3480156107bd57600080fd5b50600d546103cc906001600160a01b031681565b3480156107dd57600080fd5b50600c546103cc906001600160a01b031681565b3480156107fd57600080fd5b5061039f6112db565b34801561081257600080fd5b50610404610821366004612c1d565b6112ea565b34801561083257600080fd5b50610404610841366004612c1d565b6112f7565b34801561085257600080fd5b5061040461086136600461303f565b6113a0565b34801561087257600080fd5b5061087b6113ab565b604051610381919061308c565b34801561089457600080fd5b506104046108a3366004612ca8565b61145e565b6104046108b6366004612e9f565b611488565b3480156108c757600080fd5b506103756108d6366004612c1d565b60186020526000908152604090205460ff1681565b3480156108f757600080fd5b506104046109063660046130b4565b611493565b34801561091757600080fd5b5060135461064a9061ffff1681565b34801561093257600080fd5b5061040461094136600461311c565b6114aa565b34801561095257600080fd5b5061045760145481565b34801561096857600080fd5b506016546103cc906001600160a01b031681565b34801561098857600080fd5b5061039f610997366004612c1d565b6114ef565b3480156109a857600080fd5b506109bc6109b7366004612e15565b6115e7565b6040805161ffff9093168352602083019190915201610381565b6104046109e436600461313a565b6118ac565b3480156109f557600080fd5b50610404610a043660046131f0565b611b6d565b348015610a1557600080fd5b50610404610a24366004613299565b611c74565b348015610a3557600080fd5b50610375610a4436600461334f565b611d20565b348015610a5557600080fd5b50610404610a64366004612ca8565b611d4e565b348015610a7557600080fd5b5061045760155481565b60006001600160e01b0319821663780e9d6360e01b1480610aa45750610aa482611d89565b92915050565b606060008054610ab990613379565b80601f0160208091040260200160405190810160405280929190818152602001828054610ae590613379565b8015610b325780601f10610b0757610100808354040283529160200191610b32565b820191906000526020600020905b815481529060010190602001808311610b1557829003601f168201915b5050505050905090565b6000610b4782611dd9565b506000828152600460205260409020546001600160a01b0316610aa4565b610b70828232611e12565b5050565b600d546001600160a01b03163314610ba75760405162461bcd60e51b8152600401610b9e906133b3565b60405180910390fd5b610bb13282611e1f565b50565b610bbc611f93565b600f55565b6001600160a01b038216610beb57604051633250574960e11b815260006004820152602401610b9e565b6000610bf8838333611fc0565b9050836001600160a01b0316816001600160a01b031614610c46576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610b9e565b50505050565b6000610c5783610e5d565b8210610c885760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610b9e565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610ccc83838360405180602001604052806000815250611493565b505050565b610cd9611f93565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610d0660085490565b8210610d2f5760405163295f44f760e21b81526000600482015260248101839052604401610b9e565b60088281548110610d4257610d426133fc565b90600052602060002001549050919050565b610d5c611f93565b600e610b708282613460565b610d70611f93565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610aa482611dd9565b60106020528260005260406000206020528160005260406000208160038110610dc557600080fd5b0154925083915050565b600e8054610ddc90613379565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0890613379565b8015610e555780601f10610e2a57610100808354040283529160200191610e55565b820191906000526020600020905b815481529060010190602001808311610e3857829003601f168201915b505050505081565b60006001600160a01b038216610e89576040516322718ad960e21b815260006004820152602401610b9e565b506001600160a01b031660009081526003602052604090205490565b610ead611f93565b610eb76000612095565b565b610ec1611f93565b601680546001600160a01b0319166001600160a01b0392909216919091179055565b601654610b709083906001600160a01b0316836120e7565b33610f0586610d92565b6001600160a01b031614610f5b5760405162461bcd60e51b815260206004820152601c60248201527f596f7520617265206e6f742074686520746f6b656e204f776e657221000000006044820152606401610b9e565b60008581526018602052604090205460ff1615610fad5760405162461bcd60e51b815260206004820152601060248201526f43616e277420757064617465204f472160801b6044820152606401610b9e565b600082518451610fbd9190613536565b67ffffffffffffffff811115610fd557610fd5612d29565b604051908082528060200260200182016040528015610ffe578160200160208202803683370190505b5090506000805b855181101561107057858181518110611020576110206133fc565b6020026020010151838360ff168151811061103d5761103d6133fc565b61ffff909216602092830291909101909101528161105a81613549565b925050808061106890613568565b915050611005565b5060005b84518110156110df5784818151811061108f5761108f6133fc565b6020026020010151838360ff16815181106110ac576110ac6133fc565b61ffff90921660209283029190910190910152816110c981613549565b92505080806110d790613568565b915050611074565b50600b546001600160a01b03166371c61fe833886110fc8b6122d1565b60405160200161110d929190613581565b60405160208183030381529060405285876040518563ffffffff1660e01b815260040161113d94939291906135ef565b602060405180830381865afa15801561115a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117e9190613644565b6111be5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964205369676e617475726560781b6044820152606401610b9e565b600b54604051632091ea5f60e21b81523360048201526001600160a01b0390911690638247a97c90602401600060405180830381600087803b15801561120357600080fd5b505af1158015611217573d6000803e3d6000fd5b5050600c546040516357d2190560e11b81526001600160a01b03909116925063afa4320a915061124d9088908890600401613661565b600060405180830381600087803b15801561126757600080fd5b505af115801561127b573d6000803e3d6000fd5b505050600088815260176020526040902090506112988782613460565b507fa13c7319ba5bef599d5611d38d4f27f9538a61ec10d8d6d779d4a90209b713f187876040516112ca92919061368f565b60405180910390a150505050505050565b606060018054610ab990613379565b6112f2611f93565b601255565b6112ff611f93565b6001600052601b6020527f9fafca4c9c0d5c2cbf85f49fd8ab8212430ce78c2a0cb75b51e0f9c4f9ace00381905561133981611c20613536565b6002600052601b6020527f1dd2f4b94a51cfb409e6e317a497f7cfd9013960a1c723f830c49c05a25f08a55561137181613840613536565b6003600052601b6020527f804a3d0621e73505f5f0c57c922f3e57d6b48e175551184eb12f80d7b4a9c7835550565b610b70338383612364565b60016000908152601b6020527f9fafca4c9c0d5c2cbf85f49fd8ab8212430ce78c2a0cb75b51e0f9c4f9ace003544210156113e65750600090565b6002600052601b6020527f1dd2f4b94a51cfb409e6e317a497f7cfd9013960a1c723f830c49c05a25f08a55442101561141f5750600190565b6003600052601b6020527f804a3d0621e73505f5f0c57c922f3e57d6b48e175551184eb12f80d7b4a9c783544210156114585750600290565b50600390565b611466611f93565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b610b703383836120e7565b61149e848484610bc1565b610c4684848484612403565b6114b2611f93565b80601c60008460038111156114c9576114c9613076565b60038111156114da576114da613076565b81526020810191909152604001600020555050565b606060006114fc83610d92565b6001600160a01b0316036115495760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610b9e565b6000828152601760205260409020805461156290613379565b80601f016020809104026020016040519081016040528092919081815260200182805461158e90613379565b80156115db5780601f106115b0576101008083540402835291602001916115db565b820191906000526020600020905b8154815290600101906020018083116115be57829003601f168201915b50505050509050919050565b6001600160a01b0383166000908152601160205260408120819081908186600381111561161657611616613076565b600381111561162757611627613076565b8152602001908152602001600020600085600381111561164957611649613076565b600381111561165a5761165a613076565b815260208101919091526040016000205461ffff169050600185600381111561168557611685613076565b1480156116a3575060038460038111156116a1576116a1613076565b145b156116b55760008092509250506118a4565b60135461ffff908116908216101561175f576013546116d990829061ffff166136a8565b601060008760038111156116ef576116ef613076565b600381111561170057611700613076565b8152602001908152602001600020600086600381111561172257611722613076565b600381111561173357611733613076565b8152602001908152602001600020600060038110611753576117536133fc565b015492509250506118a4565b6013546117719061ffff1660026136ca565b61ffff168161ffff16101561180f5760135481906117949061ffff1660026136ca565b61179e91906136a8565b601060008760038111156117b4576117b4613076565b60038111156117c5576117c5613076565b815260200190815260200160002060008660038111156117e7576117e7613076565b60038111156117f8576117f8613076565b815260208101919091526040016000206001611753565b600385600381111561182357611823613076565b0361189b5760646010600087600381111561184057611840613076565b600381111561185157611851613076565b8152602001908152602001600020600086600381111561187357611873613076565b600381111561188457611884613076565b815260208101919091526040016000206002611753565b60008092509250505b935093915050565b60006118b66113ab565b905060008160038111156118cc576118cc613076565b0361190f5760405162461bcd60e51b815260206004820152601360248201527221b0b713ba1036b4b73a103337b9103737bb9760691b6044820152606401610b9e565b6040516bffffffffffffffffffffffff193360601b16602082015260009060340160405160208183030381529060405280519060200120905061198883601c600087600381111561196257611962613076565b600381111561197357611973613076565b8152602001908152602001600020548361252c565b6119c45760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210283937b7b360991b6044820152606401610b9e565b6000806119d23385886115e7565b915091508161ffff168761ffff161115611a2e5760405162461bcd60e51b815260206004820152601960248201527f45786365656420617661696c61626c6520616d6f756e74732e000000000000006044820152606401610b9e565b611a3c61ffff8816826136f0565b3414611a815760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e7420616d6f756e742160601b6044820152606401610b9e565b336000908152601a602052604090205460ff16611ab357336000908152601a60205260409020805460ff191660011790555b3360009081526011602052604081208891866003811115611ad657611ad6613076565b6003811115611ae757611ae7613076565b81526020019081526020016000206000886003811115611b0957611b09613076565b6003811115611b1a57611b1a613076565b8152602081019190915260400160009081208054909190611b4090849061ffff16613707565b92506101000a81548161ffff021916908361ffff160217905550611b643388611e1f565b50505050505050565b600d546001600160a01b03163314611b975760405162461bcd60e51b8152600401610b9e906133b3565b600160156000828254611baa9190613536565b92505081905550611bbd32601554612542565b6015546000908152601760205260409020611bd88282613460565b50611be16125a7565b326000908152601a602052604090205460ff16611c1357326000908152601a60205260409020805460ff191660011790555b6015805460009081526018602052604090819020805460ff19166001179055905490517feed395fde3485138737c2a1a567470a4d692b16aa2fec46a6f5d2de44b4b29b591611c689132919086908690613722565b60405180910390a15050565b611c7c611f93565b8051825114611cc65760405162461bcd60e51b8152602060048201526016602482015275496e76616c696420506172616d73204c656e6774682160501b6044820152606401610b9e565b60005b8251811015610ccc57611d0e838281518110611ce757611ce76133fc565b6020026020010151838381518110611d0157611d016133fc565b6020026020010151611e1f565b80611d1881613568565b915050611cc9565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b611d56611f93565b6001600160a01b038116611d8057604051631e4fbdf760e01b815260006004820152602401610b9e565b610bb181612095565b60006001600160e01b031982166380ac58cd60e01b1480611dba57506001600160e01b03198216635b5e139f60e01b145b80610aa457506301ffc9a760e01b6001600160e01b0319831614610aa4565b6000818152600260205260408120546001600160a01b031680610aa457604051637e27328960e01b815260048101849052602401610b9e565b610ccc83838360016125da565b611a0a8160ff16601454611e339190613536565b1115611e795760405162461bcd60e51b81526020600482015260156024820152745265616368206f7574206d6178206e756d6265722160581b6044820152606401610b9e565b600a546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015611eb2573d6000803e3d6000fd5b50611ebb6125a7565b60005b8160ff16811015610ccc57600160146000828254611edc9190613536565b92505081905550611eef83601454612542565b600e611efc6014546122d1565b604051602001611f0d929190613759565b60408051601f19818403018152918152601454600090815260176020522090611f369082613460565b506014546000818152601760205260409081902090517fa13c7319ba5bef599d5611d38d4f27f9538a61ec10d8d6d779d4a90209b713f192611f799290916137ff565b60405180910390a180611f8b81613568565b915050611ebe565b600a546001600160a01b03163314610eb75760405163118cdaa760e01b8152336004820152602401610b9e565b600080611fce8585856126e0565b90506001600160a01b03811661202b5761202684600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61204e565b846001600160a01b0316816001600160a01b03161461204e5761204e81856127d9565b6001600160a01b03851661206a576120658461286a565b61208d565b846001600160a01b0316816001600160a01b03161461208d5761208d8585612919565b949350505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6003600052601b6020527f804a3d0621e73505f5f0c57c922f3e57d6b48e175551184eb12f80d7b4a9c7835442116121615760405162461bcd60e51b815260206004820152601960248201527f43616e2774207075626963206d696e7420666f72206e6f7721000000000000006044820152606401610b9e565b8060ff16600f5461217291906136f0565b34146121c05760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f75676820616d6f756e7420666f72206d696e742100000000006044820152606401610b9e565b6001600160a01b03821660009081526019602052604090205460ff16806121f457506016546001600160a01b038381169116145b6122405760405162461bcd60e51b815260206004820152601960248201527f496e76616c696420726566657272616c206164647265737321000000000000006044820152606401610b9e565b6001600160a01b0383166000908152601a602052604090205460ff166122c7576001600160a01b038084166000908152601a60205260409020805460ff19166001179055601254908316906108fc9061229d9060ff8516906136f0565b6040518115909202916000818181858888f193505050501580156122c5573d6000803e3d6000fd5b505b610ccc8382611e1f565b606060006122de83612969565b600101905060008167ffffffffffffffff8111156122fe576122fe612d29565b6040519080825280601f01601f191660200182016040528015612328576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461233257509392505050565b6001600160a01b03821661239657604051630b61174360e31b81526001600160a01b0383166004820152602401610b9e565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c4657604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290612445903390889087908790600401613892565b6020604051808303816000875af1925050508015612480575060408051601f3d908101601f1916820190925261247d918101906138c5565b60015b6124e9573d8080156124ae576040519150601f19603f3d011682016040523d82523d6000602084013e6124b3565b606091505b5080516000036124e157604051633250574960e11b81526001600160a01b0385166004820152602401610b9e565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461252557604051633250574960e11b81526001600160a01b0385166004820152602401610b9e565b5050505050565b6000826125398584612a41565b14949350505050565b6001600160a01b03821661256c57604051633250574960e11b815260006004820152602401610b9e565b600061257a83836000611fc0565b90506001600160a01b03811615610ccc576040516339e3563760e11b815260006004820152602401610b9e565b3260009081526019602052604090205460ff16610eb757326000908152601960205260409020805460ff19166001179055565b80806125ee57506001600160a01b03821615155b156126b05760006125fe84611dd9565b90506001600160a01b0383161580159061262a5750826001600160a01b0316816001600160a01b031614155b801561263d575061263b8184611d20565b155b156126665760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610b9e565b81156126ae5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152600260205260408120546001600160a01b039081169083161561270d5761270d818486612a8e565b6001600160a01b0381161561274b5761272a6000856000806125da565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161561277a576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006127e483610e5d565b600083815260076020526040902054909150808214612837576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061287c906001906138e2565b600083815260096020526040812054600880549394509092849081106128a4576128a46133fc565b9060005260206000200154905080600883815481106128c5576128c56133fc565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806128fd576128fd6138f5565b6001900381819060005260206000200160009055905550505050565b6000600161292684610e5d565b61293091906138e2565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106129a85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106129d4576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106129f257662386f26fc10000830492506010015b6305f5e1008310612a0a576305f5e100830492506008015b6127108310612a1e57612710830492506004015b60648310612a30576064830492506002015b600a8310610aa45760010192915050565b600081815b8451811015612a8657612a7282868381518110612a6557612a656133fc565b6020026020010151612af2565b915080612a7e81613568565b915050612a46565b509392505050565b612a99838383612b24565b610ccc576001600160a01b038316612ac757604051637e27328960e01b815260048101829052602401610b9e565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610b9e565b6000818310612b0e576000828152602084905260409020612b1d565b60008381526020839052604090205b9392505050565b60006001600160a01b0383161580159061208d5750826001600160a01b0316846001600160a01b03161480612b5e5750612b5e8484611d20565b8061208d5750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b031981168114610bb157600080fd5b600060208284031215612baf57600080fd5b8135612b1d81612b87565b60005b83811015612bd5578181015183820152602001612bbd565b50506000910152565b60008151808452612bf6816020860160208601612bba565b601f01601f19169290920160200192915050565b602081526000612b1d6020830184612bde565b600060208284031215612c2f57600080fd5b5035919050565b80356001600160a01b0381168114612c4d57600080fd5b919050565b60008060408385031215612c6557600080fd5b612c6e83612c36565b946020939093013593505050565b803560ff81168114612c4d57600080fd5b600060208284031215612c9f57600080fd5b612b1d82612c7c565b600060208284031215612cba57600080fd5b612b1d82612c36565b600080600060608486031215612cd857600080fd5b612ce184612c36565b9250612cef60208501612c36565b9150604084013590509250925092565b60048110610bb157600080fd5b600060208284031215612d1e57600080fd5b8135612b1d81612cff565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612d6857612d68612d29565b604052919050565b600082601f830112612d8157600080fd5b813567ffffffffffffffff811115612d9b57612d9b612d29565b612dae601f8201601f1916602001612d3f565b818152846020838601011115612dc357600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215612df257600080fd5b813567ffffffffffffffff811115612e0957600080fd5b61208d84828501612d70565b600080600060608486031215612e2a57600080fd5b612e3384612c36565b92506020840135612e4381612cff565b91506040840135612e5381612cff565b809150509250925092565b600080600060608486031215612e7357600080fd5b8335612e7e81612cff565b92506020840135612e8e81612cff565b929592945050506040919091013590565b60008060408385031215612eb257600080fd5b612ebb83612c36565b9150612ec960208401612c7c565b90509250929050565b600067ffffffffffffffff821115612eec57612eec612d29565b5060051b60200190565b803561ffff81168114612c4d57600080fd5b600082601f830112612f1957600080fd5b81356020612f2e612f2983612ed2565b612d3f565b82815260059290921b84018101918181019086841115612f4d57600080fd5b8286015b84811015612f6f57612f6281612ef6565b8352918301918301612f51565b509695505050505050565b600080600080600060a08688031215612f9257600080fd5b85359450602086013567ffffffffffffffff80821115612fb157600080fd5b612fbd89838a01612d70565b95506040880135915080821115612fd357600080fd5b612fdf89838a01612f08565b94506060880135915080821115612ff557600080fd5b61300189838a01612f08565b9350608088013591508082111561301757600080fd5b5061302488828901612d70565b9150509295509295909350565b8015158114610bb157600080fd5b6000806040838503121561305257600080fd5b61305b83612c36565b9150602083013561306b81613031565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b60208101600483106130ae57634e487b7160e01b600052602160045260246000fd5b91905290565b600080600080608085870312156130ca57600080fd5b6130d385612c36565b93506130e160208601612c36565b925060408501359150606085013567ffffffffffffffff81111561310457600080fd5b61311087828801612d70565b91505092959194509250565b6000806040838503121561312f57600080fd5b8235612c6e81612cff565b60008060006060848603121561314f57600080fd5b61315884612ef6565b925060208085013561316981612cff565b9250604085013567ffffffffffffffff81111561318557600080fd5b8501601f8101871361319657600080fd5b80356131a4612f2982612ed2565b81815260059190911b820183019083810190898311156131c357600080fd5b928401925b828410156131e1578335825292840192908401906131c8565b80955050505050509250925092565b6000806040838503121561320357600080fd5b82359150602083013567ffffffffffffffff81111561322157600080fd5b61322d85828601612d70565b9150509250929050565b600082601f83011261324857600080fd5b81356020613258612f2983612ed2565b82815260059290921b8401810191818101908684111561327757600080fd5b8286015b84811015612f6f5761328c81612c7c565b835291830191830161327b565b600080604083850312156132ac57600080fd5b823567ffffffffffffffff808211156132c457600080fd5b818501915085601f8301126132d857600080fd5b813560206132e8612f2983612ed2565b82815260059290921b8401810191818101908984111561330757600080fd5b948201945b8386101561332c5761331d86612c36565b8252948201949082019061330c565b9650508601359250508082111561334257600080fd5b5061322d85828601613237565b6000806040838503121561336257600080fd5b61336b83612c36565b9150612ec960208401612c36565b600181811c9082168061338d57607f821691505b6020821081036133ad57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526029908201527f4f6e6c7920486f6f64794d6967726174652063616e2063616c6c207468697320604082015268333ab731ba34b7b71760b91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b601f821115610ccc57600081815260208120601f850160051c810160208610156134395750805b601f850160051c820191505b8181101561345857828155600101613445565b505050505050565b815167ffffffffffffffff81111561347a5761347a612d29565b61348e816134888454613379565b84613412565b602080601f8311600181146134c357600084156134ab5750858301515b600019600386901b1c1916600185901b178555613458565b600085815260208120601f198616915b828110156134f2578886015182559484019460019091019084016134d3565b50858210156135105787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b80820180821115610aa457610aa4613520565b600060ff821660ff810361355f5761355f613520565b60010192915050565b60006001820161357a5761357a613520565b5060010190565b60008351613593818460208801612bba565b8351908301906135a7818360208801612bba565b01949350505050565b600081518084526020808501945080840160005b838110156135e457815161ffff16875295820195908201906001016135c4565b509495945050505050565b6001600160a01b038516815260806020820181905260009061361390830186612bde565b828103604084015261362581866135b0565b905082810360608401526136398185612bde565b979650505050505050565b60006020828403121561365657600080fd5b8151612b1d81613031565b60408152600061367460408301856135b0565b828103602084015261368681856135b0565b95945050505050565b82815260406020820152600061208d6040830184612bde565b61ffff8281168282160390808211156136c3576136c3613520565b5092915050565b61ffff8181168382160280821691908281146136e8576136e8613520565b505092915050565b8082028115828204841417610aa457610aa4613520565b61ffff8181168382160190808211156136c3576136c3613520565b60018060a01b038516815283602082015282604082015260806060820152600061374f6080830184612bde565b9695505050505050565b600080845461376781613379565b6001828116801561377f5760018114613794576137c3565b60ff19841687528215158302870194506137c3565b8860005260208060002060005b858110156137ba5781548a8201529084019082016137a1565b50505082870194505b50602f60f81b8452865192506137df8382860160208a01612bba565b64173539b7b760d91b939092019182019290925260060195945050505050565b828152600060206040818401526000845461381981613379565b806040870152606060018084166000811461383b576001811461385557613883565b60ff1985168984015283151560051b890183019550613883565b896000528660002060005b8581101561387b5781548b8201860152908301908801613860565b8a0184019650505b50939998505050505050505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061374f90830184612bde565b6000602082840312156138d757600080fd5b8151612b1d81612b87565b81810381811115610aa457610aa4613520565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220cc428e0d50158f17641936a449ac38a7d7ba4958681c263bba12b1a18745588164736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000ffcb9e57d4000
-----Decoded View---------------
Arg [0] : _referReward (uint256): 4500000000000000
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000ffcb9e57d4000
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 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.