Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
Overview
Max Total Supply
6,416 SKELE
Holders
741
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
8 SKELELoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Skelephunks
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Unlicense // Creator: 0xYeety/YEETY.eth - Co-Founder/CTO, Virtue Labs // * ————————————————————————————————————————————————————————————————————————————————— * // | | // | SSSSS K K EEEEEE L EEEEEE PPPPP H H U U N N K K SSSSS | // | S K K E L E P P H H U U N N N K K S | // | SSSS KKKK EEE L EEE PPPPP HHHHHH U U N N N KKKK SSSS | // | S K K E L E P H H U U N N N K K S | // | SSSSS K K EEEEEE LLLLLL EEEEEE P H H UUUU N N K K SSSSS | // | | // | * AN ETHEREUM-BASED INDENTITY PLATFORM BROUGHT TO YOU BY NEUROMANTIC INDUSTRIES * | // | | // | @@@@@@@@@@@@@@@@@@@@@@@@ | // | @@@@@@@@@@@@@@@@@@@@@@@@ | // | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ | // | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ | // | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ | // | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ | // | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ | // | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ | // | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ | // | @@@@@@@@@@,,,,,,,,,,@@@@@@,,,,,,,@@@ | // | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ | // | @@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@ | // | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ | // | @@@,,,,,,,@@@@@@,,,,,,,,,,,,,,,,,@@@ | // | @@@,,,,,,,,,,,,,,,,,,,,,,,,@@@ | // | @@@,,,,,,,,,,,,,,,,,,,,@@@@@@@ | // | @@@@@@@@@@@@@@@@@@@@@@@@@@@ | // | @@@@@@@@@@@@@@@@@@@@@@@@@@@ | // | @@@@,,,,,,,,,,,,,,,,@@@@,,,@@@ | // | @@@@@@@@@@@@@@@@,,,,@@@ | // | @@@,,,,,,,,,,@@@ | // | @@@,,,,,,,,,,@@@ | // | @@@,,,,@@@ | // | @@@,,,,,,,,,,@@@ | // | | // | * ———————————————————————————————————————————————————————————————————— pragma solidity ^0.8.17; import "./ERC721Y.sol"; import "lib/openzeppelin-contracts/contracts/access/Ownable.sol"; import "lib/openzeppelin-contracts/contracts/utils/Strings.sol"; import "lib/openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol"; import "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import "lib/operator-filter-registry/src/DefaultOperatorFilterer.sol"; contract Skelephunks is ERC721Y, Ownable, DefaultOperatorFilterer { using Address for address; using Strings for uint256; string public PROVENANCE; bool provenanceSet; mapping(address => uint256) public numMinted; mapping(uint256 => string) private _gdToPath; /*************************************************************************/ /*** PAYMENT VARIABLES (Start) *******************************************/ address[] public payees; mapping(address => uint256) private paymentInfo; uint256 totalReceived = 0; mapping(address => uint256) amountsWithdrawn; bool canEmergencyWithdrawTokens = true; modifier onlyPayee() { _isPayee(); _; } function _isPayee() internal view virtual { require(paymentInfo[msg.sender] > 0, "not a payee"); } function isPayee(address addr) public view returns (bool) { return (paymentInfo[addr] > 0); } /*** PAYMENT VARIABLES (End) *******************************************/ /***********************************************************************/ uint256 public mintPrice = 0.033 ether; uint256 private maxPaidTokens = 10; enum MintStatus { PreMint, Phunks, AllowList, Public, PublicExtended, ReserveOnly, Finished } MintStatus public mintStatus = MintStatus.PreMint; bool public paused = false; uint256 public maxPossibleSupply = 9999; uint256 public maxMintableSupply = 6666; uint256 public numMintedRegular = 0; uint256 public maxReserveSupply = 3333; uint256 public numMintedReserve = 0; uint256 private _maxMintsPerWallet; string collectionDescription = "Skelephunks is a universal, adaptive PFP for the Ethereum community."; string collectionImg = ""; string externalLink = "https://skelephunks.com"; // mapping(uint256 => uint256) private _genderDirection; bytes32 public phunksMerkleRoot = 0x2df951fbc5be4633d24a81d65bfa4cf92133f3ada0d2a884f39955bd22444b24; uint256 public maxPhunkClaims = 105; bytes32 public merkleRoot = 0xdb815420d65ef8b0dec059847253b71b167965c78bd17b5a961dc8688ded7cfd; uint256 public maxAllowlistClaims = 1561; mapping(address => uint256) private _claimsInfo; mapping(address => uint256) private _claimTypes; function phunkClaimsMade() public view returns (uint256) { return _claimsInfo[address(0)]%(1<<128); } function allowlistClaimsMade() public view returns (uint256) { return _claimsInfo[address(0)]>>128; } function phunkListClaimed(address addr) public view returns (bool) { require(addr != address(0), "0"); return ((_claimsInfo[addr]%2) == 1); } function allowlistClaimed(address addr) public view returns (bool) { require(addr != address(0), "0"); return ((_claimsInfo[addr]>>1) == 1); } mapping(address => bool) private _reserveAuths; address public keysContract; uint256 public keyRedemptionAmt = 3; modifier onlyReserveAuth() { require(getReserveAuthStatus(msg.sender), "ra"); _; } bool private royaltySwitch = true; modifier onlyAllowedOperator(address from) virtual override { if (royaltySwitch) { if (from != msg.sender) { _checkFilterOperator(msg.sender); } } _; } modifier onlyAllowedOperatorApproval(address operator) virtual override { if (royaltySwitch) { _checkFilterOperator(operator); } _; } bool public preMintLocked = false; ////////// constructor ( string memory name_, string memory symbol_, uint256 maxMintsPerWallet_, address[] memory payees_, uint256[] memory basisPoints_ ) ERC721Y(name_, symbol_, maxPossibleSupply) { _maxMintsPerWallet = maxMintsPerWallet_; require(payees_.length == basisPoints_.length, "l"); payees = payees_; for (uint256 i = 0; i < payees_.length; i++) { paymentInfo[payees_[i]] = basisPoints_[i]; } _gdToPath[0] = "phunk/male"; _gdToPath[1] = "phunk/female"; _gdToPath[2] = "punk/male"; _gdToPath[3] = "punk/female"; } ////////// function flipPaused() public onlyOwner { paused = !paused; } function setMintStatus(MintStatus newMintStatus) public onlyOwner { require(newMintStatus != MintStatus.PreMint && mintStatus != MintStatus.Finished, "ms"); mintStatus = newMintStatus; } function preMint( address[] calldata recipients, uint256[] calldata numsToMint, uint256[] calldata gds, bool lock ) public onlyOwner { require(!preMintLocked, "pml"); for (uint256 i = 0; i < numsToMint.length; i++) { require(gds[i] < 4, "bad gad"); _mintMain(recipients[i], numsToMint[i], 0, gds[i], false); } preMintLocked = lock; } function min(uint256 x, uint256 y) private pure returns (uint256) { if (x < y) { return x; } return y; } function _mintClaimsMade(address minter) private view returns (uint256) { return _claimTypes[minter]%(1<<128); } function _otherClaimsMade(address minter) private view returns (uint256) { return _claimTypes[minter]>>128; } function totalClaimsMade(address minter) public view returns (uint256) { return _mintClaimsMade(minter) + _otherClaimsMade(minter); } function phunkClaimsRemain() public view returns (bool) { return (phunkClaimsMade() < maxPhunkClaims); } function eligibleForPhunk( address minter, bytes32[] calldata _proof ) public view returns (bool) { return ((!(phunkListClaimed(minter))) && MerkleProof.verify( _proof, phunksMerkleRoot, keccak256(abi.encodePacked(minter)) ) && phunkClaimsRemain()); } function allowlistClaimsRemain() public view returns (bool) { return (allowlistClaimsMade() < maxAllowlistClaims); } function eligibleForAllowlist( address minter, bytes32[] calldata _proof ) public view returns (bool) { return (MerkleProof.verify( _proof, merkleRoot, keccak256(abi.encodePacked(minter)) ) && allowlistClaimsRemain()); } ////////// function maxMintsInternal( address wallet, bytes32[] calldata _phunkProof, bytes32[] calldata _alProof ) private view returns (uint256) { uint256 mms = maxMintableSupply; uint256 nmr = numMintedRegular; uint256 _mmpw = _maxMintsPerWallet; bool efp = eligibleForPhunk(wallet, _phunkProof); bool efal = eligibleForAllowlist(wallet, _alProof); if (mintStatus == MintStatus.PreMint) { return 0; } else if (mintStatus == MintStatus.Phunks) { return (efp ? 1 : 0); } else if (mintStatus == MintStatus.AllowList) { if (efal) { return min(_mmpw - numMinted[wallet], mms - nmr); } else if (efp) { return 1; } else { return 0; } } else if (mintStatus == MintStatus.Public) { return min(_mmpw - numMinted[wallet], mms - nmr); } else if (mintStatus == MintStatus.PublicExtended) { return (mms - nmr); } else if (mintStatus == MintStatus.ReserveOnly) { return (efal ? 1 : 0) + (efp ? 1 : 0); } return 0; } function maxMintsPerWallet( address wallet, bytes32[] calldata _phunkProof, bytes32[] calldata _alProof ) public view returns (uint256) { return min(100, maxMintsInternal(wallet, _phunkProof, _alProof)); } function walletCanMint( address wallet, bytes32[] calldata _phunkProof, bytes32[] calldata _alProof ) public view returns (bool) { return (maxMintsPerWallet(wallet, _phunkProof, _alProof) > 0); } function _generalGetNumFree( address wallet, uint256 quantity, bytes32[] calldata _phunkProof, bytes32[] calldata _alProof ) private view returns (uint256) { uint256 toReturn; if (quantity == maxMintsPerWallet(wallet, _phunkProof, _alProof)) { toReturn = 3 - _mintClaimsMade(wallet); toReturn = min(toReturn, quantity); } else { toReturn = (eligibleForPhunk(wallet, _phunkProof) ? 1 : 0) + ((eligibleForAllowlist(wallet, _alProof) && (!(allowlistClaimed(wallet)))) ? 1 : 0); toReturn = min(toReturn, quantity); } return toReturn; } function getNumFree( address wallet, uint256 quantity, bytes32[] calldata _phunkProof, bytes32[] calldata _alProof ) public view returns (uint256) { bool efp = eligibleForPhunk(wallet, _phunkProof); uint256 ggnf = _generalGetNumFree(wallet, quantity, _phunkProof, _alProof); if (mintStatus == MintStatus.PreMint) { return 0; } else if (mintStatus == MintStatus.Phunks) { return (efp ? 1 : 0); } else if (mintStatus == MintStatus.AllowList) { if (eligibleForAllowlist(wallet, _alProof)) { return ggnf; } else if (efp) { return 1; } else { return 0; } } else if (mintStatus == MintStatus.Public || mintStatus == MintStatus.PublicExtended) { return ggnf; } else if (mintStatus == MintStatus.ReserveOnly) { return maxMintsInternal(wallet, _phunkProof, _alProof); } return 0; } function getMintCost( address wallet, uint256 quantity, bytes32[] calldata _phunkProof, bytes32[] calldata _alProof ) public view returns (uint256) { uint256 numFree = getNumFree(wallet, quantity, _phunkProof, _alProof); return mintPrice*(quantity - numFree); } ////////// function _mintMain(address _to, uint256 _quantity, uint256 _numFree, uint256 _gd, bool isReserve) private { require(!paused, "p"); require(_gd < 4, "v"); _mintRandom(_to, _quantity, _gd); numMinted[_to] += _quantity; if (isReserve) { numMintedReserve += _quantity; } else { numMintedRegular += _quantity - _numFree; numMintedReserve += _numFree; } if (numMintedRegular == maxMintableSupply) { mintStatus = MintStatus.ReserveOnly; } if (mintStatus == MintStatus.ReserveOnly) { if (numMintedReserve == maxReserveSupply) { mintStatus = MintStatus.Finished; } } } function mint( uint256 _quantity, uint256 genderDirection, bytes32[] calldata _phunkProof, bytes32[] calldata _alProof ) public payable { require(msg.sender == tx.origin, "no contracts fam"); uint256 numFree = getNumFree(msg.sender, _quantity, _phunkProof, _alProof); require(msg.value == mintPrice*(_quantity - numFree), "poor"); require(_quantity <= maxMintsPerWallet(msg.sender, _phunkProof, _alProof), "mmpw"); require(numMintedRegular + (_quantity - numFree) <= maxMintableSupply, "mms"); require(numMintedReserve + numFree <= maxReserveSupply, "mrs"); uint256 numFreeCopy = numFree; if (numFreeCopy > 0) { if (eligibleForPhunk(msg.sender, _phunkProof)) { _claimsInfo[msg.sender] += 1; _claimTypes[msg.sender] += 1; numFreeCopy -= 1; _claimsInfo[address(0)] += 1; } } if (numFreeCopy > 0) { if (eligibleForAllowlist(msg.sender, _alProof) && (!allowlistClaimed(msg.sender))) { _claimsInfo[msg.sender] += 2; _claimTypes[msg.sender] += 1; numFreeCopy -= 1; _claimsInfo[address(0)] += 1<<128; } } _claimTypes[msg.sender] += numFreeCopy; totalReceived += msg.value; _mintMain(msg.sender, _quantity, numFree, genderDirection, false); } function mintReserve( address _to, uint256 _quantity, uint256 genderDirection ) public onlyReserveAuth { _mintReserve(_to, _quantity, genderDirection); } function redeemKeyForSkelephunks( uint256 keyId, uint256 genderDirection ) public { require(msg.sender == tx.origin, "no contracts fam"); _mintReserve(msg.sender, keyRedemptionAmt, genderDirection); SkeleKeysProto(keysContract).redeemKey(keyId); } function _mintReserve( address _to, uint256 _quantity, uint256 genderDirection ) private { _mintMain(_to, _quantity, 0, genderDirection, true); _claimTypes[_to] += (_quantity<<128); } ////////// function setMintPrice(uint256 _mintPrice) public onlyOwner { mintPrice = _mintPrice; } function setMaxMintsPerWallet(uint256 __maxMintsPerWallet) public onlyOwner { _maxMintsPerWallet = __maxMintsPerWallet; } function setMerkleRoots( bytes32 _newPhunksMerkleRoot, bytes32 _newAllowlistMerkleRoot ) public onlyOwner { phunksMerkleRoot = _newPhunksMerkleRoot; merkleRoot = _newAllowlistMerkleRoot; } ////////// function getGenderAndDirection(uint256 tokenId) public view returns (uint256) { return gadOf(tokenId); } function setGenderAndDirection(uint256 tokenId, uint256 gender, uint256 direction) public { require(gender < 2 && direction < 2, "v"); setGAD(tokenId, direction*2 + gender); } ////////// function setKeysContract(address keysAddr) public onlyOwner { setReserveAuthStatus(keysContract, false); keysContract = keysAddr; setReserveAuthStatus(keysContract, true); } function setReserveAuthStatus(address addr, bool isAuthorized) public onlyOwner { _reserveAuths[addr] = isAuthorized; } function getReserveAuthStatus(address addr) public view returns (bool) { return _reserveAuths[addr]; } function setKeyRedemptionAmt(uint256 _newAmt) public onlyOwner { keyRedemptionAmt = _newAmt; } ////////// function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "z"); if (bytes(_basedURI).length > 0) { return string( abi.encodePacked( _basedURI, "/", _gdToPath[getGenderAndDirection(tokenId)], "/", tokenId.toString())); } else { return _preRevealURI; } } function setPreRevealURI(string memory preRevealURI_) public onlyOwner { _setPreRevealURI(preRevealURI_); } function setBasedURI(string memory basedURI_) public onlyOwner { _setBasedURI(basedURI_); } function setProvenanceHash(string memory provenanceHash) public onlyOwner { require(!provenanceSet); PROVENANCE = provenanceHash; provenanceSet = true; } ////////// function setApprovalForAll( address operator, bool approved ) public override onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve( address operator, uint256 tokenId ) public override onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } ////////// function setCollectionDescription(string memory _collectionDescription) public onlyOwner { collectionDescription = _collectionDescription; } function setCollectionImg(string memory _collectionImg) public onlyOwner { collectionImg = _collectionImg; } function setExternalLink(string memory _externalLink) public onlyOwner { externalLink = _externalLink; } function contractURI() public view returns (string memory) { return string( abi.encodePacked( "data:application/json;utf8,{\"name\":\"", name(),"\",", "\"description\":\"", collectionDescription, "\",", "\"image\":\"", collectionImg, "\",", "\"external_link\":\"", externalLink, "\",", "\"seller_fee_basis_points\":666,\"fee_recipient\":\"", uint256(uint160(address(this))).toHexString(), "\"}" ) ); } function flipRoyaltySwitch() public onlyOwner { royaltySwitch = !royaltySwitch; } /*********************************************************************/ /*** PAYMENT LOGIC (Start) *******************************************/ receive() external payable { totalReceived += msg.value; } function withdraw() public onlyPayee { uint256 totalForPayee = (totalReceived/10000)*paymentInfo[msg.sender]; uint256 toWithdraw = totalForPayee - amountsWithdrawn[msg.sender]; amountsWithdrawn[msg.sender] = totalForPayee; (bool success, ) = payable(msg.sender).call{value: toWithdraw}(""); require(success, "Payment failed!"); } function emergencyWithdraw() external onlyOwner { uint256 toWithdraw = address(this).balance; (bool success, ) = payable(msg.sender).call{value: toWithdraw}(""); require(success, "Payment failed!"); } function withdrawTokens(address tokenAddress) external onlyPayee { for (uint256 i = 0; i < payees.length; i++) { IERC20(tokenAddress).transfer( payees[i], (IERC20(tokenAddress).balanceOf(address(this))/10000)*paymentInfo[payees[i]] ); } } function disableEWT() public onlyOwner { canEmergencyWithdrawTokens = false; } function emergencyWithdrawTokens(address tokenAddress) external onlyOwner { require(canEmergencyWithdrawTokens, "!ew"); IERC20(tokenAddress).transfer(msg.sender, IERC20(tokenAddress).balanceOf(address(this))); } /*** PAYMENT LOGIC (End) *******************************************/ /*******************************************************************/ } //////////////////// abstract contract ERC721Proto { function balanceOf(address owner) public view virtual returns (uint256); } ////////// abstract contract SkeleKeysProto { function redeemKey(uint256 keyId) public virtual; } ////////////////////////////////////////
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { 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/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 (last updated v4.8.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 have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the 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 (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 (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { 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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFilterer} from "./OperatorFilterer.sol"; /** * @title DefaultOperatorFilterer * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription. */ abstract contract DefaultOperatorFilterer is OperatorFilterer { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external view returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function unregister(address addr) external; function updateOperator(address registrant, address operator, bool filtered) external; function updateOperators(address registrant, address[] calldata operators, bool filtered) external; function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol"; /** * @title OperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract OperatorFilterer { error OperatorNotAllowed(address operator); IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
// SPDX-License-Identifier: Unlicense // Creator: 0xYeety/YEETY.eth - Co-Founder/CTO, Virtue Labs pragma solidity ^0.8.17; import "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol"; import "lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol"; import "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "lib/openzeppelin-contracts/contracts/utils/Address.sol"; import "lib/openzeppelin-contracts/contracts/utils/Context.sol"; import "lib/openzeppelin-contracts/contracts/utils/Strings.sol"; import "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol"; contract ERC721Y is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; uint256 private currentIndex = 1; // Token name string private _name; // Token symbol string private _symbol; // Base URI string internal _basedURI; string internal _preRevealURI; mapping(uint => uint) private _availableTokens; uint256 private _numAvailableTokens; uint256 immutable _maxSupply; struct MintInfo { address minter; uint64 timeMinted; } struct TokenInfo { address owner; uint96 auxData; } mapping(uint256 => MintInfo) private _minters; // mapping(uint256 => address) private _ownerships; mapping(uint256 => TokenInfo) private _ownerships; mapping(address => uint256) private _balances; mapping(uint256 => MintInfo) private _mintOrdering; // 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; constructor( string memory name_, string memory symbol_, uint256 maxTokens_ ) { _name = name_; _symbol = symbol_; _maxSupply = maxTokens_; _numAvailableTokens = maxTokens_; } /** * @dev See {IERC721Enumerable-totalSupply}. **/ function totalSupply() public view override returns (uint256) { return _maxSupply - _numAvailableTokens; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view override returns (uint256) { require(index > 0, "i0"); uint256 pseudoIndex = index - 1; uint256 supply = totalSupply(); require(pseudoIndex < supply, "g"); uint256 curIndex = 0; for (uint256 i = 0; i < _maxSupply; i++) { if (_ownerships[i].owner != address(0)) { if (curIndex == pseudoIndex) { // return i; return (i + 1); } curIndex++; } } revert("u"); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { require(index < balanceOf(owner), "b"); uint256 curIndex = 0; for (uint256 i = 0; i < _maxSupply; i++) { if (_ownerships[i].owner == owner) { if (curIndex == index) { // return i; return (i + 1); } curIndex++; } } revert("u"); } /** * @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 || interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { require(owner != address(0), "0"); return uint256(_balances[owner]); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { require(_exists(tokenId), "e"); return _ownerships[tokenId - 1].owner; } function gadOf(uint256 tokenId) internal view returns (uint256) { require(_exists(tokenId), "e"); return uint256(_ownerships[tokenId - 1].auxData); } function setGAD(uint256 tokenId, uint256 newGAD) internal { require(ownerOf(tokenId) == msg.sender, "e"); _ownerships[tokenId - 1].auxData = uint96(newGAD); } /** * @dev gets the address that minted a token **/ function minterOf(uint256 tokenId) public view returns (address) { require(_exists(tokenId), "e"); return _minters[tokenId - 1].minter; } function mintedAt(uint256 tokenId) public view returns (uint64) { require(_exists(tokenId), "e"); return _minters[tokenId - 1].timeMinted; } /** * @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), "z"); if (bytes(_basedURI).length > 0) { return string(abi.encodePacked(_basedURI, "/", tokenId.toString(), ".json")); } else { return _preRevealURI; } } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `basedURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function basedURI() public view virtual returns (string memory) { return _basedURI; } /** * @dev Internal function to set the base URI for all token IDs. It is * automatically added as a prefix to the value returned in {tokenURI}, * or to the token ID if {tokenURI} is empty. */ function _setBasedURI(string memory basedURI_) internal virtual { _basedURI = basedURI_; } function preRevealURI() public view virtual returns (string memory) { return _preRevealURI; } function _setPreRevealURI(string memory preRevealURI_) internal virtual { _preRevealURI = preRevealURI_; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Y.ownerOf(tokenId); require(to != owner, "o"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "a" ); _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { require(_exists(tokenId), "a"); return _tokenApprovals[tokenId - 1]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "a"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } function setApprovalForSelf(address operator, bool approved) internal { _operatorApprovals[address(this)][operator] = approved; emit ApprovalForAll(address(this), 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 { _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 { _transfer(from, to, tokenId); require( _checkOnERC721Received(from, to, tokenId, _data), "z" ); } /** * @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`), */ function _exists(uint256 tokenId) internal view returns (bool) { if (tokenId == 0) { return false; } return (_ownerships[tokenId - 1].owner != address(0)); } /******************/ function _mintIdWithoutBalanceUpdate(address to, uint256 tokenId, uint256 gad) private { _ownerships[tokenId].owner = to; _ownerships[tokenId].auxData = uint96(gad); _minters[tokenId].minter = to; _minters[tokenId].timeMinted = uint64(block.timestamp); emit Transfer(address(0), to, tokenId + 1); } function _mintRandom(address to, uint _quantity, uint256 gad) internal virtual returns (uint256[] memory) { require(to != address(0), "0"); require(_quantity > 0, "1"); uint256[] memory toReturn = new uint256[](_quantity); uint updatedNumAvailableTokens = _numAvailableTokens; uint256 randomNum; for (uint256 i = 0; i < _quantity; i++) { // Do this ++ unchecked? uint256 modPos = i%16; if (modPos == 0) { randomNum = getRandomAvailableTokenId(to, updatedNumAvailableTokens); } uint256 randomIndex = (randomNum>>(modPos*16)) % updatedNumAvailableTokens; uint256 tokenId = getAvailableTokenAtIndex(randomIndex, updatedNumAvailableTokens); _mintIdWithoutBalanceUpdate(to, tokenId, gad); toReturn[i] = (tokenId + 1); updatedNumAvailableTokens--; } _numAvailableTokens = updatedNumAvailableTokens; _balances[to] += _quantity; _mintOrdering[currentIndex].minter = to; _mintOrdering[currentIndex].timeMinted = uint64(block.timestamp); currentIndex += _quantity; return toReturn; } function getRandomAvailableTokenId( address to, uint updatedNumAvailableTokens ) internal view returns (uint256) { uint256 randomNum = uint256( keccak256( abi.encode( to, tx.gasprice, block.number, block.timestamp, block.difficulty, blockhash(block.number - 1), address(this), updatedNumAvailableTokens ) ) ); return randomNum; // uint256 randomIndex = randomNum % updatedNumAvailableTokens; // return getAvailableTokenAtIndex(randomIndex, updatedNumAvailableTokens); } // Implements https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle. Code taken from CryptoPhunksV2 function getAvailableTokenAtIndex( uint256 indexToUse, uint256 updatedNumAvailableTokens ) internal returns (uint256) { uint256 valAtIndex = _availableTokens[indexToUse]; uint256 result; if (valAtIndex == 0) { // This means the index itself is still an available token result = indexToUse; } else { // This means the index itself is not an available token, but the val at that index is. result = valAtIndex; } uint256 lastIndex = updatedNumAvailableTokens - 1; if (indexToUse != lastIndex) { // Replace the value at indexToUse, now that it's been used. // Replace it with the data from the last index in the array, since we are going to decrease the array size afterwards. uint256 lastValInArray = _availableTokens[lastIndex]; if (lastValInArray == 0) { // This means the index itself is still an available token _availableTokens[indexToUse] = lastIndex; } else { // This means the index itself is not an available token, but the val at that index is. _availableTokens[indexToUse] = lastValInArray; // Gas refund courtsey of @dievardump delete _availableTokens[lastIndex]; } } return result; } function getMintOrderInfoByIndex(uint256 index) private view returns (MintInfo memory) { if (index > totalSupply()) { return _mintOrdering[0]; } for (uint256 i = index; i > 0; i--) { if (_mintOrdering[i].minter != address(0)) { return _mintOrdering[i]; } } return _mintOrdering[0]; // revert("u"); } function getMinterByOrderIndex(uint256 index) public view returns (address) { MintInfo memory info = getMintOrderInfoByIndex(index); return info.minter; } function getMintTimeByOrderIndex(uint256 index) public view returns (uint64) { MintInfo memory info = getMintOrderInfoByIndex(index); return info.timeMinted; } /******************/ function _transfer( address from, address to, uint256 tokenId ) private { address prevOwnership = ownerOf(tokenId); bool isApprovedOrOwner = (_msgSender() == prevOwnership || getApproved(tokenId) == _msgSender() || isApprovedForAll(prevOwnership, _msgSender())); require(isApprovedOrOwner, "a"); require(prevOwnership == from, "o"); require(to != address(0), "0"); // Clear approvals from the previous owner _approve(address(0), tokenId, prevOwnership); _balances[from] -= 1; _balances[to] += 1; _ownerships[tokenId - 1].owner = to; emit Transfer(from, to, tokenId); } function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId - 1] = to; emit Approval(owner, to, tokenId); } /******************/ 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(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("z"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } } ////////////////////////////////////////
{ "remappings": [ "ds-test/=lib/operator-filter-registry/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/operator-filter-registry/lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/operator-filter-registry/lib/forge-std/src/", "openzeppelin-contracts-upgradeable/=lib/operator-filter-registry/lib/openzeppelin-contracts-upgradeable/contracts/", "openzeppelin-contracts/=lib/operator-filter-registry/lib/openzeppelin-contracts/contracts/", "operator-filter-registry/=lib/operator-filter-registry/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint256","name":"maxMintsPerWallet_","type":"uint256"},{"internalType":"address[]","name":"payees_","type":"address[]"},{"internalType":"uint256[]","name":"basisPoints_","type":"uint256[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROVENANCE","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"allowlistClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistClaimsMade","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistClaimsRemain","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"basedURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableEWT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"eligibleForAllowlist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"eligibleForPhunk","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"emergencyWithdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipRoyaltySwitch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getGenderAndDirection","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes32[]","name":"_phunkProof","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_alProof","type":"bytes32[]"}],"name":"getMintCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getMintTimeByOrderIndex","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getMinterByOrderIndex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes32[]","name":"_phunkProof","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_alProof","type":"bytes32[]"}],"name":"getNumFree","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"getReserveAuthStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isPayee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keyRedemptionAmt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keysContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAllowlistClaims","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintableSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32[]","name":"_phunkProof","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_alProof","type":"bytes32[]"}],"name":"maxMintsPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPhunkClaims","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPossibleSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxReserveSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"genderDirection","type":"uint256"},{"internalType":"bytes32[]","name":"_phunkProof","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_alProof","type":"bytes32[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"genderDirection","type":"uint256"}],"name":"mintReserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintStatus","outputs":[{"internalType":"enum Skelephunks.MintStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintedAt","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"minterOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numMintedRegular","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numMintedReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"payees","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phunkClaimsMade","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phunkClaimsRemain","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"phunkListClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phunksMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"numsToMint","type":"uint256[]"},{"internalType":"uint256[]","name":"gds","type":"uint256[]"},{"internalType":"bool","name":"lock","type":"bool"}],"name":"preMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"preMintLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"preRevealURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"keyId","type":"uint256"},{"internalType":"uint256","name":"genderDirection","type":"uint256"}],"name":"redeemKeyForSkelephunks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"basedURI_","type":"string"}],"name":"setBasedURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_collectionDescription","type":"string"}],"name":"setCollectionDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_collectionImg","type":"string"}],"name":"setCollectionImg","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_externalLink","type":"string"}],"name":"setExternalLink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"gender","type":"uint256"},{"internalType":"uint256","name":"direction","type":"uint256"}],"name":"setGenderAndDirection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAmt","type":"uint256"}],"name":"setKeyRedemptionAmt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"keysAddr","type":"address"}],"name":"setKeysContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"__maxMintsPerWallet","type":"uint256"}],"name":"setMaxMintsPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_newPhunksMerkleRoot","type":"bytes32"},{"internalType":"bytes32","name":"_newAllowlistMerkleRoot","type":"bytes32"}],"name":"setMerkleRoots","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintPrice","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum Skelephunks.MintStatus","name":"newMintStatus","type":"uint8"}],"name":"setMintStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"preRevealURI_","type":"string"}],"name":"setPreRevealURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"provenanceHash","type":"string"}],"name":"setProvenanceHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"isAuthorized","type":"bool"}],"name":"setReserveAuthStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"totalClaimsMade","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"bytes32[]","name":"_phunkProof","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_alProof","type":"bytes32[]"}],"name":"walletCanMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6001600081815560148190556016805460ff191690921790915566753d533d968000601755600a6018556019805461ffff1916905561270f601a55611a0a601b55601c819055610d05601d55601e55610120604052604460a0818152906200539a60c039602090620000729082620006d9565b50604080516020810190915260008152602190620000919082620006d9565b5060408051808201909152601781527f68747470733a2f2f736b656c657068756e6b732e636f6d0000000000000000006020820152602290620000d59082620006d9565b507f2df951fbc5be4633d24a81d65bfa4cf92133f3ada0d2a884f39955bd22444b2460235560696024557fdb815420d65ef8b0dec059847253b71b167965c78bd17b5a961dc8688ded7cfd6025556106196026556003602b55602c805461ffff191660011790553480156200014957600080fd5b50604051620053de380380620053de8339810160408190526200016c91620008fe565b733cc6cdda760b79bafa08df41ecfa224f810dceb660018686601a548260019081620001999190620006d9565b506002620001a88382620006d9565b50608081905260065550620001bf90503362000561565b6daaeb6d7670e522a718067333cd4e3b15620003045780156200025257604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200023357600080fd5b505af115801562000248573d6000803e3d6000fd5b5050505062000304565b6001600160a01b03821615620002a35760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000218565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b158015620002ea57600080fd5b505af1158015620002ff573d6000803e3d6000fd5b505050505b5050601f8390558051825114620003455760405162461bcd60e51b81526020600482015260016024820152601b60fa1b604482015260640160405180910390fd5b81516200035a906012906020850190620005b3565b5060005b8251811015620003e0578181815181106200037d576200037d62000a31565b6020026020010151601360008584815181106200039e576200039e62000a31565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055508080620003d79062000a47565b9150506200035e565b5060408051808201909152600a8152697068756e6b2f6d616c6560b01b60208083019190915260008052601190527f4ad3b33220dddc71b994a52d72c06b10862965f7d926534c05c00fb7e819e7b7906200043c9082620006d9565b5060408051808201909152600c81526b7068756e6b2f66656d616c6560a01b6020808301919091526001600052601190527f17bc176d2408558f6e4111feebc3cab4e16b63e967be91cde721f4c8a488b552906200049b9082620006d9565b5060408051808201909152600981526870756e6b2f6d616c6560b81b6020808301919091526002600052601190527f08037d7b151cc412d25674a4e66b334d9ae9d2e5517a7feaae5cdb828bf1c62890620004f79082620006d9565b5060408051808201909152600b81526a70756e6b2f66656d616c6560a81b6020808301919091526003600052601190527f9bfbaa59f8e10e7868f8b402de9d605a390c45ddaebd8c9de3c6f31e733c87ff90620005559082620006d9565b50505050505062000a6f565b600d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280548282559060005260206000209081019282156200060b579160200282015b828111156200060b57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620005d4565b50620006199291506200061d565b5090565b5b808211156200061957600081556001016200061e565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200065f57607f821691505b6020821081036200068057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620006d457600081815260208120601f850160051c81016020861015620006af5750805b601f850160051c820191505b81811015620006d057828155600101620006bb565b5050505b505050565b81516001600160401b03811115620006f557620006f562000634565b6200070d816200070684546200064a565b8462000686565b602080601f8311600181146200074557600084156200072c5750858301515b600019600386901b1c1916600185901b178555620006d0565b600085815260208120601f198616915b82811015620007765788860151825594840194600190910190840162000755565b5085821015620007955787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604051601f8201601f191681016001600160401b0381118282101715620007d057620007d062000634565b604052919050565b600082601f830112620007ea57600080fd5b81516001600160401b0381111562000806576200080662000634565b60206200081c601f8301601f19168201620007a5565b82815285828487010111156200083157600080fd5b60005b838110156200085157858101830151828201840152820162000834565b506000928101909101919091529392505050565b60006001600160401b0382111562000881576200088162000634565b5060051b60200190565b600082601f8301126200089d57600080fd5b81516020620008b6620008b08362000865565b620007a5565b82815260059290921b84018101918181019086841115620008d657600080fd5b8286015b84811015620008f35780518352918301918301620008da565b509695505050505050565b600080600080600060a086880312156200091757600080fd5b85516001600160401b03808211156200092f57600080fd5b6200093d89838a01620007d8565b96506020915081880151818111156200095557600080fd5b620009638a828b01620007d8565b965050604088015194506060880151818111156200098057600080fd5b8801601f81018a136200099257600080fd5b8051620009a3620008b08262000865565b81815260059190911b8201840190848101908c831115620009c357600080fd5b928501925b82841015620009fa5783516001600160a01b0381168114620009ea5760008081fd5b82529285019290850190620009c8565b60808c015190975094505050508082111562000a1557600080fd5b5062000a24888289016200088b565b9150509295509295909350565b634e487b7160e01b600052603260045260246000fd5b60006001820162000a6857634e487b7160e01b600052601160045260246000fd5b5060010190565b60805161490162000a9960003960008181611154015281816112a4015261177c01526149016000f3fe6080604052600436106104b95760003560e01c8063740ac6f61161026b578063b2af127c1161014f578063db2e21bc116100c1578063ede029fc11610085578063ede029fc14610e75578063f1b0aa1514610e95578063f2eb817214610eb5578063f2fde38b14610ed5578063f4a0a52814610ef5578063f8cf016314610f1557600080fd5b8063db2e21bc14610dd8578063df87694914610ded578063e8a3d48514610e02578063e985e9c514610e17578063ecb3f09a14610e6057600080fd5b8063c48f653111610113578063c48f653114610d20578063c87b56dd14610d58578063ce8539b114610d78578063cffb47cf14610d8d578063d831f62314610da3578063daf5085914610db857600080fd5b8063b2af127c14610c97578063b6d04a0b14610cb7578063b81440bb14610cd7578063b88d4fde14610ced578063bb42436914610d0d57600080fd5b80638da5cb5b116101e85780639cf618e2116101ac5780639cf618e214610bd15780639da3f8fd14610bf05780639e942ace14610c175780639e96165814610c37578063a22cb46514610c57578063aff8cfa114610c7757600080fd5b80638da5cb5b14610b3e5780639471302e14610b5c57806395d89b4114610b7c578063963c354614610b915780639a48eb5114610bb157600080fd5b8063814c8c551161022f578063814c8c5514610a9e5780638305778a14610abe578063881e68c614610ade5780638ac06d3914610afe5780638ca1f0cf14610b1e57600080fd5b8063740ac6f614610a09578063741fd87214610a2957806379b6ed3614610a495780637ccd788714610a5e5780637e12dc1114610a7e57600080fd5b8063366653a91161039d5780634f6ccce71161030f5780636352211e116102d35780636352211e146109735780636373a6b1146109935780636817c76c146109a85780636b90fa85146109be57806370a08231146109d4578063715018a6146109f457600080fd5b80634f6ccce7146108de5780635b2ca084146108fe5780635c975abb1461091e5780636095049a1461093d57806363037b0c1461095357600080fd5b806341422eed1161036157806341422eed1461081857806341f434341461082e57806342842e0e1461085057806344dd599b146108705780634811ea441461089057806349df728c146108be57600080fd5b8063366653a91461078a578063386b7691146107c25780633b0d58a4146107d85780633ccfd60b146107ed5780633cf013441461080257600080fd5b80631a05dc87116104365780632eb4a7ab116103fa5780632eb4a7ab146106e95780632f745c59146106ff57806330359e5f1461071f578063303a67d01461073f57806330b42ec214610755578063333171bb1461077557600080fd5b80631a05dc871461063c5780631f9179211461065c57806320fc7eb21461067c57806323b872dd146106a95780632a85db55146106c957600080fd5b8063095ea7b31161047d578063095ea7b3146105b057806310969523146105d257806313ea7b04146105f257806318160ddd146106075780631931225b1461061c57600080fd5b806301ffc9a7146104dd57806304a6c8c9146105125780630519ef1f1461053657806306fdde0314610556578063081812fc1461057857600080fd5b366104d85734601460008282546104d09190613d26565b925050819055005b600080fd5b3480156104e957600080fd5b506104fd6104f8366004613d4f565b610f4e565b60405190151581526020015b60405180910390f35b34801561051e57600080fd5b50610528601b5481565b604051908152602001610509565b34801561054257600080fd5b50610528610551366004613dce565b610fbb565b34801561056257600080fd5b5061056b610ff3565b6040516105099190613ea7565b34801561058457600080fd5b50610598610593366004613eba565b611085565b6040516001600160a01b039091168152602001610509565b3480156105bc57600080fd5b506105d06105cb366004613ed3565b6110e4565b005b3480156105de57600080fd5b506105d06105ed366004613f88565b611109565b3480156105fe57600080fd5b5061056b61113e565b34801561061357600080fd5b5061052861114d565b34801561062857600080fd5b506105d0610637366004613fd0565b611182565b34801561064857600080fd5b506104fd610657366004613ffc565b6111e1565b34801561066857600080fd5b506105d0610677366004613f88565b6111fe565b34801561068857600080fd5b5061052861069736600461407c565b60106020526000908152604090205481565b3480156106b557600080fd5b506105d06106c4366004614097565b611216565b3480156106d557600080fd5b506105d06106e4366004613f88565b61124d565b3480156106f557600080fd5b5061052860255481565b34801561070b57600080fd5b5061052861071a366004613ed3565b611261565b34801561072b57600080fd5b506105d061073a3660046140d3565b611353565b34801561074b57600080fd5b50610528601c5481565b34801561076157600080fd5b506104fd61077036600461407c565b6113a2565b34801561078157600080fd5b506105d06113ec565b34801561079657600080fd5b506104fd6107a536600461407c565b6001600160a01b0316600090815260136020526040902054151590565b3480156107ce57600080fd5b50610528601a5481565b3480156107e457600080fd5b50610528611411565b3480156107f957600080fd5b506105d061143a565b34801561080e57600080fd5b5061052860265481565b34801561082457600080fd5b5061052860245481565b34801561083a57600080fd5b506105986daaeb6d7670e522a718067333cd4e81565b34801561085c57600080fd5b506105d061086b366004614097565b611524565b34801561087c57600080fd5b5061052861088b366004613eba565b611555565b34801561089c57600080fd5b506000805260276020526000805160206148ac8339815191525460801c610528565b3480156108ca57600080fd5b506105d06108d936600461407c565b611560565b3480156108ea57600080fd5b506105286108f9366004613eba565b6116f2565b34801561090a57600080fd5b506105d0610919366004614106565b6117f1565b34801561092a57600080fd5b506019546104fd90610100900460ff1681565b34801561094957600080fd5b50610528601e5481565b34801561095f57600080fd5b5061059861096e366004613eba565b6118a2565b34801561097f57600080fd5b5061059861098e366004613eba565b6118cc565b34801561099f57600080fd5b5061056b611902565b3480156109b457600080fd5b5061052860175481565b3480156109ca57600080fd5b5061052860235481565b3480156109e057600080fd5b506105286109ef36600461407c565b611990565b348015610a0057600080fd5b506105d06119d4565b348015610a1557600080fd5b506104fd610a24366004614128565b6119e8565b348015610a3557600080fd5b50602a54610598906001600160a01b031681565b348015610a5557600080fd5b5061056b611a89565b348015610a6a57600080fd5b506105d0610a79366004613eba565b611a98565b348015610a8a57600080fd5b506104fd610a99366004614128565b611aa5565b348015610aaa57600080fd5b506105d0610ab936600461417a565b611b16565b348015610aca57600080fd5b506104fd610ad936600461407c565b611baf565b348015610aea57600080fd5b50610598610af9366004613eba565b611c05565b348015610b0a57600080fd5b506105d0610b1936600461407c565b611c19565b348015610b2a57600080fd5b506105d0610b39366004613f88565b611c61565b348015610b4a57600080fd5b50600d546001600160a01b0316610598565b348015610b6857600080fd5b506105d0610b77366004613f88565b611c75565b348015610b8857600080fd5b5061056b611c89565b348015610b9d57600080fd5b506105d0610bac366004613eba565b611c98565b348015610bbd57600080fd5b506105d0610bcc366004614106565b611ca5565b348015610bdd57600080fd5b50602c546104fd90610100900460ff1681565b348015610bfc57600080fd5b50601954610c0a9060ff1681565b60405161050991906141b1565b348015610c2357600080fd5b50610598610c32366004613eba565b611cb8565b348015610c4357600080fd5b506105d0610c523660046141e7565b611cee565b348015610c6357600080fd5b506105d0610c72366004614294565b611e29565b348015610c8357600080fd5b506105d0610c92366004614294565b611e49565b348015610ca357600080fd5b506105d0610cb236600461407c565b611e7c565b348015610cc357600080fd5b50610528610cd236600461407c565b611f9d565b348015610ce357600080fd5b50610528602b5481565b348015610cf957600080fd5b506105d0610d083660046142cb565b611fcc565b6105d0610d1b366004614346565b612005565b348015610d2c57600080fd5b50610d40610d3b366004613eba565b61232d565b6040516001600160401b039091168152602001610509565b348015610d6457600080fd5b5061056b610d73366004613eba565b612344565b348015610d8457600080fd5b506105d0612467565b348015610d9957600080fd5b50610528601d5481565b348015610daf57600080fd5b506104fd612483565b348015610dc457600080fd5b50610528610dd3366004613dce565b6124b0565b348015610de457600080fd5b506105d0612613565b348015610df957600080fd5b506104fd6126a7565b348015610e0e57600080fd5b5061056b6126b4565b348015610e2357600080fd5b506104fd610e32366004614384565b6001600160a01b039182166000908152600c6020908152604080832093909416825291909152205460ff1690565b348015610e6c57600080fd5b506105d06126f5565b348015610e8157600080fd5b506105d0610e90366004613f88565b612709565b348015610ea157600080fd5b50610d40610eb0366004613eba565b61271a565b348015610ec157600080fd5b50610528610ed0366004613ffc565b612777565b348015610ee157600080fd5b506105d0610ef036600461407c565b612790565b348015610f0157600080fd5b506105d0610f10366004613eba565b612806565b348015610f2157600080fd5b506104fd610f3036600461407c565b6001600160a01b031660009081526029602052604090205460ff1690565b60006001600160e01b031982166380ac58cd60e01b1480610f7f57506001600160e01b03198216635b5e139f60e01b145b80610f9a57506001600160e01b0319821663780e9d6360e01b145b80610fb557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600080610fcc8888888888886124b0565b9050610fd881886143b7565b601754610fe591906143ca565b9150505b9695505050505050565b606060018054611002906143e1565b80601f016020809104026020016040519081016040528092919081815260200182805461102e906143e1565b801561107b5780601f106110505761010080835404028352916020019161107b565b820191906000526020600020905b81548152906001019060200180831161105e57829003601f168201915b5050505050905090565b600061109082612813565b6110b55760405162461bcd60e51b81526004016110ac90614415565b60405180910390fd5b600b60006110c46001856143b7565b81526020810191909152604001600020546001600160a01b031692915050565b602c54829060ff16156110fa576110fa81612857565b6111048383612910565b505050565b6111116129a5565b600f5460ff161561112157600080fd5b600e61112d8282614476565b5050600f805460ff19166001179055565b606060038054611002906143e1565b60006006547f000000000000000000000000000000000000000000000000000000000000000061117d91906143b7565b905090565b6002821080156111925750600281105b6111c25760405162461bcd60e51b81526020600482015260016024820152603b60f91b60448201526064016110ac565b61110483836111d28460026143ca565b6111dc9190613d26565b6129ff565b6000806111f18787878787612777565b1190505b95945050505050565b6112066129a5565b60226112128282614476565b5050565b602c54839060ff161561123c576001600160a01b038116331461123c5761123c33612857565b611247848484612a78565b50505050565b6112556129a5565b61125e81612a83565b50565b600061126c83611990565b821061129e5760405162461bcd60e51b81526020600482015260016024820152603160f91b60448201526064016110ac565b6000805b7f0000000000000000000000000000000000000000000000000000000000000000811015611326576000818152600860205260409020546001600160a01b0380871691160361131457838203611306576112fd816001613d26565b92505050610fb5565b8161131081614535565b9250505b8061131e81614535565b9150506112a2565b5060405162461bcd60e51b81526020600482015260016024820152607560f81b60448201526064016110ac565b3360009081526029602052604090205460ff166113975760405162461bcd60e51b8152602060048201526002602482015261726160f01b60448201526064016110ac565b611104838383612a8f565b60006001600160a01b0382166113ca5760405162461bcd60e51b81526004016110ac9061454e565b506001600160a01b0316600090815260276020526040902054600190811c1490565b6113f46129a5565b6019805461ff001981166101009182900460ff1615909102179055565b600080805260276020526000805160206148ac8339815191525461117d90600160801b9061457f565b611442612ad4565b336000908152601360205260408120546014546114629061271090614593565b61146c91906143ca565b336000908152601560205260408120549192509061148a90836143b7565b33600081815260156020526040808220869055519293509183908381818185875af1925050503d80600081146114dc576040519150601f19603f3d011682016040523d82523d6000602084013e6114e1565b606091505b50509050806111045760405162461bcd60e51b815260206004820152600f60248201526e5061796d656e74206661696c65642160881b60448201526064016110ac565b602c54839060ff161561154a576001600160a01b038116331461154a5761154a33612857565b611247848484612b1e565b6000610fb582612b39565b611568612ad4565b60005b60125481101561121257816001600160a01b031663a9059cbb60128381548110611597576115976145a7565b9060005260206000200160009054906101000a90046001600160a01b031660136000601286815481106115cc576115cc6145a7565b60009182526020808320909101546001600160a01b03908116845290830193909352604091820190205490516370a0823160e01b8152306004820152909161271091908816906370a0823190602401602060405180830381865afa158015611638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165c91906145bd565b6116669190614593565b61167091906143ca565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df91906145d6565b50806116ea81614535565b91505061156b565b60008082116117285760405162461bcd60e51b8152602060048201526002602482015261069360f41b60448201526064016110ac565b60006117356001846143b7565b9050600061174161114d565b90508082106117765760405162461bcd60e51b81526020600482015260016024820152606760f81b60448201526064016110ac565b6000805b7f0000000000000000000000000000000000000000000000000000000000000000811015611326576000818152600860205260409020546001600160a01b0316156117df578382036117d157610fe9816001613d26565b816117db81614535565b9250505b806117e981614535565b91505061177a565b3332146118335760405162461bcd60e51b815260206004820152601060248201526f6e6f20636f6e7472616374732066616d60801b60448201526064016110ac565b61184033602b5483612a8f565b602a546040516363aac3a360e01b8152600481018490526001600160a01b03909116906363aac3a390602401600060405180830381600087803b15801561188657600080fd5b505af115801561189a573d6000803e3d6000fd5b505050505050565b601281815481106118b257600080fd5b6000918252602090912001546001600160a01b0316905081565b60006118d782612813565b6118f35760405162461bcd60e51b81526004016110ac906145f3565b600860006110c46001856143b7565b600e805461190f906143e1565b80601f016020809104026020016040519081016040528092919081815260200182805461193b906143e1565b80156119885780601f1061195d57610100808354040283529160200191611988565b820191906000526020600020905b81548152906001019060200180831161196b57829003601f168201915b505050505081565b60006001600160a01b0382166119b85760405162461bcd60e51b81526004016110ac9061454e565b506001600160a01b031660009081526009602052604090205490565b6119dc6129a5565b6119e66000612b96565b565b60006119f384611baf565b158015611a725750611a72838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506023546040516bffffffffffffffffffffffff1960608b901b16602082015290925060340190505b60405160208183030381529060405280519060200120612be8565b8015611a815750611a816126a7565b949350505050565b606060048054611002906143e1565b611aa06129a5565b602b55565b6000611b07838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506025546040516bffffffffffffffffffffffff1960608b901b1660208201529092506034019050611a57565b8015611a815750611a81612483565b611b1e6129a5565b6000816006811115611b3257611b3261419b565b14158015611b575750600660195460ff166006811115611b5457611b5461419b565b14155b611b885760405162461bcd60e51b81526020600482015260026024820152616d7360f01b60448201526064016110ac565b6019805482919060ff19166001836006811115611ba757611ba761419b565b021790555050565b60006001600160a01b038216611bd75760405162461bcd60e51b81526004016110ac9061454e565b6001600160a01b038216600090815260276020526040902054611bfc9060029061457f565b60011492915050565b600080611c1183612bfe565b519392505050565b611c216129a5565b602a54611c38906001600160a01b03166000611e49565b602a80546001600160a01b0319166001600160a01b03831690811790915561125e906001611e49565b611c696129a5565b60216112128282614476565b611c7d6129a5565b60206112128282614476565b606060028054611002906143e1565b611ca06129a5565b601f55565b611cad6129a5565b602391909155602555565b6000611cc382612813565b611cdf5760405162461bcd60e51b81526004016110ac906145f3565b600760006110c46001856143b7565b611cf66129a5565b602c54610100900460ff1615611d345760405162461bcd60e51b81526020600482015260036024820152621c1b5b60ea1b60448201526064016110ac565b60005b84811015611e08576004848483818110611d5357611d536145a7565b9050602002013510611d915760405162461bcd60e51b81526020600482015260076024820152661898590819d85960ca1b60448201526064016110ac565b611df6888883818110611da657611da66145a7565b9050602002016020810190611dbb919061407c565b878784818110611dcd57611dcd6145a7565b905060200201356000878786818110611de857611de86145a7565b905060200201356000612d58565b80611e0081614535565b915050611d37565b50602c80549115156101000261ff0019909216919091179055505050505050565b602c54829060ff1615611e3f57611e3f81612857565b6111048383612eb4565b611e516129a5565b6001600160a01b03919091166000908152602960205260409020805460ff1916911515919091179055565b611e846129a5565b60165460ff16611ebc5760405162461bcd60e51b815260206004820152600360248201526221657760e81b60448201526064016110ac565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa158015611f0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2e91906145bd565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611f79573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121291906145d6565b6001600160a01b03811660009081526028602052604081205460801c611fc283612f48565b610fb59190613d26565b602c54849060ff1615611ff2576001600160a01b0381163314611ff257611ff233612857565b611ffe85858585612f70565b5050505050565b3332146120475760405162461bcd60e51b815260206004820152601060248201526f6e6f20636f6e7472616374732066616d60801b60448201526064016110ac565b60006120573388878787876124b0565b905061206381886143b7565b60175461207091906143ca565b34146120a75760405162461bcd60e51b81526004016110ac906020808252600490820152633837b7b960e11b604082015260600190565b6120b43386868686612777565b8711156120ec5760405162461bcd60e51b81526004016110ac906020808252600490820152636d6d707760e01b604082015260600190565b601b546120f982896143b7565b601c546121069190613d26565b111561213a5760405162461bcd60e51b81526020600482015260036024820152626d6d7360e81b60448201526064016110ac565b601d5481601e5461214b9190613d26565b111561217f5760405162461bcd60e51b81526020600482015260036024820152626d727360e81b60448201526064016110ac565b808015612221576121913387876119e8565b15612221573360009081526027602052604081208054600192906121b6908490613d26565b90915550503360009081526028602052604081208054600192906121db908490613d26565b909155506121ec90506001826143b7565b600080805260276020526000805160206148ac833981519152805492935060019290919061221b908490613d26565b90915550505b80156122d757612232338585611aa5565b80156122445750612242336113a2565b155b156122d757336000908152602760205260408120805460029290612269908490613d26565b909155505033600090815260286020526040812080546001929061228e908490613d26565b9091555061229f90506001826143b7565b600080805260276020526000805160206148ac8339815191528054929350600160801b929091906122d1908490613d26565b90915550505b33600090815260286020526040812080548392906122f6908490613d26565b92505081905550346014600082825461230f9190613d26565b9091555061232390503389848a6000612d58565b5050505050505050565b60008061233983612bfe565b602001519392505050565b606061234f82612813565b61236b5760405162461bcd60e51b81526004016110ac9061460e565b60006003805461237a906143e1565b905011156123d05760036011600061239185611555565b81526020019081526020016000206123a884612fa3565b6040516020016123ba939291906146b8565b6040516020818303038152906040529050919050565b600480546123dd906143e1565b80601f0160208091040260200160405190810160405280929190818152602001828054612409906143e1565b80156124565780601f1061242b57610100808354040283529160200191612456565b820191906000526020600020905b81548152906001019060200180831161243957829003601f168201915b50505050509050919050565b919050565b61246f6129a5565b602c805460ff19811660ff90911615179055565b60006026546124aa6000805260276020526000805160206148ac8339815191525460801c90565b10905090565b6000806124be8887876119e8565b905060006124d0898989898989613035565b9050600060195460ff1660068111156124eb576124eb61419b565b036124fb57600092505050610fe9565b600160195460ff1660068111156125145761251461419b565b036125345781612525576000612528565b60015b60ff1692505050610fe9565b600260195460ff16600681111561254d5761254d61419b565b036125875761255d898686611aa5565b1561256b579150610fe99050565b811561257c57600192505050610fe9565b600092505050610fe9565b600360195460ff1660068111156125a0576125a061419b565b14806125c25750600460195460ff1660068111156125c0576125c061419b565b145b156125d0579150610fe99050565b600560195460ff1660068111156125e9576125e961419b565b03612604576125fb89888888886130dd565b92505050610fe9565b50600098975050505050505050565b61261b6129a5565b6040514790600090339083908381818185875af1925050503d806000811461265f576040519150601f19603f3d011682016040523d82523d6000602084013e612664565b606091505b50509050806112125760405162461bcd60e51b815260206004820152600f60248201526e5061796d656e74206661696c65642160881b60448201526064016110ac565b60006024546124aa611411565b60606126be610ff3565b6020602160226126cd306132b7565b6040516020016126e19594939291906146ff565b604051602081830303815290604052905090565b6126fd6129a5565b6016805460ff19169055565b6127116129a5565b61125e816132ce565b600061272582612813565b6127415760405162461bcd60e51b81526004016110ac906145f3565b600760006127506001856143b7565b8152602081019190915260400160002054600160a01b90046001600160401b031692915050565b6000610fe9606461278b88888888886130dd565b6132da565b6127986129a5565b6001600160a01b0381166127fd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016110ac565b61125e81612b96565b61280e6129a5565b601755565b60008160000361282557506000919050565b60006008816128356001866143b7565b81526020810191909152604001600020546001600160a01b0316141592915050565b6daaeb6d7670e522a718067333cd4e3b1561125e57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156128c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e891906145d6565b61125e57604051633b79c77360e21b81526001600160a01b03821660048201526024016110ac565b600061291b826118cc565b9050806001600160a01b0316836001600160a01b0316036129625760405162461bcd60e51b81526020600482015260016024820152606f60f81b60448201526064016110ac565b336001600160a01b038216148061297e575061297e8133610e32565b61299a5760405162461bcd60e51b81526004016110ac90614415565b6111048383836132f1565b600d546001600160a01b031633146119e65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016110ac565b33612a09836118cc565b6001600160a01b031614612a2f5760405162461bcd60e51b81526004016110ac906145f3565b8060086000612a3f6001866143b7565b815260200190815260200160002060000160146101000a8154816001600160601b0302191690836001600160601b031602179055505050565b611104838383613364565b60046112128282614476565b612a9e83836000846001612d58565b6001600160a01b03831660009081526028602052604081208054608085901b9290612aca908490613d26565b9091555050505050565b336000908152601360205260409020546119e65760405162461bcd60e51b815260206004820152600b60248201526a6e6f74206120706179656560a81b60448201526064016110ac565b61110483838360405180602001604052806000815250611fcc565b6000612b4482612813565b612b605760405162461bcd60e51b81526004016110ac906145f3565b60086000612b6f6001856143b7565b8152602081019190915260400160002054600160a01b90046001600160601b031692915050565b600d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600082612bf58584613512565b14949350505050565b6040805180820190915260008082526020820152612c1a61114d565b821115612c8057505060008052600a6020908152604080518082019091527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e3546001600160a01b0381168252600160a01b90046001600160401b03169181019190915290565b815b8015612cf8576000818152600a60205260409020546001600160a01b031615612ce6576000908152600a60209081526040918290208251808401909352546001600160a01b0381168352600160a01b90046001600160401b03169082015292915050565b80612cf08161482b565b915050612c82565b50506000805250600a6020908152604080518082019091527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e3546001600160a01b0381168252600160a01b90046001600160401b03169181019190915290565b601954610100900460ff1615612d945760405162461bcd60e51b81526020600482015260016024820152600760fc1b60448201526064016110ac565b60048210612dc85760405162461bcd60e51b81526020600482015260016024820152603b60f91b60448201526064016110ac565b612dd385858461355f565b506001600160a01b03851660009081526010602052604081208054869290612dfc908490613d26565b90915550508015612e245783601e6000828254612e199190613d26565b90915550612e5e9050565b612e2e83856143b7565b601c6000828254612e3f9190613d26565b9250508190555082601e6000828254612e589190613d26565b90915550505b601b54601c5403612e77576019805460ff191660051790555b600560195460ff166006811115612e9057612e9061419b565b03611ffe57601d54601e5403611ffe5750506019805460ff19166006179055505050565b336001600160a01b03831603612edc5760405162461bcd60e51b81526004016110ac90614415565b336000818152600c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6001600160a01b038116600090815260286020526040812054610fb590600160801b9061457f565b612f7b848484613364565b612f878484848461375d565b6112475760405162461bcd60e51b81526004016110ac9061460e565b60606000612fb08361385e565b60010190506000816001600160401b03811115612fcf57612fcf613efd565b6040519080825280601f01601f191660200182016040528015612ff9576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461300357509392505050565b6000806130458887878787612777565b87036130725761305488612f48565b61305f9060036143b7565b905061306b81886132da565b90506130d2565b61307d888585611aa5565b801561308f575061308d886113a2565b155b61309a57600061309d565b60015b6130a88988886119e8565b6130b35760006130b6565b60015b6130c09190614842565b60ff1690506130cf81886132da565b90505b979650505050505050565b601b54601c54601f546000929190836130f78a8a8a6119e8565b905060006131068b8989611aa5565b9050600060195460ff1660068111156131215761312161419b565b03613134576000955050505050506111f5565b600160195460ff16600681111561314d5761314d61419b565b03613170578161315e576000613161565b60015b60ff16955050505050506111f5565b600260195460ff1660068111156131895761318961419b565b036131f35780156131d1576001600160a01b038b166000908152601060205260409020546131c5906131bb90856143b7565b61278b86886143b7565b955050505050506111f5565b81156131e5576001955050505050506111f5565b6000955050505050506111f5565b600360195460ff16600681111561320c5761320c61419b565b03613238576001600160a01b038b166000908152601060205260409020546131c5906131bb90856143b7565b600460195460ff1660068111156132515761325161419b565b03613260576131c584866143b7565b600560195460ff1660068111156132795761327961419b565b036132a6578161328a57600061328d565b60015b8161329957600061329c565b60015b6131619190614842565b5060009a9950505050505050505050565b6060610fb5826132c684613936565b6001016139a0565b60036112128282614476565b6000818310156132eb575081610fb5565b50919050565b82600b60006133016001866143b7565b815260208101919091526040908101600090812080546001600160a01b0319166001600160a01b039485161790559051849286811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b600061336f826118cc565b90506000336001600160a01b038316148061339a57503361338f84611085565b6001600160a01b0316145b806133aa57506133aa8233610e32565b9050806133c95760405162461bcd60e51b81526004016110ac90614415565b846001600160a01b0316826001600160a01b03161461340e5760405162461bcd60e51b81526020600482015260016024820152606f60f81b60448201526064016110ac565b6001600160a01b0384166134345760405162461bcd60e51b81526004016110ac9061454e565b613440600084846132f1565b6001600160a01b03851660009081526009602052604081208054600192906134699084906143b7565b90915550506001600160a01b0384166000908152600960205260408120805460019290613497908490613d26565b90915550849050600860006134ad6001876143b7565b815260208101919091526040908101600090812080546001600160a01b0319166001600160a01b039485161790559051859287811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a45050505050565b600081815b84518110156135575761354382868381518110613536576135366145a7565b6020026020010151613b42565b91508061354f81614535565b915050613517565b509392505050565b60606001600160a01b0384166135875760405162461bcd60e51b81526004016110ac9061454e565b600083116135bb5760405162461bcd60e51b81526020600482015260016024820152603160f81b60448201526064016110ac565b6000836001600160401b038111156135d5576135d5613efd565b6040519080825280602002602001820160405280156135fe578160200160208202803683370190505b506006549091506000805b868110156136b657600061361e60108361457f565b905080600003613635576136328985613b71565b92505b6000846136438360106143ca565b85901c613650919061457f565b9050600061365e8287613be8565b905061366b8b828b613c70565b613676816001613d26565b878581518110613688576136886145a7565b60209081029190910101528561369d8161482b565b96505050505080806136ae90614535565b915050613609565b5060068290556001600160a01b038716600090815260096020526040812080548892906136e4908490613d26565b9091555050600080548152600a602052604080822080546001600160a01b0319166001600160a01b038b16179055815482528120805467ffffffffffffffff60a01b1916600160a01b426001600160401b0316021790558054879190819061374d908490613d26565b9091555092979650505050505050565b60006001600160a01b0384163b1561385357604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906137a190339089908890889060040161485b565b6020604051808303816000875af19250505080156137dc575060408051601f3d908101601f191682019092526137d99181019061488e565b60015b613839573d80801561380a576040519150601f19603f3d011682016040523d82523d6000602084013e61380f565b606091505b5080516000036138315760405162461bcd60e51b81526004016110ac9061460e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611a81565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061389d5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106138c9576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106138e757662386f26fc10000830492506010015b6305f5e10083106138ff576305f5e100830492506008015b612710831061391357612710830492506004015b60648310613925576064830492506002015b600a8310610fb55760010192915050565b600080608083901c1561394e5760809290921c916010015b604083901c156139635760409290921c916008015b602083901c156139785760209290921c916004015b601083901c1561398d5760109290921c916002015b600883901c15610fb55760010192915050565b606060006139af8360026143ca565b6139ba906002613d26565b6001600160401b038111156139d1576139d1613efd565b6040519080825280601f01601f1916602001820160405280156139fb576020820181803683370190505b509050600360fc1b81600081518110613a1657613a166145a7565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613a4557613a456145a7565b60200101906001600160f81b031916908160001a9053506000613a698460026143ca565b613a74906001613d26565b90505b6001811115613aec576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613aa857613aa86145a7565b1a60f81b828281518110613abe57613abe6145a7565b60200101906001600160f81b031916908160001a90535060049490941c93613ae58161482b565b9050613a77565b508315613b3b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016110ac565b9392505050565b6000818310613b5e576000828152602084905260409020613b3b565b6000838152602083905260409020613b3b565b600080833a434244613b846001846143b7565b604080516001600160a01b0390971660208801528601949094526060850192909252608084015260a08301524060c08201523060e082015261010081018490526101200160408051808303601f190181529190528051602090910120949350505050565b60008281526005602052604081205481818103613c06575083613c09565b50805b6000613c166001866143b7565b9050808614613c675760008181526005602052604081205490819003613c4c576000878152600560205260409020829055613c65565b6000878152600560205260408082208390558382528120555b505b50949350505050565b60008281526008602090815260408083206001600160a01b038716600160a01b6001600160601b038716810282179092556007909352922080546001600160e01b031916909117426001600160401b0316909202919091179055613cd5826001613d26565b6040516001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610fb557610fb5613d10565b6001600160e01b03198116811461125e57600080fd5b600060208284031215613d6157600080fd5b8135613b3b81613d39565b80356001600160a01b038116811461246257600080fd5b60008083601f840112613d9557600080fd5b5081356001600160401b03811115613dac57600080fd5b6020830191508360208260051b8501011115613dc757600080fd5b9250929050565b60008060008060008060808789031215613de757600080fd5b613df087613d6c565b95506020870135945060408701356001600160401b0380821115613e1357600080fd5b613e1f8a838b01613d83565b90965094506060890135915080821115613e3857600080fd5b50613e4589828a01613d83565b979a9699509497509295939492505050565b60005b83811015613e72578181015183820152602001613e5a565b50506000910152565b60008151808452613e93816020860160208601613e57565b601f01601f19169290920160200192915050565b602081526000613b3b6020830184613e7b565b600060208284031215613ecc57600080fd5b5035919050565b60008060408385031215613ee657600080fd5b613eef83613d6c565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115613f2d57613f2d613efd565b604051601f8501601f19908116603f01168101908282118183101715613f5557613f55613efd565b81604052809350858152868686011115613f6e57600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215613f9a57600080fd5b81356001600160401b03811115613fb057600080fd5b8201601f81018413613fc157600080fd5b611a8184823560208401613f13565b600080600060608486031215613fe557600080fd5b505081359360208301359350604090920135919050565b60008060008060006060868803121561401457600080fd5b61401d86613d6c565b945060208601356001600160401b038082111561403957600080fd5b61404589838a01613d83565b9096509450604088013591508082111561405e57600080fd5b5061406b88828901613d83565b969995985093965092949392505050565b60006020828403121561408e57600080fd5b613b3b82613d6c565b6000806000606084860312156140ac57600080fd5b6140b584613d6c565b92506140c360208501613d6c565b9150604084013590509250925092565b6000806000606084860312156140e857600080fd5b6140f184613d6c565b95602085013595506040909401359392505050565b6000806040838503121561411957600080fd5b50508035926020909101359150565b60008060006040848603121561413d57600080fd5b61414684613d6c565b925060208401356001600160401b0381111561416157600080fd5b61416d86828701613d83565b9497909650939450505050565b60006020828403121561418c57600080fd5b813560078110613b3b57600080fd5b634e487b7160e01b600052602160045260246000fd5b60208101600783106141d357634e487b7160e01b600052602160045260246000fd5b91905290565b801515811461125e57600080fd5b60008060008060008060006080888a03121561420257600080fd5b87356001600160401b038082111561421957600080fd5b6142258b838c01613d83565b909950975060208a013591508082111561423e57600080fd5b61424a8b838c01613d83565b909750955060408a013591508082111561426357600080fd5b506142708a828b01613d83565b9094509250506060880135614284816141d9565b8091505092959891949750929550565b600080604083850312156142a757600080fd5b6142b083613d6c565b915060208301356142c0816141d9565b809150509250929050565b600080600080608085870312156142e157600080fd5b6142ea85613d6c565b93506142f860208601613d6c565b92506040850135915060608501356001600160401b0381111561431a57600080fd5b8501601f8101871361432b57600080fd5b61433a87823560208401613f13565b91505092959194509250565b6000806000806000806080878903121561435f57600080fd5b863595506020870135945060408701356001600160401b0380821115613e1357600080fd5b6000806040838503121561439757600080fd5b6143a083613d6c565b91506143ae60208401613d6c565b90509250929050565b81810381811115610fb557610fb5613d10565b8082028115828204841417610fb557610fb5613d10565b600181811c908216806143f557607f821691505b6020821081036132eb57634e487b7160e01b600052602260045260246000fd5b6020808252600190820152606160f81b604082015260600190565b601f82111561110457600081815260208120601f850160051c810160208610156144575750805b601f850160051c820191505b8181101561189a57828155600101614463565b81516001600160401b0381111561448f5761448f613efd565b6144a38161449d84546143e1565b84614430565b602080601f8311600181146144d857600084156144c05750858301515b600019600386901b1c1916600185901b17855561189a565b600085815260208120601f198616915b82811015614507578886015182559484019460019091019084016144e8565b50858210156145255787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001820161454757614547613d10565b5060010190565b6020808252600190820152600360fc1b604082015260600190565b634e487b7160e01b600052601260045260246000fd5b60008261458e5761458e614569565b500690565b6000826145a2576145a2614569565b500490565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156145cf57600080fd5b5051919050565b6000602082840312156145e857600080fd5b8151613b3b816141d9565b6020808252600190820152606560f81b604082015260600190565b6020808252600190820152603d60f91b604082015260600190565b60008154614636816143e1565b6001828116801561464e576001811461466357614692565b60ff1984168752821515830287019450614692565b8560005260208060002060005b858110156146895781548a820152908401908201614670565b50505082870194505b5050505092915050565b600081516146ae818560208601613e57565b9290920192915050565b60006146c48286614629565b602f60f81b8082526146d96001830187614629565b91508082525083516146f2816001840160208801613e57565b0160010195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c7b226e616d81526332911d1160e11b602082015260008651614744816024850160208b01613e57565b61088b60f21b60249184019182018190526e113232b9b1b934b83a34b7b7111d1160891b602683015261477a6035830189614629565b818152681134b6b0b3b2911d1160b91b6002820152915061479e600b830188614629565b818152701132bc3a32b93730b62fb634b735911d1160791b600282015291506147ca6013830187614629565b9081527f2273656c6c65725f6665655f62617369735f706f696e7473223a3636362c226660028201526e32b2afb932b1b4b834b2b73a111d1160891b60228201529050610fe561481d603183018661469c565b61227d60f01b815260020190565b60008161483a5761483a613d10565b506000190190565b60ff8181168382160190811115610fb557610fb5613d10565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090610fe990830184613e7b565b6000602082840312156148a057600080fd5b8151613b3b81613d3956fe552d06d8e69b1fc894b5bb152d5c34ccb2ea2834fd646ff017b1562d77bdb85aa264697066735822122050000427ceb03d33bce0a665839836818d1e8b3a601a048fc38a05219330ee4964736f6c63430008110033536b656c657068756e6b73206973206120756e6976657273616c2c2061646170746976652050465020666f722074686520457468657265756d20636f6d6d756e6974792e00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000d00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000b536b656c657068756e6b730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005534b454c4500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000001088a6585f9a1e2a47933c53c96a1832f25536c9000000000000000000000000d1f4e12d074b4ecbbe0ce6626da2e7d317e6c2d6000000000000000000000000236e5fc476d2f944ce441c50faf158a0a55fed04000000000000000000000000e042054bb645893914c7c11ec6d54ca8797ee33b000000000000000000000000baf53d5a52be22497393fb94ee8b8fd5576217e4000000000000000000000000898360d33c9200329f387c93354b25e969083bdc0000000000000000000000005e86777dfa4393a29f8d0c7308b0e6e9f991a0b000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000fa00000000000000000000000000000000000000000000000000000000000000ce400000000000000000000000000000000000000000000000000000000000004b000000000000000000000000000000000000000000000000000000000000002bc00000000000000000000000000000000000000000000000000000000000000aa000000000000000000000000000000000000000000000000000000000000008200000000000000000000000000000000000000000000000000000000000001f4
Deployed Bytecode
0x6080604052600436106104b95760003560e01c8063740ac6f61161026b578063b2af127c1161014f578063db2e21bc116100c1578063ede029fc11610085578063ede029fc14610e75578063f1b0aa1514610e95578063f2eb817214610eb5578063f2fde38b14610ed5578063f4a0a52814610ef5578063f8cf016314610f1557600080fd5b8063db2e21bc14610dd8578063df87694914610ded578063e8a3d48514610e02578063e985e9c514610e17578063ecb3f09a14610e6057600080fd5b8063c48f653111610113578063c48f653114610d20578063c87b56dd14610d58578063ce8539b114610d78578063cffb47cf14610d8d578063d831f62314610da3578063daf5085914610db857600080fd5b8063b2af127c14610c97578063b6d04a0b14610cb7578063b81440bb14610cd7578063b88d4fde14610ced578063bb42436914610d0d57600080fd5b80638da5cb5b116101e85780639cf618e2116101ac5780639cf618e214610bd15780639da3f8fd14610bf05780639e942ace14610c175780639e96165814610c37578063a22cb46514610c57578063aff8cfa114610c7757600080fd5b80638da5cb5b14610b3e5780639471302e14610b5c57806395d89b4114610b7c578063963c354614610b915780639a48eb5114610bb157600080fd5b8063814c8c551161022f578063814c8c5514610a9e5780638305778a14610abe578063881e68c614610ade5780638ac06d3914610afe5780638ca1f0cf14610b1e57600080fd5b8063740ac6f614610a09578063741fd87214610a2957806379b6ed3614610a495780637ccd788714610a5e5780637e12dc1114610a7e57600080fd5b8063366653a91161039d5780634f6ccce71161030f5780636352211e116102d35780636352211e146109735780636373a6b1146109935780636817c76c146109a85780636b90fa85146109be57806370a08231146109d4578063715018a6146109f457600080fd5b80634f6ccce7146108de5780635b2ca084146108fe5780635c975abb1461091e5780636095049a1461093d57806363037b0c1461095357600080fd5b806341422eed1161036157806341422eed1461081857806341f434341461082e57806342842e0e1461085057806344dd599b146108705780634811ea441461089057806349df728c146108be57600080fd5b8063366653a91461078a578063386b7691146107c25780633b0d58a4146107d85780633ccfd60b146107ed5780633cf013441461080257600080fd5b80631a05dc87116104365780632eb4a7ab116103fa5780632eb4a7ab146106e95780632f745c59146106ff57806330359e5f1461071f578063303a67d01461073f57806330b42ec214610755578063333171bb1461077557600080fd5b80631a05dc871461063c5780631f9179211461065c57806320fc7eb21461067c57806323b872dd146106a95780632a85db55146106c957600080fd5b8063095ea7b31161047d578063095ea7b3146105b057806310969523146105d257806313ea7b04146105f257806318160ddd146106075780631931225b1461061c57600080fd5b806301ffc9a7146104dd57806304a6c8c9146105125780630519ef1f1461053657806306fdde0314610556578063081812fc1461057857600080fd5b366104d85734601460008282546104d09190613d26565b925050819055005b600080fd5b3480156104e957600080fd5b506104fd6104f8366004613d4f565b610f4e565b60405190151581526020015b60405180910390f35b34801561051e57600080fd5b50610528601b5481565b604051908152602001610509565b34801561054257600080fd5b50610528610551366004613dce565b610fbb565b34801561056257600080fd5b5061056b610ff3565b6040516105099190613ea7565b34801561058457600080fd5b50610598610593366004613eba565b611085565b6040516001600160a01b039091168152602001610509565b3480156105bc57600080fd5b506105d06105cb366004613ed3565b6110e4565b005b3480156105de57600080fd5b506105d06105ed366004613f88565b611109565b3480156105fe57600080fd5b5061056b61113e565b34801561061357600080fd5b5061052861114d565b34801561062857600080fd5b506105d0610637366004613fd0565b611182565b34801561064857600080fd5b506104fd610657366004613ffc565b6111e1565b34801561066857600080fd5b506105d0610677366004613f88565b6111fe565b34801561068857600080fd5b5061052861069736600461407c565b60106020526000908152604090205481565b3480156106b557600080fd5b506105d06106c4366004614097565b611216565b3480156106d557600080fd5b506105d06106e4366004613f88565b61124d565b3480156106f557600080fd5b5061052860255481565b34801561070b57600080fd5b5061052861071a366004613ed3565b611261565b34801561072b57600080fd5b506105d061073a3660046140d3565b611353565b34801561074b57600080fd5b50610528601c5481565b34801561076157600080fd5b506104fd61077036600461407c565b6113a2565b34801561078157600080fd5b506105d06113ec565b34801561079657600080fd5b506104fd6107a536600461407c565b6001600160a01b0316600090815260136020526040902054151590565b3480156107ce57600080fd5b50610528601a5481565b3480156107e457600080fd5b50610528611411565b3480156107f957600080fd5b506105d061143a565b34801561080e57600080fd5b5061052860265481565b34801561082457600080fd5b5061052860245481565b34801561083a57600080fd5b506105986daaeb6d7670e522a718067333cd4e81565b34801561085c57600080fd5b506105d061086b366004614097565b611524565b34801561087c57600080fd5b5061052861088b366004613eba565b611555565b34801561089c57600080fd5b506000805260276020526000805160206148ac8339815191525460801c610528565b3480156108ca57600080fd5b506105d06108d936600461407c565b611560565b3480156108ea57600080fd5b506105286108f9366004613eba565b6116f2565b34801561090a57600080fd5b506105d0610919366004614106565b6117f1565b34801561092a57600080fd5b506019546104fd90610100900460ff1681565b34801561094957600080fd5b50610528601e5481565b34801561095f57600080fd5b5061059861096e366004613eba565b6118a2565b34801561097f57600080fd5b5061059861098e366004613eba565b6118cc565b34801561099f57600080fd5b5061056b611902565b3480156109b457600080fd5b5061052860175481565b3480156109ca57600080fd5b5061052860235481565b3480156109e057600080fd5b506105286109ef36600461407c565b611990565b348015610a0057600080fd5b506105d06119d4565b348015610a1557600080fd5b506104fd610a24366004614128565b6119e8565b348015610a3557600080fd5b50602a54610598906001600160a01b031681565b348015610a5557600080fd5b5061056b611a89565b348015610a6a57600080fd5b506105d0610a79366004613eba565b611a98565b348015610a8a57600080fd5b506104fd610a99366004614128565b611aa5565b348015610aaa57600080fd5b506105d0610ab936600461417a565b611b16565b348015610aca57600080fd5b506104fd610ad936600461407c565b611baf565b348015610aea57600080fd5b50610598610af9366004613eba565b611c05565b348015610b0a57600080fd5b506105d0610b1936600461407c565b611c19565b348015610b2a57600080fd5b506105d0610b39366004613f88565b611c61565b348015610b4a57600080fd5b50600d546001600160a01b0316610598565b348015610b6857600080fd5b506105d0610b77366004613f88565b611c75565b348015610b8857600080fd5b5061056b611c89565b348015610b9d57600080fd5b506105d0610bac366004613eba565b611c98565b348015610bbd57600080fd5b506105d0610bcc366004614106565b611ca5565b348015610bdd57600080fd5b50602c546104fd90610100900460ff1681565b348015610bfc57600080fd5b50601954610c0a9060ff1681565b60405161050991906141b1565b348015610c2357600080fd5b50610598610c32366004613eba565b611cb8565b348015610c4357600080fd5b506105d0610c523660046141e7565b611cee565b348015610c6357600080fd5b506105d0610c72366004614294565b611e29565b348015610c8357600080fd5b506105d0610c92366004614294565b611e49565b348015610ca357600080fd5b506105d0610cb236600461407c565b611e7c565b348015610cc357600080fd5b50610528610cd236600461407c565b611f9d565b348015610ce357600080fd5b50610528602b5481565b348015610cf957600080fd5b506105d0610d083660046142cb565b611fcc565b6105d0610d1b366004614346565b612005565b348015610d2c57600080fd5b50610d40610d3b366004613eba565b61232d565b6040516001600160401b039091168152602001610509565b348015610d6457600080fd5b5061056b610d73366004613eba565b612344565b348015610d8457600080fd5b506105d0612467565b348015610d9957600080fd5b50610528601d5481565b348015610daf57600080fd5b506104fd612483565b348015610dc457600080fd5b50610528610dd3366004613dce565b6124b0565b348015610de457600080fd5b506105d0612613565b348015610df957600080fd5b506104fd6126a7565b348015610e0e57600080fd5b5061056b6126b4565b348015610e2357600080fd5b506104fd610e32366004614384565b6001600160a01b039182166000908152600c6020908152604080832093909416825291909152205460ff1690565b348015610e6c57600080fd5b506105d06126f5565b348015610e8157600080fd5b506105d0610e90366004613f88565b612709565b348015610ea157600080fd5b50610d40610eb0366004613eba565b61271a565b348015610ec157600080fd5b50610528610ed0366004613ffc565b612777565b348015610ee157600080fd5b506105d0610ef036600461407c565b612790565b348015610f0157600080fd5b506105d0610f10366004613eba565b612806565b348015610f2157600080fd5b506104fd610f3036600461407c565b6001600160a01b031660009081526029602052604090205460ff1690565b60006001600160e01b031982166380ac58cd60e01b1480610f7f57506001600160e01b03198216635b5e139f60e01b145b80610f9a57506001600160e01b0319821663780e9d6360e01b145b80610fb557506301ffc9a760e01b6001600160e01b03198316145b92915050565b600080610fcc8888888888886124b0565b9050610fd881886143b7565b601754610fe591906143ca565b9150505b9695505050505050565b606060018054611002906143e1565b80601f016020809104026020016040519081016040528092919081815260200182805461102e906143e1565b801561107b5780601f106110505761010080835404028352916020019161107b565b820191906000526020600020905b81548152906001019060200180831161105e57829003601f168201915b5050505050905090565b600061109082612813565b6110b55760405162461bcd60e51b81526004016110ac90614415565b60405180910390fd5b600b60006110c46001856143b7565b81526020810191909152604001600020546001600160a01b031692915050565b602c54829060ff16156110fa576110fa81612857565b6111048383612910565b505050565b6111116129a5565b600f5460ff161561112157600080fd5b600e61112d8282614476565b5050600f805460ff19166001179055565b606060038054611002906143e1565b60006006547f000000000000000000000000000000000000000000000000000000000000270f61117d91906143b7565b905090565b6002821080156111925750600281105b6111c25760405162461bcd60e51b81526020600482015260016024820152603b60f91b60448201526064016110ac565b61110483836111d28460026143ca565b6111dc9190613d26565b6129ff565b6000806111f18787878787612777565b1190505b95945050505050565b6112066129a5565b60226112128282614476565b5050565b602c54839060ff161561123c576001600160a01b038116331461123c5761123c33612857565b611247848484612a78565b50505050565b6112556129a5565b61125e81612a83565b50565b600061126c83611990565b821061129e5760405162461bcd60e51b81526020600482015260016024820152603160f91b60448201526064016110ac565b6000805b7f000000000000000000000000000000000000000000000000000000000000270f811015611326576000818152600860205260409020546001600160a01b0380871691160361131457838203611306576112fd816001613d26565b92505050610fb5565b8161131081614535565b9250505b8061131e81614535565b9150506112a2565b5060405162461bcd60e51b81526020600482015260016024820152607560f81b60448201526064016110ac565b3360009081526029602052604090205460ff166113975760405162461bcd60e51b8152602060048201526002602482015261726160f01b60448201526064016110ac565b611104838383612a8f565b60006001600160a01b0382166113ca5760405162461bcd60e51b81526004016110ac9061454e565b506001600160a01b0316600090815260276020526040902054600190811c1490565b6113f46129a5565b6019805461ff001981166101009182900460ff1615909102179055565b600080805260276020526000805160206148ac8339815191525461117d90600160801b9061457f565b611442612ad4565b336000908152601360205260408120546014546114629061271090614593565b61146c91906143ca565b336000908152601560205260408120549192509061148a90836143b7565b33600081815260156020526040808220869055519293509183908381818185875af1925050503d80600081146114dc576040519150601f19603f3d011682016040523d82523d6000602084013e6114e1565b606091505b50509050806111045760405162461bcd60e51b815260206004820152600f60248201526e5061796d656e74206661696c65642160881b60448201526064016110ac565b602c54839060ff161561154a576001600160a01b038116331461154a5761154a33612857565b611247848484612b1e565b6000610fb582612b39565b611568612ad4565b60005b60125481101561121257816001600160a01b031663a9059cbb60128381548110611597576115976145a7565b9060005260206000200160009054906101000a90046001600160a01b031660136000601286815481106115cc576115cc6145a7565b60009182526020808320909101546001600160a01b03908116845290830193909352604091820190205490516370a0823160e01b8152306004820152909161271091908816906370a0823190602401602060405180830381865afa158015611638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165c91906145bd565b6116669190614593565b61167091906143ca565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df91906145d6565b50806116ea81614535565b91505061156b565b60008082116117285760405162461bcd60e51b8152602060048201526002602482015261069360f41b60448201526064016110ac565b60006117356001846143b7565b9050600061174161114d565b90508082106117765760405162461bcd60e51b81526020600482015260016024820152606760f81b60448201526064016110ac565b6000805b7f000000000000000000000000000000000000000000000000000000000000270f811015611326576000818152600860205260409020546001600160a01b0316156117df578382036117d157610fe9816001613d26565b816117db81614535565b9250505b806117e981614535565b91505061177a565b3332146118335760405162461bcd60e51b815260206004820152601060248201526f6e6f20636f6e7472616374732066616d60801b60448201526064016110ac565b61184033602b5483612a8f565b602a546040516363aac3a360e01b8152600481018490526001600160a01b03909116906363aac3a390602401600060405180830381600087803b15801561188657600080fd5b505af115801561189a573d6000803e3d6000fd5b505050505050565b601281815481106118b257600080fd5b6000918252602090912001546001600160a01b0316905081565b60006118d782612813565b6118f35760405162461bcd60e51b81526004016110ac906145f3565b600860006110c46001856143b7565b600e805461190f906143e1565b80601f016020809104026020016040519081016040528092919081815260200182805461193b906143e1565b80156119885780601f1061195d57610100808354040283529160200191611988565b820191906000526020600020905b81548152906001019060200180831161196b57829003601f168201915b505050505081565b60006001600160a01b0382166119b85760405162461bcd60e51b81526004016110ac9061454e565b506001600160a01b031660009081526009602052604090205490565b6119dc6129a5565b6119e66000612b96565b565b60006119f384611baf565b158015611a725750611a72838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506023546040516bffffffffffffffffffffffff1960608b901b16602082015290925060340190505b60405160208183030381529060405280519060200120612be8565b8015611a815750611a816126a7565b949350505050565b606060048054611002906143e1565b611aa06129a5565b602b55565b6000611b07838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506025546040516bffffffffffffffffffffffff1960608b901b1660208201529092506034019050611a57565b8015611a815750611a81612483565b611b1e6129a5565b6000816006811115611b3257611b3261419b565b14158015611b575750600660195460ff166006811115611b5457611b5461419b565b14155b611b885760405162461bcd60e51b81526020600482015260026024820152616d7360f01b60448201526064016110ac565b6019805482919060ff19166001836006811115611ba757611ba761419b565b021790555050565b60006001600160a01b038216611bd75760405162461bcd60e51b81526004016110ac9061454e565b6001600160a01b038216600090815260276020526040902054611bfc9060029061457f565b60011492915050565b600080611c1183612bfe565b519392505050565b611c216129a5565b602a54611c38906001600160a01b03166000611e49565b602a80546001600160a01b0319166001600160a01b03831690811790915561125e906001611e49565b611c696129a5565b60216112128282614476565b611c7d6129a5565b60206112128282614476565b606060028054611002906143e1565b611ca06129a5565b601f55565b611cad6129a5565b602391909155602555565b6000611cc382612813565b611cdf5760405162461bcd60e51b81526004016110ac906145f3565b600760006110c46001856143b7565b611cf66129a5565b602c54610100900460ff1615611d345760405162461bcd60e51b81526020600482015260036024820152621c1b5b60ea1b60448201526064016110ac565b60005b84811015611e08576004848483818110611d5357611d536145a7565b9050602002013510611d915760405162461bcd60e51b81526020600482015260076024820152661898590819d85960ca1b60448201526064016110ac565b611df6888883818110611da657611da66145a7565b9050602002016020810190611dbb919061407c565b878784818110611dcd57611dcd6145a7565b905060200201356000878786818110611de857611de86145a7565b905060200201356000612d58565b80611e0081614535565b915050611d37565b50602c80549115156101000261ff0019909216919091179055505050505050565b602c54829060ff1615611e3f57611e3f81612857565b6111048383612eb4565b611e516129a5565b6001600160a01b03919091166000908152602960205260409020805460ff1916911515919091179055565b611e846129a5565b60165460ff16611ebc5760405162461bcd60e51b815260206004820152600360248201526221657760e81b60448201526064016110ac565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa158015611f0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2e91906145bd565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015611f79573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121291906145d6565b6001600160a01b03811660009081526028602052604081205460801c611fc283612f48565b610fb59190613d26565b602c54849060ff1615611ff2576001600160a01b0381163314611ff257611ff233612857565b611ffe85858585612f70565b5050505050565b3332146120475760405162461bcd60e51b815260206004820152601060248201526f6e6f20636f6e7472616374732066616d60801b60448201526064016110ac565b60006120573388878787876124b0565b905061206381886143b7565b60175461207091906143ca565b34146120a75760405162461bcd60e51b81526004016110ac906020808252600490820152633837b7b960e11b604082015260600190565b6120b43386868686612777565b8711156120ec5760405162461bcd60e51b81526004016110ac906020808252600490820152636d6d707760e01b604082015260600190565b601b546120f982896143b7565b601c546121069190613d26565b111561213a5760405162461bcd60e51b81526020600482015260036024820152626d6d7360e81b60448201526064016110ac565b601d5481601e5461214b9190613d26565b111561217f5760405162461bcd60e51b81526020600482015260036024820152626d727360e81b60448201526064016110ac565b808015612221576121913387876119e8565b15612221573360009081526027602052604081208054600192906121b6908490613d26565b90915550503360009081526028602052604081208054600192906121db908490613d26565b909155506121ec90506001826143b7565b600080805260276020526000805160206148ac833981519152805492935060019290919061221b908490613d26565b90915550505b80156122d757612232338585611aa5565b80156122445750612242336113a2565b155b156122d757336000908152602760205260408120805460029290612269908490613d26565b909155505033600090815260286020526040812080546001929061228e908490613d26565b9091555061229f90506001826143b7565b600080805260276020526000805160206148ac8339815191528054929350600160801b929091906122d1908490613d26565b90915550505b33600090815260286020526040812080548392906122f6908490613d26565b92505081905550346014600082825461230f9190613d26565b9091555061232390503389848a6000612d58565b5050505050505050565b60008061233983612bfe565b602001519392505050565b606061234f82612813565b61236b5760405162461bcd60e51b81526004016110ac9061460e565b60006003805461237a906143e1565b905011156123d05760036011600061239185611555565b81526020019081526020016000206123a884612fa3565b6040516020016123ba939291906146b8565b6040516020818303038152906040529050919050565b600480546123dd906143e1565b80601f0160208091040260200160405190810160405280929190818152602001828054612409906143e1565b80156124565780601f1061242b57610100808354040283529160200191612456565b820191906000526020600020905b81548152906001019060200180831161243957829003601f168201915b50505050509050919050565b919050565b61246f6129a5565b602c805460ff19811660ff90911615179055565b60006026546124aa6000805260276020526000805160206148ac8339815191525460801c90565b10905090565b6000806124be8887876119e8565b905060006124d0898989898989613035565b9050600060195460ff1660068111156124eb576124eb61419b565b036124fb57600092505050610fe9565b600160195460ff1660068111156125145761251461419b565b036125345781612525576000612528565b60015b60ff1692505050610fe9565b600260195460ff16600681111561254d5761254d61419b565b036125875761255d898686611aa5565b1561256b579150610fe99050565b811561257c57600192505050610fe9565b600092505050610fe9565b600360195460ff1660068111156125a0576125a061419b565b14806125c25750600460195460ff1660068111156125c0576125c061419b565b145b156125d0579150610fe99050565b600560195460ff1660068111156125e9576125e961419b565b03612604576125fb89888888886130dd565b92505050610fe9565b50600098975050505050505050565b61261b6129a5565b6040514790600090339083908381818185875af1925050503d806000811461265f576040519150601f19603f3d011682016040523d82523d6000602084013e612664565b606091505b50509050806112125760405162461bcd60e51b815260206004820152600f60248201526e5061796d656e74206661696c65642160881b60448201526064016110ac565b60006024546124aa611411565b60606126be610ff3565b6020602160226126cd306132b7565b6040516020016126e19594939291906146ff565b604051602081830303815290604052905090565b6126fd6129a5565b6016805460ff19169055565b6127116129a5565b61125e816132ce565b600061272582612813565b6127415760405162461bcd60e51b81526004016110ac906145f3565b600760006127506001856143b7565b8152602081019190915260400160002054600160a01b90046001600160401b031692915050565b6000610fe9606461278b88888888886130dd565b6132da565b6127986129a5565b6001600160a01b0381166127fd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016110ac565b61125e81612b96565b61280e6129a5565b601755565b60008160000361282557506000919050565b60006008816128356001866143b7565b81526020810191909152604001600020546001600160a01b0316141592915050565b6daaeb6d7670e522a718067333cd4e3b1561125e57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156128c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e891906145d6565b61125e57604051633b79c77360e21b81526001600160a01b03821660048201526024016110ac565b600061291b826118cc565b9050806001600160a01b0316836001600160a01b0316036129625760405162461bcd60e51b81526020600482015260016024820152606f60f81b60448201526064016110ac565b336001600160a01b038216148061297e575061297e8133610e32565b61299a5760405162461bcd60e51b81526004016110ac90614415565b6111048383836132f1565b600d546001600160a01b031633146119e65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016110ac565b33612a09836118cc565b6001600160a01b031614612a2f5760405162461bcd60e51b81526004016110ac906145f3565b8060086000612a3f6001866143b7565b815260200190815260200160002060000160146101000a8154816001600160601b0302191690836001600160601b031602179055505050565b611104838383613364565b60046112128282614476565b612a9e83836000846001612d58565b6001600160a01b03831660009081526028602052604081208054608085901b9290612aca908490613d26565b9091555050505050565b336000908152601360205260409020546119e65760405162461bcd60e51b815260206004820152600b60248201526a6e6f74206120706179656560a81b60448201526064016110ac565b61110483838360405180602001604052806000815250611fcc565b6000612b4482612813565b612b605760405162461bcd60e51b81526004016110ac906145f3565b60086000612b6f6001856143b7565b8152602081019190915260400160002054600160a01b90046001600160601b031692915050565b600d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600082612bf58584613512565b14949350505050565b6040805180820190915260008082526020820152612c1a61114d565b821115612c8057505060008052600a6020908152604080518082019091527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e3546001600160a01b0381168252600160a01b90046001600160401b03169181019190915290565b815b8015612cf8576000818152600a60205260409020546001600160a01b031615612ce6576000908152600a60209081526040918290208251808401909352546001600160a01b0381168352600160a01b90046001600160401b03169082015292915050565b80612cf08161482b565b915050612c82565b50506000805250600a6020908152604080518082019091527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e3546001600160a01b0381168252600160a01b90046001600160401b03169181019190915290565b601954610100900460ff1615612d945760405162461bcd60e51b81526020600482015260016024820152600760fc1b60448201526064016110ac565b60048210612dc85760405162461bcd60e51b81526020600482015260016024820152603b60f91b60448201526064016110ac565b612dd385858461355f565b506001600160a01b03851660009081526010602052604081208054869290612dfc908490613d26565b90915550508015612e245783601e6000828254612e199190613d26565b90915550612e5e9050565b612e2e83856143b7565b601c6000828254612e3f9190613d26565b9250508190555082601e6000828254612e589190613d26565b90915550505b601b54601c5403612e77576019805460ff191660051790555b600560195460ff166006811115612e9057612e9061419b565b03611ffe57601d54601e5403611ffe5750506019805460ff19166006179055505050565b336001600160a01b03831603612edc5760405162461bcd60e51b81526004016110ac90614415565b336000818152600c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6001600160a01b038116600090815260286020526040812054610fb590600160801b9061457f565b612f7b848484613364565b612f878484848461375d565b6112475760405162461bcd60e51b81526004016110ac9061460e565b60606000612fb08361385e565b60010190506000816001600160401b03811115612fcf57612fcf613efd565b6040519080825280601f01601f191660200182016040528015612ff9576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461300357509392505050565b6000806130458887878787612777565b87036130725761305488612f48565b61305f9060036143b7565b905061306b81886132da565b90506130d2565b61307d888585611aa5565b801561308f575061308d886113a2565b155b61309a57600061309d565b60015b6130a88988886119e8565b6130b35760006130b6565b60015b6130c09190614842565b60ff1690506130cf81886132da565b90505b979650505050505050565b601b54601c54601f546000929190836130f78a8a8a6119e8565b905060006131068b8989611aa5565b9050600060195460ff1660068111156131215761312161419b565b03613134576000955050505050506111f5565b600160195460ff16600681111561314d5761314d61419b565b03613170578161315e576000613161565b60015b60ff16955050505050506111f5565b600260195460ff1660068111156131895761318961419b565b036131f35780156131d1576001600160a01b038b166000908152601060205260409020546131c5906131bb90856143b7565b61278b86886143b7565b955050505050506111f5565b81156131e5576001955050505050506111f5565b6000955050505050506111f5565b600360195460ff16600681111561320c5761320c61419b565b03613238576001600160a01b038b166000908152601060205260409020546131c5906131bb90856143b7565b600460195460ff1660068111156132515761325161419b565b03613260576131c584866143b7565b600560195460ff1660068111156132795761327961419b565b036132a6578161328a57600061328d565b60015b8161329957600061329c565b60015b6131619190614842565b5060009a9950505050505050505050565b6060610fb5826132c684613936565b6001016139a0565b60036112128282614476565b6000818310156132eb575081610fb5565b50919050565b82600b60006133016001866143b7565b815260208101919091526040908101600090812080546001600160a01b0319166001600160a01b039485161790559051849286811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b600061336f826118cc565b90506000336001600160a01b038316148061339a57503361338f84611085565b6001600160a01b0316145b806133aa57506133aa8233610e32565b9050806133c95760405162461bcd60e51b81526004016110ac90614415565b846001600160a01b0316826001600160a01b03161461340e5760405162461bcd60e51b81526020600482015260016024820152606f60f81b60448201526064016110ac565b6001600160a01b0384166134345760405162461bcd60e51b81526004016110ac9061454e565b613440600084846132f1565b6001600160a01b03851660009081526009602052604081208054600192906134699084906143b7565b90915550506001600160a01b0384166000908152600960205260408120805460019290613497908490613d26565b90915550849050600860006134ad6001876143b7565b815260208101919091526040908101600090812080546001600160a01b0319166001600160a01b039485161790559051859287811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a45050505050565b600081815b84518110156135575761354382868381518110613536576135366145a7565b6020026020010151613b42565b91508061354f81614535565b915050613517565b509392505050565b60606001600160a01b0384166135875760405162461bcd60e51b81526004016110ac9061454e565b600083116135bb5760405162461bcd60e51b81526020600482015260016024820152603160f81b60448201526064016110ac565b6000836001600160401b038111156135d5576135d5613efd565b6040519080825280602002602001820160405280156135fe578160200160208202803683370190505b506006549091506000805b868110156136b657600061361e60108361457f565b905080600003613635576136328985613b71565b92505b6000846136438360106143ca565b85901c613650919061457f565b9050600061365e8287613be8565b905061366b8b828b613c70565b613676816001613d26565b878581518110613688576136886145a7565b60209081029190910101528561369d8161482b565b96505050505080806136ae90614535565b915050613609565b5060068290556001600160a01b038716600090815260096020526040812080548892906136e4908490613d26565b9091555050600080548152600a602052604080822080546001600160a01b0319166001600160a01b038b16179055815482528120805467ffffffffffffffff60a01b1916600160a01b426001600160401b0316021790558054879190819061374d908490613d26565b9091555092979650505050505050565b60006001600160a01b0384163b1561385357604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906137a190339089908890889060040161485b565b6020604051808303816000875af19250505080156137dc575060408051601f3d908101601f191682019092526137d99181019061488e565b60015b613839573d80801561380a576040519150601f19603f3d011682016040523d82523d6000602084013e61380f565b606091505b5080516000036138315760405162461bcd60e51b81526004016110ac9061460e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611a81565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061389d5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106138c9576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106138e757662386f26fc10000830492506010015b6305f5e10083106138ff576305f5e100830492506008015b612710831061391357612710830492506004015b60648310613925576064830492506002015b600a8310610fb55760010192915050565b600080608083901c1561394e5760809290921c916010015b604083901c156139635760409290921c916008015b602083901c156139785760209290921c916004015b601083901c1561398d5760109290921c916002015b600883901c15610fb55760010192915050565b606060006139af8360026143ca565b6139ba906002613d26565b6001600160401b038111156139d1576139d1613efd565b6040519080825280601f01601f1916602001820160405280156139fb576020820181803683370190505b509050600360fc1b81600081518110613a1657613a166145a7565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613a4557613a456145a7565b60200101906001600160f81b031916908160001a9053506000613a698460026143ca565b613a74906001613d26565b90505b6001811115613aec576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613aa857613aa86145a7565b1a60f81b828281518110613abe57613abe6145a7565b60200101906001600160f81b031916908160001a90535060049490941c93613ae58161482b565b9050613a77565b508315613b3b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016110ac565b9392505050565b6000818310613b5e576000828152602084905260409020613b3b565b6000838152602083905260409020613b3b565b600080833a434244613b846001846143b7565b604080516001600160a01b0390971660208801528601949094526060850192909252608084015260a08301524060c08201523060e082015261010081018490526101200160408051808303601f190181529190528051602090910120949350505050565b60008281526005602052604081205481818103613c06575083613c09565b50805b6000613c166001866143b7565b9050808614613c675760008181526005602052604081205490819003613c4c576000878152600560205260409020829055613c65565b6000878152600560205260408082208390558382528120555b505b50949350505050565b60008281526008602090815260408083206001600160a01b038716600160a01b6001600160601b038716810282179092556007909352922080546001600160e01b031916909117426001600160401b0316909202919091179055613cd5826001613d26565b6040516001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610fb557610fb5613d10565b6001600160e01b03198116811461125e57600080fd5b600060208284031215613d6157600080fd5b8135613b3b81613d39565b80356001600160a01b038116811461246257600080fd5b60008083601f840112613d9557600080fd5b5081356001600160401b03811115613dac57600080fd5b6020830191508360208260051b8501011115613dc757600080fd5b9250929050565b60008060008060008060808789031215613de757600080fd5b613df087613d6c565b95506020870135945060408701356001600160401b0380821115613e1357600080fd5b613e1f8a838b01613d83565b90965094506060890135915080821115613e3857600080fd5b50613e4589828a01613d83565b979a9699509497509295939492505050565b60005b83811015613e72578181015183820152602001613e5a565b50506000910152565b60008151808452613e93816020860160208601613e57565b601f01601f19169290920160200192915050565b602081526000613b3b6020830184613e7b565b600060208284031215613ecc57600080fd5b5035919050565b60008060408385031215613ee657600080fd5b613eef83613d6c565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115613f2d57613f2d613efd565b604051601f8501601f19908116603f01168101908282118183101715613f5557613f55613efd565b81604052809350858152868686011115613f6e57600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215613f9a57600080fd5b81356001600160401b03811115613fb057600080fd5b8201601f81018413613fc157600080fd5b611a8184823560208401613f13565b600080600060608486031215613fe557600080fd5b505081359360208301359350604090920135919050565b60008060008060006060868803121561401457600080fd5b61401d86613d6c565b945060208601356001600160401b038082111561403957600080fd5b61404589838a01613d83565b9096509450604088013591508082111561405e57600080fd5b5061406b88828901613d83565b969995985093965092949392505050565b60006020828403121561408e57600080fd5b613b3b82613d6c565b6000806000606084860312156140ac57600080fd5b6140b584613d6c565b92506140c360208501613d6c565b9150604084013590509250925092565b6000806000606084860312156140e857600080fd5b6140f184613d6c565b95602085013595506040909401359392505050565b6000806040838503121561411957600080fd5b50508035926020909101359150565b60008060006040848603121561413d57600080fd5b61414684613d6c565b925060208401356001600160401b0381111561416157600080fd5b61416d86828701613d83565b9497909650939450505050565b60006020828403121561418c57600080fd5b813560078110613b3b57600080fd5b634e487b7160e01b600052602160045260246000fd5b60208101600783106141d357634e487b7160e01b600052602160045260246000fd5b91905290565b801515811461125e57600080fd5b60008060008060008060006080888a03121561420257600080fd5b87356001600160401b038082111561421957600080fd5b6142258b838c01613d83565b909950975060208a013591508082111561423e57600080fd5b61424a8b838c01613d83565b909750955060408a013591508082111561426357600080fd5b506142708a828b01613d83565b9094509250506060880135614284816141d9565b8091505092959891949750929550565b600080604083850312156142a757600080fd5b6142b083613d6c565b915060208301356142c0816141d9565b809150509250929050565b600080600080608085870312156142e157600080fd5b6142ea85613d6c565b93506142f860208601613d6c565b92506040850135915060608501356001600160401b0381111561431a57600080fd5b8501601f8101871361432b57600080fd5b61433a87823560208401613f13565b91505092959194509250565b6000806000806000806080878903121561435f57600080fd5b863595506020870135945060408701356001600160401b0380821115613e1357600080fd5b6000806040838503121561439757600080fd5b6143a083613d6c565b91506143ae60208401613d6c565b90509250929050565b81810381811115610fb557610fb5613d10565b8082028115828204841417610fb557610fb5613d10565b600181811c908216806143f557607f821691505b6020821081036132eb57634e487b7160e01b600052602260045260246000fd5b6020808252600190820152606160f81b604082015260600190565b601f82111561110457600081815260208120601f850160051c810160208610156144575750805b601f850160051c820191505b8181101561189a57828155600101614463565b81516001600160401b0381111561448f5761448f613efd565b6144a38161449d84546143e1565b84614430565b602080601f8311600181146144d857600084156144c05750858301515b600019600386901b1c1916600185901b17855561189a565b600085815260208120601f198616915b82811015614507578886015182559484019460019091019084016144e8565b50858210156145255787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001820161454757614547613d10565b5060010190565b6020808252600190820152600360fc1b604082015260600190565b634e487b7160e01b600052601260045260246000fd5b60008261458e5761458e614569565b500690565b6000826145a2576145a2614569565b500490565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156145cf57600080fd5b5051919050565b6000602082840312156145e857600080fd5b8151613b3b816141d9565b6020808252600190820152606560f81b604082015260600190565b6020808252600190820152603d60f91b604082015260600190565b60008154614636816143e1565b6001828116801561464e576001811461466357614692565b60ff1984168752821515830287019450614692565b8560005260208060002060005b858110156146895781548a820152908401908201614670565b50505082870194505b5050505092915050565b600081516146ae818560208601613e57565b9290920192915050565b60006146c48286614629565b602f60f81b8082526146d96001830187614629565b91508082525083516146f2816001840160208801613e57565b0160010195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c7b226e616d81526332911d1160e11b602082015260008651614744816024850160208b01613e57565b61088b60f21b60249184019182018190526e113232b9b1b934b83a34b7b7111d1160891b602683015261477a6035830189614629565b818152681134b6b0b3b2911d1160b91b6002820152915061479e600b830188614629565b818152701132bc3a32b93730b62fb634b735911d1160791b600282015291506147ca6013830187614629565b9081527f2273656c6c65725f6665655f62617369735f706f696e7473223a3636362c226660028201526e32b2afb932b1b4b834b2b73a111d1160891b60228201529050610fe561481d603183018661469c565b61227d60f01b815260020190565b60008161483a5761483a613d10565b506000190190565b60ff8181168382160190811115610fb557610fb5613d10565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090610fe990830184613e7b565b6000602082840312156148a057600080fd5b8151613b3b81613d3956fe552d06d8e69b1fc894b5bb152d5c34ccb2ea2834fd646ff017b1562d77bdb85aa264697066735822122050000427ceb03d33bce0a665839836818d1e8b3a601a048fc38a05219330ee4964736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000d00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000b536b656c657068756e6b730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005534b454c4500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000001088a6585f9a1e2a47933c53c96a1832f25536c9000000000000000000000000d1f4e12d074b4ecbbe0ce6626da2e7d317e6c2d6000000000000000000000000236e5fc476d2f944ce441c50faf158a0a55fed04000000000000000000000000e042054bb645893914c7c11ec6d54ca8797ee33b000000000000000000000000baf53d5a52be22497393fb94ee8b8fd5576217e4000000000000000000000000898360d33c9200329f387c93354b25e969083bdc0000000000000000000000005e86777dfa4393a29f8d0c7308b0e6e9f991a0b000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000fa00000000000000000000000000000000000000000000000000000000000000ce400000000000000000000000000000000000000000000000000000000000004b000000000000000000000000000000000000000000000000000000000000002bc00000000000000000000000000000000000000000000000000000000000000aa000000000000000000000000000000000000000000000000000000000000008200000000000000000000000000000000000000000000000000000000000001f4
-----Decoded View---------------
Arg [0] : name_ (string): Skelephunks
Arg [1] : symbol_ (string): SKELE
Arg [2] : maxMintsPerWallet_ (uint256): 13
Arg [3] : payees_ (address[]): 0x1088a6585F9a1E2a47933c53C96A1832f25536c9,0xd1F4E12D074b4ECBbE0ce6626da2E7d317e6c2D6,0x236E5fc476D2f944CE441c50fAF158a0a55fed04,0xE042054Bb645893914C7C11Ec6d54cA8797ee33B,0xbAf53d5A52bE22497393Fb94Ee8B8fd5576217E4,0x898360D33c9200329F387c93354B25E969083bdC,0x5E86777DFA4393A29f8D0C7308B0e6E9F991A0b0
Arg [4] : basisPoints_ (uint256[]): 4000,3300,1200,700,170,130,500
-----Encoded View---------------
25 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 000000000000000000000000000000000000000000000000000000000000000d
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [6] : 536b656c657068756e6b73000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [8] : 534b454c45000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [10] : 0000000000000000000000001088a6585f9a1e2a47933c53c96a1832f25536c9
Arg [11] : 000000000000000000000000d1f4e12d074b4ecbbe0ce6626da2e7d317e6c2d6
Arg [12] : 000000000000000000000000236e5fc476d2f944ce441c50faf158a0a55fed04
Arg [13] : 000000000000000000000000e042054bb645893914c7c11ec6d54ca8797ee33b
Arg [14] : 000000000000000000000000baf53d5a52be22497393fb94ee8b8fd5576217e4
Arg [15] : 000000000000000000000000898360d33c9200329f387c93354b25e969083bdc
Arg [16] : 0000000000000000000000005e86777dfa4393a29f8d0c7308b0e6e9f991a0b0
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000fa0
Arg [19] : 0000000000000000000000000000000000000000000000000000000000000ce4
Arg [20] : 00000000000000000000000000000000000000000000000000000000000004b0
Arg [21] : 00000000000000000000000000000000000000000000000000000000000002bc
Arg [22] : 00000000000000000000000000000000000000000000000000000000000000aa
Arg [23] : 0000000000000000000000000000000000000000000000000000000000000082
Arg [24] : 00000000000000000000000000000000000000000000000000000000000001f4
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.