Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,252 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 15637553 | 656 days ago | IN | 0 ETH | 0.00033368 | ||||
Claim | 15627641 | 658 days ago | IN | 0 ETH | 0.00087641 | ||||
Claim | 15623662 | 658 days ago | IN | 0 ETH | 0.0008759 | ||||
Claim | 15619371 | 659 days ago | IN | 0 ETH | 0.00114756 | ||||
Claim | 15619369 | 659 days ago | IN | 0 ETH | 0.00112547 | ||||
Claim | 15609748 | 660 days ago | IN | 0 ETH | 0.00032773 | ||||
Claim | 15604160 | 661 days ago | IN | 0 ETH | 0.00059128 | ||||
Claim | 15599240 | 662 days ago | IN | 0 ETH | 0.00038177 | ||||
Claim | 15599237 | 662 days ago | IN | 0 ETH | 0.00039571 | ||||
Claim | 15595466 | 662 days ago | IN | 0 ETH | 0.0004828 | ||||
Claim | 15595466 | 662 days ago | IN | 0 ETH | 0.0004828 | ||||
Claim | 15590147 | 663 days ago | IN | 0 ETH | 0.00067095 | ||||
Claim | 15590143 | 663 days ago | IN | 0 ETH | 0.00072218 | ||||
Claim | 15590139 | 663 days ago | IN | 0 ETH | 0.0006632 | ||||
Claim | 15588623 | 663 days ago | IN | 0 ETH | 0.00043501 | ||||
Claim | 15587887 | 663 days ago | IN | 0 ETH | 0.00036278 | ||||
Claim | 15576699 | 665 days ago | IN | 0 ETH | 0.00052871 | ||||
Claim | 15570110 | 666 days ago | IN | 0 ETH | 0.00060884 | ||||
Claim | 15570109 | 666 days ago | IN | 0 ETH | 0.00087638 | ||||
Claim | 15570109 | 666 days ago | IN | 0 ETH | 0.00087638 | ||||
Claim | 15570108 | 666 days ago | IN | 0 ETH | 0.00083203 | ||||
Claim | 15570108 | 666 days ago | IN | 0 ETH | 0.00083203 | ||||
Claim | 15570106 | 666 days ago | IN | 0 ETH | 0.00066776 | ||||
Claim | 15570105 | 666 days ago | IN | 0 ETH | 0.00098231 | ||||
Claim | 15570104 | 666 days ago | IN | 0 ETH | 0.00096652 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
15637553 | 656 days ago | 24.49255202 ETH | ||||
15627641 | 658 days ago | 0.0371603 ETH | ||||
15623662 | 658 days ago | 0.0130511 ETH | ||||
15619371 | 659 days ago | 0.003527 ETH | ||||
15619369 | 659 days ago | 0.0012388 ETH | ||||
15609748 | 660 days ago | 0.0258824 ETH | ||||
15604160 | 661 days ago | 0.0012388 ETH | ||||
15599240 | 662 days ago | 0.003527 ETH | ||||
15599237 | 662 days ago | 0.0012388 ETH | ||||
15595466 | 662 days ago | 0.0371603 ETH | ||||
15595466 | 662 days ago | 0.0371603 ETH | ||||
15590147 | 663 days ago | 0.0012388 ETH | ||||
15590143 | 663 days ago | 0.0012388 ETH | ||||
15590139 | 663 days ago | 0.0012388 ETH | ||||
15588623 | 663 days ago | 0.0130511 ETH | ||||
15587887 | 663 days ago | 0.003527 ETH | ||||
15576699 | 665 days ago | 0.0012388 ETH | ||||
15570109 | 666 days ago | 0.0012388 ETH | ||||
15570109 | 666 days ago | 0.0012388 ETH | ||||
15570108 | 666 days ago | 0.0012388 ETH | ||||
15570108 | 666 days ago | 0.0012388 ETH | ||||
15570105 | 666 days ago | 0.003527 ETH | ||||
15570104 | 666 days ago | 0.003527 ETH | ||||
15562723 | 667 days ago | 0.003527 ETH | ||||
15562567 | 667 days ago | 0.0012388 ETH |
Loading...
Loading
Contract Name:
W3FClaim
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "./W3F.sol"; contract W3FClaim is Ownable { using SafeMath for uint256; uint256 private constant MAX_SUPPLY_RAINBOW = 11; uint256 private constant MAX_SUPPLY_GOLD = 102; uint256 private constant MAX_SUPPLY_SILVER = 499; uint256 private constant MAX_SUPPLY_BRONZE = 888; uint256 private constant SHARE_PCT_RAINBOW = 25 * 2; uint256 private constant SHARE_PCT_GOLD = 12 * 2; uint256 private constant SHARE_PCT_SILVER = 8 * 2; uint256 private constant SHARE_PCT_BRONZE = 5 * 2; uint256 public totalClaimed = 0; W3F private w3fPass; mapping(uint256 => uint256) private claimedForPass; event AddedReserves(address indexed adder, uint256 added); event Claim(address indexed claimedBy, uint256 indexed tokenId, uint256 amount); constructor(W3F _w3fPass) { w3fPass = _w3fPass; } // Returns the amount that is/was claimable for a given pass, // regardless of wheter or not the claim already took place function claimableFor(uint256 _tokenId) public view returns(uint256 _claimable) { require(_tokenId <= MAX_SUPPLY_RAINBOW + MAX_SUPPLY_GOLD + MAX_SUPPLY_SILVER + MAX_SUPPLY_BRONZE, "Invalid token ID"); uint256 totalClaimable = address(this).balance.add(totalClaimed); uint256 percentage = 0; uint256 totalPasses = 0; if(_tokenId == 0) { // Correct for missing token 1500 percentage = SHARE_PCT_BRONZE; totalPasses = MAX_SUPPLY_BRONZE; } else if (_tokenId <= MAX_SUPPLY_RAINBOW) { percentage = SHARE_PCT_RAINBOW; totalPasses = MAX_SUPPLY_RAINBOW; } else if (_tokenId <= MAX_SUPPLY_RAINBOW + MAX_SUPPLY_GOLD) { percentage = SHARE_PCT_GOLD; totalPasses = MAX_SUPPLY_GOLD; } else if (_tokenId <= MAX_SUPPLY_RAINBOW + MAX_SUPPLY_GOLD + MAX_SUPPLY_SILVER) { percentage = SHARE_PCT_SILVER; totalPasses = MAX_SUPPLY_SILVER; } else { percentage = SHARE_PCT_BRONZE; totalPasses = MAX_SUPPLY_BRONZE; } uint256 claimableByLevel = totalClaimable.div(100).mul(percentage); _claimable = claimableByLevel.div(100000000000).div(totalPasses).mul(100000000000); } // Returns the amount that is currently available to claim for the pass function unclaimedFor(uint256 _tokenId) public view returns(uint256 _unclaimed) { uint256 claimable = claimableFor(_tokenId); uint256 claimed = claimedFor(_tokenId); _unclaimed = claimable.sub(claimed); } // Returns the amount that has already been claimed for the pass function claimedFor(uint256 _tokenId) public view returns(uint256 _claimed) { _claimed = claimedForPass[_tokenId]; } // Allows the owner to claim the share of one W3F pass function claim(uint256 _tokenId) public { require(w3fPass.ownerOf(_tokenId) == msg.sender, "W3FClaim: Invalid pass owner"); uint claimable = claimableFor(_tokenId); uint claimed = claimedFor(_tokenId); require(claimed < claimable, "W3FClaim: Nothing left to claim for pass"); uint unclaimed = claimable.sub(claimed); require(address(this).balance >= unclaimed, "W3FClaim: Insufficient reserves"); claimedForPass[_tokenId] = claimed.add(unclaimed); totalClaimed = totalClaimed.add(unclaimed); emit Claim(msg.sender, _tokenId, unclaimed); (bool sent,) = payable(msg.sender).call{value: unclaimed}(""); require(sent, "W3FClaim: Recipient could not receive"); } function withdraw() public onlyOwner { (bool sent, ) = payable(owner()).call{value: address(this).balance}(""); require(sent); } function withdrawToken(ERC20 token) public onlyOwner { uint256 tokenBalance = token.balanceOf(address(this)); token.transfer(owner(), tokenBalance); } receive() external payable {} }
// 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 (last updated v4.6.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens 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 amount ) 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, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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 addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract W3F is IERC721Metadata, ERC721Enumerable, Ownable { using Strings for uint256; uint256 private constant MAX_SUPPLY = 1500; uint256 private constant MAX_SUPPLY_RAINBOW = 11; uint256 private constant W3FMAX_SUPPLY_GOLD = 102; uint256 private constant MAX_SUPPLY_SILVER = 499; uint256 private constant MAX_MINT_COUNT = 3; uint256 public price = 0.21 ether; uint256 public commissionBasePoints = 2500; // 25% string public notRevealedUri; string public baseURI; bool public paused = false; bool public revealed = false; uint256 private availablePassesCount = MAX_SUPPLY; mapping(uint => uint) private availablePasses; mapping(address => uint256) private mintedCount; event Referral(address indexed referrer, address indexed referred); event Commission(address indexed recipient, address indexed referred, uint256 amount, uint256 count); constructor( string memory _name, string memory _symbol, string memory _initBaseURI, string memory _initNotRevealedUri ) public ERC721(_name, _symbol) { setBaseURI(_initBaseURI); setNotRevealedURI(_initNotRevealedUri); } function setCommissionBasePoints(uint256 _newCommissionBasePoints) external onlyOwner { require(_newCommissionBasePoints <= 10000); commissionBasePoints = _newCommissionBasePoints; } function passLevelOf(address _owner) external view virtual returns (string memory) { uint256[] memory tokenIds = walletOf(_owner); require(tokenIds.length > 0, "W3F: Owner has an empty wallet."); // The lower the lowest owned token ID, the better the pass level. uint256 lowestTokenId = tokenIds[0]; if (tokenIds.length > 1) { for (uint256 i = 1; i < tokenIds.length; i++) { if (tokenIds[i] < lowestTokenId) { lowestTokenId = tokenIds[i]; if (lowestTokenId <= MAX_SUPPLY_RAINBOW) break; } } } require(lowestTokenId > 0 && lowestTokenId <= MAX_SUPPLY, "W3F: Account has no valid pass."); if (lowestTokenId <= MAX_SUPPLY_RAINBOW) { return "Rainbow"; } else if (lowestTokenId <= MAX_SUPPLY_RAINBOW + W3FMAX_SUPPLY_GOLD) { return "Gold"; } else if (lowestTokenId <= MAX_SUPPLY_RAINBOW + W3FMAX_SUPPLY_GOLD + MAX_SUPPLY_SILVER) { return "Silver"; } return "Bronze"; } // The 11 rainbow passes are not included here function mintedBy(address _minter) external view returns (uint256) { require(_minter != address(0), "Zero address not allowed."); return mintedCount[_minter]; } function mintRainbowPasses(uint256 _count) public onlyOwner { require(totalSupply() + _count <= 11, "W3F: Max 11 rainbow passes."); for (uint256 i = 1; i <= _count; i++) { _mint(msg.sender, i); } availablePassesCount -= _count; } function setBaseURI(string memory _newBaseURI) public onlyOwner { baseURI = _newBaseURI; } function mint(uint256 _count, address _referrer) public payable { require(_count > 0, "W3F: Invalid number of NFTs to mint."); require(_referrer != msg.sender, "W3F: Invalid referrer."); require(totalSupply() < MAX_SUPPLY, "W3F: All NFTs have been minted."); require(!paused, "W3F: Minting paused."); uint256 supply = totalSupply(); require(supply + _count <= MAX_SUPPLY, "W3F: Number exceeds maximum supply."); uint256 cost = _getCost(_count, _referrer); require(msg.value >= cost, "W3F: Insufficient payment."); require(_count <= MAX_MINT_COUNT - mintedCount[msg.sender], "W3F: Mint limit reached."); mintedCount[msg.sender] += _count; _mintRandom(msg.sender, _count); address commissionRecipient = _referrer; if (commissionRecipient != address(0)) { emit Referral(_referrer, msg.sender); } if (commissionBasePoints > 0) { if (commissionRecipient == address(0)) { commissionRecipient = owner(); } uint256 commissionAmount = cost * commissionBasePoints / 10000; (bool sent, ) = commissionRecipient.call{value: commissionAmount}(""); require(sent, "W3F: Refferer failed to receive."); emit Commission(_referrer, msg.sender, commissionAmount, _count); } } function tokenURI(uint256 tokenId) public view virtual override(ERC721, IERC721Metadata) returns (string memory) { require(_exists(tokenId), "W3F: URI query for nonexistent token."); if (revealed == false) { return notRevealedUri; } string memory currentBaseURI = _baseURI(); return bytes(currentBaseURI).length > 0 ? string(abi.encodePacked(currentBaseURI, tokenId.toString(), ".json")) : ""; } function walletOf(address _owner) public view returns (uint256[] memory) { uint256 ownerTokenCount = balanceOf(_owner); uint256[] memory tokenIds = new uint256[](ownerTokenCount); for (uint256 i; i < ownerTokenCount; i++) { tokenIds[i] = tokenOfOwnerByIndex(_owner, i); } return tokenIds; } function reveal() public onlyOwner { revealed = true; } function setPrice(uint256 _newPrice) public onlyOwner { price = _newPrice; } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { notRevealedUri = _notRevealedURI; } function pause(bool _state) public onlyOwner { paused = _state; } function withdraw() public onlyOwner { (bool sent, ) = payable(owner()).call{value: address(this).balance}(""); require(sent); } function withdrawToken(address _token) public onlyOwner { ERC20 token = ERC20(_token); uint256 tokenBalance = token.balanceOf(address(this)); token.transfer(owner(), tokenBalance); } function _mintRandom(address to, uint _count) internal virtual { require(_msgSender() == tx.origin, "ERC721r: Contracts cannot mint."); uint newAvailablePassesCount = availablePassesCount; for (uint256 i; i < _count; ++i) { // Do this ++ unchecked? uint256 tokenId = getRandomAvailableTokenId(to, newAvailablePassesCount); _mint(to, tokenId); --newAvailablePassesCount; } availablePassesCount = newAvailablePassesCount; } function getRandomAvailableTokenId(address to, uint newAvailablePassesCount) internal returns (uint256) { uint256 randomNum = uint256( keccak256( abi.encode( to, tx.gasprice, block.number, block.timestamp, block.difficulty, blockhash(block.number - 1), address(this), newAvailablePassesCount ) ) ); uint256 randomIndex = randomNum % newAvailablePassesCount; return getAvailableTokenAtIndex(randomIndex, newAvailablePassesCount); } // Implementation of the Fisher-Yates shuffle (https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) function getAvailableTokenAtIndex(uint256 index, uint newAvailablePassesCount) internal returns (uint256) { uint256 result; if (availablePasses[index] == 0) { // Index is still an available token. result = index; } else { // Index itself is not available, but the value at that index is. result = availablePasses[index]; } uint256 lastIndex = newAvailablePassesCount - 1; if (index != lastIndex) { // Replace the value at index with the data from the last index in the array, // since we are going to decrease the array size afterwards. uint256 lastValInArray = availablePasses[lastIndex]; if (lastValInArray == 0) { // This means the index itself is still an available token availablePasses[index] = lastIndex; } else { // Index itself is not an available token, but the value at that index is. availablePasses[index] = lastValInArray; delete availablePasses[lastIndex]; } } return result; } function _baseURI() internal view virtual override returns (string memory) { return baseURI; } function _getCost(uint256 _count, address _referrer) private view returns (uint256) { return price * _count; } receive() external payable {} }
// 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 (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (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 `IERC721Receiver.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 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 (last updated v4.6.0) (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`. * * 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 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 Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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 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 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 || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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 (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/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; } }
{ "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
[{"inputs":[{"internalType":"contract W3F","name":"_w3fPass","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"adder","type":"address"},{"indexed":false,"internalType":"uint256","name":"added","type":"uint256"}],"name":"AddedReserves","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"claimedBy","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","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"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"claimableFor","outputs":[{"internalType":"uint256","name":"_claimable","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"claimedFor","outputs":[{"internalType":"uint256","name":"_claimed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"unclaimedFor","outputs":[{"internalType":"uint256","name":"_unclaimed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"token","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405260006001553480156200001657600080fd5b50604051620017123803806200171283398181016040528101906200003c919062000187565b6200005c62000050620000a460201b60201c565b620000ac60201b60201c565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505062000220565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050620001818162000206565b92915050565b600060208284031215620001a0576200019f62000201565b5b6000620001b08482850162000170565b91505092915050565b6000620001c682620001e1565b9050919050565b6000620001da82620001b9565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b6200021181620001cd565b81146200021d57600080fd5b50565b6114e280620002306000396000f3fe6080604052600436106100955760003560e01c8063894760691161005957806389476069146101725780638da5cb5b1461019b578063d54ad2a1146101c6578063f2fde38b146101f1578063f6dae4301461021a5761009c565b8063034717c2146100a1578063379607f5146100de5780633ccfd60b146101075780636d4a7ed71461011e578063715018a61461015b5761009c565b3661009c57005b600080fd5b3480156100ad57600080fd5b506100c860048036038101906100c39190610dea565b610257565b6040516100d591906110b3565b60405180910390f35b3480156100ea57600080fd5b5061010560048036038101906101009190610dea565b6103de565b005b34801561011357600080fd5b5061011c6106f3565b005b34801561012a57600080fd5b5061014560048036038101906101409190610dea565b6107ef565b60405161015291906110b3565b60405180910390f35b34801561016757600080fd5b50610170610826565b005b34801561017e57600080fd5b5061019960048036038101906101949190610dbd565b6108ae565b005b3480156101a757600080fd5b506101b0610a50565b6040516101bd9190610f8f565b60405180910390f35b3480156101d257600080fd5b506101db610a79565b6040516101e891906110b3565b60405180910390f35b3480156101fd57600080fd5b5061021860048036038101906102139190610d36565b610a7f565b005b34801561022657600080fd5b50610241600480360381019061023c9190610dea565b610b77565b60405161024e91906110b3565b60405180910390f35b60006103786101f36066600b61026d91906110ea565b61027791906110ea565b61028191906110ea565b8211156102c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ba90611053565b60405180910390fd5b60006102da60015447610b9490919063ffffffff16565b905060008060008514156102f657600a91506103789050610368565b600b851161030b5760329150600b9050610367565b6066600b61031991906110ea565b851161032c576018915060669050610366565b6101f36066600b61033d91906110ea565b61034791906110ea565b851161035b57601091506101f39050610365565b600a915061037890505b5b5b5b600061039083610382606487610baa90919063ffffffff16565b610bc090919063ffffffff16565b90506103d364174876e8006103c5846103b764174876e80086610baa90919063ffffffff16565b610baa90919063ffffffff16565b610bc090919063ffffffff16565b945050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161045091906110b3565b60206040518083038186803b15801561046857600080fd5b505afa15801561047c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a09190610d63565b73ffffffffffffffffffffffffffffffffffffffff16146104f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ed90610fd3565b60405180910390fd5b600061050182610257565b9050600061050e83610b77565b9050818110610552576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054990611013565b60405180910390fd5b60006105678284610bd690919063ffffffff16565b9050804710156105ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a390611093565b60405180910390fd5b6105bf8183610b9490919063ffffffff16565b60036000868152602001908152602001600020819055506105eb81600154610b9490919063ffffffff16565b600181905550833373ffffffffffffffffffffffffffffffffffffffff167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf78360405161063891906110b3565b60405180910390a360003373ffffffffffffffffffffffffffffffffffffffff168260405161066690610f7a565b60006040518083038185875af1925050503d80600081146106a3576040519150601f19603f3d011682016040523d82523d6000602084013e6106a8565b606091505b50509050806106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e390611073565b60405180910390fd5b5050505050565b6106fb610bec565b73ffffffffffffffffffffffffffffffffffffffff16610719610a50565b73ffffffffffffffffffffffffffffffffffffffff161461076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076690611033565b60405180910390fd5b6000610779610a50565b73ffffffffffffffffffffffffffffffffffffffff164760405161079c90610f7a565b60006040518083038185875af1925050503d80600081146107d9576040519150601f19603f3d011682016040523d82523d6000602084013e6107de565b606091505b50509050806107ec57600080fd5b50565b6000806107fb83610257565b9050600061080884610b77565b905061081d8183610bd690919063ffffffff16565b92505050919050565b61082e610bec565b73ffffffffffffffffffffffffffffffffffffffff1661084c610a50565b73ffffffffffffffffffffffffffffffffffffffff16146108a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089990611033565b60405180910390fd5b6108ac6000610bf4565b565b6108b6610bec565b73ffffffffffffffffffffffffffffffffffffffff166108d4610a50565b73ffffffffffffffffffffffffffffffffffffffff161461092a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092190611033565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109659190610f8f565b60206040518083038186803b15801561097d57600080fd5b505afa158015610991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b59190610e17565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6109db610a50565b836040518363ffffffff1660e01b81526004016109f9929190610faa565b602060405180830381600087803b158015610a1357600080fd5b505af1158015610a27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4b9190610d90565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60015481565b610a87610bec565b73ffffffffffffffffffffffffffffffffffffffff16610aa5610a50565b73ffffffffffffffffffffffffffffffffffffffff1614610afb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af290611033565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6290610ff3565b60405180910390fd5b610b7481610bf4565b50565b600060036000838152602001908152602001600020549050919050565b60008183610ba291906110ea565b905092915050565b60008183610bb89190611140565b905092915050565b60008183610bce9190611171565b905092915050565b60008183610be491906111cb565b905092915050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081359050610cc781611450565b92915050565b600081519050610cdc81611450565b92915050565b600081519050610cf181611467565b92915050565b600081359050610d068161147e565b92915050565b600081359050610d1b81611495565b92915050565b600081519050610d3081611495565b92915050565b600060208284031215610d4c57610d4b6112b7565b5b6000610d5a84828501610cb8565b91505092915050565b600060208284031215610d7957610d786112b7565b5b6000610d8784828501610ccd565b91505092915050565b600060208284031215610da657610da56112b7565b5b6000610db484828501610ce2565b91505092915050565b600060208284031215610dd357610dd26112b7565b5b6000610de184828501610cf7565b91505092915050565b600060208284031215610e0057610dff6112b7565b5b6000610e0e84828501610d0c565b91505092915050565b600060208284031215610e2d57610e2c6112b7565b5b6000610e3b84828501610d21565b91505092915050565b610e4d816111ff565b82525050565b6000610e60601c836110d9565b9150610e6b826112bc565b602082019050919050565b6000610e836026836110d9565b9150610e8e826112e5565b604082019050919050565b6000610ea66028836110d9565b9150610eb182611334565b604082019050919050565b6000610ec96020836110d9565b9150610ed482611383565b602082019050919050565b6000610eec6010836110d9565b9150610ef7826113ac565b602082019050919050565b6000610f0f6025836110d9565b9150610f1a826113d5565b604082019050919050565b6000610f326000836110ce565b9150610f3d82611424565b600082019050919050565b6000610f55601f836110d9565b9150610f6082611427565b602082019050919050565b610f748161124f565b82525050565b6000610f8582610f25565b9150819050919050565b6000602082019050610fa46000830184610e44565b92915050565b6000604082019050610fbf6000830185610e44565b610fcc6020830184610f6b565b9392505050565b60006020820190508181036000830152610fec81610e53565b9050919050565b6000602082019050818103600083015261100c81610e76565b9050919050565b6000602082019050818103600083015261102c81610e99565b9050919050565b6000602082019050818103600083015261104c81610ebc565b9050919050565b6000602082019050818103600083015261106c81610edf565b9050919050565b6000602082019050818103600083015261108c81610f02565b9050919050565b600060208201905081810360008301526110ac81610f48565b9050919050565b60006020820190506110c86000830184610f6b565b92915050565b600081905092915050565b600082825260208201905092915050565b60006110f58261124f565b91506111008361124f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561113557611134611259565b5b828201905092915050565b600061114b8261124f565b91506111568361124f565b92508261116657611165611288565b5b828204905092915050565b600061117c8261124f565b91506111878361124f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156111c0576111bf611259565b5b828202905092915050565b60006111d68261124f565b91506111e18361124f565b9250828210156111f4576111f3611259565b5b828203905092915050565b600061120a8261122f565b9050919050565b60008115159050919050565b6000611228826111ff565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600080fd5b7f573346436c61696d3a20496e76616c69642070617373206f776e657200000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f573346436c61696d3a204e6f7468696e67206c65667420746f20636c61696d2060008201527f666f722070617373000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f496e76616c696420746f6b656e20494400000000000000000000000000000000600082015250565b7f573346436c61696d3a20526563697069656e7420636f756c64206e6f7420726560008201527f6365697665000000000000000000000000000000000000000000000000000000602082015250565b50565b7f573346436c61696d3a20496e73756666696369656e7420726573657276657300600082015250565b611459816111ff565b811461146457600080fd5b50565b61147081611211565b811461147b57600080fd5b50565b6114878161121d565b811461149257600080fd5b50565b61149e8161124f565b81146114a957600080fd5b5056fea264697066735822122049dcfea143c7807cb69052ea56629c9af80569f9e22043a6e10ade33ab73630764736f6c63430008070033000000000000000000000000f0e9ac808c7404c57a5d008c343e33ba76cf93c3
Deployed Bytecode
0x6080604052600436106100955760003560e01c8063894760691161005957806389476069146101725780638da5cb5b1461019b578063d54ad2a1146101c6578063f2fde38b146101f1578063f6dae4301461021a5761009c565b8063034717c2146100a1578063379607f5146100de5780633ccfd60b146101075780636d4a7ed71461011e578063715018a61461015b5761009c565b3661009c57005b600080fd5b3480156100ad57600080fd5b506100c860048036038101906100c39190610dea565b610257565b6040516100d591906110b3565b60405180910390f35b3480156100ea57600080fd5b5061010560048036038101906101009190610dea565b6103de565b005b34801561011357600080fd5b5061011c6106f3565b005b34801561012a57600080fd5b5061014560048036038101906101409190610dea565b6107ef565b60405161015291906110b3565b60405180910390f35b34801561016757600080fd5b50610170610826565b005b34801561017e57600080fd5b5061019960048036038101906101949190610dbd565b6108ae565b005b3480156101a757600080fd5b506101b0610a50565b6040516101bd9190610f8f565b60405180910390f35b3480156101d257600080fd5b506101db610a79565b6040516101e891906110b3565b60405180910390f35b3480156101fd57600080fd5b5061021860048036038101906102139190610d36565b610a7f565b005b34801561022657600080fd5b50610241600480360381019061023c9190610dea565b610b77565b60405161024e91906110b3565b60405180910390f35b60006103786101f36066600b61026d91906110ea565b61027791906110ea565b61028191906110ea565b8211156102c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ba90611053565b60405180910390fd5b60006102da60015447610b9490919063ffffffff16565b905060008060008514156102f657600a91506103789050610368565b600b851161030b5760329150600b9050610367565b6066600b61031991906110ea565b851161032c576018915060669050610366565b6101f36066600b61033d91906110ea565b61034791906110ea565b851161035b57601091506101f39050610365565b600a915061037890505b5b5b5b600061039083610382606487610baa90919063ffffffff16565b610bc090919063ffffffff16565b90506103d364174876e8006103c5846103b764174876e80086610baa90919063ffffffff16565b610baa90919063ffffffff16565b610bc090919063ffffffff16565b945050505050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b815260040161045091906110b3565b60206040518083038186803b15801561046857600080fd5b505afa15801561047c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a09190610d63565b73ffffffffffffffffffffffffffffffffffffffff16146104f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ed90610fd3565b60405180910390fd5b600061050182610257565b9050600061050e83610b77565b9050818110610552576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054990611013565b60405180910390fd5b60006105678284610bd690919063ffffffff16565b9050804710156105ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a390611093565b60405180910390fd5b6105bf8183610b9490919063ffffffff16565b60036000868152602001908152602001600020819055506105eb81600154610b9490919063ffffffff16565b600181905550833373ffffffffffffffffffffffffffffffffffffffff167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf78360405161063891906110b3565b60405180910390a360003373ffffffffffffffffffffffffffffffffffffffff168260405161066690610f7a565b60006040518083038185875af1925050503d80600081146106a3576040519150601f19603f3d011682016040523d82523d6000602084013e6106a8565b606091505b50509050806106ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e390611073565b60405180910390fd5b5050505050565b6106fb610bec565b73ffffffffffffffffffffffffffffffffffffffff16610719610a50565b73ffffffffffffffffffffffffffffffffffffffff161461076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076690611033565b60405180910390fd5b6000610779610a50565b73ffffffffffffffffffffffffffffffffffffffff164760405161079c90610f7a565b60006040518083038185875af1925050503d80600081146107d9576040519150601f19603f3d011682016040523d82523d6000602084013e6107de565b606091505b50509050806107ec57600080fd5b50565b6000806107fb83610257565b9050600061080884610b77565b905061081d8183610bd690919063ffffffff16565b92505050919050565b61082e610bec565b73ffffffffffffffffffffffffffffffffffffffff1661084c610a50565b73ffffffffffffffffffffffffffffffffffffffff16146108a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089990611033565b60405180910390fd5b6108ac6000610bf4565b565b6108b6610bec565b73ffffffffffffffffffffffffffffffffffffffff166108d4610a50565b73ffffffffffffffffffffffffffffffffffffffff161461092a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092190611033565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109659190610f8f565b60206040518083038186803b15801561097d57600080fd5b505afa158015610991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b59190610e17565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6109db610a50565b836040518363ffffffff1660e01b81526004016109f9929190610faa565b602060405180830381600087803b158015610a1357600080fd5b505af1158015610a27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4b9190610d90565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60015481565b610a87610bec565b73ffffffffffffffffffffffffffffffffffffffff16610aa5610a50565b73ffffffffffffffffffffffffffffffffffffffff1614610afb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af290611033565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6290610ff3565b60405180910390fd5b610b7481610bf4565b50565b600060036000838152602001908152602001600020549050919050565b60008183610ba291906110ea565b905092915050565b60008183610bb89190611140565b905092915050565b60008183610bce9190611171565b905092915050565b60008183610be491906111cb565b905092915050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081359050610cc781611450565b92915050565b600081519050610cdc81611450565b92915050565b600081519050610cf181611467565b92915050565b600081359050610d068161147e565b92915050565b600081359050610d1b81611495565b92915050565b600081519050610d3081611495565b92915050565b600060208284031215610d4c57610d4b6112b7565b5b6000610d5a84828501610cb8565b91505092915050565b600060208284031215610d7957610d786112b7565b5b6000610d8784828501610ccd565b91505092915050565b600060208284031215610da657610da56112b7565b5b6000610db484828501610ce2565b91505092915050565b600060208284031215610dd357610dd26112b7565b5b6000610de184828501610cf7565b91505092915050565b600060208284031215610e0057610dff6112b7565b5b6000610e0e84828501610d0c565b91505092915050565b600060208284031215610e2d57610e2c6112b7565b5b6000610e3b84828501610d21565b91505092915050565b610e4d816111ff565b82525050565b6000610e60601c836110d9565b9150610e6b826112bc565b602082019050919050565b6000610e836026836110d9565b9150610e8e826112e5565b604082019050919050565b6000610ea66028836110d9565b9150610eb182611334565b604082019050919050565b6000610ec96020836110d9565b9150610ed482611383565b602082019050919050565b6000610eec6010836110d9565b9150610ef7826113ac565b602082019050919050565b6000610f0f6025836110d9565b9150610f1a826113d5565b604082019050919050565b6000610f326000836110ce565b9150610f3d82611424565b600082019050919050565b6000610f55601f836110d9565b9150610f6082611427565b602082019050919050565b610f748161124f565b82525050565b6000610f8582610f25565b9150819050919050565b6000602082019050610fa46000830184610e44565b92915050565b6000604082019050610fbf6000830185610e44565b610fcc6020830184610f6b565b9392505050565b60006020820190508181036000830152610fec81610e53565b9050919050565b6000602082019050818103600083015261100c81610e76565b9050919050565b6000602082019050818103600083015261102c81610e99565b9050919050565b6000602082019050818103600083015261104c81610ebc565b9050919050565b6000602082019050818103600083015261106c81610edf565b9050919050565b6000602082019050818103600083015261108c81610f02565b9050919050565b600060208201905081810360008301526110ac81610f48565b9050919050565b60006020820190506110c86000830184610f6b565b92915050565b600081905092915050565b600082825260208201905092915050565b60006110f58261124f565b91506111008361124f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561113557611134611259565b5b828201905092915050565b600061114b8261124f565b91506111568361124f565b92508261116657611165611288565b5b828204905092915050565b600061117c8261124f565b91506111878361124f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156111c0576111bf611259565b5b828202905092915050565b60006111d68261124f565b91506111e18361124f565b9250828210156111f4576111f3611259565b5b828203905092915050565b600061120a8261122f565b9050919050565b60008115159050919050565b6000611228826111ff565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600080fd5b7f573346436c61696d3a20496e76616c69642070617373206f776e657200000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f573346436c61696d3a204e6f7468696e67206c65667420746f20636c61696d2060008201527f666f722070617373000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f496e76616c696420746f6b656e20494400000000000000000000000000000000600082015250565b7f573346436c61696d3a20526563697069656e7420636f756c64206e6f7420726560008201527f6365697665000000000000000000000000000000000000000000000000000000602082015250565b50565b7f573346436c61696d3a20496e73756666696369656e7420726573657276657300600082015250565b611459816111ff565b811461146457600080fd5b50565b61147081611211565b811461147b57600080fd5b50565b6114878161121d565b811461149257600080fd5b50565b61149e8161124f565b81146114a957600080fd5b5056fea264697066735822122049dcfea143c7807cb69052ea56629c9af80569f9e22043a6e10ade33ab73630764736f6c63430008070033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f0e9ac808c7404c57a5d008c343e33ba76cf93c3
-----Decoded View---------------
Arg [0] : _w3fPass (address): 0xf0e9ac808C7404C57A5D008c343E33ba76CF93C3
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000f0e9ac808c7404c57a5d008c343e33ba76cf93c3
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.