Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Latest 25 from a total of 377 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Claim Tokens | 15993124 | 1194 days ago | IN | 0 ETH | 0.00060521 | ||||
| Claim Tokens | 15993124 | 1194 days ago | IN | 0 ETH | 0.00180185 | ||||
| Claim Tokens | 15765414 | 1225 days ago | IN | 0 ETH | 0.00144706 | ||||
| Claim Tokens | 15448273 | 1272 days ago | IN | 0 ETH | 0.00237395 | ||||
| Claim Tokens | 15430548 | 1275 days ago | IN | 0 ETH | 0.00089307 | ||||
| Claim Tokens | 15248651 | 1303 days ago | IN | 0 ETH | 0.00030103 | ||||
| Claim Tokens | 15248651 | 1303 days ago | IN | 0 ETH | 0.00018688 | ||||
| Claim Tokens | 15213078 | 1309 days ago | IN | 0 ETH | 0.00101665 | ||||
| Claim Tokens | 15213076 | 1309 days ago | IN | 0 ETH | 0.00369034 | ||||
| Claim Tokens | 15206225 | 1310 days ago | IN | 0 ETH | 0.00063739 | ||||
| Claim Tokens | 14970296 | 1349 days ago | IN | 0 ETH | 0.00532378 | ||||
| Claim Tokens | 14890595 | 1362 days ago | IN | 0 ETH | 0.00172702 | ||||
| Claim Tokens | 14890589 | 1362 days ago | IN | 0 ETH | 0.00549873 | ||||
| Claim Tokens | 14858294 | 1367 days ago | IN | 0 ETH | 0.00150702 | ||||
| Claim Tokens | 14847475 | 1369 days ago | IN | 0 ETH | 0.00115416 | ||||
| Claim Tokens | 14786350 | 1379 days ago | IN | 0 ETH | 0.00282728 | ||||
| Claim Tokens | 14782131 | 1380 days ago | IN | 0 ETH | 0.00306694 | ||||
| Claim Tokens | 14781315 | 1380 days ago | IN | 0 ETH | 0.00212479 | ||||
| Claim Tokens | 14770768 | 1382 days ago | IN | 0 ETH | 0.00155667 | ||||
| Claim Tokens | 14770767 | 1382 days ago | IN | 0 ETH | 0.0043133 | ||||
| Claim Tokens | 14747924 | 1385 days ago | IN | 0 ETH | 0.00393938 | ||||
| Claim Tokens | 14734906 | 1387 days ago | IN | 0 ETH | 0.00359038 | ||||
| Claim Tokens | 14714679 | 1391 days ago | IN | 0 ETH | 0.006134 | ||||
| Claim Tokens | 14707618 | 1392 days ago | IN | 0 ETH | 0.00540665 | ||||
| Claim Tokens | 14707166 | 1392 days ago | IN | 0 ETH | 0.00627652 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ClaimFashion
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
contract ClaimFashion is Ownable, Pausable {
using SafeERC20 for IERC20;
IERC20 public immutable fashionToken;
ERC721Enumerable public immutable fashionApe;
uint256 public immutable DISTRIBUTION_AMOUNT;
uint256 public totalClaimed;
mapping (uint256 => bool) public fashionClaimed;
event FashionClaimed(
uint256 indexed tokenId,
address indexed account,
uint256 timestamp
);
event AirDrop(
address indexed account,
uint256 indexed amount,
uint256 timestamp
);
constructor(
address _fashionTokenAddress,
address _fashionApeContractAddress,
uint256 _DISTRIBUTION_AMOUNT
) {
require(_fashionTokenAddress != address(0), "The Fashion token address can't be 0");
require(_fashionApeContractAddress != address(0), "The Fashion Ape contract address can't be 0");
fashionToken = IERC20(_fashionTokenAddress);
fashionApe = ERC721Enumerable(_fashionApeContractAddress);
DISTRIBUTION_AMOUNT = _DISTRIBUTION_AMOUNT;
_pause();
}
function pause() public onlyOwner {
_pause();
}
function unpause() public onlyOwner {
_unpause();
}
function claimTokens() external whenNotPaused {
require(fashionApe.balanceOf(msg.sender) > 0, "Nothing to claim no fashion ape in wallet");
require(getClaimableTokenAmount(msg.sender) > 0, "Nothing to claim");
uint256 tokensToClaim;
tokensToClaim = _getClaimableTokenAmount(msg.sender);
for(uint256 i; i < fashionApe.balanceOf(msg.sender); ++i) {
uint256 tokenId = fashionApe.tokenOfOwnerByIndex(msg.sender, i);
if(!fashionClaimed[tokenId]) {
fashionClaimed[tokenId] = true;
emit FashionClaimed(tokenId, msg.sender, block.timestamp);
}
}
fashionToken.safeTransfer(msg.sender, tokensToClaim);
totalClaimed += tokensToClaim;
emit AirDrop(msg.sender, tokensToClaim, block.timestamp);
}
function getClaimableTokenAmount(address _account) public view returns (uint256) {
uint256 tokensAmount;
(tokensAmount) = _getClaimableTokenAmount(_account);
return tokensAmount;
}
function _getClaimableTokenAmount(address _account) private view returns (uint256)
{
uint256 unclaimedBalance;
for(uint256 i; i < fashionApe.balanceOf(_account); ++i) {
uint256 tokenId = fashionApe.tokenOfOwnerByIndex(_account, i);
if(!fashionClaimed[tokenId]) {
++unclaimedBalance;
}
}
uint256 tokensAmount = (unclaimedBalance * DISTRIBUTION_AMOUNT);
return tokensAmount;
}
function claimUnclaimedTokens() external onlyOwner {
fashionToken.safeTransfer(owner(), fashionToken.balanceOf(address(this)));
uint256 balance = address(this).balance;
if (balance > 0) {
Address.sendValue(payable(owner()), balance);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "./IERC721Enumerable.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.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @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 override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @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 = ERC721.balanceOf(to);
_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 = ERC721.balanceOf(from) - 1;
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();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.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}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => 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 override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(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 overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @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.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - 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,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* 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 virtual {
_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);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @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 virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), 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 virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* 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
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../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 v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @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 `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../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 v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_fashionTokenAddress","type":"address"},{"internalType":"address","name":"_fashionApeContractAddress","type":"address"},{"internalType":"uint256","name":"_DISTRIBUTION_AMOUNT","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"AirDrop","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"FashionClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DISTRIBUTION_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimUnclaimedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fashionApe","outputs":[{"internalType":"contract ERC721Enumerable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"fashionClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fashionToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getClaimableTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60e06040523480156200001157600080fd5b506040516200251c3803806200251c83398181016040528101906200003791906200041f565b620000576200004b620001e060201b60201c565b620001e860201b60201c565b60008060146101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415620000e4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000db9062000502565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000157576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200014e906200059a565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250508060c08181525050620001d7620002ac60201b60201c565b5050506200065c565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b620002bc6200036460201b60201c565b15620002ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002f6906200060c565b60405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586200034b620001e060201b60201c565b6040516200035a91906200063f565b60405180910390a1565b60008060149054906101000a900460ff16905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003ac826200037f565b9050919050565b620003be816200039f565b8114620003ca57600080fd5b50565b600081519050620003de81620003b3565b92915050565b6000819050919050565b620003f981620003e4565b81146200040557600080fd5b50565b6000815190506200041981620003ee565b92915050565b6000806000606084860312156200043b576200043a6200037a565b5b60006200044b86828701620003cd565b93505060206200045e86828701620003cd565b9250506040620004718682870162000408565b9150509250925092565b600082825260208201905092915050565b7f5468652046617368696f6e20746f6b656e20616464726573732063616e27742060008201527f6265203000000000000000000000000000000000000000000000000000000000602082015250565b6000620004ea6024836200047b565b9150620004f7826200048c565b604082019050919050565b600060208201905081810360008301526200051d81620004db565b9050919050565b7f5468652046617368696f6e2041706520636f6e7472616374206164647265737360008201527f2063616e27742062652030000000000000000000000000000000000000000000602082015250565b600062000582602b836200047b565b91506200058f8262000524565b604082019050919050565b60006020820190508181036000830152620005b58162000573565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000620005f46010836200047b565b91506200060182620005bc565b602082019050919050565b600060208201905081810360008301526200062781620005e5565b9050919050565b62000639816200039f565b82525050565b60006020820190506200065660008301846200062e565b92915050565b60805160a05160c051611e51620006cb60003960008181610b570152610d0901526000818161033a0152818161046f01528181610512015281816109ec01528181610b810152610c24015260008181610669015281816107b8015281816108e901526109830152611e516000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806388c5db271161008c578063b571ce2411610066578063b571ce24146101c9578063d54ad2a1146101f9578063f2fde38b14610217578063ff8f164f14610233576100ea565b806388c5db27146101835780638b0453ec1461018d5780638da5cb5b146101ab576100ea565b80635c975abb116100c85780635c975abb14610133578063715018a6146101515780637505e2991461015b5780638456cb5914610179576100ea565b80633a6afc25146100ef5780633f4ba83a1461011f57806348c54b9d14610129575b600080fd5b610109600480360381019061010491906113a9565b610251565b60405161011691906113ef565b60405180910390f35b610127610268565b005b6101316102ee565b005b61013b610718565b6040516101489190611425565b60405180910390f35b61015961072e565b005b6101636107b6565b604051610170919061149f565b60405180910390f35b6101816107da565b005b61018b610860565b005b6101956109ea565b6040516101a291906114db565b60405180910390f35b6101b3610a0e565b6040516101c09190611505565b60405180910390f35b6101e360048036038101906101de919061154c565b610a37565b6040516101f09190611425565b60405180910390f35b610201610a57565b60405161020e91906113ef565b60405180910390f35b610231600480360381019061022c91906113a9565b610a5d565b005b61023b610b55565b60405161024891906113ef565b60405180910390f35b60008061025d83610b79565b905080915050919050565b610270610d3f565b73ffffffffffffffffffffffffffffffffffffffff1661028e610a0e565b73ffffffffffffffffffffffffffffffffffffffff16146102e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102db906115d6565b60405180910390fd5b6102ec610d47565b565b6102f6610718565b15610336576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032d90611642565b60405180910390fd5b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016103919190611505565b602060405180830381865afa1580156103ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d29190611677565b11610412576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040990611716565b60405180910390fd5b600061041d33610251565b1161045d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045490611782565b60405180910390fd5b600061046833610b79565b905060005b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016104c69190611505565b602060405180830381865afa1580156104e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105079190611677565b8110156106615760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632f745c5933846040518363ffffffff1660e01b815260040161056b9291906117a2565b602060405180830381865afa158015610588573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ac9190611677565b90506002600082815260200190815260200160002060009054906101000a900460ff1661064f5760016002600083815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff16817f9d7081abb42b57bf98e43a86b9ee83efeb1a1e6d0d47ba64030bbdc4395a62d44260405161064691906113ef565b60405180910390a35b508061065a906117fa565b905061046d565b506106ad33827f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610de89092919063ffffffff16565b80600160008282546106bf9190611843565b92505081905550803373ffffffffffffffffffffffffffffffffffffffff167fc804beabd6deef69632486188d3b1a0fc6837d20bf348393884d368fa5bf10cd4260405161070d91906113ef565b60405180910390a350565b60008060149054906101000a900460ff16905090565b610736610d3f565b73ffffffffffffffffffffffffffffffffffffffff16610754610a0e565b73ffffffffffffffffffffffffffffffffffffffff16146107aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a1906115d6565b60405180910390fd5b6107b46000610e6e565b565b7f000000000000000000000000000000000000000000000000000000000000000081565b6107e2610d3f565b73ffffffffffffffffffffffffffffffffffffffff16610800610a0e565b73ffffffffffffffffffffffffffffffffffffffff1614610856576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084d906115d6565b60405180910390fd5b61085e610f32565b565b610868610d3f565b73ffffffffffffffffffffffffffffffffffffffff16610886610a0e565b73ffffffffffffffffffffffffffffffffffffffff16146108dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d3906115d6565b60405180910390fd5b6109c76108e7610a0e565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109409190611505565b602060405180830381865afa15801561095d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109819190611677565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610de89092919063ffffffff16565b600047905060008111156109e7576109e66109e0610a0e565b82610fd5565b5b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60026020528060005260406000206000915054906101000a900460ff1681565b60015481565b610a65610d3f565b73ffffffffffffffffffffffffffffffffffffffff16610a83610a0e565b73ffffffffffffffffffffffffffffffffffffffff1614610ad9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad0906115d6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b409061190b565b60405180910390fd5b610b5281610e6e565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008060005b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401610bd89190611505565b602060405180830381865afa158015610bf5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c199190611677565b811015610d045760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632f745c5986846040518363ffffffff1660e01b8152600401610c7d9291906117a2565b602060405180830381865afa158015610c9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbe9190611677565b90506002600082815260200190815260200160002060009054906101000a900460ff16610cf25782610cef906117fa565b92505b5080610cfd906117fa565b9050610b7f565b5060007f000000000000000000000000000000000000000000000000000000000000000082610d33919061192b565b90508092505050919050565b600033905090565b610d4f610718565b610d8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d85906119d1565b60405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610dd1610d3f565b604051610dde9190611505565b60405180910390a1565b610e698363a9059cbb60e01b8484604051602401610e079291906117a2565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506110c9565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b610f3a610718565b15610f7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7190611642565b60405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610fbe610d3f565b604051610fcb9190611505565b60405180910390a1565b80471015611018576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100f90611a3d565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405161103e90611a8e565b60006040518083038185875af1925050503d806000811461107b576040519150601f19603f3d011682016040523d82523d6000602084013e611080565b606091505b50509050806110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bb90611b15565b60405180910390fd5b505050565b600061112b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166111909092919063ffffffff16565b905060008151111561118b578080602001905181019061114b9190611b61565b61118a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118190611c00565b60405180910390fd5b5b505050565b606061119f84846000856111a8565b90509392505050565b6060824710156111ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e490611c92565b60405180910390fd5b6111f6856112bc565b611235576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122c90611cfe565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161125e9190611d8d565b60006040518083038185875af1925050503d806000811461129b576040519150601f19603f3d011682016040523d82523d6000602084013e6112a0565b606091505b50915091506112b08282866112df565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b606083156112ef5782905061133f565b6000835111156113025782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113369190611df9565b60405180910390fd5b9392505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113768261134b565b9050919050565b6113868161136b565b811461139157600080fd5b50565b6000813590506113a38161137d565b92915050565b6000602082840312156113bf576113be611346565b5b60006113cd84828501611394565b91505092915050565b6000819050919050565b6113e9816113d6565b82525050565b600060208201905061140460008301846113e0565b92915050565b60008115159050919050565b61141f8161140a565b82525050565b600060208201905061143a6000830184611416565b92915050565b6000819050919050565b600061146561146061145b8461134b565b611440565b61134b565b9050919050565b60006114778261144a565b9050919050565b60006114898261146c565b9050919050565b6114998161147e565b82525050565b60006020820190506114b46000830184611490565b92915050565b60006114c58261146c565b9050919050565b6114d5816114ba565b82525050565b60006020820190506114f060008301846114cc565b92915050565b6114ff8161136b565b82525050565b600060208201905061151a60008301846114f6565b92915050565b611529816113d6565b811461153457600080fd5b50565b60008135905061154681611520565b92915050565b60006020828403121561156257611561611346565b5b600061157084828501611537565b91505092915050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006115c0602083611579565b91506115cb8261158a565b602082019050919050565b600060208201905081810360008301526115ef816115b3565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b600061162c601083611579565b9150611637826115f6565b602082019050919050565b6000602082019050818103600083015261165b8161161f565b9050919050565b60008151905061167181611520565b92915050565b60006020828403121561168d5761168c611346565b5b600061169b84828501611662565b91505092915050565b7f4e6f7468696e6720746f20636c61696d206e6f2066617368696f6e206170652060008201527f696e2077616c6c65740000000000000000000000000000000000000000000000602082015250565b6000611700602983611579565b915061170b826116a4565b604082019050919050565b6000602082019050818103600083015261172f816116f3565b9050919050565b7f4e6f7468696e6720746f20636c61696d00000000000000000000000000000000600082015250565b600061176c601083611579565b915061177782611736565b602082019050919050565b6000602082019050818103600083015261179b8161175f565b9050919050565b60006040820190506117b760008301856114f6565b6117c460208301846113e0565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611805826113d6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611838576118376117cb565b5b600182019050919050565b600061184e826113d6565b9150611859836113d6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561188e5761188d6117cb565b5b828201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006118f5602683611579565b915061190082611899565b604082019050919050565b60006020820190508181036000830152611924816118e8565b9050919050565b6000611936826113d6565b9150611941836113d6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561197a576119796117cb565b5b828202905092915050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b60006119bb601483611579565b91506119c682611985565b602082019050919050565b600060208201905081810360008301526119ea816119ae565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e6365000000600082015250565b6000611a27601d83611579565b9150611a32826119f1565b602082019050919050565b60006020820190508181036000830152611a5681611a1a565b9050919050565b600081905092915050565b50565b6000611a78600083611a5d565b9150611a8382611a68565b600082019050919050565b6000611a9982611a6b565b9150819050919050565b7f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008201527f6563697069656e74206d61792068617665207265766572746564000000000000602082015250565b6000611aff603a83611579565b9150611b0a82611aa3565b604082019050919050565b60006020820190508181036000830152611b2e81611af2565b9050919050565b611b3e8161140a565b8114611b4957600080fd5b50565b600081519050611b5b81611b35565b92915050565b600060208284031215611b7757611b76611346565b5b6000611b8584828501611b4c565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000611bea602a83611579565b9150611bf582611b8e565b604082019050919050565b60006020820190508181036000830152611c1981611bdd565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000611c7c602683611579565b9150611c8782611c20565b604082019050919050565b60006020820190508181036000830152611cab81611c6f565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000611ce8601d83611579565b9150611cf382611cb2565b602082019050919050565b60006020820190508181036000830152611d1781611cdb565b9050919050565b600081519050919050565b60005b83811015611d47578082015181840152602081019050611d2c565b83811115611d56576000848401525b50505050565b6000611d6782611d1e565b611d718185611a5d565b9350611d81818560208601611d29565b80840191505092915050565b6000611d998284611d5c565b915081905092915050565b600081519050919050565b6000601f19601f8301169050919050565b6000611dcb82611da4565b611dd58185611579565b9350611de5818560208601611d29565b611dee81611daf565b840191505092915050565b60006020820190508181036000830152611e138184611dc0565b90509291505056fea26469706673582212203538b0bebdeb927f599b754480a3d937d3f57055e2307debbc587b5d4ec875f864736f6c634300080a0033000000000000000000000000290d627185b51e4a7fec5a937347940bc799a4160000000000000000000000006d200bb6e0d75daf29992b9ec25d61fa0d99cc9200000000000000000000000000000000000000000000003635c9adc5dea00000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806388c5db271161008c578063b571ce2411610066578063b571ce24146101c9578063d54ad2a1146101f9578063f2fde38b14610217578063ff8f164f14610233576100ea565b806388c5db27146101835780638b0453ec1461018d5780638da5cb5b146101ab576100ea565b80635c975abb116100c85780635c975abb14610133578063715018a6146101515780637505e2991461015b5780638456cb5914610179576100ea565b80633a6afc25146100ef5780633f4ba83a1461011f57806348c54b9d14610129575b600080fd5b610109600480360381019061010491906113a9565b610251565b60405161011691906113ef565b60405180910390f35b610127610268565b005b6101316102ee565b005b61013b610718565b6040516101489190611425565b60405180910390f35b61015961072e565b005b6101636107b6565b604051610170919061149f565b60405180910390f35b6101816107da565b005b61018b610860565b005b6101956109ea565b6040516101a291906114db565b60405180910390f35b6101b3610a0e565b6040516101c09190611505565b60405180910390f35b6101e360048036038101906101de919061154c565b610a37565b6040516101f09190611425565b60405180910390f35b610201610a57565b60405161020e91906113ef565b60405180910390f35b610231600480360381019061022c91906113a9565b610a5d565b005b61023b610b55565b60405161024891906113ef565b60405180910390f35b60008061025d83610b79565b905080915050919050565b610270610d3f565b73ffffffffffffffffffffffffffffffffffffffff1661028e610a0e565b73ffffffffffffffffffffffffffffffffffffffff16146102e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102db906115d6565b60405180910390fd5b6102ec610d47565b565b6102f6610718565b15610336576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032d90611642565b60405180910390fd5b60007f0000000000000000000000006d200bb6e0d75daf29992b9ec25d61fa0d99cc9273ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016103919190611505565b602060405180830381865afa1580156103ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103d29190611677565b11610412576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040990611716565b60405180910390fd5b600061041d33610251565b1161045d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045490611782565b60405180910390fd5b600061046833610b79565b905060005b7f0000000000000000000000006d200bb6e0d75daf29992b9ec25d61fa0d99cc9273ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016104c69190611505565b602060405180830381865afa1580156104e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105079190611677565b8110156106615760007f0000000000000000000000006d200bb6e0d75daf29992b9ec25d61fa0d99cc9273ffffffffffffffffffffffffffffffffffffffff16632f745c5933846040518363ffffffff1660e01b815260040161056b9291906117a2565b602060405180830381865afa158015610588573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ac9190611677565b90506002600082815260200190815260200160002060009054906101000a900460ff1661064f5760016002600083815260200190815260200160002060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff16817f9d7081abb42b57bf98e43a86b9ee83efeb1a1e6d0d47ba64030bbdc4395a62d44260405161064691906113ef565b60405180910390a35b508061065a906117fa565b905061046d565b506106ad33827f000000000000000000000000290d627185b51e4a7fec5a937347940bc799a41673ffffffffffffffffffffffffffffffffffffffff16610de89092919063ffffffff16565b80600160008282546106bf9190611843565b92505081905550803373ffffffffffffffffffffffffffffffffffffffff167fc804beabd6deef69632486188d3b1a0fc6837d20bf348393884d368fa5bf10cd4260405161070d91906113ef565b60405180910390a350565b60008060149054906101000a900460ff16905090565b610736610d3f565b73ffffffffffffffffffffffffffffffffffffffff16610754610a0e565b73ffffffffffffffffffffffffffffffffffffffff16146107aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a1906115d6565b60405180910390fd5b6107b46000610e6e565b565b7f000000000000000000000000290d627185b51e4a7fec5a937347940bc799a41681565b6107e2610d3f565b73ffffffffffffffffffffffffffffffffffffffff16610800610a0e565b73ffffffffffffffffffffffffffffffffffffffff1614610856576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084d906115d6565b60405180910390fd5b61085e610f32565b565b610868610d3f565b73ffffffffffffffffffffffffffffffffffffffff16610886610a0e565b73ffffffffffffffffffffffffffffffffffffffff16146108dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d3906115d6565b60405180910390fd5b6109c76108e7610a0e565b7f000000000000000000000000290d627185b51e4a7fec5a937347940bc799a41673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109409190611505565b602060405180830381865afa15801561095d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109819190611677565b7f000000000000000000000000290d627185b51e4a7fec5a937347940bc799a41673ffffffffffffffffffffffffffffffffffffffff16610de89092919063ffffffff16565b600047905060008111156109e7576109e66109e0610a0e565b82610fd5565b5b50565b7f0000000000000000000000006d200bb6e0d75daf29992b9ec25d61fa0d99cc9281565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60026020528060005260406000206000915054906101000a900460ff1681565b60015481565b610a65610d3f565b73ffffffffffffffffffffffffffffffffffffffff16610a83610a0e565b73ffffffffffffffffffffffffffffffffffffffff1614610ad9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad0906115d6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b409061190b565b60405180910390fd5b610b5281610e6e565b50565b7f00000000000000000000000000000000000000000000003635c9adc5dea0000081565b60008060005b7f0000000000000000000000006d200bb6e0d75daf29992b9ec25d61fa0d99cc9273ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401610bd89190611505565b602060405180830381865afa158015610bf5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c199190611677565b811015610d045760007f0000000000000000000000006d200bb6e0d75daf29992b9ec25d61fa0d99cc9273ffffffffffffffffffffffffffffffffffffffff16632f745c5986846040518363ffffffff1660e01b8152600401610c7d9291906117a2565b602060405180830381865afa158015610c9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbe9190611677565b90506002600082815260200190815260200160002060009054906101000a900460ff16610cf25782610cef906117fa565b92505b5080610cfd906117fa565b9050610b7f565b5060007f00000000000000000000000000000000000000000000003635c9adc5dea0000082610d33919061192b565b90508092505050919050565b600033905090565b610d4f610718565b610d8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d85906119d1565b60405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610dd1610d3f565b604051610dde9190611505565b60405180910390a1565b610e698363a9059cbb60e01b8484604051602401610e079291906117a2565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506110c9565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b610f3a610718565b15610f7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7190611642565b60405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610fbe610d3f565b604051610fcb9190611505565b60405180910390a1565b80471015611018576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100f90611a3d565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405161103e90611a8e565b60006040518083038185875af1925050503d806000811461107b576040519150601f19603f3d011682016040523d82523d6000602084013e611080565b606091505b50509050806110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bb90611b15565b60405180910390fd5b505050565b600061112b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166111909092919063ffffffff16565b905060008151111561118b578080602001905181019061114b9190611b61565b61118a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118190611c00565b60405180910390fd5b5b505050565b606061119f84846000856111a8565b90509392505050565b6060824710156111ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e490611c92565b60405180910390fd5b6111f6856112bc565b611235576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122c90611cfe565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161125e9190611d8d565b60006040518083038185875af1925050503d806000811461129b576040519150601f19603f3d011682016040523d82523d6000602084013e6112a0565b606091505b50915091506112b08282866112df565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b606083156112ef5782905061133f565b6000835111156113025782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113369190611df9565b60405180910390fd5b9392505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113768261134b565b9050919050565b6113868161136b565b811461139157600080fd5b50565b6000813590506113a38161137d565b92915050565b6000602082840312156113bf576113be611346565b5b60006113cd84828501611394565b91505092915050565b6000819050919050565b6113e9816113d6565b82525050565b600060208201905061140460008301846113e0565b92915050565b60008115159050919050565b61141f8161140a565b82525050565b600060208201905061143a6000830184611416565b92915050565b6000819050919050565b600061146561146061145b8461134b565b611440565b61134b565b9050919050565b60006114778261144a565b9050919050565b60006114898261146c565b9050919050565b6114998161147e565b82525050565b60006020820190506114b46000830184611490565b92915050565b60006114c58261146c565b9050919050565b6114d5816114ba565b82525050565b60006020820190506114f060008301846114cc565b92915050565b6114ff8161136b565b82525050565b600060208201905061151a60008301846114f6565b92915050565b611529816113d6565b811461153457600080fd5b50565b60008135905061154681611520565b92915050565b60006020828403121561156257611561611346565b5b600061157084828501611537565b91505092915050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006115c0602083611579565b91506115cb8261158a565b602082019050919050565b600060208201905081810360008301526115ef816115b3565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b600061162c601083611579565b9150611637826115f6565b602082019050919050565b6000602082019050818103600083015261165b8161161f565b9050919050565b60008151905061167181611520565b92915050565b60006020828403121561168d5761168c611346565b5b600061169b84828501611662565b91505092915050565b7f4e6f7468696e6720746f20636c61696d206e6f2066617368696f6e206170652060008201527f696e2077616c6c65740000000000000000000000000000000000000000000000602082015250565b6000611700602983611579565b915061170b826116a4565b604082019050919050565b6000602082019050818103600083015261172f816116f3565b9050919050565b7f4e6f7468696e6720746f20636c61696d00000000000000000000000000000000600082015250565b600061176c601083611579565b915061177782611736565b602082019050919050565b6000602082019050818103600083015261179b8161175f565b9050919050565b60006040820190506117b760008301856114f6565b6117c460208301846113e0565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611805826113d6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611838576118376117cb565b5b600182019050919050565b600061184e826113d6565b9150611859836113d6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561188e5761188d6117cb565b5b828201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006118f5602683611579565b915061190082611899565b604082019050919050565b60006020820190508181036000830152611924816118e8565b9050919050565b6000611936826113d6565b9150611941836113d6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561197a576119796117cb565b5b828202905092915050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b60006119bb601483611579565b91506119c682611985565b602082019050919050565b600060208201905081810360008301526119ea816119ae565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e6365000000600082015250565b6000611a27601d83611579565b9150611a32826119f1565b602082019050919050565b60006020820190508181036000830152611a5681611a1a565b9050919050565b600081905092915050565b50565b6000611a78600083611a5d565b9150611a8382611a68565b600082019050919050565b6000611a9982611a6b565b9150819050919050565b7f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008201527f6563697069656e74206d61792068617665207265766572746564000000000000602082015250565b6000611aff603a83611579565b9150611b0a82611aa3565b604082019050919050565b60006020820190508181036000830152611b2e81611af2565b9050919050565b611b3e8161140a565b8114611b4957600080fd5b50565b600081519050611b5b81611b35565b92915050565b600060208284031215611b7757611b76611346565b5b6000611b8584828501611b4c565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000611bea602a83611579565b9150611bf582611b8e565b604082019050919050565b60006020820190508181036000830152611c1981611bdd565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000611c7c602683611579565b9150611c8782611c20565b604082019050919050565b60006020820190508181036000830152611cab81611c6f565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000611ce8601d83611579565b9150611cf382611cb2565b602082019050919050565b60006020820190508181036000830152611d1781611cdb565b9050919050565b600081519050919050565b60005b83811015611d47578082015181840152602081019050611d2c565b83811115611d56576000848401525b50505050565b6000611d6782611d1e565b611d718185611a5d565b9350611d81818560208601611d29565b80840191505092915050565b6000611d998284611d5c565b915081905092915050565b600081519050919050565b6000601f19601f8301169050919050565b6000611dcb82611da4565b611dd58185611579565b9350611de5818560208601611d29565b611dee81611daf565b840191505092915050565b60006020820190508181036000830152611e138184611dc0565b90509291505056fea26469706673582212203538b0bebdeb927f599b754480a3d937d3f57055e2307debbc587b5d4ec875f864736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000290d627185b51e4a7fec5a937347940bc799a4160000000000000000000000006d200bb6e0d75daf29992b9ec25d61fa0d99cc9200000000000000000000000000000000000000000000003635c9adc5dea00000
-----Decoded View---------------
Arg [0] : _fashionTokenAddress (address): 0x290D627185b51E4A7fEc5A937347940Bc799a416
Arg [1] : _fashionApeContractAddress (address): 0x6d200bb6E0d75daF29992b9Ec25D61Fa0d99cc92
Arg [2] : _DISTRIBUTION_AMOUNT (uint256): 1000000000000000000000
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000290d627185b51e4a7fec5a937347940bc799a416
Arg [1] : 0000000000000000000000006d200bb6e0d75daf29992b9ec25d61fa0d99cc92
Arg [2] : 00000000000000000000000000000000000000000000003635c9adc5dea00000
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
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.