Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0.04 ETH
Eth Value
$136.42 (@ $3,410.41/ETH)More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 59 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Public Sale Mint | 19659716 | 222 days ago | IN | 0.04 ETH | 0.0015176 | ||||
Withdraw | 18516260 | 382 days ago | IN | 0 ETH | 0.001818 | ||||
Public Sale Mint | 18178383 | 430 days ago | IN | 0.04 ETH | 0.00166741 | ||||
Public Sale Mint | 18178378 | 430 days ago | IN | 0.04 ETH | 0.00184717 | ||||
Public Sale Mint | 18049935 | 448 days ago | IN | 0.04 ETH | 0.00173288 | ||||
Public Sale Mint | 17668592 | 501 days ago | IN | 0.04 ETH | 0.00197559 | ||||
Set Public Sale ... | 17415647 | 537 days ago | IN | 0 ETH | 0.00180523 | ||||
Set Public Sale ... | 17415640 | 537 days ago | IN | 0 ETH | 0.00200968 | ||||
Set Public Sale ... | 17415501 | 537 days ago | IN | 0 ETH | 0.0030967 | ||||
Withdraw | 17389814 | 540 days ago | IN | 0 ETH | 0.00092954 | ||||
Public Sale Mint | 17386239 | 541 days ago | IN | 0.04 ETH | 0.00369549 | ||||
Public Sale Mint | 17385630 | 541 days ago | IN | 0.04 ETH | 0.00430721 | ||||
Public Sale Mint | 17382949 | 541 days ago | IN | 0.04 ETH | 0.00603994 | ||||
Set Public Sale | 17382292 | 541 days ago | IN | 0 ETH | 0.00076801 | ||||
Set Auction Sett... | 17382289 | 541 days ago | IN | 0 ETH | 0.00123826 | ||||
Settle Bidder | 17382287 | 541 days ago | IN | 0 ETH | 0.00173587 | ||||
Settle Bidder | 17382280 | 541 days ago | IN | 0 ETH | 0.0175836 | ||||
Set Raffle Winne... | 17382277 | 541 days ago | IN | 0 ETH | 0.00095448 | ||||
Set Auction Winn... | 17382274 | 541 days ago | IN | 0 ETH | 0.00926106 | ||||
Allowlist Mint | 17381774 | 541 days ago | IN | 0.04 ETH | 0.00617029 | ||||
Create Bid | 17381757 | 541 days ago | IN | 0.04 ETH | 0.00414285 | ||||
Allowlist Mint | 17381755 | 541 days ago | IN | 0.04 ETH | 0.01013872 | ||||
Allowlist Mint | 17381751 | 541 days ago | IN | 0.04 ETH | 0.01074449 | ||||
Allowlist Mint | 17381668 | 541 days ago | IN | 0.08 ETH | 0.00701556 | ||||
Allowlist Mint | 17381466 | 541 days ago | IN | 0.04 ETH | 0.00525355 |
Loading...
Loading
Contract Name:
AuctionHouse
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 // The Wildxyz AuctionHouse.sol // AuctionHouse.sol is a modified version of the original code from the // NounsAuctionHouse.sol which is a modified version of Zora's AuctionHouse.sol: // https://github.com/ourzora/auction-house/ // licensed under the GPL-3.0 license. pragma solidity ^0.8.17; import '@openzeppelin/contracts/security/Pausable.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import {Math} from '@openzeppelin/contracts/utils/math/Math.sol'; import {ECDSA} from '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import './WildNFT.sol'; import './IAuctionHouse.sol'; interface SanctionsList { function isSanctioned(address addr) external view returns (bool); } interface IOasis { function balanceOf(address _address) external view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); } interface IDelegationRegistry { /** * @notice Returns true if the address is delegated to act on your behalf for a token contract or an entire vault * @param delegate The hotwallet to act on your behalf * @param contract_ The address for the contract you're delegating * @param vault The cold wallet who issued the delegation */ function checkDelegateForContract(address delegate, address vault, address contract_) external view returns (bool); } contract AuctionHouse is IAuctionHouse, Pausable, ReentrancyGuard, Ownable { // auction variables (packed) uint256 public oasisPrice; // oasis allowlist price uint256 public allowListPrice; // The allowlist price uint256 public minimumBid; // The minimum price accepted in an auction uint256 public minBidIncrement; // The minimum amount by which a bid must exceed the current highest bid uint256 public publicPrice; // public price uint256 public publicSaleMintMax; // max number of tokens per public sale mint uint256 public allowlistMintMax; // max number of tokens per allowlist mint uint256 public timeBuffer; // min amount of time left in an auction after last bid uint256 public duration; // 86400 == 1 day The duration of a single auction in seconds uint256 public raffleSupply; // max number of raffle winners uint256 public auctionSupply; // number of auction supply max of raffle ticket uint256 public allowlistSupply; // number allowlist supply uint256 public maxSupply; // max supply uint256 public promoSupply; // promo supply uint256 public oasisListStartDateTime; //oasislistStartDate uint256 public allowListStartDateTime; //allowListStartDateTime uint256 public allowListEndDateTime; //allowListEndDateTime uint256 public auctionStartDateTime; //==allowListEndDateTime; uint256 public auctionEndDateTime; //auctionEndDateTime uint256 public auctionExtentedTime; address payable public payee; // The address that receives funds from the auction address payable public admin; // for admin functions address public allowlistSigner; // The signer for the allowlist minting bool public auctionWinnersSet = false; bool public raffleWinnersSet = false; bool public auctionSettled = false; bool public settled = false; bool public publicSale = false; // the Oasis contract object IOasis public oasis; // NFT to auction WildNFT public nft; // OFAC sanctions list // mainnet: 0x40C57923924B5c5c5455c48D93317139ADDaC8fb // goerli: 0x5EBdB1188c0D54efB0a004c1d8737A922C1Ad8D2 SanctionsList public sanctionsList; // Bids Struct struct Bid { address payable bidder; // The address of the bidder uint256 amount; // The amount of the bid bool minted; // has the bid been minted uint256 timestamp; // timestamp of the bid bool refunded; // refund difference between winning_bid and max_bid for winner; and all for losers bool winner; // is the bid the winner uint256 finalprice; // if won, what price won at bool rafflewinner; // only true if they were a raffle winner } // mapping of Bid structs mapping(address => Bid) public Bids; // allowList mapping 1=oasis;2=allowlist;0=not on list mapping(address => uint8) public allowList; mapping(address => uint256) public allowListMinted; mapping(uint256 => uint8) public oasisPassMints; /* MODIFIERS */ // used by setVariablesBatch<X> methods mapping(uint64 => bool) private onlyOnceMapping; modifier onlyOnce(uint64 key) { require(onlyOnceMapping[key] == false); onlyOnceMapping[key] = true; _; } // Only allow the auction functions to be active when not paused modifier onlyUnpaused() { require(!paused(), 'AuctionHouse: paused'); _; } // only allows admin to run function modifier onlyAdmin() { require(msg.sender == admin, 'AuctionHouse: only admin permitted.'); _; } // Not on OFAC list modifier onlyUnsanctioned(address _to) { bool isToSanctioned = sanctionsList.isSanctioned(_to); require(!isToSanctioned, 'Blocked: OFAC sanctioned address'); _; } /* CONSTRUCTOR */ constructor(WildNFT _nft, address _payee, address _oasis, address _sanctions, address _allowlistSigner) { nft = _nft; payee = payable(_payee); oasis = IOasis(_oasis); sanctionsList = SanctionsList(_sanctions); allowlistSigner = _allowlistSigner; admin = payable(0x9DAF56fB5d08b1dad7e6A46e0d5E814F41d1b7F9); } /* INITIALIZER FUNCTIONS */ function setVariablesBatch1(uint256 _allowlistMintMax, uint256 _timeBuffer, uint256 _minimumBid, uint256 _minBidIncrement, uint256 _allowListPrice, uint256 _duration, uint256 _publicSaleMintMax, uint256 _oasisPrice, uint256 _publicPrice) public onlyOwner onlyOnce(1) { allowlistMintMax = _allowlistMintMax; timeBuffer = _timeBuffer; minimumBid = _minimumBid; minBidIncrement = _minBidIncrement; allowListPrice = _allowListPrice; duration = _duration; publicSaleMintMax = _publicSaleMintMax; oasisPrice = _oasisPrice; publicPrice = _publicPrice; } function setVariablesBatch2(uint256 _raffleSupply, uint256 _auctionSupply, uint256 _allowlistSupply, uint256 _maxSupply, uint256 _promoSupply, uint256 _oasisListStartDateTime, uint256 _allowListStartDateTime, uint256 _allowListEndDateTime, uint256 _auctionStartDateTime, uint256 _auctionEndDateTime) public onlyOwner onlyOnce(2) { raffleSupply = _raffleSupply; auctionSupply = _auctionSupply; allowlistSupply = _allowlistSupply; maxSupply = _maxSupply; promoSupply = _promoSupply; oasisListStartDateTime = _oasisListStartDateTime; allowListStartDateTime = _allowListStartDateTime; allowListEndDateTime = _allowListEndDateTime; auctionStartDateTime = _auctionStartDateTime; auctionEndDateTime = _auctionEndDateTime; } function setVariablesBatch3(address _payee, address _admin) public onlyOwner onlyOnce(3) { payee = payable(_payee); admin = payable(_admin); } /* OWNER FUNCTIONS */ // set admin address; function setAdmin(address _admin) public onlyOwner { admin = payable(_admin); } // update payee for withdraw function setPayee(address payable _payee) public onlyOwner { payee = _payee; } // pause function pause() external override onlyOwner { _pause(); } // unpause function unpause() external override onlyOwner { _unpause(); } // withdraw function _withdraw() internal { require(auctionSettled == true && block.timestamp > auctionEndDateTime, 'Auction not settled||not ended.'); (bool success, ) = payee.call{value: address(this).balance}(''); require(success, 'Failed to send to payee.'); } function withdraw() public onlyOwner { _withdraw(); } function setRaffleWinners(address[] memory _raffleWinners) external onlyOwner { require(block.timestamp > auctionEndDateTime, 'Auction not over yet.'); require(raffleWinnersSet == false, 'Raffle already settled'); require(_raffleWinners.length <= raffleSupply, 'Incorrect number of winners'); for (uint256 i = 0; i < _raffleWinners.length; i++) { Bid storage bid = Bids[_raffleWinners[i]]; bid.winner = true; bid.finalprice = minimumBid; bid.rafflewinner = true; } raffleWinnersSet = true; } function setAuctionWinners(address[] memory _auctionWinners, uint256[] memory _prices) external onlyOwner { require(block.timestamp > auctionEndDateTime, 'Auction not over yet.'); require(auctionWinnersSet == false, 'Auction already settled'); for (uint256 i = 0; i < _auctionWinners.length; i++) { Bid storage bid = Bids[_auctionWinners[i]]; bid.winner = true; bid.finalprice = _prices[i]; bid.rafflewinner = false; } auctionWinnersSet = true; } /** * Settle an auction. */ function settleBidder(address[] memory _bidders) external onlyOwner nonReentrant { require(block.timestamp > auctionEndDateTime, "Auction hasn't ended."); require(auctionWinnersSet == true && raffleWinnersSet == true, 'Auction winners not set'); for (uint256 i = 0; i < _bidders.length; i++) { address bidder = _bidders[i]; Bid storage bid = Bids[bidder]; if (bid.winner == true && bid.minted == false && bid.refunded == false) { // if winner, mint and refunde diff if any, update Bids uint256 difference = bid.amount - bid.finalprice; if (difference > 0) { (bool success, ) = bidder.call{value: difference}(''); require(success, 'Failed to refund difference to winner.'); } uint256 tokenId = nft.mint(bidder); // different mint type for raffle winner if (bid.rafflewinner == true) { emit TokenMint(bidder, tokenId, MintType.Raffle, bid.finalprice, false, address(0), false, 0); } else { emit TokenMint(bidder, tokenId, MintType.Auction, bid.finalprice, false, address(0), false, 0); } bid.minted = true; bid.refunded = true; } else if (bid.winner == false && bid.refunded == false) { // if not winner, refund (bool success, ) = bidder.call{value: bid.amount}(''); require(success, 'Failed to send refund to loser.'); bid.refunded = true; } } } /** @notice Set the base URI for the NFTs. @dev Calls _setBaseURI internally, while emitting the event RevealMetadata. Only callable by the owner. */ function revealMetadata(string memory _newBaseURI) external onlyOwner { nft.setBaseURIMinter(_newBaseURI); emit MetadataRevealed(); } // Q: Should this be combined with settleBidder? function setAuctionSettled() external onlyOwner { require(auctionSettled == false, 'Auction already settled'); auctionSettled = !auctionSettled; _withdraw(); emit AuctionSettled(); } function setTimes(uint256 allowListStart, uint256 _duration) public onlyOwner { oasisListStartDateTime = allowListStart + 90; allowListStartDateTime = allowListStart + 90; allowListEndDateTime = allowListStartDateTime + _duration; auctionStartDateTime = allowListEndDateTime; auctionEndDateTime = auctionStartDateTime + _duration; } function setAllowListPrice(uint256 _allowListPrice) public onlyOwner { allowListPrice = _allowListPrice; } /* ADMIN VARIABLE SETTERS FUNCTIONS */ function setAllowlistSigner(address _signer) public onlyAdmin { allowlistSigner = _signer; } // set the 721 contract address function set721ContractAddress(WildNFT _nft) public onlyAdmin { nft = _nft; } function setAllowlistSupply(uint256 _allowlistSupply) public onlyAdmin { allowlistSupply = _allowlistSupply; } function setAuctionSupply(uint256 _newAuctionSupply) public onlyAdmin { auctionSupply = _newAuctionSupply; } function setPromoSupply(uint256 _newPromoSupply) public onlyAdmin { promoSupply = _newPromoSupply; } function addToAllowList(address[] memory _addresses, uint8 _state) public onlyAdmin { for (uint256 i = 0; i < _addresses.length; i++) { address _address = _addresses[i]; allowList[_address] = _state; emit AddedToAllowList(_address, _state); } } function removeFromAllowList(address[] memory _addresses) public onlyAdmin { for (uint256 i = 0; i < _addresses.length; i++) { address _address = _addresses[i]; allowList[_address] = 0; emit RemovedFromAllowList(_address); } } function setPublicSaleMintMax(uint256 _newPublicSaleMintMax) public onlyAdmin { publicSaleMintMax = _newPublicSaleMintMax; } function setAllowlistMintMax(uint256 _newAllowlistMintMax) public onlyAdmin { allowlistMintMax = _newAllowlistMintMax; } function setOasislistStartDateTime(uint256 _newOasislistStartDateTime) public onlyAdmin { oasisListStartDateTime = _newOasislistStartDateTime; } function setAuctionStartDateTime(uint256 _newAuctionStartDateTime) public onlyAdmin { auctionStartDateTime = _newAuctionStartDateTime; } function setAuctionEndDateTime(uint256 _newAuctionEndDateTime) public onlyAdmin { auctionEndDateTime = _newAuctionEndDateTime; } function setAllowListStartDateTime(uint256 _newAllowListStartDateTime) public onlyAdmin { allowListStartDateTime = _newAllowListStartDateTime; } function setAllowListEndDateTime(uint256 _newAllowListEndDateTime) public onlyAdmin { allowListEndDateTime = _newAllowListEndDateTime; } function setPublicSale() public onlyAdmin { publicSale = !publicSale; } function setRaffleSupply(uint256 _newRaffleSupply) public onlyAdmin { raffleSupply = _newRaffleSupply; } function setMaxSupply(uint256 _newMaxSupply) public onlyAdmin { maxSupply = _newMaxSupply; } // set the time buffer function setTimeBuffer(uint256 _timeBuffer) external override onlyAdmin { timeBuffer = _timeBuffer; emit AuctionTimeBufferUpdated(_timeBuffer); } // set the minimum bid function setMinimumBid(uint256 _minimumBid) external onlyAdmin { minimumBid = _minimumBid; emit AuctionMinimumBidUpdated(_minimumBid); } // set oasis list price function setOasisPrice(uint256 _oasisPrice) external onlyAdmin { oasisPrice = _oasisPrice; } // set public price function setPublicPrice(uint256 _publicPrice) external onlyAdmin { publicPrice = _publicPrice; } // set min bid incr function setMinBidIncrement(uint256 _minBidIncrement) external onlyAdmin { minBidIncrement = _minBidIncrement; emit AuctionMinBidIncrementUpdated(_minBidIncrement); } // set the duration function setDuration(uint256 _duration) external override onlyAdmin { duration = _duration; emit AuctionDurationUpdated(_duration); } // airdrop mint function promoMint(address _to, uint256 _qty) external onlyAdmin { require(promoSupply >= _qty, 'Not enough promo supply'); require(block.timestamp <= allowListEndDateTime, 'Outside promo mint window'); // this require is to avoid an empty error string if a transaction fails require((maxSupply - nft.totalSupply() - _qty) >= raffleSupply, 'Not enough supply remaining for raffle'); for (uint256 i = 0; i < _qty; i++) { _promoMint(_to, MintType.Promo); } promoSupply -= _qty; auctionSupply = maxSupply - nft.totalSupply() - raffleSupply; } // airdrop batch mint; sends 1 to each address in array function promoBatchMint(address[] memory _to) external onlyAdmin { uint256 numAddresses = _to.length; require(promoSupply >= numAddresses, 'Not enough promo supply'); require(block.timestamp <= allowListEndDateTime, 'Outside promo mint window'); // this require is to avoid an empty error string if a transaction fails require((maxSupply - nft.totalSupply() - numAddresses) >= raffleSupply, 'Not enough supply remaining for raffle'); for (uint256 i = 0; i < numAddresses; i++) { _promoMint(_to[i], MintType.Promo); } promoSupply -= numAddresses; auctionSupply = maxSupply - nft.totalSupply() - raffleSupply; } /* PUBLIC FUNCTIONS */ function allowlistMint(uint256 _qty, bytes memory _signature) external payable onlyUnsanctioned(msg.sender) { _allowlistMint(_qty, msg.sender, _signature); } function allowlistMintDelegated(uint256 _qty, address _vault) external payable onlyUnsanctioned(msg.sender) { require(IDelegationRegistry(0x00000000000076A84feF008CDAbe6409d2FE638B).checkDelegateForContract(msg.sender, _vault, address(oasis))); _allowlistMint(_qty, _vault, ''); } function verifySignature(address _address, bytes memory _signature) public view returns (bool valid) { if (_signature.length == 65) { // we pass the uers _address and this contracts address to // verify that it is intended for this contract specifically bytes32 addressHash = keccak256(abi.encodePacked(_address, address(this))); bytes32 message = ECDSA.toEthSignedMessageHash(addressHash); address signerAddress = ECDSA.recover(message, _signature); return (signerAddress != address(0) && signerAddress == allowlistSigner); } else { return false; } } /* is address on allowlist returns which group (1 = oasis, 2 = allowlist) and tokens left to mint */ function checkAllowlist(address _address, bytes memory _signature) public view returns (uint8 group, uint256 tokens) { uint256 oasisBalance = oasis.balanceOf(_address); if (oasisBalance > 0) { return (1, _oasisListQuantity(_address)); } // must recover allowlistSigner from signature bool isValid = verifySignature(_address, _signature); if (isValid) { return (2, allowlistMintMax - allowListMinted[_address]); } return (0, 0); } /* INTERNAL FUNCTIONS */ function _oasisListQuantity(address _address) internal view returns (uint256) { uint256 oasisCount = oasis.balanceOf(_address); uint256 quantity = 0; for (uint256 i = 0; i < oasisCount; i++) { uint256 tokenId = oasis.tokenOfOwnerByIndex(_address, i); quantity += allowlistMintMax - oasisPassMints[tokenId]; } return quantity; } function _promoMint(address to, MintType mintType) internal { uint256 tokenId = nft.mint(to); emit TokenMint(to, tokenId, mintType, 0, false, address(0), false, 0); } // allowlist mint function _allowlistMint(uint256 _qty, address requester, bytes memory _signature) internal { require(allowlistSupply - _qty >= 0, 'No more allowlist supply'); uint256 msgValue = msg.value; address receiver = msg.sender; (uint group, uint256 allowance) = checkAllowlist(requester, _signature); require(group > 0, 'Not allowed'); require(_qty <= allowance, 'Qty exceeds max allowed.'); // this require is to avoid an empty error string if a transaction fails require((maxSupply - nft.totalSupply() - _qty) >= raffleSupply, 'Not enough supply remaining for raffle'); if (group == 1) { // oasis list minter require(msgValue >= oasisPrice * _qty, 'Oasis allowlist minting: Not enough ETH sent'); require(block.timestamp >= oasisListStartDateTime && block.timestamp <= allowListEndDateTime, 'Outside Oasis allowlist window'); // start of markOasisPassesUsed uint256 oasisCount = oasis.balanceOf(requester); uint256 mintsLeft = _qty; for (uint256 i = 0; i < oasisCount; i++) { uint256 oasisId = oasis.tokenOfOwnerByIndex(requester, i); uint256 tokenAllowance = allowlistMintMax - oasisPassMints[oasisId]; if (tokenAllowance == 0) { // Oasis pass been fully minted continue; } uint8 quantityMintedWithOasis = uint8(Math.min(tokenAllowance, mintsLeft)); oasisPassMints[oasisId] += quantityMintedWithOasis; mintsLeft -= quantityMintedWithOasis; for (uint256 j = 0; j < quantityMintedWithOasis; j++) { uint256 tokenId = nft.mint(receiver); // we call this here to mark the oasis pass as used in the event itself _emitAllowListTokenMint(requester, receiver, tokenId, msgValue, true, oasisId); allowlistSupply--; } } require(mintsLeft == 0, 'Not enough Oasis mint available'); // end of markOasisPassesUsed } else { // other allowlist minter require(msgValue >= allowListPrice * _qty, 'Public allowlist minting: Not enough ETH sent'); require(block.timestamp >= allowListStartDateTime && block.timestamp <= allowListEndDateTime, 'Outside allowlist window'); for (uint256 i = 0; i < _qty; i++) { uint256 tokenId = nft.mint(receiver); _emitAllowListTokenMint(requester, receiver, tokenId, msgValue, false, 0); allowlistSupply--; } allowListMinted[requester] += _qty; } auctionSupply = maxSupply - nft.totalSupply() - raffleSupply; } // helper to check if this is a delegated mint or not function _emitAllowListTokenMint(address requester, address receiver, uint256 tokenId, uint256 pricePaid, bool oasisUsed, uint256 oasisId) internal { if (requester != receiver) { // delegated emit TokenMint(receiver, tokenId, MintType.Allowlist, pricePaid, true, requester, oasisUsed, oasisId); } else { // not delegated emit TokenMint(receiver, tokenId, MintType.Allowlist, pricePaid, false, address(0), oasisUsed, oasisId); } } /** * Transfer ETH and return the success status. * This function only forwards 30,000 gas to the callee. */ function _safeTransferETH(address to, uint256 value) internal returns (bool) { (bool success, ) = to.call{value: value, gas: 30_000}(new bytes(0)); return success; } /* PUBLIC FUNCTIONS */ // UNIVERSAL GETTER FOR AUCTION-RELATED VARIABLES function getAuctionInfo() public view returns (uint256 _auctionSupply, uint256 _auctionStartDateTime, uint256 _auctionEndDateTime, uint256 _auctionExtentedTime, bool _auctionWinnersSet, bool _auctionSettled, bool _settled, uint256 _timeBuffer, uint256 _duration, uint256 _minimumBid, uint256 _minBidIncrement) { return (auctionSupply, auctionStartDateTime, auctionEndDateTime, auctionExtentedTime, auctionWinnersSet, auctionSettled, settled, timeBuffer, duration, minimumBid, minBidIncrement); } // UNIVERSAL GETTER FOR ALLOWLIST AND RAFFLE-RELATED VARIABLES function getAllowlistAndRaffleInfo() public view returns (uint256 _raffleSupply, uint256 _allowListPrice, uint256 _allowListStartDateTime, uint256 _allowListEndDateTime, bool _raffleWinnersSet, bool _publicSale, uint256 _allowlistSupply, uint256 _totalMinted, uint256 _oasislistStartDateTime, uint256 _allowlistMintMax, uint256 _oasisPrice, uint256 _publicPrice) { return (raffleSupply, allowListPrice, allowListStartDateTime, allowListEndDateTime, raffleWinnersSet, publicSale, allowlistSupply, nft.totalSupply(), oasisListStartDateTime, allowlistMintMax, oasisPrice, publicPrice); } // Creates bids for the current auction function createBid() external payable nonReentrant onlyUnpaused onlyUnsanctioned(msg.sender) { address bidder = msg.sender; uint256 bidAmount = msg.value; // Check that the auction is live && Bid Amount is greater than minimum bid require(block.timestamp < auctionEndDateTime && block.timestamp >= auctionStartDateTime, 'Outside auction window.'); require(bidAmount >= minimumBid, 'Bid amount too low.'); // check if bidder already has bid if (Bids[bidder].amount > 0) { // if so, refund old and replace with new Bid storage existingBid = Bids[bidder]; require(bidAmount > existingBid.amount, 'You can only increase your bid, not decrease.'); _safeTransferETH(payable(bidder), existingBid.amount); existingBid.amount = bidAmount; } else { // otherwise, enter new bid. Bid memory new_bid; new_bid.bidder = payable(bidder); new_bid.amount = bidAmount; new_bid.timestamp = block.timestamp; new_bid.winner = false; new_bid.refunded = false; new_bid.minted = false; new_bid.finalprice = 0; Bids[bidder] = new_bid; } // Extend the auction if the bid was received within the time buffer // bool extended = auctionEndDateTime - block.timestamp < timeBuffer; //if (extended) { // auctionEndDateTime = auctionEndDateTime + timeBuffer; // auctionExtentedTime = auctionExtentedTime + timeBuffer; //} emit AuctionBid(bidder, bidAmount, false); } function publicSaleMint() public payable nonReentrant onlyUnpaused onlyUnsanctioned(msg.sender) { // if we didnt sell out, we can mint the remaining // for price of min bid // will error when supply is 0 // Note: 1) is the auction closed and 2) is the raffle set and // 3) if the total supply is less than the max supply, then you can allow ppl to mint // require(auctionEndDateTime < block.timestamp, "Auction not over yet."); // require(raffleWinnersSet == true, "Raffle not settled yet."); require(nft.totalSupply() < nft.maxSupply(), 'No more tokens available.'); require(publicSale == true, 'Not authorized.'); uint256 msgValue = msg.value; require(msg.value >= publicPrice, 'Amount too low.'); uint256 tokenId = nft.mint(msg.sender); emit TokenMint(msg.sender, tokenId, MintType.PublicSale, msgValue, false, address(0), false, 0); } // multiple minting for public sale (do not use this for one mint, use publicSaleMint() instead) function publicSaleMintMultiple(uint256 _qty) public payable nonReentrant onlyUnpaused onlyUnsanctioned(msg.sender) { uint256 _maxSupply = nft.maxSupply(); uint256 _totalSupply = nft.totalSupply(); require(_qty <= publicSaleMintMax, 'Too many tokens requested.'); require(_totalSupply < _maxSupply, 'No more tokens available.'); // which one is better? require((_maxSupply - _totalSupply) >= _qty, 'Not enough supply left - 1.'); require(publicSale == true, 'Not authorized.'); uint256 msgValue = msg.value; require(msgValue >= (publicPrice * _qty), 'Amount too low.'); for (uint256 i = 0; i < _qty; i++) { uint256 tokenId = nft.mint(msg.sender); emit TokenMint(msg.sender, tokenId, MintType.PublicSale, msgValue, false, address(0), false, 0); } } // airdrop mint function creditCardMint(address _to, uint256 _qty) external onlyAdmin { require(promoSupply >= _qty, 'Not enough promo supply'); require(block.timestamp <= allowListEndDateTime, 'Outside promo mint window'); // this require is to avoid an empty error string if a transaction fails require((maxSupply - nft.totalSupply() - _qty) >= raffleSupply, 'Not enough supply remaining for raffle'); for (uint256 i = 0; i < _qty; i++) { _promoMint(_to, MintType.CreditCard); } promoSupply -= _qty; auctionSupply = maxSupply - nft.totalSupply() - raffleSupply; } // airdrop batch mint; sends 1 to each address in array function creditCardBatchMint(address[] memory _to) external onlyAdmin { uint256 numAddresses = _to.length; require(promoSupply >= numAddresses, 'Not enough promo supply'); require(block.timestamp <= allowListEndDateTime, 'Outside promo mint window'); // this require is to avoid an empty error string if a transaction fails require((maxSupply - nft.totalSupply() - numAddresses) >= raffleSupply, 'Not enough supply remaining for raffle'); for (uint256 i = 0; i < numAddresses; i++) { _promoMint(_to[i], MintType.CreditCard); } promoSupply -= numAddresses; auctionSupply = maxSupply - nft.totalSupply() - raffleSupply; } }
// 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.8.0) (finance/PaymentSplitter.sol) pragma solidity ^0.8.0; import "../token/ERC20/utils/SafeERC20.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. The distribution of shares is set at the * time of contract deployment and can't be updated thereafter. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. * * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you * to run tests before sending real value to this contract. */ contract PaymentSplitter is Context { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; mapping(IERC20 => uint256) private _erc20TotalReleased; mapping(IERC20 => mapping(address => uint256)) private _erc20Released; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ constructor(address[] memory payees, uint256[] memory shares_) payable { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20 * contract. */ function totalReleased(IERC20 token) public view returns (uint256) { return _erc20TotalReleased[token]; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an * IERC20 contract. */ function released(IERC20 token, address account) public view returns (uint256) { return _erc20Released[token][account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Getter for the amount of payee's releasable Ether. */ function releasable(address account) public view returns (uint256) { uint256 totalReceived = address(this).balance + totalReleased(); return _pendingPayment(account, totalReceived, released(account)); } /** * @dev Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an * IERC20 contract. */ function releasable(IERC20 token, address account) public view returns (uint256) { uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token); return _pendingPayment(account, totalReceived, released(token, account)); } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _totalReleased is the sum of all values in _released. // If "_totalReleased += payment" does not overflow, then "_released[account] += payment" cannot overflow. _totalReleased += payment; unchecked { _released[account] += payment; } Address.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20 * contract. */ function release(IERC20 token, address account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(token, account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _erc20TotalReleased[token] is the sum of all values in _erc20Released[token]. // If "_erc20TotalReleased[token] += payment" does not overflow, then "_erc20Released[token][account] += payment" // cannot overflow. _erc20TotalReleased[token] += payment; unchecked { _erc20Released[token][account] += payment; } SafeERC20.safeTransfer(token, account, payment); emit ERC20PaymentReleased(token, account, payment); } /** * @dev internal logic for computing the pending payment of an `account` given the token historical balances and * already released amounts. */ function _pendingPayment( address account, uint256 totalReceived, uint256 alreadyReleased ) private view returns (uint256) { return (totalReceived * _shares[account]) / _totalShares - alreadyReleased; } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated 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/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.2) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such * that `ownerOf(tokenId)` is `a`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } }
// 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) (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.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 (last updated v4.7.0) (utils/Base64.sol) pragma solidity ^0.8.0; /** * @dev Provides a set of functions to operate with Base64 strings. * * _Available since v4.5._ */ library Base64 { /** * @dev Base64 Encoding/Decoding Table */ string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * @dev Converts a `bytes` to its Bytes64 `string` representation. */ function encode(bytes memory data) internal pure returns (string memory) { /** * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol */ if (data.length == 0) return ""; // Loads the table into memory string memory table = _TABLE; // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter // and split into 4 numbers of 6 bits. // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up // - `data.length + 2` -> Round up // - `/ 3` -> Number of 3-bytes chunks // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) // Prepare result pointer, jump over length let resultPtr := add(result, 32) // Run over the input, 3 bytes at a time for { let dataPtr := data let endPtr := add(data, mload(data)) } lt(dataPtr, endPtr) { } { // Advance 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // To write each character, shift the 3 bytes (18 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) // and apply logical AND with 0x3F which is the number of // the previous character in the ASCII table prior to the Base64 Table // The result is then added to the table to get the character to write, // and finally write it in the result pointer but with a left shift // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) // Advance } // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) case 1 { mstore8(sub(resultPtr, 1), 0x3d) mstore8(sub(resultPtr, 2), 0x3d) } case 2 { mstore8(sub(resultPtr, 1), 0x3d) } } return result; } }
// 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/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// 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 // 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: GPL-3.0 /// @title Interface for Auction Houses pragma solidity ^0.8.6; interface IAuctionHouse { /// @notice MintType enum used to distinguish nft mint types enum MintType { Promo, Allowlist, Auction, Raffle, PublicSale, CreditCard } /** @notice Emitted when a new token is minted @dev Generalized mint event, uses the MintType parameter to distinguish mint types @param to - address of the token owner @param tokenId - token ID @param mintType - MintType enum @param isDelegated - whether or not the mint was delegated @param delegatedVault - address of the delegated vault @param oasisUsed - whether or not an Oasis pass was used @param oasisId - Oasis pass ID */ event TokenMint(address indexed to, uint256 indexed tokenId, MintType indexed mintType, uint256 amountPaid, bool isDelegated, address delegatedVault, bool oasisUsed, uint256 oasisId); /** @notice Emitted when AuctionHouse.revealMetadata(_newBaseURI) is called @dev Used to trigger webhook listeners */ event MetadataRevealed(); event AddedToAllowList(address indexed addedAddress, uint8 indexed state); event RemovedFromAllowList(address indexed removedAddress); event AuctionBid(address sender, uint256 value, bool extended); event AuctionSettled(); event AuctionTimeBufferUpdated(uint256 timeBuffer); event AuctionMinimumBidUpdated(uint256 minimumBid); event AuctionMinBidIncrementUpdated(uint256 minBidIncrementPercentage); event AuctionDurationUpdated(uint256 duration); function setAuctionWinners(address[] memory _auctionWinners, uint256[] memory _price) external; function setTimes(uint256 _startTime, uint256 _duration) external; function createBid() external payable; function pause() external; function unpause() external; function setTimeBuffer(uint256 timeBuffer) external; function setDuration(uint256 _duration) external; }
// SPDX-License-Identifier: GPL-3.0 // LICENSE // This is a modified version of the original code from the // NounsToken.sol— an implementation of OpenZeppelin's ERC-721: // https://github.com/nounsDAO/nouns-monorepo/blob/master/packages/nouns-contracts/contracts/NounsToken.sol // The original code is licensed under the GPL-3.0 license // Thank you to the Nouns team for the inspiration and code! pragma solidity ^0.8.6; import {UpdatableOperatorFilterer} from '../../utils/operator-filter-registry/UpdatableOperatorFilterer.sol'; import {RevokableDefaultOperatorFilterer} from '../../utils/operator-filter-registry/RevokableDefaultOperatorFilterer.sol'; import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol'; import {Strings} from '@openzeppelin/contracts/utils/Strings.sol'; import {Base64} from '@openzeppelin/contracts/utils/Base64.sol'; import {Math} from '@openzeppelin/contracts/utils/math/Math.sol'; import {IERC721} from '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import {ERC2981} from '@openzeppelin/contracts/token/common/ERC2981.sol'; import {IERC165} from '@openzeppelin/contracts/utils/introspection/IERC165.sol'; import {PaymentSplitter} from '@openzeppelin/contracts/finance/PaymentSplitter.sol'; import {WildNFT} from './WildNFT.sol'; interface IWildNFT is IERC721 { event TokenCreated(uint256 indexed tokenId, address mintedTo); event TokenBurned(uint256 indexed tokenId); event MetadataUpdate(uint256 _tokenId); event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); function mint(address _to) external returns (uint256); function burn(uint256 tokenId) external; function setMinter(address minter) external; function setBaseURI(string memory _newBaseURI) external; function totalSupply() external view returns (uint256); function maxSupply() external view returns (uint256); } abstract contract WildNFT is IWildNFT, Ownable, RevokableDefaultOperatorFilterer, ERC721, ERC2981, PaymentSplitter { // An address who has permissions to mint qf tokens address public minter; // Mapping of operators to whether they are approved or not mapping(address => bool) public authorized; // Mapping of addresses flagged for denying token interactions mapping(address => bool) public blockList; uint256 public _currentTokenId; uint256 public maxSupply; string public baseURI; constructor(string memory name_, string memory symbol_, address _minter, uint256 _maxSupply, string memory _baseURI, address[] memory _payees, uint256[] memory _shares, uint96 _feeNumerator) PaymentSplitter(_payees, _shares) ERC721(name_, symbol_) { minter = _minter; maxSupply = _maxSupply; baseURI = _baseURI; _setDefaultRoyalty(address(this), _feeNumerator); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } /** * @notice Require that the sender is the minter. */ modifier onlyMinter() { require(msg.sender == minter, 'Sender is not the minter'); _; } /** * @notice updates the deny list * @param flaggedOperator the address to be added to the deny list * @param status whether the address is to be added or removed from the deny list */ function updateDenyList(address flaggedOperator, bool status) public onlyOwner { _updateDenyList(flaggedOperator, status); } /* * @notice Override isApprovedForAll * @param owner The owner of the Nouns * @param operator The operator to check if approved */ function isApprovedForAll(address _owner, address operator) public view override(IERC721, ERC721) returns (bool) { require(blockList[operator] == false, 'Operator has been denied by contract owner.'); if (authorized[operator] == true) { return true; } return super.isApprovedForAll(_owner, operator); } /* OS */ function setApprovalForAll(address operator, bool approved) public override(IERC721, ERC721) onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve(address operator, uint256 tokenId) public override(IERC721, ERC721) onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom(address from, address to, uint256 tokenId) public override(IERC721, ERC721) onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId) public override(IERC721, ERC721) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public override(IERC721, ERC721) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } function owner() public view virtual override(Ownable, UpdatableOperatorFilterer) returns (address) { return Ownable.owner(); } /** * @notice sets the authorized operators for interacting with the contract * @param operator the address to be added to the authorized operators * @param approved whether the address is approved or not within authorized operators */ function setAuthorized(address operator, bool approved) public onlyOwner { authorized[operator] = approved; } /** * @notice Set the token minter. * @dev Only callable by the owner when not locked. * @param _minter The address of the new minter. */ function setMinter(address _minter) external onlyOwner { minter = _minter; } /** * @notice updates the deny list * @param flaggedOperator The address to be approved. * @param status True if the operator is approved, false to revoke approval. */ function _updateDenyList(address flaggedOperator, bool status) internal virtual { blockList[flaggedOperator] = status; } /** * @notice Mint a token to the given address. * @dev Only callable by the minter. * @param _to The address to mint the qf token to. * @return The ID of the newly minted qf token. */ function mint(address _to) public override onlyMinter returns (uint256) { require(_currentTokenId < maxSupply, 'Max supply reached'); return _mintTo(_to, _currentTokenId++); } /** * @notice Burn a pass. * @dev Only callable by the minter. * @param tokenId The ID of the qf token to burn. */ function burn(uint256 tokenId) public override onlyMinter { _burn(tokenId); emit TokenBurned(tokenId); } /** * @notice Set the base URI. * @dev Only callable by the owner. * @param _newBaseURI The new base URI. */ function setBaseURI(string memory _newBaseURI) public onlyOwner { baseURI = _newBaseURI; emit BatchMetadataUpdate(0, maxSupply - 1); } /// @notice Identical to setBaseURI but callable by minter only. function setBaseURIMinter(string memory _newBaseURI) public onlyMinter { baseURI = _newBaseURI; emit BatchMetadataUpdate(0, maxSupply - 1); } /** @notice Mints a new token * @param to: the address of the new owner looking to mint * @param tokenId: the token ID * @return the ID of the newly minted token */ function _mintTo(address to, uint256 tokenId) internal returns (uint256) { _mint(to, tokenId); emit TokenCreated(tokenId, to); return tokenId; } function totalSupply() public view returns (uint256) { return _currentTokenId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; /* NOTE ON SEPOLIA: The address 0x000000000000AAeB6D7670E522A718067333cd4E is currently broken on Sepolia, pending OpenSea sepolia support. A temporary workaround to get the WildNFT deploying on sepolia is to use a non-existing address such as 0xB69c34f580d74396Daeb327D35B4fb4677353Fa9 For production, please change this to the correct address. */ address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0xB69c34f580d74396Daeb327D35B4fb4677353Fa9; //0x000000000000AAeB6D7670E522A718067333cd4E; address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { /** * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns * true if supplied registrant address is not registered. */ function isOperatorAllowed(address registrant, address operator) external view returns (bool); /** * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner. */ function register(address registrant) external; /** * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes. */ function registerAndSubscribe(address registrant, address subscription) external; /** * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another * address without subscribing. */ function registerAndCopyEntries(address registrant, address registrantToCopy) external; /** * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner. * Note that this does not remove any filtered addresses or codeHashes. * Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes. */ function unregister(address addr) external; /** * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered. */ function updateOperator(address registrant, address operator, bool filtered) external; /** * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates. */ function updateOperators(address registrant, address[] calldata operators, bool filtered) external; /** * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered. */ function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; /** * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates. */ function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; /** * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous * subscription if present. * Note that accounts with subscriptions may go on to subscribe to other accounts - in this case, * subscriptions will not be forwarded. Instead the former subscription's existing entries will still be * used. */ function subscribe(address registrant, address registrantToSubscribe) external; /** * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes. */ function unsubscribe(address registrant, bool copyExistingEntries) external; /** * @notice Get the subscription address of a given registrant, if any. */ function subscriptionOf(address addr) external returns (address registrant); /** * @notice Get the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscribers(address registrant) external returns (address[] memory); /** * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscriberAt(address registrant, uint256 index) external returns (address); /** * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr. */ function copyEntriesOf(address registrant, address registrantToCopy) external; /** * @notice Returns true if operator is filtered by a given address or its subscription. */ function isOperatorFiltered(address registrant, address operator) external returns (bool); /** * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription. */ function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); /** * @notice Returns true if a codeHash is filtered by a given address or its subscription. */ function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); /** * @notice Returns a list of filtered operators for a given address or its subscription. */ function filteredOperators(address addr) external returns (address[] memory); /** * @notice Returns the set of filtered codeHashes for a given address or its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashes(address addr) external returns (bytes32[] memory); /** * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredOperatorAt(address registrant, uint256 index) external returns (address); /** * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); /** * @notice Returns true if an address has registered */ function isRegistered(address addr) external returns (bool); /** * @dev Convenience method to compute the code hash of an arbitrary contract */ function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {RevokableOperatorFilterer} from './RevokableOperatorFilterer.sol'; import {CANONICAL_CORI_SUBSCRIPTION, CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from './Constants.sol'; /** * @title RevokableDefaultOperatorFilterer * @notice Inherits from RevokableOperatorFilterer and automatically subscribes to the default OpenSea subscription. * Note that OpenSea will disable creator earnings enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. */ abstract contract RevokableDefaultOperatorFilterer is RevokableOperatorFilterer { /// @dev The constructor that is called when the contract is being deployed. constructor() RevokableOperatorFilterer(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS, CANONICAL_CORI_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {UpdatableOperatorFilterer} from './UpdatableOperatorFilterer.sol'; import {IOperatorFilterRegistry} from './IOperatorFilterRegistry.sol'; /** * @title RevokableOperatorFilterer * @notice This contract is meant to allow contracts to permanently skip OperatorFilterRegistry checks if desired. The * Registry itself has an "unregister" function, but if the contract is ownable, the owner can re-register at * any point. As implemented, this abstract contract allows the contract owner to permanently skip the * OperatorFilterRegistry checks by calling revokeOperatorFilterRegistry. Once done, the registry * address cannot be further updated. * Note that OpenSea will still disable creator earnings enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. */ abstract contract RevokableOperatorFilterer is UpdatableOperatorFilterer { /// @dev Emitted when the registry has already been revoked. error RegistryHasBeenRevoked(); /// @dev Emitted when the initial registry address is attempted to be set to the zero address. error InitialRegistryAddressCannotBeZeroAddress(); event OperatorFilterRegistryRevoked(); bool public isOperatorFilterRegistryRevoked; /// @dev The constructor that is called when the contract is being deployed. constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) UpdatableOperatorFilterer(_registry, subscriptionOrRegistrantToCopy, subscribe) { // don't allow creating a contract with a permanently revoked registry if (_registry == address(0)) { revert InitialRegistryAddressCannotBeZeroAddress(); } } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be permanently bypassed, and the address cannot be updated again. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public override { if (msg.sender != owner()) { revert OnlyOwner(); } // if registry has been revoked, do not allow further updates if (isOperatorFilterRegistryRevoked) { revert RegistryHasBeenRevoked(); } operatorFilterRegistry = IOperatorFilterRegistry(newRegistry); emit OperatorFilterRegistryAddressUpdated(newRegistry); } /** * @notice Revoke the OperatorFilterRegistry address, permanently bypassing checks. OnlyOwner. */ function revokeOperatorFilterRegistry() public { if (msg.sender != owner()) { revert OnlyOwner(); } // if registry has been revoked, do not allow further updates if (isOperatorFilterRegistryRevoked) { revert RegistryHasBeenRevoked(); } // set to zero address to bypass checks operatorFilterRegistry = IOperatorFilterRegistry(address(0)); isOperatorFilterRegistryRevoked = true; emit OperatorFilterRegistryRevoked(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from './IOperatorFilterRegistry.sol'; /** * @title UpdatableOperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. This contract allows the Owner to update the * OperatorFilterRegistry address via updateOperatorFilterRegistryAddress, including to the zero address, * which will bypass registry checks. * Note that OpenSea will still disable creator earnings enforcement if filtered operators begin fulfilling orders * on-chain, eg, if the registry is revoked or bypassed. * @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 UpdatableOperatorFilterer { /// @dev Emitted when an operator is not allowed. error OperatorNotAllowed(address operator); /// @dev Emitted when someone other than the owner is trying to call an only owner function. error OnlyOwner(); event OperatorFilterRegistryAddressUpdated(address newRegistry); IOperatorFilterRegistry public operatorFilterRegistry; /// @dev The constructor that is called when the contract is being deployed. constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) { IOperatorFilterRegistry registry = IOperatorFilterRegistry(_registry); operatorFilterRegistry = registry; // 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(registry).code.length > 0) { if (subscribe) { registry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { registry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { registry.register(address(this)); } } } } /** * @dev A helper function to check if the operator is allowed. */ 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); } _; } /** * @dev A helper function to check if the operator approval is allowed. */ modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } /** * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero * address, checks will be bypassed. OnlyOwner. */ function updateOperatorFilterRegistryAddress(address newRegistry) public virtual { if (msg.sender != owner()) { revert OnlyOwner(); } operatorFilterRegistry = IOperatorFilterRegistry(newRegistry); emit OperatorFilterRegistryAddressUpdated(newRegistry); } /** * @dev Assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract. */ function owner() public view virtual returns (address); /** * @dev A helper function to check if the operator is allowed. */ function _checkFilterOperator(address operator) internal view virtual { IOperatorFilterRegistry registry = operatorFilterRegistry; // Check registry code length to facilitate testing in environments without a deployed registry. if (address(registry) != address(0) && address(registry).code.length > 0) { // under normal circumstances, this function will revert rather than return false, but inheriting contracts // may specify their own OperatorFilterRegistry implementations, which may behave differently if (!registry.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract WildNFT","name":"_nft","type":"address"},{"internalType":"address","name":"_payee","type":"address"},{"internalType":"address","name":"_oasis","type":"address"},{"internalType":"address","name":"_sanctions","type":"address"},{"internalType":"address","name":"_allowlistSigner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addedAddress","type":"address"},{"indexed":true,"internalType":"uint8","name":"state","type":"uint8"}],"name":"AddedToAllowList","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bool","name":"extended","type":"bool"}],"name":"AuctionBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"}],"name":"AuctionDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minBidIncrementPercentage","type":"uint256"}],"name":"AuctionMinBidIncrementUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minimumBid","type":"uint256"}],"name":"AuctionMinimumBidUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"AuctionSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timeBuffer","type":"uint256"}],"name":"AuctionTimeBufferUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"MetadataRevealed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"removedAddress","type":"address"}],"name":"RemovedFromAllowList","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"enum IAuctionHouse.MintType","name":"mintType","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"amountPaid","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isDelegated","type":"bool"},{"indexed":false,"internalType":"address","name":"delegatedVault","type":"address"},{"indexed":false,"internalType":"bool","name":"oasisUsed","type":"bool"},{"indexed":false,"internalType":"uint256","name":"oasisId","type":"uint256"}],"name":"TokenMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"Bids","outputs":[{"internalType":"address payable","name":"bidder","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"minted","type":"bool"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bool","name":"refunded","type":"bool"},{"internalType":"bool","name":"winner","type":"bool"},{"internalType":"uint256","name":"finalprice","type":"uint256"},{"internalType":"bool","name":"rafflewinner","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"},{"internalType":"uint8","name":"_state","type":"uint8"}],"name":"addToAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowList","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowListEndDateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowListMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowListPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowListStartDateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_qty","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"allowlistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_qty","type":"uint256"},{"internalType":"address","name":"_vault","type":"address"}],"name":"allowlistMintDelegated","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"allowlistMintMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionEndDateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionExtentedTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionSettled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionStartDateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"auctionWinnersSet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"checkAllowlist","outputs":[{"internalType":"uint8","name":"group","type":"uint8"},{"internalType":"uint256","name":"tokens","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"createBid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_to","type":"address[]"}],"name":"creditCardBatchMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_qty","type":"uint256"}],"name":"creditCardMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllowlistAndRaffleInfo","outputs":[{"internalType":"uint256","name":"_raffleSupply","type":"uint256"},{"internalType":"uint256","name":"_allowListPrice","type":"uint256"},{"internalType":"uint256","name":"_allowListStartDateTime","type":"uint256"},{"internalType":"uint256","name":"_allowListEndDateTime","type":"uint256"},{"internalType":"bool","name":"_raffleWinnersSet","type":"bool"},{"internalType":"bool","name":"_publicSale","type":"bool"},{"internalType":"uint256","name":"_allowlistSupply","type":"uint256"},{"internalType":"uint256","name":"_totalMinted","type":"uint256"},{"internalType":"uint256","name":"_oasislistStartDateTime","type":"uint256"},{"internalType":"uint256","name":"_allowlistMintMax","type":"uint256"},{"internalType":"uint256","name":"_oasisPrice","type":"uint256"},{"internalType":"uint256","name":"_publicPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAuctionInfo","outputs":[{"internalType":"uint256","name":"_auctionSupply","type":"uint256"},{"internalType":"uint256","name":"_auctionStartDateTime","type":"uint256"},{"internalType":"uint256","name":"_auctionEndDateTime","type":"uint256"},{"internalType":"uint256","name":"_auctionExtentedTime","type":"uint256"},{"internalType":"bool","name":"_auctionWinnersSet","type":"bool"},{"internalType":"bool","name":"_auctionSettled","type":"bool"},{"internalType":"bool","name":"_settled","type":"bool"},{"internalType":"uint256","name":"_timeBuffer","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"uint256","name":"_minimumBid","type":"uint256"},{"internalType":"uint256","name":"_minBidIncrement","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBidIncrement","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumBid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nft","outputs":[{"internalType":"contract WildNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oasis","outputs":[{"internalType":"contract IOasis","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oasisListStartDateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"oasisPassMints","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oasisPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payee","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_to","type":"address[]"}],"name":"promoBatchMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_qty","type":"uint256"}],"name":"promoMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"promoSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"publicSaleMintMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_qty","type":"uint256"}],"name":"publicSaleMintMultiple","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"raffleSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"raffleWinnersSet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"removeFromAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"revealMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sanctionsList","outputs":[{"internalType":"contract SanctionsList","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract WildNFT","name":"_nft","type":"address"}],"name":"set721ContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAllowListEndDateTime","type":"uint256"}],"name":"setAllowListEndDateTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allowListPrice","type":"uint256"}],"name":"setAllowListPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAllowListStartDateTime","type":"uint256"}],"name":"setAllowListStartDateTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAllowlistMintMax","type":"uint256"}],"name":"setAllowlistMintMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setAllowlistSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allowlistSupply","type":"uint256"}],"name":"setAllowlistSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAuctionEndDateTime","type":"uint256"}],"name":"setAuctionEndDateTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setAuctionSettled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAuctionStartDateTime","type":"uint256"}],"name":"setAuctionStartDateTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAuctionSupply","type":"uint256"}],"name":"setAuctionSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_auctionWinners","type":"address[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"}],"name":"setAuctionWinners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"setDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMaxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minBidIncrement","type":"uint256"}],"name":"setMinBidIncrement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minimumBid","type":"uint256"}],"name":"setMinimumBid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_oasisPrice","type":"uint256"}],"name":"setOasisPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newOasislistStartDateTime","type":"uint256"}],"name":"setOasislistStartDateTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_payee","type":"address"}],"name":"setPayee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPromoSupply","type":"uint256"}],"name":"setPromoSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_publicPrice","type":"uint256"}],"name":"setPublicPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPublicSaleMintMax","type":"uint256"}],"name":"setPublicSaleMintMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newRaffleSupply","type":"uint256"}],"name":"setRaffleSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_raffleWinners","type":"address[]"}],"name":"setRaffleWinners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timeBuffer","type":"uint256"}],"name":"setTimeBuffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"allowListStart","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"setTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allowlistMintMax","type":"uint256"},{"internalType":"uint256","name":"_timeBuffer","type":"uint256"},{"internalType":"uint256","name":"_minimumBid","type":"uint256"},{"internalType":"uint256","name":"_minBidIncrement","type":"uint256"},{"internalType":"uint256","name":"_allowListPrice","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"uint256","name":"_publicSaleMintMax","type":"uint256"},{"internalType":"uint256","name":"_oasisPrice","type":"uint256"},{"internalType":"uint256","name":"_publicPrice","type":"uint256"}],"name":"setVariablesBatch1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleSupply","type":"uint256"},{"internalType":"uint256","name":"_auctionSupply","type":"uint256"},{"internalType":"uint256","name":"_allowlistSupply","type":"uint256"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"uint256","name":"_promoSupply","type":"uint256"},{"internalType":"uint256","name":"_oasisListStartDateTime","type":"uint256"},{"internalType":"uint256","name":"_allowListStartDateTime","type":"uint256"},{"internalType":"uint256","name":"_allowListEndDateTime","type":"uint256"},{"internalType":"uint256","name":"_auctionStartDateTime","type":"uint256"},{"internalType":"uint256","name":"_auctionEndDateTime","type":"uint256"}],"name":"setVariablesBatch2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_payee","type":"address"},{"internalType":"address","name":"_admin","type":"address"}],"name":"setVariablesBatch3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_bidders","type":"address[]"}],"name":"settleBidder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"settled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeBuffer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"verifySignature","outputs":[{"internalType":"bool","name":"valid","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526019805464ffffffffff60a01b191690553480156200002257600080fd5b50604051620052813803806200528183398101604081905262000045916200014c565b6000805460ff19169055600180556200005e33620000e1565b601b80546001600160a01b03199081166001600160a01b039788161790915560178054821695871695909517909455601a8054851693861693909317909255601c80548416918516919091179055601980548316919093161790915560188054739daf56fb5d08b1dad7e6a46e0d5e814f41d1b7f99216919091179055620001cc565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03811681146200014957600080fd5b50565b600080600080600060a086880312156200016557600080fd5b8551620001728162000133565b6020870151909550620001858162000133565b6040870151909450620001988162000133565b6060870151909350620001ab8162000133565b6080870151909250620001be8162000133565b809150509295509295909350565b6150a580620001dc6000396000f3fe6080604052600436106104e15760003560e01c806385e3aac611610281578063c5693a841161015a578063e474def4116100cc578063f6be71d111610085578063f6be71d114610ffc578063f851a4401461101c578063fa1431da1461103c578063fc3a635314611069578063fd49af1314611089578063fe3e492d1461109f57600080fd5b8063e474def414610f50578063e548175414610f70578063ec571c6a14610f90578063ec91f2a414610fb0578063f2c6cc5214610fc6578063f2fde38b14610fdc57600080fd5b8063d3a863861161011e578063d3a8638614610e34578063d3e761a414610e4a578063d5abeb0114610e6b578063d94a350514610e81578063d9ad7f9114610f1b578063e30ac00314610f3b57600080fd5b8063c5693a8414610dc0578063c627525514610dd6578063d1b7bda314610df6578063d2b898df14610e0c578063d2eb86ee14610e2c57600080fd5b8063a2a3eb4d116101f3578063b59f6bf5116101b7578063b59f6bf514610d13578063ba060b7d14610d34578063c1b819b914610d4a578063c32fe11b14610d6a578063c403b5b214610d8a578063c417f57f14610da057600080fd5b8063a2a3eb4d14610c7d578063a3afda1a14610c9d578063a51312c814610cbd578063a945bf8014610cdd578063ae90b21314610cf357600080fd5b80638bab534d116102455780638bab534d14610bd55780638d57c9a914610bf55780638da5cb5b14610c155780638f77583914610c335780639a3afdec14610c54578063a24e515314610c6757600080fd5b806385e3aac614610b3357806386495b0414610b5357806388bbba1214610b7357806389b8c18014610ba25780638a64bbf014610bb557600080fd5b80634adbc2d3116103be5780636df9fa8811610330578063727b4d96116102e9578063727b4d9614610aa057806378f1988714610ac057806380a06f9714610ae05780638362407414610af65780638456cb5914610afe578063852fedc914610b1357600080fd5b80636df9fa88146109d25780636f8b44b0146109f2578063704b6c0214610a125780637107366414610a325780637120334b14610a6b578063715018a614610a8b57600080fd5b806358151ef41161038257806358151ef41461092457806358d5d66614610944578063599d127a146109645780635c975abb1461097a57806365d634c5146109925780636d8aded1146109b257600080fd5b80634adbc2d31461088e578063510f615a146108ae57806355ee09d7146108ce57806355f15f0c146108ee57806356f8f78c1461090f57600080fd5b80632848aeaf116104575780633ccfd60b1161041b5780633ccfd60b146107d65780633f17d40a146107eb5780633f4ba83a14610801578063410459ad1461081657806347c36e171461083657806347ccca021461085657600080fd5b80632848aeaf146106d9578063298230281461071b578063335b115e1461078957806333bc1c5c1461079f578063381bf932146107c057600080fd5b806313cabd69116104a957806313cabd691461062a57806315c8f106146106405780631eb8b34314610653578063224348361461066957806323ab54b514610689578063258c1ef5146106a957600080fd5b806301596309146104e65780630251e03e146105085780630cb71584146105d05780630fb5a6b4146105f057806312300ba414610614575b600080fd5b3480156104f257600080fd5b50610506610501366004614921565b6110bf565b005b34801561051457600080fd5b5061057a610523366004614979565b601d6020526000908152604090208054600182015460028301546003840154600485015460058601546006909601546001600160a01b0390951695939460ff93841694929382811693610100909304811692911688565b604080516001600160a01b039099168952602089019790975294151595870195909552606086019290925215156080850152151560a084015260c0830191909152151560e0820152610100015b60405180910390f35b3480156105dc57600080fd5b506105066105eb3660046149ee565b61118b565b3480156105fc57600080fd5b50610606600b5481565b6040519081526020016105c7565b34801561062057600080fd5b5061060660165481565b34801561063657600080fd5b5061060660145481565b61050661064e366004614a5f565b611221565b34801561065f57600080fd5b5061060660125481565b34801561067557600080fd5b50610506610684366004614aa6565b6112c4565b34801561069557600080fd5b506105066106a4366004614ac8565b611311565b3480156106b557600080fd5b506106c96106c4366004614b83565b61146a565b60405190151581526020016105c7565b3480156106e557600080fd5b506107096106f4366004614979565b601e6020526000908152604090205460ff1681565b60405160ff90911681526020016105c7565b34801561072757600080fd5b50610730611544565b604080519c8d5260208d019b909b52998b019890985260608a0196909652931515608089015291151560a088015260c087015260e0860152610100850152610120840152610140830152610160820152610180016105c7565b34801561079557600080fd5b5061060660065481565b3480156107ab57600080fd5b506019546106c990600160c01b900460ff1681565b3480156107cc57600080fd5b5061060660085481565b3480156107e257600080fd5b5061050661162e565b3480156107f757600080fd5b5061060660135481565b34801561080d57600080fd5b50610506611640565b34801561082257600080fd5b50610506610831366004614979565b611650565b34801561084257600080fd5b50610506610851366004614bbd565b61167a565b34801561086257600080fd5b50601b54610876906001600160a01b031681565b6040516001600160a01b0390911681526020016105c7565b34801561089a57600080fd5b506105066108a9366004614bf2565b611877565b3480156108ba57600080fd5b506105066108c9366004614c51565b611906565b3480156108da57600080fd5b506105066108e9366004614c51565b611935565b3480156108fa57600080fd5b506019546106c990600160a01b900460ff1681565b34801561091b57600080fd5b5061050661199b565b34801561093057600080fd5b5061050661093f366004614c51565b6119e6565b34801561095057600080fd5b5061050661095f366004614979565b611a15565b34801561097057600080fd5b50610606600c5481565b34801561098657600080fd5b5060005460ff166106c9565b34801561099e57600080fd5b506105066109ad366004614c51565b611a61565b3480156109be57600080fd5b506105066109cd366004614bbd565b611a90565b3480156109de57600080fd5b506105066109ed366004614c51565b611c1f565b3480156109fe57600080fd5b50610506610a0d366004614c51565b611c2c565b348015610a1e57600080fd5b50610506610a2d366004614979565b611c5b565b348015610a3e57600080fd5b50610a52610a4d366004614b83565b611c85565b6040805160ff90931683526020830191909152016105c7565b348015610a7757600080fd5b50610506610a86366004614c51565b611d6f565b348015610a9757600080fd5b50610506611dce565b348015610aac57600080fd5b50610506610abb366004614c6a565b611de0565b348015610acc57600080fd5b50610506610adb366004614c51565b611e74565b348015610aec57600080fd5b5061060660095481565b610506611ea3565b348015610b0a57600080fd5b506105066121f0565b348015610b1f57600080fd5b50610506610b2e366004614bbd565b612200565b348015610b3f57600080fd5b50610506610b4e366004614c98565b612654565b348015610b5f57600080fd5b50610506610b6e366004614c51565b61278f565b348015610b7f57600080fd5b50610709610b8e366004614c51565b602080526000908152604090205460ff1681565b610506610bb0366004614cc4565b6127ee565b348015610bc157600080fd5b50610506610bd0366004614c51565b61292b565b348015610be157600080fd5b50610506610bf0366004614c51565b61295a565b348015610c0157600080fd5b50610506610c10366004614c51565b612989565b348015610c2157600080fd5b506002546001600160a01b0316610876565b348015610c3f57600080fd5b506019546106c990600160b81b900460ff1681565b610506610c62366004614c51565b6129b8565b348015610c7357600080fd5b5061060660045481565b348015610c8957600080fd5b50610506610c98366004614c98565b612dd1565b348015610ca957600080fd5b50601a54610876906001600160a01b031681565b348015610cc957600080fd5b50610506610cd8366004614bbd565b612f0c565b348015610ce957600080fd5b5061060660075481565b348015610cff57600080fd5b50601754610876906001600160a01b031681565b348015610d1f57600080fd5b506019546106c990600160a81b900460ff1681565b348015610d4057600080fd5b50610606600d5481565b348015610d5657600080fd5b50610506610d65366004614c51565b612fc2565b348015610d7657600080fd5b50601954610876906001600160a01b031681565b348015610d9657600080fd5b5061060660155481565b348015610dac57600080fd5b50610506610dbb366004614ce9565b612ff1565b348015610dcc57600080fd5b5061060660115481565b348015610de257600080fd5b50610506610df1366004614c51565b613086565b348015610e0257600080fd5b5061060660105481565b348015610e1857600080fd5b50610506610e27366004614c51565b6130b5565b6105066130e4565b348015610e4057600080fd5b5061060660055481565b348015610e5657600080fd5b506019546106c990600160b01b900460ff1681565b348015610e7757600080fd5b50610606600f5481565b348015610e8d57600080fd5b50600d54601454601554601654601954600a54600b5460055460065460408051998a5260208a019890985296880195909552606087019390935260ff600160a01b8304811615156080880152600160b01b83048116151560a0880152600160b81b909204909116151560c086015260e0850152610100840152610120830152610140820152610160016105c7565b348015610f2757600080fd5b50610506610f36366004614c51565b613428565b348015610f4757600080fd5b50610506613457565b348015610f5c57600080fd5b50610506610f6b366004614979565b613505565b348015610f7c57600080fd5b50610506610f8b366004614c51565b613551565b348015610f9c57600080fd5b50601c54610876906001600160a01b031681565b348015610fbc57600080fd5b50610606600a5481565b348015610fd257600080fd5b5061060660035481565b348015610fe857600080fd5b50610506610ff7366004614979565b613580565b34801561100857600080fd5b50610506611017366004614c51565b6135f6565b34801561102857600080fd5b50601854610876906001600160a01b031681565b34801561104857600080fd5b50610606611057366004614979565b601f6020526000908152604090205481565b34801561107557600080fd5b50610506611084366004614c51565b613655565b34801561109557600080fd5b50610606600e5481565b3480156110ab57600080fd5b506105066110ba366004614bbd565b613684565b6018546001600160a01b031633146110f25760405162461bcd60e51b81526004016110e990614d51565b60405180910390fd5b60005b825181101561118657600083828151811061111257611112614d94565b6020908102919091018101516001600160a01b0381166000818152601e9093526040808420805460ff191660ff891690811790915590519294509290917f5e1c988ff223cdb5da0e9c3b4228dfe56444cb87e7d328c8495a1c40bfe9fa2a9190a3508061117e81614dc0565b9150506110f5565b505050565b6111936137da565b601b54604051630b85272160e11b81526001600160a01b039091169063170a4e42906111c3908490600401614dfd565b600060405180830381600087803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b50506040517ffaa4867c3ad82b35eef727eb877061cab7f6eb3576904aea9bc9520868076822925060009150a150565b601c5460405163df592f7d60e01b81523360048201819052916000916001600160a01b039091169063df592f7d90602401602060405180830381865afa15801561126f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112939190614e30565b905080156112b35760405162461bcd60e51b81526004016110e990614e52565b6112be843385613834565b50505050565b6112cc6137da565b6112d782605a614e87565b6011556112e582605a614e87565b60128190556112f5908290614e87565b6013819055601481905561130a908290614e87565b6015555050565b6113196137da565b60155442116113625760405162461bcd60e51b815260206004820152601560248201527420bab1ba34b7b7103737ba1037bb32b9103cb2ba1760591b60448201526064016110e9565b601954600160a01b900460ff16156113b65760405162461bcd60e51b8152602060048201526017602482015276105d58dd1a5bdb88185b1c9958591e481cd95d1d1b1959604a1b60448201526064016110e9565b60005b8251811015611452576000601d60008584815181106113da576113da614d94565b6020908102919091018101516001600160a01b0316825281019190915260400160002060048101805461ff001916610100179055835190915083908390811061142557611425614d94565b60209081029190910101516005820155600601805460ff191690558061144a81614dc0565b9150506113b9565b50506019805460ff60a01b1916600160a01b17905550565b6000815160410361153a5760408051606085811b6bffffffffffffffffffffffff199081166020808501919091523090921b166034830152825160288184030181526048830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a333200000000606884015260848084018290528451808503909101815260a4909301909352815191012060006115098286613fb1565b90506001600160a01b0381161580159061153057506019546001600160a01b038281169116145b935050505061153e565b5060005b92915050565b600080600080600080600080600080600080600c54600454601254601354601960159054906101000a900460ff16601960189054906101000a900460ff16600e54601b60009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fc9190614e9a565b6011546009546003546007549b509b509b509b509b509b509b509b509b509b509b509b50909192939495969798999a9b565b6116366137da565b61163e613fd5565b565b6116486137da565b61163e6140e3565b6116586137da565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b6018546001600160a01b031633146116a45760405162461bcd60e51b81526004016110e990614d51565b80516010548111156116c85760405162461bcd60e51b81526004016110e990614eb3565b6013544211156116ea5760405162461bcd60e51b81526004016110e990614eea565b600c54601b54604080516318160ddd60e01b8152905184926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175a9190614e9a565b600f546117679190614f21565b6117719190614f21565b101561178f5760405162461bcd60e51b81526004016110e990614f34565b60005b818110156117d0576117be8382815181106117af576117af614d94565b60200260200101516005614135565b806117c881614dc0565b915050611792565b5080601060008282546117e39190614f21565b9091555050600c54601b54604080516318160ddd60e01b815290516001600160a01b03909216916318160ddd916004808201926020929091908290030181865afa158015611835573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118599190614e9a565b600f546118669190614f21565b6118709190614f21565b600d555050565b61187f6137da565b6001600081905260216020527f2b59c9df127166d3570f589f0cb7377a6b175795e70ab275ebf42fa16c0a23f45460ff16156118ba57600080fd5b67ffffffffffffffff166000908152602160205260409020805460ff19166001179055600998909855600a96909655600594909455600692909255600455600b55600855600355600755565b6018546001600160a01b031633146119305760405162461bcd60e51b81526004016110e990614d51565b601355565b6018546001600160a01b0316331461195f5760405162461bcd60e51b81526004016110e990614d51565b60068190556040518181527fc3c898bec609452e0cecc8990f6692426351b704f348f19cc242bd4d42d65ce9906020015b60405180910390a150565b6018546001600160a01b031633146119c55760405162461bcd60e51b81526004016110e990614d51565b6019805460ff60c01b198116600160c01b9182900460ff1615909102179055565b6018546001600160a01b03163314611a105760405162461bcd60e51b81526004016110e990614d51565b600855565b6018546001600160a01b03163314611a3f5760405162461bcd60e51b81526004016110e990614d51565b601b80546001600160a01b0319166001600160a01b0392909216919091179055565b6018546001600160a01b03163314611a8b5760405162461bcd60e51b81526004016110e990614d51565b600c55565b611a986137da565b6015544211611ae15760405162461bcd60e51b815260206004820152601560248201527420bab1ba34b7b7103737ba1037bb32b9103cb2ba1760591b60448201526064016110e9565b601954600160a81b900460ff1615611b345760405162461bcd60e51b8152602060048201526016602482015275149859999b1948185b1c9958591e481cd95d1d1b195960521b60448201526064016110e9565b600c5481511115611b875760405162461bcd60e51b815260206004820152601b60248201527f496e636f7272656374206e756d626572206f662077696e6e657273000000000060448201526064016110e9565b60005b8151811015611c08576000601d6000848481518110611bab57611bab614d94565b6020908102919091018101516001600160a01b0316825281019190915260400160002060048101805461ff0019166101001790556005805490820155600601805460ff191660011790555080611c0081614dc0565b915050611b8a565b50506019805460ff60a81b1916600160a81b179055565b611c276137da565b600455565b6018546001600160a01b03163314611c565760405162461bcd60e51b81526004016110e990614d51565b600f55565b611c636137da565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b601a546040516370a0823160e01b81526001600160a01b03848116600483015260009283928392909116906370a0823190602401602060405180830381865afa158015611cd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfa9190614e9a565b90508015611d17576001611d0d866141fa565b9250925050611d68565b6000611d23868661146a565b90508015611d5e576001600160a01b0386166000908152601f6020526040902054600954600291611d5391614f21565b935093505050611d68565b6000809350935050505b9250929050565b6018546001600160a01b03163314611d995760405162461bcd60e51b81526004016110e990614d51565b600a8190556040518181527f1b55d9f7002bda4490f467e326f22a4a847629c0f2d1ed421607d318d25b410d90602001611990565b611dd66137da565b61163e6000614333565b611de86137da565b6003600081905260216020527fbae8fb7bb9008c9bfa6625328b7613a2bedfb2f936a7718f51173039a77c107c5460ff1615611e2357600080fd5b67ffffffffffffffff166000908152602160205260409020805460ff19166001179055601780546001600160a01b039384166001600160a01b03199182161790915560188054929093169116179055565b6018546001600160a01b03163314611e9e5760405162461bcd60e51b81526004016110e990614d51565b600355565b611eab614385565b60005460ff1615611ece5760405162461bcd60e51b81526004016110e990614f7a565b601c5460405163df592f7d60e01b81523360048201819052916000916001600160a01b039091169063df592f7d90602401602060405180830381865afa158015611f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f409190614e30565b90508015611f605760405162461bcd60e51b81526004016110e990614e52565b6015543390349042108015611f7757506014544210155b611fc35760405162461bcd60e51b815260206004820152601760248201527f4f7574736964652061756374696f6e2077696e646f772e00000000000000000060448201526064016110e9565b60055481101561200b5760405162461bcd60e51b81526020600482015260136024820152722134b21030b6b7bab73a103a37b7903637bb9760691b60448201526064016110e9565b6001600160a01b0382166000908152601d6020526040902060010154156120c7576001600160a01b0382166000908152601d60205260409020600181015482116120ad5760405162461bcd60e51b815260206004820152602d60248201527f596f752063616e206f6e6c7920696e63726561736520796f7572206269642c2060448201526c3737ba103232b1b932b0b9b29760991b60648201526084016110e9565b6120bb8382600101546143de565b5060010181905561219a565b60408051610100808201835260008284018181526080840182815260a0850183815260c0860184815260e087018581526001600160a01b038b8116808a526020808b018d81524260608d01908152928a52601d9091529a909720985189546001600160a01b031916911617885597516001880155925160028701805460ff19908116921515929092179055935160038701559051600486018054925161ffff1990931691151561ff0019169190911791151590940217909255905160058301559151600690910180549092169015151790555b604080516001600160a01b03841681526020810183905260008183015290517f4c59a472ced976904d21e373e2f2d8326defffabfe087e3d7886f0c516495ba79181900360600190a15050505061163e60018055565b6121f86137da565b61163e61445c565b6122086137da565b612210614385565b60155442116122595760405162461bcd60e51b815260206004820152601560248201527420bab1ba34b7b7103430b9b713ba1032b73232b21760591b60448201526064016110e9565b601954600160a01b900460ff16151560011480156122855750601954600160a81b900460ff1615156001145b6122d15760405162461bcd60e51b815260206004820152601760248201527f41756374696f6e2077696e6e657273206e6f742073657400000000000000000060448201526064016110e9565b60005b81518110156126475760008282815181106122f1576122f1614d94565b6020908102919091018101516001600160a01b0381166000908152601d909252604090912060048101549192509060ff610100909104161515600114801561233e5750600281015460ff16155b801561234f5750600481015460ff16155b156125595760008160050154826001015461236a9190614f21565b90508015612426576000836001600160a01b03168260405160006040518083038185875af1925050503d80600081146123bf576040519150601f19603f3d011682016040523d82523d6000602084013e6123c4565b606091505b50509050806124245760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f20726566756e6420646966666572656e636520746f207760448201526534b73732b91760d11b60648201526084016110e9565b505b601b546040516335313c2160e11b81526001600160a01b0385811660048301526000921690636a627842906024016020604051808303816000875af1158015612473573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124979190614e9a565b600684015490915060ff1615156001036124f057600381856001600160a01b031660008051602061505083398151915286600501546000806000806040516124e3959493929190614fbe565b60405180910390a4612531565b600281856001600160a01b03166000805160206150508339815191528660050154600080600080604051612528959493929190614fbe565b60405180910390a45b5050600281018054600160ff1991821681179092556004830180549091169091179055612632565b6004810154610100900460ff161580156125785750600481015460ff16155b156126325760018101546040516000916001600160a01b038516918381818185875af1925050503d80600081146125cb576040519150601f19603f3d011682016040523d82523d6000602084013e6125d0565b606091505b50509050806126215760405162461bcd60e51b815260206004820152601f60248201527f4661696c656420746f2073656e6420726566756e6420746f206c6f7365722e0060448201526064016110e9565b5060048101805460ff191660011790555b5050808061263f90614dc0565b9150506122d4565b5061265160018055565b50565b6018546001600160a01b0316331461267e5760405162461bcd60e51b81526004016110e990614d51565b8060105410156126a05760405162461bcd60e51b81526004016110e990614eb3565b6013544211156126c25760405162461bcd60e51b81526004016110e990614eea565b600c54601b54604080516318160ddd60e01b8152905184926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa15801561270e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127329190614e9a565b600f5461273f9190614f21565b6127499190614f21565b10156127675760405162461bcd60e51b81526004016110e990614f34565b60005b818110156117d05761277d836005614135565b8061278781614dc0565b91505061276a565b6018546001600160a01b031633146127b95760405162461bcd60e51b81526004016110e990614d51565b60058190556040518181527f0b2415f9ab63dbd60a9b1d42289c1deace6a9bbb6c006d8f3f2c1d872a47144490602001611990565b601c5460405163df592f7d60e01b81523360048201819052916000916001600160a01b039091169063df592f7d90602401602060405180830381865afa15801561283c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128609190614e30565b905080156128805760405162461bcd60e51b81526004016110e990614e52565b601a5460405163090c9a2d60e41b81523360048201526001600160a01b03808616602483015290911660448201526d76a84fef008cdabe6409d2fe638b906390c9a2d090606401602060405180830381865afa1580156128e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129089190614e30565b61291157600080fd5b6112be848460405180602001604052806000815250613834565b6018546001600160a01b031633146129555760405162461bcd60e51b81526004016110e990614d51565b601055565b6018546001600160a01b031633146129845760405162461bcd60e51b81526004016110e990614d51565b600e55565b6018546001600160a01b031633146129b35760405162461bcd60e51b81526004016110e990614d51565b601555565b6129c0614385565b60005460ff16156129e35760405162461bcd60e51b81526004016110e990614f7a565b601c5460405163df592f7d60e01b81523360048201819052916000916001600160a01b039091169063df592f7d90602401602060405180830381865afa158015612a31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a559190614e30565b90508015612a755760405162461bcd60e51b81526004016110e990614e52565b601b546040805163d5abeb0160e01b815290516000926001600160a01b03169163d5abeb019160048083019260209291908290030181865afa158015612abf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae39190614e9a565b90506000601b60009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190614e9a565b9050600854851115612bb25760405162461bcd60e51b815260206004820152601a60248201527f546f6f206d616e7920746f6b656e73207265717565737465642e00000000000060448201526064016110e9565b818110612bfd5760405162461bcd60e51b815260206004820152601960248201527827379036b7b932903a37b5b2b7399030bb30b4b630b136329760391b60448201526064016110e9565b84612c088284614f21565b1015612c565760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f75676820737570706c79206c656674202d20312e000000000060448201526064016110e9565b601954600160c01b900460ff161515600114612ca65760405162461bcd60e51b815260206004820152600f60248201526e2737ba1030baba3437b934bd32b21760891b60448201526064016110e9565b6007543490612cb6908790614fec565b811015612cf75760405162461bcd60e51b815260206004820152600f60248201526e20b6b7bab73a103a37b7903637bb9760891b60448201526064016110e9565b60005b86811015612dc257601b546040516335313c2160e11b81523360048201526000916001600160a01b031690636a627842906024016020604051808303816000875af1158015612d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d719190614e9a565b9050600481336001600160a01b031660008051602061505083398151915286600080600080604051612da7959493929190614fbe565b60405180910390a45080612dba81614dc0565b915050612cfa565b50505050505061265160018055565b6018546001600160a01b03163314612dfb5760405162461bcd60e51b81526004016110e990614d51565b806010541015612e1d5760405162461bcd60e51b81526004016110e990614eb3565b601354421115612e3f5760405162461bcd60e51b81526004016110e990614eea565b600c54601b54604080516318160ddd60e01b8152905184926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015612e8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eaf9190614e9a565b600f54612ebc9190614f21565b612ec69190614f21565b1015612ee45760405162461bcd60e51b81526004016110e990614f34565b60005b818110156117d057612efa836000614135565b80612f0481614dc0565b915050612ee7565b6018546001600160a01b03163314612f365760405162461bcd60e51b81526004016110e990614d51565b60005b8151811015612fbe576000828281518110612f5657612f56614d94565b6020908102919091018101516001600160a01b0381166000818152601e9093526040808420805460ff1916905551919350917f29beb8aae77ba82cbb9d5a13ac9153539286534ddea0dc0a0aa61c484585a61491a25080612fb681614dc0565b915050612f39565b5050565b6018546001600160a01b03163314612fec5760405162461bcd60e51b81526004016110e990614d51565b601255565b612ff96137da565b6002600081905260216020527f914a2534c436de5a3f77164e6b9b90d20144139ce899b6a8d30a442e7b9ef5335460ff161561303457600080fd5b67ffffffffffffffff166000908152602160205260409020805460ff19166001179055600c99909955600d97909755600e95909555600f93909355601091909155601155601255601355601455601555565b6018546001600160a01b031633146130b05760405162461bcd60e51b81526004016110e990614d51565b600755565b6018546001600160a01b031633146130df5760405162461bcd60e51b81526004016110e990614d51565b600955565b6130ec614385565b60005460ff161561310f5760405162461bcd60e51b81526004016110e990614f7a565b601c5460405163df592f7d60e01b81523360048201819052916000916001600160a01b039091169063df592f7d90602401602060405180830381865afa15801561315d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131819190614e30565b905080156131a15760405162461bcd60e51b81526004016110e990614e52565b601b60009054906101000a90046001600160a01b03166001600160a01b031663d5abeb016040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132189190614e9a565b601b60009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561326b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061328f9190614e9a565b106132d85760405162461bcd60e51b815260206004820152601960248201527827379036b7b932903a37b5b2b7399030bb30b4b630b136329760391b60448201526064016110e9565b601954600160c01b900460ff1615156001146133285760405162461bcd60e51b815260206004820152600f60248201526e2737ba1030baba3437b934bd32b21760891b60448201526064016110e9565b600754349081101561336e5760405162461bcd60e51b815260206004820152600f60248201526e20b6b7bab73a103a37b7903637bb9760891b60448201526064016110e9565b601b546040516335313c2160e11b81523360048201526000916001600160a01b031690636a627842906024016020604051808303816000875af11580156133b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133dd9190614e9a565b9050600481336001600160a01b031660008051602061505083398151915285600080600080604051613413959493929190614fbe565b60405180910390a45050505061163e60018055565b6018546001600160a01b031633146134525760405162461bcd60e51b81526004016110e990614d51565b601455565b61345f6137da565b601954600160b01b900460ff16156134b35760405162461bcd60e51b8152602060048201526017602482015276105d58dd1a5bdb88185b1c9958591e481cd95d1d1b1959604a1b60448201526064016110e9565b6019805460ff60b01b198116600160b01b9182900460ff16159091021790556134da613fd5565b6040517ffa73a4fea5fd06d0d6a99612856bf1c8c91b17959d34072d2d0230999f98671790600090a1565b6018546001600160a01b0316331461352f5760405162461bcd60e51b81526004016110e990614d51565b601980546001600160a01b0319166001600160a01b0392909216919091179055565b6018546001600160a01b0316331461357b5760405162461bcd60e51b81526004016110e990614d51565b601155565b6135886137da565b6001600160a01b0381166135ed5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016110e9565b61265181614333565b6018546001600160a01b031633146136205760405162461bcd60e51b81526004016110e990614d51565b600b8190556040518181527faab6389d8f1c16ba1deb6e9831f5c5442cf4fcf99bf5bfa867460be408a9111890602001611990565b6018546001600160a01b0316331461367f5760405162461bcd60e51b81526004016110e990614d51565b600d55565b6018546001600160a01b031633146136ae5760405162461bcd60e51b81526004016110e990614d51565b80516010548111156136d25760405162461bcd60e51b81526004016110e990614eb3565b6013544211156136f45760405162461bcd60e51b81526004016110e990614eea565b600c54601b54604080516318160ddd60e01b8152905184926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015613740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137649190614e9a565b600f546137719190614f21565b61377b9190614f21565b10156137995760405162461bcd60e51b81526004016110e990614f34565b60005b818110156117d0576137c88382815181106137b9576137b9614d94565b60200260200101516000614135565b806137d281614dc0565b91505061379c565b6002546001600160a01b0316331461163e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016110e9565b600083600e546138449190614f21565b10156138925760405162461bcd60e51b815260206004820152601860248201527f4e6f206d6f726520616c6c6f776c69737420737570706c79000000000000000060448201526064016110e9565b34336000806138a18686611c85565b915060ff169150600082116138e65760405162461bcd60e51b815260206004820152600b60248201526a139bdd08185b1b1bddd95960aa1b60448201526064016110e9565b808711156139365760405162461bcd60e51b815260206004820152601860248201527f5174792065786365656473206d617820616c6c6f7765642e000000000000000060448201526064016110e9565b600c54601b54604080516318160ddd60e01b815290518a926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015613982573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139a69190614e9a565b600f546139b39190614f21565b6139bd9190614f21565b10156139db5760405162461bcd60e51b81526004016110e990614f34565b81600103613d5c57866003546139f19190614fec565b841015613a555760405162461bcd60e51b815260206004820152602c60248201527f4f6173697320616c6c6f776c697374206d696e74696e673a204e6f7420656e6f60448201526b1d59da08115512081cd95b9d60a21b60648201526084016110e9565b6011544210158015613a6957506013544211155b613ab55760405162461bcd60e51b815260206004820152601e60248201527f4f757473696465204f6173697320616c6c6f776c6973742077696e646f77000060448201526064016110e9565b601a546040516370a0823160e01b81526001600160a01b03888116600483015260009216906370a0823190602401602060405180830381865afa158015613b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b249190614e9a565b90508760005b82811015613d0657601a54604051632f745c5960e01b81526001600160a01b038b81166004830152602482018490526000921690632f745c5990604401602060405180830381865afa158015613b84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ba89190614e9a565b60008181526020805260408120546009549293509091613bcb9160ff1690614f21565b905080600003613bdc575050613cf4565b6000613be88286614499565b6000848152602080526040812080549293508392909190613c0d90849060ff16615003565b92506101000a81548160ff021916908360ff1602179055508060ff1685613c349190614f21565b945060005b8160ff16811015613cef57601b546040516335313c2160e11b81526001600160a01b038c811660048301526000921690636a627842906024016020604051808303816000875af1158015613c91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cb59190614e9a565b9050613cc68e8c838f60018a6144b1565b600e8054906000613cd68361501c565b9190505550508080613ce790614dc0565b915050613c39565b505050505b80613cfe81614dc0565b915050613b2a565b508015613d555760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420656e6f756768204f61736973206d696e7420617661696c61626c650060448201526064016110e9565b5050613f14565b86600454613d6a9190614fec565b841015613dcf5760405162461bcd60e51b815260206004820152602d60248201527f5075626c696320616c6c6f776c697374206d696e74696e673a204e6f7420656e60448201526c1bdd59da08115512081cd95b9d609a1b60648201526084016110e9565b6012544210158015613de357506013544211155b613e2f5760405162461bcd60e51b815260206004820152601860248201527f4f75747369646520616c6c6f776c6973742077696e646f77000000000000000060448201526064016110e9565b60005b87811015613ee557601b546040516335313c2160e11b81526001600160a01b0386811660048301526000921690636a627842906024016020604051808303816000875af1158015613e87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613eab9190614e9a565b9050613ebc888683896000806144b1565b600e8054906000613ecc8361501c565b9190505550508080613edd90614dc0565b915050613e32565b506001600160a01b0386166000908152601f602052604081208054899290613f0e908490614e87565b90915550505b600c54601b60009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613f6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f8e9190614e9a565b600f54613f9b9190614f21565b613fa59190614f21565b600d5550505050505050565b6000806000613fc0858561454e565b91509150613fcd81614590565b509392505050565b601954600160b01b900460ff1615156001148015613ff4575060155442115b6140405760405162461bcd60e51b815260206004820152601f60248201527f41756374696f6e206e6f7420736574746c65647c7c6e6f7420656e6465642e0060448201526064016110e9565b6017546040516000916001600160a01b03169047908381818185875af1925050503d806000811461408d576040519150601f19603f3d011682016040523d82523d6000602084013e614092565b606091505b50509050806126515760405162461bcd60e51b815260206004820152601860248201527f4661696c656420746f2073656e6420746f2070617965652e000000000000000060448201526064016110e9565b6140eb6146da565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b601b546040516335313c2160e11b81526001600160a01b0384811660048301526000921690636a627842906024016020604051808303816000875af1158015614182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141a69190614e9a565b90508160058111156141ba576141ba614fa8565b81846001600160a01b031660008051602061505083398151915260008060008060006040516141ed959493929190614fbe565b60405180910390a4505050565b601a546040516370a0823160e01b81526001600160a01b03838116600483015260009283929116906370a0823190602401602060405180830381865afa158015614248573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061426c9190614e9a565b90506000805b82811015613fcd57601a54604051632f745c5960e01b81526001600160a01b038781166004830152602482018490526000921690632f745c5990604401602060405180830381865afa1580156142cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142f09190614e9a565b60008181526020805260409020546009549192506143139160ff90911690614f21565b61431d9084614e87565b925050808061432b90614dc0565b915050614272565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002600154036143d75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016110e9565b6002600155565b6040805160008082526020820190925281906001600160a01b0385169061753090859060405161440e9190615033565b600060405180830381858888f193505050503d806000811461444c576040519150601f19603f3d011682016040523d82523d6000602084013e614451565b606091505b509095945050505050565b614464614723565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586141183390565b60008183106144a857816144aa565b825b9392505050565b846001600160a01b0316866001600160a01b03161461450a57600184866001600160a01b03166000805160206150508339815191528660018b88886040516144fd959493929190614fbe565b60405180910390a4614546565b600184866001600160a01b031660008051602061505083398151915286600080888860405161453d959493929190614fbe565b60405180910390a45b505050505050565b60008082516041036145845760208301516040840151606085015160001a61457887828585614769565b94509450505050611d68565b50600090506002611d68565b60008160048111156145a4576145a4614fa8565b036145ac5750565b60018160048111156145c0576145c0614fa8565b0361460d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016110e9565b600281600481111561462157614621614fa8565b0361466e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016110e9565b600381600481111561468257614682614fa8565b036126515760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016110e9565b60005460ff1661163e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016110e9565b60005460ff161561163e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016110e9565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156147a05750600090506003614824565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156147f4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661481d57600060019250925050614824565b9150600090505b94509492505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561486c5761486c61482d565b604052919050565b600067ffffffffffffffff82111561488e5761488e61482d565b5060051b60200190565b6001600160a01b038116811461265157600080fd5b600082601f8301126148be57600080fd5b813560206148d36148ce83614874565b614843565b82815260059290921b840181019181810190868411156148f257600080fd5b8286015b8481101561491657803561490981614898565b83529183019183016148f6565b509695505050505050565b6000806040838503121561493457600080fd5b823567ffffffffffffffff81111561494b57600080fd5b614957858286016148ad565b925050602083013560ff8116811461496e57600080fd5b809150509250929050565b60006020828403121561498b57600080fd5b81356144aa81614898565b600067ffffffffffffffff8311156149b0576149b061482d565b6149c3601f8401601f1916602001614843565b90508281528383830111156149d757600080fd5b828260208301376000602084830101529392505050565b600060208284031215614a0057600080fd5b813567ffffffffffffffff811115614a1757600080fd5b8201601f81018413614a2857600080fd5b614a3784823560208401614996565b949350505050565b600082601f830112614a5057600080fd5b6144aa83833560208501614996565b60008060408385031215614a7257600080fd5b82359150602083013567ffffffffffffffff811115614a9057600080fd5b614a9c85828601614a3f565b9150509250929050565b60008060408385031215614ab957600080fd5b50508035926020909101359150565b60008060408385031215614adb57600080fd5b823567ffffffffffffffff80821115614af357600080fd5b614aff868387016148ad565b9350602091508185013581811115614b1657600080fd5b85019050601f81018613614b2957600080fd5b8035614b376148ce82614874565b81815260059190911b82018301908381019088831115614b5657600080fd5b928401925b82841015614b7457833582529284019290840190614b5b565b80955050505050509250929050565b60008060408385031215614b9657600080fd5b8235614ba181614898565b9150602083013567ffffffffffffffff811115614a9057600080fd5b600060208284031215614bcf57600080fd5b813567ffffffffffffffff811115614be657600080fd5b614a37848285016148ad565b60008060008060008060008060006101208a8c031215614c1157600080fd5b505087359960208901359950604089013598606081013598506080810135975060a0810135965060c0810135955060e08101359450610100013592509050565b600060208284031215614c6357600080fd5b5035919050565b60008060408385031215614c7d57600080fd5b8235614c8881614898565b9150602083013561496e81614898565b60008060408385031215614cab57600080fd5b8235614cb681614898565b946020939093013593505050565b60008060408385031215614cd757600080fd5b82359150602083013561496e81614898565b6000806000806000806000806000806101408b8d031215614d0957600080fd5b505088359a60208a01359a5060408a013599606081013599506080810135985060a0810135975060c0810135965060e081013595506101008101359450610120013592509050565b60208082526023908201527f41756374696f6e486f7573653a206f6e6c792061646d696e207065726d69747460408201526232b21760e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201614dd257614dd2614daa565b5060010190565b60005b83811015614df4578181015183820152602001614ddc565b50506000910152565b6020815260008251806020840152614e1c816040850160208701614dd9565b601f01601f19169190910160400192915050565b600060208284031215614e4257600080fd5b815180151581146144aa57600080fd5b6020808252818101527f426c6f636b65643a204f4641432073616e6374696f6e65642061646472657373604082015260600190565b8082018082111561153e5761153e614daa565b600060208284031215614eac57600080fd5b5051919050565b60208082526017908201527f4e6f7420656e6f7567682070726f6d6f20737570706c79000000000000000000604082015260600190565b60208082526019908201527f4f7574736964652070726f6d6f206d696e742077696e646f7700000000000000604082015260600190565b8181038181111561153e5761153e614daa565b60208082526026908201527f4e6f7420656e6f75676820737570706c792072656d61696e696e6720666f7220604082015265726166666c6560d01b606082015260800190565b602080825260149082015273105d58dd1a5bdb921bdd5cd94e881c185d5cd95960621b604082015260600190565b634e487b7160e01b600052602160045260246000fd5b94855292151560208501526001600160a01b0391909116604084015215156060830152608082015260a00190565b808202811582820484141761153e5761153e614daa565b60ff818116838216019081111561153e5761153e614daa565b60008161502b5761502b614daa565b506000190190565b60008251615045818460208701614dd9565b919091019291505056fea134ff4a851b5867631cd832ea22daffdbd2870d47e51a0ad1afb7913b183bfea26469706673582212203b7bbaaf582d3bd9c322d40a33ea354905c0ffe54e9038e9eea140b1db6e16ac64736f6c63430008120033000000000000000000000000cf860bbe9eea9bf95cac9ef2b8278da1e041e50b000000000000000000000000b3f9957d93c29d886a5f4bbbfdabcfbaea2e676d000000000000000000000000898157afb3e158cc835d19b9ecd37c69bf460f8c00000000000000000000000040c57923924b5c5c5455c48d93317139addac8fb000000000000000000000000a8eaa9dc2d49624d0ca0bdefa30a6e2a957efb91
Deployed Bytecode
0x6080604052600436106104e15760003560e01c806385e3aac611610281578063c5693a841161015a578063e474def4116100cc578063f6be71d111610085578063f6be71d114610ffc578063f851a4401461101c578063fa1431da1461103c578063fc3a635314611069578063fd49af1314611089578063fe3e492d1461109f57600080fd5b8063e474def414610f50578063e548175414610f70578063ec571c6a14610f90578063ec91f2a414610fb0578063f2c6cc5214610fc6578063f2fde38b14610fdc57600080fd5b8063d3a863861161011e578063d3a8638614610e34578063d3e761a414610e4a578063d5abeb0114610e6b578063d94a350514610e81578063d9ad7f9114610f1b578063e30ac00314610f3b57600080fd5b8063c5693a8414610dc0578063c627525514610dd6578063d1b7bda314610df6578063d2b898df14610e0c578063d2eb86ee14610e2c57600080fd5b8063a2a3eb4d116101f3578063b59f6bf5116101b7578063b59f6bf514610d13578063ba060b7d14610d34578063c1b819b914610d4a578063c32fe11b14610d6a578063c403b5b214610d8a578063c417f57f14610da057600080fd5b8063a2a3eb4d14610c7d578063a3afda1a14610c9d578063a51312c814610cbd578063a945bf8014610cdd578063ae90b21314610cf357600080fd5b80638bab534d116102455780638bab534d14610bd55780638d57c9a914610bf55780638da5cb5b14610c155780638f77583914610c335780639a3afdec14610c54578063a24e515314610c6757600080fd5b806385e3aac614610b3357806386495b0414610b5357806388bbba1214610b7357806389b8c18014610ba25780638a64bbf014610bb557600080fd5b80634adbc2d3116103be5780636df9fa8811610330578063727b4d96116102e9578063727b4d9614610aa057806378f1988714610ac057806380a06f9714610ae05780638362407414610af65780638456cb5914610afe578063852fedc914610b1357600080fd5b80636df9fa88146109d25780636f8b44b0146109f2578063704b6c0214610a125780637107366414610a325780637120334b14610a6b578063715018a614610a8b57600080fd5b806358151ef41161038257806358151ef41461092457806358d5d66614610944578063599d127a146109645780635c975abb1461097a57806365d634c5146109925780636d8aded1146109b257600080fd5b80634adbc2d31461088e578063510f615a146108ae57806355ee09d7146108ce57806355f15f0c146108ee57806356f8f78c1461090f57600080fd5b80632848aeaf116104575780633ccfd60b1161041b5780633ccfd60b146107d65780633f17d40a146107eb5780633f4ba83a14610801578063410459ad1461081657806347c36e171461083657806347ccca021461085657600080fd5b80632848aeaf146106d9578063298230281461071b578063335b115e1461078957806333bc1c5c1461079f578063381bf932146107c057600080fd5b806313cabd69116104a957806313cabd691461062a57806315c8f106146106405780631eb8b34314610653578063224348361461066957806323ab54b514610689578063258c1ef5146106a957600080fd5b806301596309146104e65780630251e03e146105085780630cb71584146105d05780630fb5a6b4146105f057806312300ba414610614575b600080fd5b3480156104f257600080fd5b50610506610501366004614921565b6110bf565b005b34801561051457600080fd5b5061057a610523366004614979565b601d6020526000908152604090208054600182015460028301546003840154600485015460058601546006909601546001600160a01b0390951695939460ff93841694929382811693610100909304811692911688565b604080516001600160a01b039099168952602089019790975294151595870195909552606086019290925215156080850152151560a084015260c0830191909152151560e0820152610100015b60405180910390f35b3480156105dc57600080fd5b506105066105eb3660046149ee565b61118b565b3480156105fc57600080fd5b50610606600b5481565b6040519081526020016105c7565b34801561062057600080fd5b5061060660165481565b34801561063657600080fd5b5061060660145481565b61050661064e366004614a5f565b611221565b34801561065f57600080fd5b5061060660125481565b34801561067557600080fd5b50610506610684366004614aa6565b6112c4565b34801561069557600080fd5b506105066106a4366004614ac8565b611311565b3480156106b557600080fd5b506106c96106c4366004614b83565b61146a565b60405190151581526020016105c7565b3480156106e557600080fd5b506107096106f4366004614979565b601e6020526000908152604090205460ff1681565b60405160ff90911681526020016105c7565b34801561072757600080fd5b50610730611544565b604080519c8d5260208d019b909b52998b019890985260608a0196909652931515608089015291151560a088015260c087015260e0860152610100850152610120840152610140830152610160820152610180016105c7565b34801561079557600080fd5b5061060660065481565b3480156107ab57600080fd5b506019546106c990600160c01b900460ff1681565b3480156107cc57600080fd5b5061060660085481565b3480156107e257600080fd5b5061050661162e565b3480156107f757600080fd5b5061060660135481565b34801561080d57600080fd5b50610506611640565b34801561082257600080fd5b50610506610831366004614979565b611650565b34801561084257600080fd5b50610506610851366004614bbd565b61167a565b34801561086257600080fd5b50601b54610876906001600160a01b031681565b6040516001600160a01b0390911681526020016105c7565b34801561089a57600080fd5b506105066108a9366004614bf2565b611877565b3480156108ba57600080fd5b506105066108c9366004614c51565b611906565b3480156108da57600080fd5b506105066108e9366004614c51565b611935565b3480156108fa57600080fd5b506019546106c990600160a01b900460ff1681565b34801561091b57600080fd5b5061050661199b565b34801561093057600080fd5b5061050661093f366004614c51565b6119e6565b34801561095057600080fd5b5061050661095f366004614979565b611a15565b34801561097057600080fd5b50610606600c5481565b34801561098657600080fd5b5060005460ff166106c9565b34801561099e57600080fd5b506105066109ad366004614c51565b611a61565b3480156109be57600080fd5b506105066109cd366004614bbd565b611a90565b3480156109de57600080fd5b506105066109ed366004614c51565b611c1f565b3480156109fe57600080fd5b50610506610a0d366004614c51565b611c2c565b348015610a1e57600080fd5b50610506610a2d366004614979565b611c5b565b348015610a3e57600080fd5b50610a52610a4d366004614b83565b611c85565b6040805160ff90931683526020830191909152016105c7565b348015610a7757600080fd5b50610506610a86366004614c51565b611d6f565b348015610a9757600080fd5b50610506611dce565b348015610aac57600080fd5b50610506610abb366004614c6a565b611de0565b348015610acc57600080fd5b50610506610adb366004614c51565b611e74565b348015610aec57600080fd5b5061060660095481565b610506611ea3565b348015610b0a57600080fd5b506105066121f0565b348015610b1f57600080fd5b50610506610b2e366004614bbd565b612200565b348015610b3f57600080fd5b50610506610b4e366004614c98565b612654565b348015610b5f57600080fd5b50610506610b6e366004614c51565b61278f565b348015610b7f57600080fd5b50610709610b8e366004614c51565b602080526000908152604090205460ff1681565b610506610bb0366004614cc4565b6127ee565b348015610bc157600080fd5b50610506610bd0366004614c51565b61292b565b348015610be157600080fd5b50610506610bf0366004614c51565b61295a565b348015610c0157600080fd5b50610506610c10366004614c51565b612989565b348015610c2157600080fd5b506002546001600160a01b0316610876565b348015610c3f57600080fd5b506019546106c990600160b81b900460ff1681565b610506610c62366004614c51565b6129b8565b348015610c7357600080fd5b5061060660045481565b348015610c8957600080fd5b50610506610c98366004614c98565b612dd1565b348015610ca957600080fd5b50601a54610876906001600160a01b031681565b348015610cc957600080fd5b50610506610cd8366004614bbd565b612f0c565b348015610ce957600080fd5b5061060660075481565b348015610cff57600080fd5b50601754610876906001600160a01b031681565b348015610d1f57600080fd5b506019546106c990600160a81b900460ff1681565b348015610d4057600080fd5b50610606600d5481565b348015610d5657600080fd5b50610506610d65366004614c51565b612fc2565b348015610d7657600080fd5b50601954610876906001600160a01b031681565b348015610d9657600080fd5b5061060660155481565b348015610dac57600080fd5b50610506610dbb366004614ce9565b612ff1565b348015610dcc57600080fd5b5061060660115481565b348015610de257600080fd5b50610506610df1366004614c51565b613086565b348015610e0257600080fd5b5061060660105481565b348015610e1857600080fd5b50610506610e27366004614c51565b6130b5565b6105066130e4565b348015610e4057600080fd5b5061060660055481565b348015610e5657600080fd5b506019546106c990600160b01b900460ff1681565b348015610e7757600080fd5b50610606600f5481565b348015610e8d57600080fd5b50600d54601454601554601654601954600a54600b5460055460065460408051998a5260208a019890985296880195909552606087019390935260ff600160a01b8304811615156080880152600160b01b83048116151560a0880152600160b81b909204909116151560c086015260e0850152610100840152610120830152610140820152610160016105c7565b348015610f2757600080fd5b50610506610f36366004614c51565b613428565b348015610f4757600080fd5b50610506613457565b348015610f5c57600080fd5b50610506610f6b366004614979565b613505565b348015610f7c57600080fd5b50610506610f8b366004614c51565b613551565b348015610f9c57600080fd5b50601c54610876906001600160a01b031681565b348015610fbc57600080fd5b50610606600a5481565b348015610fd257600080fd5b5061060660035481565b348015610fe857600080fd5b50610506610ff7366004614979565b613580565b34801561100857600080fd5b50610506611017366004614c51565b6135f6565b34801561102857600080fd5b50601854610876906001600160a01b031681565b34801561104857600080fd5b50610606611057366004614979565b601f6020526000908152604090205481565b34801561107557600080fd5b50610506611084366004614c51565b613655565b34801561109557600080fd5b50610606600e5481565b3480156110ab57600080fd5b506105066110ba366004614bbd565b613684565b6018546001600160a01b031633146110f25760405162461bcd60e51b81526004016110e990614d51565b60405180910390fd5b60005b825181101561118657600083828151811061111257611112614d94565b6020908102919091018101516001600160a01b0381166000818152601e9093526040808420805460ff191660ff891690811790915590519294509290917f5e1c988ff223cdb5da0e9c3b4228dfe56444cb87e7d328c8495a1c40bfe9fa2a9190a3508061117e81614dc0565b9150506110f5565b505050565b6111936137da565b601b54604051630b85272160e11b81526001600160a01b039091169063170a4e42906111c3908490600401614dfd565b600060405180830381600087803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b50506040517ffaa4867c3ad82b35eef727eb877061cab7f6eb3576904aea9bc9520868076822925060009150a150565b601c5460405163df592f7d60e01b81523360048201819052916000916001600160a01b039091169063df592f7d90602401602060405180830381865afa15801561126f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112939190614e30565b905080156112b35760405162461bcd60e51b81526004016110e990614e52565b6112be843385613834565b50505050565b6112cc6137da565b6112d782605a614e87565b6011556112e582605a614e87565b60128190556112f5908290614e87565b6013819055601481905561130a908290614e87565b6015555050565b6113196137da565b60155442116113625760405162461bcd60e51b815260206004820152601560248201527420bab1ba34b7b7103737ba1037bb32b9103cb2ba1760591b60448201526064016110e9565b601954600160a01b900460ff16156113b65760405162461bcd60e51b8152602060048201526017602482015276105d58dd1a5bdb88185b1c9958591e481cd95d1d1b1959604a1b60448201526064016110e9565b60005b8251811015611452576000601d60008584815181106113da576113da614d94565b6020908102919091018101516001600160a01b0316825281019190915260400160002060048101805461ff001916610100179055835190915083908390811061142557611425614d94565b60209081029190910101516005820155600601805460ff191690558061144a81614dc0565b9150506113b9565b50506019805460ff60a01b1916600160a01b17905550565b6000815160410361153a5760408051606085811b6bffffffffffffffffffffffff199081166020808501919091523090921b166034830152825160288184030181526048830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a333200000000606884015260848084018290528451808503909101815260a4909301909352815191012060006115098286613fb1565b90506001600160a01b0381161580159061153057506019546001600160a01b038281169116145b935050505061153e565b5060005b92915050565b600080600080600080600080600080600080600c54600454601254601354601960159054906101000a900460ff16601960189054906101000a900460ff16600e54601b60009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115fc9190614e9a565b6011546009546003546007549b509b509b509b509b509b509b509b509b509b509b509b50909192939495969798999a9b565b6116366137da565b61163e613fd5565b565b6116486137da565b61163e6140e3565b6116586137da565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b6018546001600160a01b031633146116a45760405162461bcd60e51b81526004016110e990614d51565b80516010548111156116c85760405162461bcd60e51b81526004016110e990614eb3565b6013544211156116ea5760405162461bcd60e51b81526004016110e990614eea565b600c54601b54604080516318160ddd60e01b8152905184926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175a9190614e9a565b600f546117679190614f21565b6117719190614f21565b101561178f5760405162461bcd60e51b81526004016110e990614f34565b60005b818110156117d0576117be8382815181106117af576117af614d94565b60200260200101516005614135565b806117c881614dc0565b915050611792565b5080601060008282546117e39190614f21565b9091555050600c54601b54604080516318160ddd60e01b815290516001600160a01b03909216916318160ddd916004808201926020929091908290030181865afa158015611835573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118599190614e9a565b600f546118669190614f21565b6118709190614f21565b600d555050565b61187f6137da565b6001600081905260216020527f2b59c9df127166d3570f589f0cb7377a6b175795e70ab275ebf42fa16c0a23f45460ff16156118ba57600080fd5b67ffffffffffffffff166000908152602160205260409020805460ff19166001179055600998909855600a96909655600594909455600692909255600455600b55600855600355600755565b6018546001600160a01b031633146119305760405162461bcd60e51b81526004016110e990614d51565b601355565b6018546001600160a01b0316331461195f5760405162461bcd60e51b81526004016110e990614d51565b60068190556040518181527fc3c898bec609452e0cecc8990f6692426351b704f348f19cc242bd4d42d65ce9906020015b60405180910390a150565b6018546001600160a01b031633146119c55760405162461bcd60e51b81526004016110e990614d51565b6019805460ff60c01b198116600160c01b9182900460ff1615909102179055565b6018546001600160a01b03163314611a105760405162461bcd60e51b81526004016110e990614d51565b600855565b6018546001600160a01b03163314611a3f5760405162461bcd60e51b81526004016110e990614d51565b601b80546001600160a01b0319166001600160a01b0392909216919091179055565b6018546001600160a01b03163314611a8b5760405162461bcd60e51b81526004016110e990614d51565b600c55565b611a986137da565b6015544211611ae15760405162461bcd60e51b815260206004820152601560248201527420bab1ba34b7b7103737ba1037bb32b9103cb2ba1760591b60448201526064016110e9565b601954600160a81b900460ff1615611b345760405162461bcd60e51b8152602060048201526016602482015275149859999b1948185b1c9958591e481cd95d1d1b195960521b60448201526064016110e9565b600c5481511115611b875760405162461bcd60e51b815260206004820152601b60248201527f496e636f7272656374206e756d626572206f662077696e6e657273000000000060448201526064016110e9565b60005b8151811015611c08576000601d6000848481518110611bab57611bab614d94565b6020908102919091018101516001600160a01b0316825281019190915260400160002060048101805461ff0019166101001790556005805490820155600601805460ff191660011790555080611c0081614dc0565b915050611b8a565b50506019805460ff60a81b1916600160a81b179055565b611c276137da565b600455565b6018546001600160a01b03163314611c565760405162461bcd60e51b81526004016110e990614d51565b600f55565b611c636137da565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b601a546040516370a0823160e01b81526001600160a01b03848116600483015260009283928392909116906370a0823190602401602060405180830381865afa158015611cd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfa9190614e9a565b90508015611d17576001611d0d866141fa565b9250925050611d68565b6000611d23868661146a565b90508015611d5e576001600160a01b0386166000908152601f6020526040902054600954600291611d5391614f21565b935093505050611d68565b6000809350935050505b9250929050565b6018546001600160a01b03163314611d995760405162461bcd60e51b81526004016110e990614d51565b600a8190556040518181527f1b55d9f7002bda4490f467e326f22a4a847629c0f2d1ed421607d318d25b410d90602001611990565b611dd66137da565b61163e6000614333565b611de86137da565b6003600081905260216020527fbae8fb7bb9008c9bfa6625328b7613a2bedfb2f936a7718f51173039a77c107c5460ff1615611e2357600080fd5b67ffffffffffffffff166000908152602160205260409020805460ff19166001179055601780546001600160a01b039384166001600160a01b03199182161790915560188054929093169116179055565b6018546001600160a01b03163314611e9e5760405162461bcd60e51b81526004016110e990614d51565b600355565b611eab614385565b60005460ff1615611ece5760405162461bcd60e51b81526004016110e990614f7a565b601c5460405163df592f7d60e01b81523360048201819052916000916001600160a01b039091169063df592f7d90602401602060405180830381865afa158015611f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f409190614e30565b90508015611f605760405162461bcd60e51b81526004016110e990614e52565b6015543390349042108015611f7757506014544210155b611fc35760405162461bcd60e51b815260206004820152601760248201527f4f7574736964652061756374696f6e2077696e646f772e00000000000000000060448201526064016110e9565b60055481101561200b5760405162461bcd60e51b81526020600482015260136024820152722134b21030b6b7bab73a103a37b7903637bb9760691b60448201526064016110e9565b6001600160a01b0382166000908152601d6020526040902060010154156120c7576001600160a01b0382166000908152601d60205260409020600181015482116120ad5760405162461bcd60e51b815260206004820152602d60248201527f596f752063616e206f6e6c7920696e63726561736520796f7572206269642c2060448201526c3737ba103232b1b932b0b9b29760991b60648201526084016110e9565b6120bb8382600101546143de565b5060010181905561219a565b60408051610100808201835260008284018181526080840182815260a0850183815260c0860184815260e087018581526001600160a01b038b8116808a526020808b018d81524260608d01908152928a52601d9091529a909720985189546001600160a01b031916911617885597516001880155925160028701805460ff19908116921515929092179055935160038701559051600486018054925161ffff1990931691151561ff0019169190911791151590940217909255905160058301559151600690910180549092169015151790555b604080516001600160a01b03841681526020810183905260008183015290517f4c59a472ced976904d21e373e2f2d8326defffabfe087e3d7886f0c516495ba79181900360600190a15050505061163e60018055565b6121f86137da565b61163e61445c565b6122086137da565b612210614385565b60155442116122595760405162461bcd60e51b815260206004820152601560248201527420bab1ba34b7b7103430b9b713ba1032b73232b21760591b60448201526064016110e9565b601954600160a01b900460ff16151560011480156122855750601954600160a81b900460ff1615156001145b6122d15760405162461bcd60e51b815260206004820152601760248201527f41756374696f6e2077696e6e657273206e6f742073657400000000000000000060448201526064016110e9565b60005b81518110156126475760008282815181106122f1576122f1614d94565b6020908102919091018101516001600160a01b0381166000908152601d909252604090912060048101549192509060ff610100909104161515600114801561233e5750600281015460ff16155b801561234f5750600481015460ff16155b156125595760008160050154826001015461236a9190614f21565b90508015612426576000836001600160a01b03168260405160006040518083038185875af1925050503d80600081146123bf576040519150601f19603f3d011682016040523d82523d6000602084013e6123c4565b606091505b50509050806124245760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f20726566756e6420646966666572656e636520746f207760448201526534b73732b91760d11b60648201526084016110e9565b505b601b546040516335313c2160e11b81526001600160a01b0385811660048301526000921690636a627842906024016020604051808303816000875af1158015612473573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124979190614e9a565b600684015490915060ff1615156001036124f057600381856001600160a01b031660008051602061505083398151915286600501546000806000806040516124e3959493929190614fbe565b60405180910390a4612531565b600281856001600160a01b03166000805160206150508339815191528660050154600080600080604051612528959493929190614fbe565b60405180910390a45b5050600281018054600160ff1991821681179092556004830180549091169091179055612632565b6004810154610100900460ff161580156125785750600481015460ff16155b156126325760018101546040516000916001600160a01b038516918381818185875af1925050503d80600081146125cb576040519150601f19603f3d011682016040523d82523d6000602084013e6125d0565b606091505b50509050806126215760405162461bcd60e51b815260206004820152601f60248201527f4661696c656420746f2073656e6420726566756e6420746f206c6f7365722e0060448201526064016110e9565b5060048101805460ff191660011790555b5050808061263f90614dc0565b9150506122d4565b5061265160018055565b50565b6018546001600160a01b0316331461267e5760405162461bcd60e51b81526004016110e990614d51565b8060105410156126a05760405162461bcd60e51b81526004016110e990614eb3565b6013544211156126c25760405162461bcd60e51b81526004016110e990614eea565b600c54601b54604080516318160ddd60e01b8152905184926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa15801561270e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127329190614e9a565b600f5461273f9190614f21565b6127499190614f21565b10156127675760405162461bcd60e51b81526004016110e990614f34565b60005b818110156117d05761277d836005614135565b8061278781614dc0565b91505061276a565b6018546001600160a01b031633146127b95760405162461bcd60e51b81526004016110e990614d51565b60058190556040518181527f0b2415f9ab63dbd60a9b1d42289c1deace6a9bbb6c006d8f3f2c1d872a47144490602001611990565b601c5460405163df592f7d60e01b81523360048201819052916000916001600160a01b039091169063df592f7d90602401602060405180830381865afa15801561283c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128609190614e30565b905080156128805760405162461bcd60e51b81526004016110e990614e52565b601a5460405163090c9a2d60e41b81523360048201526001600160a01b03808616602483015290911660448201526d76a84fef008cdabe6409d2fe638b906390c9a2d090606401602060405180830381865afa1580156128e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129089190614e30565b61291157600080fd5b6112be848460405180602001604052806000815250613834565b6018546001600160a01b031633146129555760405162461bcd60e51b81526004016110e990614d51565b601055565b6018546001600160a01b031633146129845760405162461bcd60e51b81526004016110e990614d51565b600e55565b6018546001600160a01b031633146129b35760405162461bcd60e51b81526004016110e990614d51565b601555565b6129c0614385565b60005460ff16156129e35760405162461bcd60e51b81526004016110e990614f7a565b601c5460405163df592f7d60e01b81523360048201819052916000916001600160a01b039091169063df592f7d90602401602060405180830381865afa158015612a31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a559190614e30565b90508015612a755760405162461bcd60e51b81526004016110e990614e52565b601b546040805163d5abeb0160e01b815290516000926001600160a01b03169163d5abeb019160048083019260209291908290030181865afa158015612abf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ae39190614e9a565b90506000601b60009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5e9190614e9a565b9050600854851115612bb25760405162461bcd60e51b815260206004820152601a60248201527f546f6f206d616e7920746f6b656e73207265717565737465642e00000000000060448201526064016110e9565b818110612bfd5760405162461bcd60e51b815260206004820152601960248201527827379036b7b932903a37b5b2b7399030bb30b4b630b136329760391b60448201526064016110e9565b84612c088284614f21565b1015612c565760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f75676820737570706c79206c656674202d20312e000000000060448201526064016110e9565b601954600160c01b900460ff161515600114612ca65760405162461bcd60e51b815260206004820152600f60248201526e2737ba1030baba3437b934bd32b21760891b60448201526064016110e9565b6007543490612cb6908790614fec565b811015612cf75760405162461bcd60e51b815260206004820152600f60248201526e20b6b7bab73a103a37b7903637bb9760891b60448201526064016110e9565b60005b86811015612dc257601b546040516335313c2160e11b81523360048201526000916001600160a01b031690636a627842906024016020604051808303816000875af1158015612d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d719190614e9a565b9050600481336001600160a01b031660008051602061505083398151915286600080600080604051612da7959493929190614fbe565b60405180910390a45080612dba81614dc0565b915050612cfa565b50505050505061265160018055565b6018546001600160a01b03163314612dfb5760405162461bcd60e51b81526004016110e990614d51565b806010541015612e1d5760405162461bcd60e51b81526004016110e990614eb3565b601354421115612e3f5760405162461bcd60e51b81526004016110e990614eea565b600c54601b54604080516318160ddd60e01b8152905184926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015612e8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eaf9190614e9a565b600f54612ebc9190614f21565b612ec69190614f21565b1015612ee45760405162461bcd60e51b81526004016110e990614f34565b60005b818110156117d057612efa836000614135565b80612f0481614dc0565b915050612ee7565b6018546001600160a01b03163314612f365760405162461bcd60e51b81526004016110e990614d51565b60005b8151811015612fbe576000828281518110612f5657612f56614d94565b6020908102919091018101516001600160a01b0381166000818152601e9093526040808420805460ff1916905551919350917f29beb8aae77ba82cbb9d5a13ac9153539286534ddea0dc0a0aa61c484585a61491a25080612fb681614dc0565b915050612f39565b5050565b6018546001600160a01b03163314612fec5760405162461bcd60e51b81526004016110e990614d51565b601255565b612ff96137da565b6002600081905260216020527f914a2534c436de5a3f77164e6b9b90d20144139ce899b6a8d30a442e7b9ef5335460ff161561303457600080fd5b67ffffffffffffffff166000908152602160205260409020805460ff19166001179055600c99909955600d97909755600e95909555600f93909355601091909155601155601255601355601455601555565b6018546001600160a01b031633146130b05760405162461bcd60e51b81526004016110e990614d51565b600755565b6018546001600160a01b031633146130df5760405162461bcd60e51b81526004016110e990614d51565b600955565b6130ec614385565b60005460ff161561310f5760405162461bcd60e51b81526004016110e990614f7a565b601c5460405163df592f7d60e01b81523360048201819052916000916001600160a01b039091169063df592f7d90602401602060405180830381865afa15801561315d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131819190614e30565b905080156131a15760405162461bcd60e51b81526004016110e990614e52565b601b60009054906101000a90046001600160a01b03166001600160a01b031663d5abeb016040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132189190614e9a565b601b60009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561326b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061328f9190614e9a565b106132d85760405162461bcd60e51b815260206004820152601960248201527827379036b7b932903a37b5b2b7399030bb30b4b630b136329760391b60448201526064016110e9565b601954600160c01b900460ff1615156001146133285760405162461bcd60e51b815260206004820152600f60248201526e2737ba1030baba3437b934bd32b21760891b60448201526064016110e9565b600754349081101561336e5760405162461bcd60e51b815260206004820152600f60248201526e20b6b7bab73a103a37b7903637bb9760891b60448201526064016110e9565b601b546040516335313c2160e11b81523360048201526000916001600160a01b031690636a627842906024016020604051808303816000875af11580156133b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133dd9190614e9a565b9050600481336001600160a01b031660008051602061505083398151915285600080600080604051613413959493929190614fbe565b60405180910390a45050505061163e60018055565b6018546001600160a01b031633146134525760405162461bcd60e51b81526004016110e990614d51565b601455565b61345f6137da565b601954600160b01b900460ff16156134b35760405162461bcd60e51b8152602060048201526017602482015276105d58dd1a5bdb88185b1c9958591e481cd95d1d1b1959604a1b60448201526064016110e9565b6019805460ff60b01b198116600160b01b9182900460ff16159091021790556134da613fd5565b6040517ffa73a4fea5fd06d0d6a99612856bf1c8c91b17959d34072d2d0230999f98671790600090a1565b6018546001600160a01b0316331461352f5760405162461bcd60e51b81526004016110e990614d51565b601980546001600160a01b0319166001600160a01b0392909216919091179055565b6018546001600160a01b0316331461357b5760405162461bcd60e51b81526004016110e990614d51565b601155565b6135886137da565b6001600160a01b0381166135ed5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016110e9565b61265181614333565b6018546001600160a01b031633146136205760405162461bcd60e51b81526004016110e990614d51565b600b8190556040518181527faab6389d8f1c16ba1deb6e9831f5c5442cf4fcf99bf5bfa867460be408a9111890602001611990565b6018546001600160a01b0316331461367f5760405162461bcd60e51b81526004016110e990614d51565b600d55565b6018546001600160a01b031633146136ae5760405162461bcd60e51b81526004016110e990614d51565b80516010548111156136d25760405162461bcd60e51b81526004016110e990614eb3565b6013544211156136f45760405162461bcd60e51b81526004016110e990614eea565b600c54601b54604080516318160ddd60e01b8152905184926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015613740573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137649190614e9a565b600f546137719190614f21565b61377b9190614f21565b10156137995760405162461bcd60e51b81526004016110e990614f34565b60005b818110156117d0576137c88382815181106137b9576137b9614d94565b60200260200101516000614135565b806137d281614dc0565b91505061379c565b6002546001600160a01b0316331461163e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016110e9565b600083600e546138449190614f21565b10156138925760405162461bcd60e51b815260206004820152601860248201527f4e6f206d6f726520616c6c6f776c69737420737570706c79000000000000000060448201526064016110e9565b34336000806138a18686611c85565b915060ff169150600082116138e65760405162461bcd60e51b815260206004820152600b60248201526a139bdd08185b1b1bddd95960aa1b60448201526064016110e9565b808711156139365760405162461bcd60e51b815260206004820152601860248201527f5174792065786365656473206d617820616c6c6f7765642e000000000000000060448201526064016110e9565b600c54601b54604080516318160ddd60e01b815290518a926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015613982573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139a69190614e9a565b600f546139b39190614f21565b6139bd9190614f21565b10156139db5760405162461bcd60e51b81526004016110e990614f34565b81600103613d5c57866003546139f19190614fec565b841015613a555760405162461bcd60e51b815260206004820152602c60248201527f4f6173697320616c6c6f776c697374206d696e74696e673a204e6f7420656e6f60448201526b1d59da08115512081cd95b9d60a21b60648201526084016110e9565b6011544210158015613a6957506013544211155b613ab55760405162461bcd60e51b815260206004820152601e60248201527f4f757473696465204f6173697320616c6c6f776c6973742077696e646f77000060448201526064016110e9565b601a546040516370a0823160e01b81526001600160a01b03888116600483015260009216906370a0823190602401602060405180830381865afa158015613b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b249190614e9a565b90508760005b82811015613d0657601a54604051632f745c5960e01b81526001600160a01b038b81166004830152602482018490526000921690632f745c5990604401602060405180830381865afa158015613b84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ba89190614e9a565b60008181526020805260408120546009549293509091613bcb9160ff1690614f21565b905080600003613bdc575050613cf4565b6000613be88286614499565b6000848152602080526040812080549293508392909190613c0d90849060ff16615003565b92506101000a81548160ff021916908360ff1602179055508060ff1685613c349190614f21565b945060005b8160ff16811015613cef57601b546040516335313c2160e11b81526001600160a01b038c811660048301526000921690636a627842906024016020604051808303816000875af1158015613c91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cb59190614e9a565b9050613cc68e8c838f60018a6144b1565b600e8054906000613cd68361501c565b9190505550508080613ce790614dc0565b915050613c39565b505050505b80613cfe81614dc0565b915050613b2a565b508015613d555760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420656e6f756768204f61736973206d696e7420617661696c61626c650060448201526064016110e9565b5050613f14565b86600454613d6a9190614fec565b841015613dcf5760405162461bcd60e51b815260206004820152602d60248201527f5075626c696320616c6c6f776c697374206d696e74696e673a204e6f7420656e60448201526c1bdd59da08115512081cd95b9d609a1b60648201526084016110e9565b6012544210158015613de357506013544211155b613e2f5760405162461bcd60e51b815260206004820152601860248201527f4f75747369646520616c6c6f776c6973742077696e646f77000000000000000060448201526064016110e9565b60005b87811015613ee557601b546040516335313c2160e11b81526001600160a01b0386811660048301526000921690636a627842906024016020604051808303816000875af1158015613e87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613eab9190614e9a565b9050613ebc888683896000806144b1565b600e8054906000613ecc8361501c565b9190505550508080613edd90614dc0565b915050613e32565b506001600160a01b0386166000908152601f602052604081208054899290613f0e908490614e87565b90915550505b600c54601b60009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613f6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f8e9190614e9a565b600f54613f9b9190614f21565b613fa59190614f21565b600d5550505050505050565b6000806000613fc0858561454e565b91509150613fcd81614590565b509392505050565b601954600160b01b900460ff1615156001148015613ff4575060155442115b6140405760405162461bcd60e51b815260206004820152601f60248201527f41756374696f6e206e6f7420736574746c65647c7c6e6f7420656e6465642e0060448201526064016110e9565b6017546040516000916001600160a01b03169047908381818185875af1925050503d806000811461408d576040519150601f19603f3d011682016040523d82523d6000602084013e614092565b606091505b50509050806126515760405162461bcd60e51b815260206004820152601860248201527f4661696c656420746f2073656e6420746f2070617965652e000000000000000060448201526064016110e9565b6140eb6146da565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b601b546040516335313c2160e11b81526001600160a01b0384811660048301526000921690636a627842906024016020604051808303816000875af1158015614182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141a69190614e9a565b90508160058111156141ba576141ba614fa8565b81846001600160a01b031660008051602061505083398151915260008060008060006040516141ed959493929190614fbe565b60405180910390a4505050565b601a546040516370a0823160e01b81526001600160a01b03838116600483015260009283929116906370a0823190602401602060405180830381865afa158015614248573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061426c9190614e9a565b90506000805b82811015613fcd57601a54604051632f745c5960e01b81526001600160a01b038781166004830152602482018490526000921690632f745c5990604401602060405180830381865afa1580156142cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142f09190614e9a565b60008181526020805260409020546009549192506143139160ff90911690614f21565b61431d9084614e87565b925050808061432b90614dc0565b915050614272565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002600154036143d75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016110e9565b6002600155565b6040805160008082526020820190925281906001600160a01b0385169061753090859060405161440e9190615033565b600060405180830381858888f193505050503d806000811461444c576040519150601f19603f3d011682016040523d82523d6000602084013e614451565b606091505b509095945050505050565b614464614723565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586141183390565b60008183106144a857816144aa565b825b9392505050565b846001600160a01b0316866001600160a01b03161461450a57600184866001600160a01b03166000805160206150508339815191528660018b88886040516144fd959493929190614fbe565b60405180910390a4614546565b600184866001600160a01b031660008051602061505083398151915286600080888860405161453d959493929190614fbe565b60405180910390a45b505050505050565b60008082516041036145845760208301516040840151606085015160001a61457887828585614769565b94509450505050611d68565b50600090506002611d68565b60008160048111156145a4576145a4614fa8565b036145ac5750565b60018160048111156145c0576145c0614fa8565b0361460d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016110e9565b600281600481111561462157614621614fa8565b0361466e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016110e9565b600381600481111561468257614682614fa8565b036126515760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016110e9565b60005460ff1661163e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016110e9565b60005460ff161561163e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016110e9565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156147a05750600090506003614824565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156147f4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661481d57600060019250925050614824565b9150600090505b94509492505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561486c5761486c61482d565b604052919050565b600067ffffffffffffffff82111561488e5761488e61482d565b5060051b60200190565b6001600160a01b038116811461265157600080fd5b600082601f8301126148be57600080fd5b813560206148d36148ce83614874565b614843565b82815260059290921b840181019181810190868411156148f257600080fd5b8286015b8481101561491657803561490981614898565b83529183019183016148f6565b509695505050505050565b6000806040838503121561493457600080fd5b823567ffffffffffffffff81111561494b57600080fd5b614957858286016148ad565b925050602083013560ff8116811461496e57600080fd5b809150509250929050565b60006020828403121561498b57600080fd5b81356144aa81614898565b600067ffffffffffffffff8311156149b0576149b061482d565b6149c3601f8401601f1916602001614843565b90508281528383830111156149d757600080fd5b828260208301376000602084830101529392505050565b600060208284031215614a0057600080fd5b813567ffffffffffffffff811115614a1757600080fd5b8201601f81018413614a2857600080fd5b614a3784823560208401614996565b949350505050565b600082601f830112614a5057600080fd5b6144aa83833560208501614996565b60008060408385031215614a7257600080fd5b82359150602083013567ffffffffffffffff811115614a9057600080fd5b614a9c85828601614a3f565b9150509250929050565b60008060408385031215614ab957600080fd5b50508035926020909101359150565b60008060408385031215614adb57600080fd5b823567ffffffffffffffff80821115614af357600080fd5b614aff868387016148ad565b9350602091508185013581811115614b1657600080fd5b85019050601f81018613614b2957600080fd5b8035614b376148ce82614874565b81815260059190911b82018301908381019088831115614b5657600080fd5b928401925b82841015614b7457833582529284019290840190614b5b565b80955050505050509250929050565b60008060408385031215614b9657600080fd5b8235614ba181614898565b9150602083013567ffffffffffffffff811115614a9057600080fd5b600060208284031215614bcf57600080fd5b813567ffffffffffffffff811115614be657600080fd5b614a37848285016148ad565b60008060008060008060008060006101208a8c031215614c1157600080fd5b505087359960208901359950604089013598606081013598506080810135975060a0810135965060c0810135955060e08101359450610100013592509050565b600060208284031215614c6357600080fd5b5035919050565b60008060408385031215614c7d57600080fd5b8235614c8881614898565b9150602083013561496e81614898565b60008060408385031215614cab57600080fd5b8235614cb681614898565b946020939093013593505050565b60008060408385031215614cd757600080fd5b82359150602083013561496e81614898565b6000806000806000806000806000806101408b8d031215614d0957600080fd5b505088359a60208a01359a5060408a013599606081013599506080810135985060a0810135975060c0810135965060e081013595506101008101359450610120013592509050565b60208082526023908201527f41756374696f6e486f7573653a206f6e6c792061646d696e207065726d69747460408201526232b21760e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201614dd257614dd2614daa565b5060010190565b60005b83811015614df4578181015183820152602001614ddc565b50506000910152565b6020815260008251806020840152614e1c816040850160208701614dd9565b601f01601f19169190910160400192915050565b600060208284031215614e4257600080fd5b815180151581146144aa57600080fd5b6020808252818101527f426c6f636b65643a204f4641432073616e6374696f6e65642061646472657373604082015260600190565b8082018082111561153e5761153e614daa565b600060208284031215614eac57600080fd5b5051919050565b60208082526017908201527f4e6f7420656e6f7567682070726f6d6f20737570706c79000000000000000000604082015260600190565b60208082526019908201527f4f7574736964652070726f6d6f206d696e742077696e646f7700000000000000604082015260600190565b8181038181111561153e5761153e614daa565b60208082526026908201527f4e6f7420656e6f75676820737570706c792072656d61696e696e6720666f7220604082015265726166666c6560d01b606082015260800190565b602080825260149082015273105d58dd1a5bdb921bdd5cd94e881c185d5cd95960621b604082015260600190565b634e487b7160e01b600052602160045260246000fd5b94855292151560208501526001600160a01b0391909116604084015215156060830152608082015260a00190565b808202811582820484141761153e5761153e614daa565b60ff818116838216019081111561153e5761153e614daa565b60008161502b5761502b614daa565b506000190190565b60008251615045818460208701614dd9565b919091019291505056fea134ff4a851b5867631cd832ea22daffdbd2870d47e51a0ad1afb7913b183bfea26469706673582212203b7bbaaf582d3bd9c322d40a33ea354905c0ffe54e9038e9eea140b1db6e16ac64736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000cf860bbe9eea9bf95cac9ef2b8278da1e041e50b000000000000000000000000b3f9957d93c29d886a5f4bbbfdabcfbaea2e676d000000000000000000000000898157afb3e158cc835d19b9ecd37c69bf460f8c00000000000000000000000040c57923924b5c5c5455c48d93317139addac8fb000000000000000000000000a8eaa9dc2d49624d0ca0bdefa30a6e2a957efb91
-----Decoded View---------------
Arg [0] : _nft (address): 0xcF860bBE9eEA9Bf95caC9eF2b8278da1E041e50B
Arg [1] : _payee (address): 0xb3f9957d93c29D886a5F4BBBFDAbCFBaeA2e676d
Arg [2] : _oasis (address): 0x898157afB3E158cc835D19B9ecd37C69bF460f8C
Arg [3] : _sanctions (address): 0x40C57923924B5c5c5455c48D93317139ADDaC8fb
Arg [4] : _allowlistSigner (address): 0xA8Eaa9DC2D49624d0ca0BDefa30A6e2A957Efb91
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000cf860bbe9eea9bf95cac9ef2b8278da1e041e50b
Arg [1] : 000000000000000000000000b3f9957d93c29d886a5f4bbbfdabcfbaea2e676d
Arg [2] : 000000000000000000000000898157afb3e158cc835d19b9ecd37c69bf460f8c
Arg [3] : 00000000000000000000000040c57923924b5c5c5455c48d93317139addac8fb
Arg [4] : 000000000000000000000000a8eaa9dc2d49624d0ca0bdefa30a6e2a957efb91
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | Ether (ETH) | 100.00% | $3,416.46 | 0.04 | $136.66 |
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.