Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 112 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Settle Auction | 17224606 | 510 days ago | IN | 0 ETH | 0.00908316 | ||||
Create Bid | 17223673 | 510 days ago | IN | 0 ETH | 0.00616857 | ||||
Create Auction | 17223632 | 510 days ago | IN | 0 ETH | 0.04475172 | ||||
Settle Auction | 16991287 | 543 days ago | IN | 0 ETH | 0.00338151 | ||||
Settle Auction | 16991230 | 543 days ago | IN | 0 ETH | 0.00366544 | ||||
Create Bid | 16991169 | 543 days ago | IN | 5.5 ETH | 0.0018626 | ||||
Create Auction | 16991148 | 543 days ago | IN | 0 ETH | 0.01043875 | ||||
Create Bid | 16991109 | 543 days ago | IN | 1.75 ETH | 0.00170813 | ||||
Create Bid | 16991102 | 543 days ago | IN | 1.7 ETH | 0.00198006 | ||||
Create Bid | 16991096 | 543 days ago | IN | 1.65 ETH | 0.00163684 | ||||
Create Bid | 16991074 | 543 days ago | IN | 1.6 ETH | 0.00160945 | ||||
Create Bid | 16991064 | 543 days ago | IN | 1 ETH | 0.00182228 | ||||
Settle Auction | 16991062 | 543 days ago | IN | 0 ETH | 0.00378332 | ||||
Create Bid | 16991061 | 543 days ago | IN | 0.8 ETH | 0.00215545 | ||||
Create Bid | 16991060 | 543 days ago | IN | 1 ETH | 0.00220324 | ||||
Create Auction | 16991056 | 543 days ago | IN | 0 ETH | 0.01061279 | ||||
Create Bid | 16991027 | 543 days ago | IN | 0.61 ETH | 0.00168455 | ||||
Create Bid | 16991002 | 543 days ago | IN | 0.56 ETH | 0.00185906 | ||||
Create Bid | 16990998 | 543 days ago | IN | 0.5 ETH | 0.00186034 | ||||
Create Bid | 16990996 | 543 days ago | IN | 0.45 ETH | 0.00172318 | ||||
Create Bid | 16990987 | 543 days ago | IN | 0.4 ETH | 0.00190958 | ||||
Create Bid | 16990981 | 543 days ago | IN | 0.35 ETH | 0.00197996 | ||||
Create Bid | 16990980 | 543 days ago | IN | 0.3 ETH | 0.00204241 | ||||
Create Bid | 16990978 | 543 days ago | IN | 0.15 ETH | 0.00199186 | ||||
Create Bid | 16990971 | 543 days ago | IN | 0.1 ETH | 0.00181734 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
16991287 | 543 days ago | 5.5 ETH | ||||
16991230 | 543 days ago | 1.75 ETH | ||||
16991109 | 543 days ago | 1.7 ETH | ||||
16991102 | 543 days ago | 1.65 ETH | ||||
16991096 | 543 days ago | 1.6 ETH | ||||
16991074 | 543 days ago | 1 ETH | ||||
16991064 | 543 days ago | 0.8 ETH | ||||
16991062 | 543 days ago | 0.61 ETH | ||||
16991027 | 543 days ago | 0.56 ETH | ||||
16991002 | 543 days ago | 0.5 ETH | ||||
16990998 | 543 days ago | 0.45 ETH | ||||
16990996 | 543 days ago | 0.4 ETH | ||||
16990987 | 543 days ago | 0.35 ETH | ||||
16990981 | 543 days ago | 0.15 ETH | ||||
16990980 | 543 days ago | 0.15 ETH | ||||
16990978 | 543 days ago | 0.1 ETH | ||||
16990971 | 543 days ago | 0.01 ETH | ||||
16990970 | 543 days ago | 0.01 ETH | ||||
16884663 | 558 days ago | 0.53 ETH | ||||
16884636 | 558 days ago | 0.48 ETH | ||||
16884621 | 558 days ago | 0.4 ETH | ||||
16884611 | 558 days ago | 0.269 ETH | ||||
16884608 | 558 days ago | 0.2 ETH | ||||
16884605 | 558 days ago | 0.069 ETH | ||||
16884587 | 558 days ago | 0.5 ETH |
Loading...
Loading
Contract Name:
AuctionHouse
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {Counters} from "@openzeppelin/contracts/utils/Counters.sol"; import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {Auction, Asset, AuctionStatus, AuctionType} from "./lib/AuctionStructs.sol"; import {IWhitelistRegistry} from "./interfaces/IWhitelistRegistry.sol"; contract AuctionHouse is Ownable, ReentrancyGuard, ERC721Holder, ERC1155Holder { using SafeMath for uint256; using Math for uint256; using Counters for Counters.Counter; // ERC721 interfaceID bytes4 public constant INTERFACE_ID_ERC721 = 0x80ac58cd; // ERC1155 interfaceID bytes4 public constant INTERFACE_ID_ERC1155 = 0xd9b67a26; address public protocolFeeRecipient; uint256 public protocolFee; uint256 public penaltyFee; uint256 public maxLotSize; bool public allowListings = false; bool public isBeta = true; mapping(uint256 => Auction) public auctions; mapping(uint256 => Asset[]) public assets; Counters.Counter public totalAuctionCount; Counters.Counter public totalBidCount; address private whitelistRegistry; event AuctionCreated(uint256 indexed auctionId, address indexed seller); event AuctionCancelled(uint256 indexed auctionId); event AuctionReverted(uint256 indexed auctionId); event AuctionSettled( uint256 indexed auctionId, address indexed seller, address indexed buyer, uint256 price ); event AuctionUpdated(uint256 indexed auctionId); event BidCreated( uint256 indexed auctionId, address indexed bidder, address indexed seller, uint256 price, bool reserveMet ); error InvalidBid(); modifier openAuction(uint256 auctionId) { require( auctions[auctionId].status == AuctionStatus.ACTIVE, "Auction is not open" ); _; } modifier nonExpiredAuction(uint256 auctionId) { require( auctions[auctionId].endDate >= block.timestamp, "Auction already expired" ); _; } modifier expiredAuction(uint256 auctionId) { require( auctions[auctionId].endDate < block.timestamp, "Auction has not expired yet" ); _; } modifier onlySeller(uint256 auctionId) { require(msg.sender == auctions[auctionId].seller, "Not seller"); _; } modifier notSeller(uint256 auctionId) { require( msg.sender != auctions[auctionId].seller, "Cannot be called by seller" ); _; } modifier nonContract() { require(msg.sender == tx.origin, "Cannot be called by contract"); _; } modifier canList() { require( !isBeta || IWhitelistRegistry(whitelistRegistry).checkWhitelistStatus( msg.sender ) == true, "Not whitelisted" ); _; } constructor( address _protocolFeeRecipient, address _whitelistRegistry, uint256 _protocolFee, uint256 _penaltyFee, uint256 _maxLotSize ) { protocolFeeRecipient = _protocolFeeRecipient; whitelistRegistry = _whitelistRegistry; protocolFee = _protocolFee; penaltyFee = _penaltyFee; maxLotSize = _maxLotSize; } /** * @notice Creates an auction * @dev client should group all ERC1155 with the same ids in one asset struct and update qty as needed * @param _assets assets to include in the auction lot (tokenAddress, tokenId, qty) * @param _startingPrice starting auction price. First bid must be greater than this value * @param _reservePrice lowest price seller is willing to sell at. * @param _startDate scheduled startDate. To start immediately set a value that is less than or equal to the current timestamp * @param _endDate scheduled endDate. Must be greater than the startDate and the current block timestamp */ function createAuction( Asset[] calldata _assets, uint256 _startingPrice, uint256 _reservePrice, uint256 _minBidThreshold, uint256 _startDate, uint256 _endDate, bool _isExtendedType ) public canList nonContract returns (uint256 auctionId) { require( _endDate > block.timestamp, "Auction end date cannot be set in the past" ); require(_endDate > _startDate, "Start date greater than end date"); require(allowListings, "Auction creation paused"); require(_assets.length <= maxLotSize, "Max lot size exceeded"); require(_assets.length >= 1, "Auction must containt at least 1 asset"); totalAuctionCount.increment(); auctionId = totalAuctionCount.current(); for (uint256 i; i < _assets.length; i++) { Asset calldata targetAsset = _assets[i]; Asset memory newAsset = Asset( targetAsset.tokenAddress, targetAsset.tokenId, targetAsset.qty ); assets[auctionId].push(newAsset); } auctions[auctionId] = Auction( auctionId, _startingPrice, _reservePrice, _minBidThreshold, msg.sender, Math.max(_startDate, block.timestamp), _endDate, _startingPrice, address(0), AuctionStatus.ACTIVE, _isExtendedType ? AuctionType.EXTENDED : AuctionType.ABSOLUTE ); _transferAssets(_assets, msg.sender, address(this)); emit AuctionCreated(auctionId, msg.sender); return auctionId; } /** * @notice Creates bid tied to a specific auction. Bid amount will be the value of msg.value * @param _auctionId auctionId * @return bidId ID of the newly created bid */ function createBid( uint256 _auctionId ) public payable nonReentrant nonContract openAuction(_auctionId) notSeller(_auctionId) nonExpiredAuction(_auctionId) returns (uint256 bidId) { Auction storage auction = auctions[_auctionId]; // opening bid check if (auction.topBidder == address(0)) { if (msg.value < auction.startingPrice) { revert InvalidBid(); } } else { // non-opening bid check if (auction.minBidThreshold == 0 && msg.value <= auction.topBid) { revert InvalidBid(); } else if ( auction.minBidThreshold > 0 && auction.topBid.add(auction.minBidThreshold) > msg.value ) { revert InvalidBid(); } } bool reserveMet = msg.value > auction.reservePrice; if (auction.topBidder != address(0)) { payable(auction.topBidder).transfer(auction.topBid); } auction.topBid = msg.value; auction.topBidder = msg.sender; if (auction.auctionType == AuctionType.EXTENDED) _extendAuction(_auctionId); emit BidCreated( _auctionId, msg.sender, auction.seller, msg.value, reserveMet ); return bidId; } function increaseBid(uint256 _auctionId) public payable { Auction storage auction = auctions[_auctionId]; require(msg.sender == auction.topBidder, "Not top bidder"); require(msg.value > 0, "New bid must be greater than preivous"); require( auction.status == AuctionStatus.ACTIVE && auction.endDate >= block.timestamp, "Auction is not active" ); if (msg.value == 0 || msg.value < auction.minBidThreshold) { revert InvalidBid(); } auction.topBid = auction.topBid.add(msg.value); if (auction.auctionType == AuctionType.EXTENDED) _extendAuction(_auctionId); emit BidCreated( _auctionId, msg.sender, auction.seller, auction.topBid, (auction.topBid > auction.reservePrice) ); } /** * @notice Cancels an auction and pays out penalty (if applicable) * @dev Only callable by seller. If bid exists, seller will need to pay a penalty which will go to the curent top bidder * @param _auctionId ID of the auction to cancel */ function cancelAuction( uint256 _auctionId ) public payable nonReentrant nonExpiredAuction(_auctionId) openAuction(_auctionId) onlySeller(_auctionId) { Auction storage auction = auctions[_auctionId]; Asset[] memory _assets = assets[_auctionId]; uint256 penalty = _calculatePenaltyFees(auction.topBid); if (auction.topBidder != address(0) && auction.topBid > 0) { require(msg.value >= penalty, "Incorrect penalty fee"); payable(auction.topBidder).transfer(penalty.add(auction.topBid)); if (msg.value.sub(penalty) > 0) { payable(msg.sender).transfer(msg.value.sub(penalty)); } } auction.status = AuctionStatus.CANCELLED; auction.endDate = block.timestamp; _transferAssets(_assets, address(this), auction.seller); emit AuctionCancelled(_auctionId); } /** * @notice For seller to change the reserve price. * @dev Only callable by seller. New reserve price must be lower than previous reserve. * @param _auctionId ID of the auction to change reserve price for * @param _reservePrice new reserve price */ function changeReservePrice( uint256 _auctionId, uint256 _reservePrice ) public onlySeller(_auctionId) openAuction(_auctionId) { Auction storage auction = auctions[_auctionId]; require( _reservePrice < auction.reservePrice, "New reserve price too high" ); auction.reservePrice = _reservePrice; emit AuctionUpdated(_auctionId); } /** * @notice Callable by anyone to settle auctions * @dev This function is used as both redeem and claim. Function handles all necessary payouts and transfers * @param _auctionId ID of the auction to settle */ function settleAuction( uint256 _auctionId ) public payable nonReentrant openAuction(_auctionId) expiredAuction(_auctionId) { Auction storage auction = auctions[_auctionId]; if (auction.topBidder != address(0)) { if (auction.topBid >= auction.reservePrice) { uint256 protocolFeeValue = _calculateProtocolFees( auction.topBid ); payable(protocolFeeRecipient).transfer(protocolFeeValue); payable(auction.seller).transfer( auction.topBid.sub(protocolFeeValue) ); _transferAuctionAssets( _auctionId, address(this), auction.topBidder ); } else { // return funds to top bidder; payable(auction.topBidder).transfer(auction.topBid); // return assets to seller; _transferAssets( assets[_auctionId], address(this), auction.seller ); } } else { // return assets to seller _transferAuctionAssets(_auctionId, address(this), auction.seller); } auction.status = AuctionStatus.SETTLED; emit AuctionSettled( _auctionId, auction.seller, auction.topBidder, auction.topBid ); } /** * @dev Internal function to handle bulk transfer of ERC721 and ERC1155 assets * @param _auctionId ID of the auction assets are tied to * @param _from address where the assets are currently held (seller or this contract) * @param _to address where assets should be sent to (seller, buyer, or this contract) */ function _transferAuctionAssets( uint256 _auctionId, address _from, address _to ) internal { Asset[] memory _assets = assets[_auctionId]; _transferAssets(_assets, _from, _to); } function _transferAssets( Asset[] memory _assets, address _from, address _to ) internal { uint256 numAssets = _assets.length; for (uint256 i; i < numAssets; i++) { Asset memory _asset = _assets[i]; if ( IERC165(_asset.tokenAddress).supportsInterface( INTERFACE_ID_ERC1155 ) ) { IERC1155(_asset.tokenAddress).safeTransferFrom( _from, _to, _asset.tokenId, _asset.qty, "" ); } else if ( IERC165(_asset.tokenAddress).supportsInterface( INTERFACE_ID_ERC721 ) ) { IERC721(_asset.tokenAddress).safeTransferFrom( _from, _to, _asset.tokenId ); } } } function _calculateProtocolFees( uint256 amount ) internal view returns (uint256) { return ((protocolFee.mul(amount)).div(10000)); } function _calculatePenaltyFees( uint256 amount ) internal view returns (uint256) { return ((penaltyFee.mul(amount)).div(10000)); } function _extendAuction(uint256 _auctionId) internal { uint256 newEndDate = block.timestamp.add(5 minutes); auctions[_auctionId].endDate = Math.max( newEndDate, auctions[_auctionId].endDate ); } /** * ============================ View functions ========================== */ function getAuction( uint256 _auctionId ) public view returns (Auction memory) { Auction memory auction = auctions[_auctionId]; require( _auctionId > 0 && auction.id == _auctionId, "Auction does not exist" ); return auction; } function getHighestBid( uint256 _auctionId ) public view returns (uint256 bid, address bidder) { Auction memory auction = getAuction(_auctionId); require(_auctionId > 0 && auction.id != 0, "Auction does not exist"); return (auction.topBid, auction.topBidder); } function getAuctionAssets( uint256 _auctionId ) public view returns (Asset[] memory) { Auction memory auction = getAuction(_auctionId); require( _auctionId > 0 && auction.id == _auctionId, "Auction does not exist" ); return assets[_auctionId]; } /** * ============================ Admin only functions ========================== */ /** * @dev updates fee recipient address * @param _protocolFeeRecipient new few recipient address */ function updateProtocolFeeRecipient( address _protocolFeeRecipient ) external onlyOwner { require(_protocolFeeRecipient != address(0), "Cannot be null address"); protocolFeeRecipient = (_protocolFeeRecipient); } /** * @dev updates platform fee for settled auctions * @param _protocolFee percentage of fee 200 = 2% */ function updateProtocolFee(uint256 _protocolFee) external onlyOwner { protocolFee = _protocolFee; } /** * @dev updates penalty fee for canceled auctions * @param _penaltyFee 200 = 2% */ function updatePenaltyFee(uint256 _penaltyFee) external onlyOwner { penaltyFee = _penaltyFee; } /** * @dev toggles ability for auction creation * @param _allowListings if set to false nobody will be able to create auctions */ function toggleAllowListings(bool _allowListings) external onlyOwner { allowListings = _allowListings; } /** * @dev flips beta mode for auction creation * @param _beta if set to to true only wallets listed in the wallet registry can create auctions */ function toggleBeta(bool _beta) external onlyOwner { isBeta = _beta; } /** * @notice updates the maxLotSize * @dev this should be set low enough to ensure settlement and transfers of all assets stay well below the block limit * @param _maxLotSize max number of individual assets allowed to be included in an auction */ function updateMaxLotSize(uint256 _maxLotSize) external onlyOwner { maxLotSize = _maxLotSize; } /** * @notice updates the whitelist registry contract address pointer * @param _registry address of whitelist registry contract */ function updateWhitelistRegistry(address _registry) external onlyOwner { whitelistRegistry = _registry; } /** * @notice Reverts auction and returns bid funds to bidder and assets to seller. * @dev may be removed in the future. This should only be used in the rare instances where seller is intending to do something malicous or misleading * Example: Asset getting flagged by Opensea during the auction when bidders were expecting an unmarked asset. * @param _auctionId ID of auction */ function revertAuction( uint256 _auctionId ) external onlyOwner nonExpiredAuction(_auctionId) openAuction(_auctionId) { Auction storage auction = auctions[_auctionId]; if (auction.topBidder != address(0) && auction.topBid > 0) { payable(auction.topBidder).transfer(auction.topBid); } auction.status = AuctionStatus.CANCELLED; auction.endDate = block.timestamp; _transferAuctionAssets(_auctionId, address(this), auction.seller); emit AuctionReverted(_auctionId); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface IWhitelistRegistry { function addToWhitelist(address _whitelistee) external; function removeFromWhitelist(address _whitelistee) external; function bulkAddToWhitelist(address[] calldata _whitelistees) external; function bulkremoveFromWhitelist(address[] calldata _whitelistees) external; function checkWhitelistStatus(address _whitelistee) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; enum AuctionStatus { NONE, ACTIVE, SETTLED, CANCELLED } enum AuctionType { ABSOLUTE, EXTENDED } struct Asset { address tokenAddress; uint256 tokenId; uint256 qty; } struct Auction { uint256 id; uint256 startingPrice; uint256 reservePrice; uint256 minBidThreshold; address seller; uint256 startDate; uint256 endDate; uint256 topBid; address topBidder; AuctionStatus status; AuctionType auctionType; }
// 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 v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // 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 v4.4.1 (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol) pragma solidity ^0.8.0; import "./ERC1155Receiver.sol"; /** * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. * * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be * stuck. * * @dev _Available since v3.1._ */ contract ERC1155Holder is ERC1155Receiver { function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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. It 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)`. // We also know that `k`, the position of the most significant bit, is such that `msb(a) = 2**k`. // This gives `2**k < a <= 2**(k+1)` → `2**(k/2) <= sqrt(a) < 2 ** (k/2+1)`. // Using an algorithm similar to the msb conmputation, we are able to compute `result = 2**(k/2)` which is a // good first aproximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1; uint256 x = a; if (x >> 128 > 0) { x >>= 128; result <<= 64; } if (x >> 64 > 0) { x >>= 64; result <<= 32; } if (x >> 32 > 0) { x >>= 32; result <<= 16; } if (x >> 16 > 0) { x >>= 16; result <<= 8; } if (x >> 8 > 0) { x >>= 8; result <<= 4; } if (x >> 4 > 0) { x >>= 4; result <<= 2; } if (x >> 2 > 0) { result <<= 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) { uint256 result = sqrt(a); if (rounding == Rounding.Up && result * result < a) { result += 1; } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: 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 v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) pragma solidity ^0.8.0; import "../IERC1155Receiver.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
{ "optimizer": { "enabled": true, "runs": 10000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_protocolFeeRecipient","type":"address"},{"internalType":"address","name":"_whitelistRegistry","type":"address"},{"internalType":"uint256","name":"_protocolFee","type":"uint256"},{"internalType":"uint256","name":"_penaltyFee","type":"uint256"},{"internalType":"uint256","name":"_maxLotSize","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidBid","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"}],"name":"AuctionCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"}],"name":"AuctionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"}],"name":"AuctionReverted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"AuctionSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"}],"name":"AuctionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"bool","name":"reserveMet","type":"bool"}],"name":"BidCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"INTERFACE_ID_ERC1155","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INTERFACE_ID_ERC721","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowListings","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"assets","outputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"qty","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctions","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"startingPrice","type":"uint256"},{"internalType":"uint256","name":"reservePrice","type":"uint256"},{"internalType":"uint256","name":"minBidThreshold","type":"uint256"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"startDate","type":"uint256"},{"internalType":"uint256","name":"endDate","type":"uint256"},{"internalType":"uint256","name":"topBid","type":"uint256"},{"internalType":"address","name":"topBidder","type":"address"},{"internalType":"enum AuctionStatus","name":"status","type":"uint8"},{"internalType":"enum AuctionType","name":"auctionType","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"}],"name":"cancelAuction","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"},{"internalType":"uint256","name":"_reservePrice","type":"uint256"}],"name":"changeReservePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"qty","type":"uint256"}],"internalType":"struct Asset[]","name":"_assets","type":"tuple[]"},{"internalType":"uint256","name":"_startingPrice","type":"uint256"},{"internalType":"uint256","name":"_reservePrice","type":"uint256"},{"internalType":"uint256","name":"_minBidThreshold","type":"uint256"},{"internalType":"uint256","name":"_startDate","type":"uint256"},{"internalType":"uint256","name":"_endDate","type":"uint256"},{"internalType":"bool","name":"_isExtendedType","type":"bool"}],"name":"createAuction","outputs":[{"internalType":"uint256","name":"auctionId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"}],"name":"createBid","outputs":[{"internalType":"uint256","name":"bidId","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"}],"name":"getAuction","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"startingPrice","type":"uint256"},{"internalType":"uint256","name":"reservePrice","type":"uint256"},{"internalType":"uint256","name":"minBidThreshold","type":"uint256"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"startDate","type":"uint256"},{"internalType":"uint256","name":"endDate","type":"uint256"},{"internalType":"uint256","name":"topBid","type":"uint256"},{"internalType":"address","name":"topBidder","type":"address"},{"internalType":"enum AuctionStatus","name":"status","type":"uint8"},{"internalType":"enum AuctionType","name":"auctionType","type":"uint8"}],"internalType":"struct Auction","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"}],"name":"getAuctionAssets","outputs":[{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"qty","type":"uint256"}],"internalType":"struct Asset[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"}],"name":"getHighestBid","outputs":[{"internalType":"uint256","name":"bid","type":"uint256"},{"internalType":"address","name":"bidder","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"}],"name":"increaseBid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"isBeta","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxLotSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"penaltyFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"}],"name":"revertAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"}],"name":"settleAuction","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_allowListings","type":"bool"}],"name":"toggleAllowListings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_beta","type":"bool"}],"name":"toggleBeta","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalAuctionCount","outputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBidCount","outputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxLotSize","type":"uint256"}],"name":"updateMaxLotSize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_penaltyFee","type":"uint256"}],"name":"updatePenaltyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_protocolFee","type":"uint256"}],"name":"updateProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_protocolFeeRecipient","type":"address"}],"name":"updateProtocolFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"updateWhitelistRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526006805461ffff19166101001790553480156200002057600080fd5b506040516200360338038062003603833981016040819052620000439162000101565b6200004e3362000094565b60018055600280546001600160a01b039687166001600160a01b031991821617909155600b80549590961694169390931790935560035560049190915560055562000154565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000fc57600080fd5b919050565b600080600080600060a086880312156200011a57600080fd5b6200012586620000e4565b94506200013560208701620000e4565b6040870151606088015160809098015196999198509695945092505050565b61349f80620001646000396000f3fe60806040526004361061024e5760003560e01c8063715018a611610138578063bc197c81116100b0578063f1d3831e1161007f578063f2fde38b11610064578063f2fde38b146107fd578063faaf34151461081d578063fffda3581461083d57600080fd5b8063f1d3831e14610798578063f23a6e61146107b857600080fd5b8063bc197c81146106df578063bc6bc0cd14610724578063c68bf99f14610758578063d9ec787d1461077857600080fd5b80638f28864411610107578063a0ba1bbf116100ec578063a0ba1bbf14610682578063adc832e51461069c578063b0e21e8a146106c957600080fd5b80638f2886441461063257806396b5a7551461066f57600080fd5b8063715018a6146105bb57806378bd7935146105d05780637cbc6903146105fd5780638da5cb5b1461061457600080fd5b80634256dd78116101cb5780635c6bb69a1161019a57806364df049e1161017f57806364df049e14610551578063659dd2b4146105895780636ca1d96a1461059c57600080fd5b80635c6bb69a146104f657806364629fd11461053b57600080fd5b80634256dd78146103d457806356f0fe67146103f4578063571a26a0146104145780635c5e20b6146104d657600080fd5b8063188713fe116102225780632e993611116102075780632e9936111461037757806333bf61561461038a5780633dc10ad4146103be57600080fd5b8063188713fe146103375780631df47f801461035757600080fd5b806270c5371461025357806301ffc9a714610268578063150b7a021461029d5780631825df2114610312575b600080fd5b610266610261366004612c62565b61085d565b005b34801561027457600080fd5b50610288610283366004612c7b565b610acd565b60405190151581526020015b60405180910390f35b3480156102a957600080fd5b506102e16102b8366004612de5565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610294565b34801561031e57600080fd5b506009546103299081565b604051908152602001610294565b34801561034357600080fd5b50610266610352366004612e66565b610b66565b34801561036357600080fd5b50610266610372366004612e83565b610b9f565b610266610385366004612c62565b610c37565b34801561039657600080fd5b506102e17fd9b67a260000000000000000000000000000000000000000000000000000000081565b3480156103ca57600080fd5b5061032960045481565b3480156103e057600080fd5b506102666103ef366004612c62565b611009565b34801561040057600080fd5b5061026661040f366004612c62565b611016565b34801561042057600080fd5b506104bf61042f366004612c62565b600760208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701549787015460089097015495979496939592946001600160a01b03928316949193909281169060ff74010000000000000000000000000000000000000000820481169175010000000000000000000000000000000000000000009004168b565b6040516102949b9a99989796959493929190612ef1565b3480156104e257600080fd5b506102666104f1366004612c62565b611023565b34801561050257600080fd5b50610516610511366004612f67565b611224565b604080516001600160a01b039094168452602084019290925290820152606001610294565b34801561054757600080fd5b5061032960055481565b34801561055d57600080fd5b50600254610571906001600160a01b031681565b6040516001600160a01b039091168152602001610294565b610329610597366004612c62565b611270565b3480156105a857600080fd5b5060065461028890610100900460ff1681565b3480156105c757600080fd5b506102666116b9565b3480156105dc57600080fd5b506105f06105eb366004612c62565b6116cd565b6040516102949190612f89565b34801561060957600080fd5b50600a546103299081565b34801561062057600080fd5b506000546001600160a01b0316610571565b34801561063e57600080fd5b5061065261064d366004612c62565b611835565b604080519283526001600160a01b03909116602083015201610294565b61026661067d366004612c62565b6118b6565b34801561068e57600080fd5b506006546102889060ff1681565b3480156106a857600080fd5b506106bc6106b7366004612c62565b611cb1565b604051610294919061303a565b3480156106d557600080fd5b5061032960035481565b3480156106eb57600080fd5b506102e16106fa36600461311c565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b34801561073057600080fd5b506102e17f80ac58cd0000000000000000000000000000000000000000000000000000000081565b34801561076457600080fd5b506103296107733660046131c6565b611da6565b34801561078457600080fd5b50610266610793366004612f67565b612436565b3480156107a457600080fd5b506102666107b3366004612c62565b6125c9565b3480156107c457600080fd5b506102e16107d3366004613278565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b34801561080957600080fd5b50610266610818366004612e83565b6125d6565b34801561082957600080fd5b50610266610838366004612e83565b612666565b34801561084957600080fd5b50610266610858366004612e66565b6126a8565b600081815260076020526040902060088101546001600160a01b031633146108cc5760405162461bcd60e51b815260206004820152600e60248201527f4e6f7420746f702062696464657200000000000000000000000000000000000060448201526064015b60405180910390fd5b600034116109425760405162461bcd60e51b815260206004820152602560248201527f4e657720626964206d7573742062652067726561746572207468616e2070726560448201527f69766f757300000000000000000000000000000000000000000000000000000060648201526084016108c3565b6001600882015474010000000000000000000000000000000000000000900460ff16600381111561097557610975612e9e565b148015610986575042816006015410155b6109d25760405162461bcd60e51b815260206004820152601560248201527f41756374696f6e206973206e6f7420616374697665000000000000000000000060448201526064016108c3565b3415806109e25750806003015434105b15610a19576040517fc6388ef700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007810154610a2890346126e7565b6007820155600160088201547501000000000000000000000000000000000000000000900460ff166001811115610a6157610a61612e9e565b03610a6f57610a6f826126fa565b600481015460078201546002830154604080518381529190921160208201526001600160a01b0390921691339185917f824a725b632caa58558cb4cd5885ceb11db552889642f87009c94b72f4b8b7f2910160405180910390a45050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e0000000000000000000000000000000000000000000000000000000001480610b6057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b610b6e612741565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b610ba7612741565b6001600160a01b038116610bfd5760405162461bcd60e51b815260206004820152601660248201527f43616e6e6f74206265206e756c6c20616464726573730000000000000000000060448201526064016108c3565b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600260015403610c895760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c3565b60026001908155819060008281526007602052604090206008015474010000000000000000000000000000000000000000900460ff166003811115610cd057610cd0612e9e565b14610d1d5760405162461bcd60e51b815260206004820152601360248201527f41756374696f6e206973206e6f74206f70656e0000000000000000000000000060448201526064016108c3565b60008281526007602052604090206006015482904211610d7f5760405162461bcd60e51b815260206004820152601b60248201527f41756374696f6e20686173206e6f74206578706972656420796574000000000060448201526064016108c3565b600083815260076020526040902060088101546001600160a01b031615610f52578060020154816007015410610e68576000610dbe826007015461279b565b6002546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015610df9573d6000803e3d6000fd5b50600482015460078301546001600160a01b03909116906108fc90610e1e90846127be565b6040518115909202916000818181858888f19350505050158015610e46573d6000803e3d6000fd5b506008820154610e6290869030906001600160a01b03166127ca565b50610f6d565b600881015460078201546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015610ea8573d6000803e3d6000fd5b50610f4d60086000868152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610f34576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101610edf565b50505060048401543091506001600160a01b0316612862565b610f6d565b6004810154610f6d90859030906001600160a01b03166127ca565b600881018054740200000000000000000000000000000000000000007fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff821617909155600482015460078301546040519081526001600160a01b03928316929091169086907f3e25c3675d003af5184b628dd8bd4775b9b3abc7351c3574c90870ca25b55f119060200160405180910390a45050600180555050565b611011612741565b600355565b61101e612741565b600555565b61102b612741565b600081815260076020526040902060060154819042111561108e5760405162461bcd60e51b815260206004820152601760248201527f41756374696f6e20616c7265616479206578706972656400000000000000000060448201526064016108c3565b81600160008281526007602052604090206008015474010000000000000000000000000000000000000000900460ff1660038111156110cf576110cf612e9e565b1461111c5760405162461bcd60e51b815260206004820152601360248201527f41756374696f6e206973206e6f74206f70656e0000000000000000000000000060448201526064016108c3565b600083815260076020526040902060088101546001600160a01b03161580159061114a575060008160070154115b1561119157600881015460078201546040516001600160a01b039092169181156108fc0291906000818181858888f1935050505015801561118f573d6000803e3d6000fd5b505b6008810180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167403000000000000000000000000000000000000000017905542600682015560048101546111f390859030906001600160a01b03166127ca565b60405184907fb8abfcd4209fc846d8ed83173a29417997f59b03ae7dc2d8ca80ba569e24188590600090a250505050565b6008602052816000526040600020818154811061124057600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116935090915083565b60006002600154036112c45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c3565b60026001553332146113185760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742062652063616c6c656420627920636f6e74726163740000000060448201526064016108c3565b81600160008281526007602052604090206008015474010000000000000000000000000000000000000000900460ff16600381111561135957611359612e9e565b146113a65760405162461bcd60e51b815260206004820152601360248201527f41756374696f6e206973206e6f74206f70656e0000000000000000000000000060448201526064016108c3565b60008381526007602052604090206004015483906001600160a01b031633036114115760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f742062652063616c6c65642062792073656c6c657200000000000060448201526064016108c3565b60008481526007602052604090206006015484904211156114745760405162461bcd60e51b815260206004820152601760248201527f41756374696f6e20616c7265616479206578706972656400000000000000000060448201526064016108c3565b600085815260076020526040902060088101546001600160a01b03166114d75780600101543410156114d2576040517fc6388ef700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611588565b60038101541580156114ed575080600701543411155b15611524576040517fc6388ef700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000816003015411801561155157503461154f826003015483600701546126e790919063ffffffff16565b115b15611588576040517fc6388ef700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600281015460088201543491909111906001600160a01b0316156115e857600882015460078301546040516001600160a01b039092169181156108fc0291906000818181858888f193505050501580156115e6573d6000803e3d6000fd5b505b3460078301556008820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055600160088301547501000000000000000000000000000000000000000000900460ff16600181111561164e5761164e612e9e565b0361165c5761165c876126fa565b60048201546040805134815283151560208201526001600160a01b039092169133918a917f824a725b632caa58558cb4cd5885ceb11db552889642f87009c94b72f4b8b7f2910160405180910390a4505050506001805550919050565b6116c1612741565b6116cb6000612b32565b565b6116d5612be6565b600082815260076020818152604080842081516101608101835281548152600182015493810193909352600281015491830191909152600380820154606084015260048201546001600160a01b039081166080850152600583015460a0850152600683015460c08501529382015460e084015260088201549384166101008401529192909161012084019174010000000000000000000000000000000000000000900460ff169081111561178b5761178b612e9e565b600381111561179c5761179c612e9e565b81526020016008820160159054906101000a900460ff1660018111156117c4576117c4612e9e565b60018111156117d5576117d5612e9e565b905250905082158015906117e95750805183145b610b605760405162461bcd60e51b815260206004820152601660248201527f41756374696f6e20646f6573206e6f742065786973740000000000000000000060448201526064016108c3565b6000806000611843846116cd565b90506000841180156118555750805115155b6118a15760405162461bcd60e51b815260206004820152601660248201527f41756374696f6e20646f6573206e6f742065786973740000000000000000000060448201526064016108c3565b8060e001518161010001519250925050915091565b6002600154036119085760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c3565b600260015560008181526007602052604090206006015481904211156119705760405162461bcd60e51b815260206004820152601760248201527f41756374696f6e20616c7265616479206578706972656400000000000000000060448201526064016108c3565b81600160008281526007602052604090206008015474010000000000000000000000000000000000000000900460ff1660038111156119b1576119b1612e9e565b146119fe5760405162461bcd60e51b815260206004820152601360248201527f41756374696f6e206973206e6f74206f70656e0000000000000000000000000060448201526064016108c3565b60008381526007602052604090206004015483906001600160a01b03163314611a695760405162461bcd60e51b815260206004820152600a60248201527f4e6f742073656c6c65720000000000000000000000000000000000000000000060448201526064016108c3565b6000848152600760209081526040808320600883528184208054835181860281018601909452808452919493909190849084015b82821015611af2576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101611a9d565b5050505090506000611b078360070154612b9a565b60088401549091506001600160a01b031615801590611b2a575060008360070154115b15611c175780341015611b7f5760405162461bcd60e51b815260206004820152601560248201527f496e636f72726563742070656e616c747920666565000000000000000000000060448201526064016108c3565b600883015460078401546001600160a01b03909116906108fc90611ba49084906126e7565b6040518115909202916000818181858888f19350505050158015611bcc573d6000803e3d6000fd5b506000611bd934836127be565b1115611c1757336108fc611bed34846127be565b6040518115909202916000818181858888f19350505050158015611c15573d6000803e3d6000fd5b505b6008830180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740300000000000000000000000000000000000000001790554260068401556004830154611c7990839030906001600160a01b0316612862565b60405187907f2809c7e17bf978fbc7194c0a694b638c4215e9140cacc6c38ca36010b45697df90600090a25050600180555050505050565b60606000611cbe836116cd565b9050600083118015611cd05750805183145b611d1c5760405162461bcd60e51b815260206004820152601660248201527f41756374696f6e20646f6573206e6f742065786973740000000000000000000060448201526064016108c3565b600083815260086020908152604080832080548251818502810185019093528083529193909284015b82821015611d9a576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101611d45565b50505050915050919050565b600654600090610100900460ff161580611e465750600b546040517f178d4de50000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b039091169063178d4de590602401602060405180830381865afa158015611e1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4091906132dd565b15156001145b611e925760405162461bcd60e51b815260206004820152600f60248201527f4e6f742077686974656c6973746564000000000000000000000000000000000060448201526064016108c3565b333214611ee15760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742062652063616c6c656420627920636f6e74726163740000000060448201526064016108c3565b428311611f565760405162461bcd60e51b815260206004820152602a60248201527f41756374696f6e20656e6420646174652063616e6e6f7420626520736574206960448201527f6e2074686520706173740000000000000000000000000000000000000000000060648201526084016108c3565b838311611fa55760405162461bcd60e51b815260206004820181905260248201527f537461727420646174652067726561746572207468616e20656e64206461746560448201526064016108c3565b60065460ff16611ff75760405162461bcd60e51b815260206004820152601760248201527f41756374696f6e206372656174696f6e2070617573656400000000000000000060448201526064016108c3565b6005548811156120495760405162461bcd60e51b815260206004820152601560248201527f4d6178206c6f742073697a65206578636565646564000000000000000000000060448201526064016108c3565b60018810156120c05760405162461bcd60e51b815260206004820152602660248201527f41756374696f6e206d75737420636f6e7461696e74206174206c65617374203160448201527f206173736574000000000000000000000000000000000000000000000000000060648201526084016108c3565b6120ce600980546001019055565b5060095460005b888110156121b857368a8a838181106120f0576120f06132fa565b9050606002019050600060405180606001604052808360000160208101906121189190612e83565b6001600160a01b039081168252602085810135818401526040958601359286019290925260008781526008835285812080546001808201835591835291849020855160039093020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001692909316919091178255918301519181019190915592015160029092019190915550806121b081613358565b9150506120d5565b50604051806101600160405280828152602001888152602001878152602001868152602001336001600160a01b031681526020016121f68642612bb7565b81526020810185905260408101899052600060608201526080016001815260200183612223576000612226565b60015b600181111561223757612237612e9e565b905260008281526007602081815260409283902084518155908401516001820155918301516002830155606083015160038084019190915560808401516004840180547fffffffffffffffffffffffff00000000000000000000000000000000000000009081166001600160a01b039384161790915560a0860151600586015560c0860151600686015560e0860151938501939093556101008501516008850180549485169190921690811782556101208601519391927fffffffffffffffffffffff00000000000000000000000000000000000000000090921617907401000000000000000000000000000000000000000090849081111561233c5761233c612e9e565b02179055506101408201516008820180547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750100000000000000000000000000000000000000000083600181111561239857612398612e9e565b02179055509050506123fd8989808060200260200160405190810160405280939291908181526020016000905b828210156123f1576123e260608302860136819003810190613390565b815260200190600101906123c5565b50505050503330612862565b604051339082907f5d551e2a2cc977fd8c530317059b4f2d9f504fb82f7dfad736f8d56679bcdfd090600090a398975050505050505050565b60008281526007602052604090206004015482906001600160a01b031633146124a15760405162461bcd60e51b815260206004820152600a60248201527f4e6f742073656c6c65720000000000000000000000000000000000000000000060448201526064016108c3565b82600160008281526007602052604090206008015474010000000000000000000000000000000000000000900460ff1660038111156124e2576124e2612e9e565b1461252f5760405162461bcd60e51b815260206004820152601360248201527f41756374696f6e206973206e6f74206f70656e0000000000000000000000000060448201526064016108c3565b6000848152600760205260409020600281015484106125905760405162461bcd60e51b815260206004820152601a60248201527f4e6577207265736572766520707269636520746f6f206869676800000000000060448201526064016108c3565b6002810184905560405185907faed3e56ca017d9b02e523c2c7ba81ae5591f43f264dd5d603d70953a12d8079e90600090a25050505050565b6125d1612741565b600455565b6125de612741565b6001600160a01b03811661265a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016108c3565b61266381612b32565b50565b61266e612741565b600b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6126b0612741565b60068054911515610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909216919091179055565b60006126f382846133f1565b9392505050565b60006127084261012c6126e7565b600083815260076020526040902060060154909150612728908290612bb7565b6000928352600760205260409092206006019190915550565b6000546001600160a01b031633146116cb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108c3565b6000610b606127106127b884600354612bce90919063ffffffff16565b90612bda565b60006126f38284613404565b600083815260086020908152604080832080548251818502810185019093528083529192909190849084015b8282101561284b576000848152602090819020604080516060810182526003860290920180546001600160a01b03168352600180820154848601526002909101549183019190915290835290920191016127f6565b50505050905061285c818484612862565b50505050565b825160005b81811015612b2b576000858281518110612883576128836132fa565b602090810291909101015180516040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527fd9b67a260000000000000000000000000000000000000000000000000000000060048201529192506001600160a01b0316906301ffc9a790602401602060405180830381865afa15801561290f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293391906132dd565b156129e3578051602082015160408084015190517ff242432a0000000000000000000000000000000000000000000000000000000081526001600160a01b03898116600483015288811660248301526044820193909352606481019190915260a06084820152600060a482015291169063f242432a9060c401600060405180830381600087803b1580156129c657600080fd5b505af11580156129da573d6000803e3d6000fd5b50505050612b18565b80516040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f80ac58cd0000000000000000000000000000000000000000000000000000000060048201526001600160a01b03909116906301ffc9a790602401602060405180830381865afa158015612a63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a8791906132dd565b15612b1857805160208201516040517f42842e0e0000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152878116602483015260448201929092529116906342842e0e90606401600060405180830381600087803b158015612aff57600080fd5b505af1158015612b13573d6000803e3d6000fd5b505050505b5080612b2381613358565b915050612867565b5050505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610b606127106127b884600454612bce90919063ffffffff16565b600081831015612bc757816126f3565b5090919050565b60006126f38284613417565b60006126f3828461342e565b6040518061016001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006003811115612c5657612c56612e9e565b81526020016000905290565b600060208284031215612c7457600080fd5b5035919050565b600060208284031215612c8d57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146126f357600080fd5b80356001600160a01b0381168114612cd457600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612d4f57612d4f612cd9565b604052919050565b600082601f830112612d6857600080fd5b813567ffffffffffffffff811115612d8257612d82612cd9565b612db360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612d08565b818152846020838601011115612dc857600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215612dfb57600080fd5b612e0485612cbd565b9350612e1260208601612cbd565b925060408501359150606085013567ffffffffffffffff811115612e3557600080fd5b612e4187828801612d57565b91505092959194509250565b801515811461266357600080fd5b8035612cd481612e4d565b600060208284031215612e7857600080fd5b81356126f381612e4d565b600060208284031215612e9557600080fd5b6126f382612cbd565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110612edd57612edd612e9e565b9052565b60028110612edd57612edd612e9e565b6000610160820190508c82528b60208301528a60408301528960608301526001600160a01b03808a1660808401528860a08401528760c08401528660e084015280861661010084015250612f49610120830185612ecd565b612f57610140830184612ee1565b9c9b505050505050505050505050565b60008060408385031215612f7a57600080fd5b50508035926020909101359150565b600061016082019050825182526020830151602083015260408301516040830152606083015160608301526080830151612fce60808401826001600160a01b03169052565b5060a083015160a083015260c083015160c083015260e083015160e083015261010080840151613008828501826001600160a01b03169052565b50506101208084015161301d82850182612ecd565b50506101408084015161303282850182612ee1565b505092915050565b602080825282518282018190526000919060409081850190868401855b8281101561308f57815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101613057565b5091979650505050505050565b600082601f8301126130ad57600080fd5b8135602067ffffffffffffffff8211156130c9576130c9612cd9565b8160051b6130d8828201612d08565b92835284810182019282810190878511156130f257600080fd5b83870192505b84831015613111578235825291830191908301906130f8565b979650505050505050565b600080600080600060a0868803121561313457600080fd5b61313d86612cbd565b945061314b60208701612cbd565b9350604086013567ffffffffffffffff8082111561316857600080fd5b61317489838a0161309c565b9450606088013591508082111561318a57600080fd5b61319689838a0161309c565b935060808801359150808211156131ac57600080fd5b506131b988828901612d57565b9150509295509295909350565b60008060008060008060008060e0898b0312156131e257600080fd5b883567ffffffffffffffff808211156131fa57600080fd5b818b0191508b601f83011261320e57600080fd5b81358181111561321d57600080fd5b8c602060608302850101111561323257600080fd5b60209283019a50985050890135955060408901359450606089013593506080890135925060a0890135915061326960c08a01612e5b565b90509295985092959890939650565b600080600080600060a0868803121561329057600080fd5b61329986612cbd565b94506132a760208701612cbd565b93506040860135925060608601359150608086013567ffffffffffffffff8111156132d157600080fd5b6131b988828901612d57565b6000602082840312156132ef57600080fd5b81516126f381612e4d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361338957613389613329565b5060010190565b6000606082840312156133a257600080fd5b6040516060810181811067ffffffffffffffff821117156133c5576133c5612cd9565b6040526133d183612cbd565b815260208301356020820152604083013560408201528091505092915050565b80820180821115610b6057610b60613329565b81810381811115610b6057610b60613329565b8082028115828204841417610b6057610b60613329565b600082613464577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea26469706673582212203797aa75f12a286016aa93eccae4a1a18da2d1834a4b3518e246e9e6cb883a1864736f6c63430008110033000000000000000000000000af5d6f971f26480f74384daec727d621ce55f6bd00000000000000000000000040a400a1a2910adf18ad28629ed8f629a86be5f8000000000000000000000000000000000000000000000000000000000000012c00000000000000000000000000000000000000000000000000000000000000960000000000000000000000000000000000000000000000000000000000000014
Deployed Bytecode
0x60806040526004361061024e5760003560e01c8063715018a611610138578063bc197c81116100b0578063f1d3831e1161007f578063f2fde38b11610064578063f2fde38b146107fd578063faaf34151461081d578063fffda3581461083d57600080fd5b8063f1d3831e14610798578063f23a6e61146107b857600080fd5b8063bc197c81146106df578063bc6bc0cd14610724578063c68bf99f14610758578063d9ec787d1461077857600080fd5b80638f28864411610107578063a0ba1bbf116100ec578063a0ba1bbf14610682578063adc832e51461069c578063b0e21e8a146106c957600080fd5b80638f2886441461063257806396b5a7551461066f57600080fd5b8063715018a6146105bb57806378bd7935146105d05780637cbc6903146105fd5780638da5cb5b1461061457600080fd5b80634256dd78116101cb5780635c6bb69a1161019a57806364df049e1161017f57806364df049e14610551578063659dd2b4146105895780636ca1d96a1461059c57600080fd5b80635c6bb69a146104f657806364629fd11461053b57600080fd5b80634256dd78146103d457806356f0fe67146103f4578063571a26a0146104145780635c5e20b6146104d657600080fd5b8063188713fe116102225780632e993611116102075780632e9936111461037757806333bf61561461038a5780633dc10ad4146103be57600080fd5b8063188713fe146103375780631df47f801461035757600080fd5b806270c5371461025357806301ffc9a714610268578063150b7a021461029d5780631825df2114610312575b600080fd5b610266610261366004612c62565b61085d565b005b34801561027457600080fd5b50610288610283366004612c7b565b610acd565b60405190151581526020015b60405180910390f35b3480156102a957600080fd5b506102e16102b8366004612de5565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610294565b34801561031e57600080fd5b506009546103299081565b604051908152602001610294565b34801561034357600080fd5b50610266610352366004612e66565b610b66565b34801561036357600080fd5b50610266610372366004612e83565b610b9f565b610266610385366004612c62565b610c37565b34801561039657600080fd5b506102e17fd9b67a260000000000000000000000000000000000000000000000000000000081565b3480156103ca57600080fd5b5061032960045481565b3480156103e057600080fd5b506102666103ef366004612c62565b611009565b34801561040057600080fd5b5061026661040f366004612c62565b611016565b34801561042057600080fd5b506104bf61042f366004612c62565b600760208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701549787015460089097015495979496939592946001600160a01b03928316949193909281169060ff74010000000000000000000000000000000000000000820481169175010000000000000000000000000000000000000000009004168b565b6040516102949b9a99989796959493929190612ef1565b3480156104e257600080fd5b506102666104f1366004612c62565b611023565b34801561050257600080fd5b50610516610511366004612f67565b611224565b604080516001600160a01b039094168452602084019290925290820152606001610294565b34801561054757600080fd5b5061032960055481565b34801561055d57600080fd5b50600254610571906001600160a01b031681565b6040516001600160a01b039091168152602001610294565b610329610597366004612c62565b611270565b3480156105a857600080fd5b5060065461028890610100900460ff1681565b3480156105c757600080fd5b506102666116b9565b3480156105dc57600080fd5b506105f06105eb366004612c62565b6116cd565b6040516102949190612f89565b34801561060957600080fd5b50600a546103299081565b34801561062057600080fd5b506000546001600160a01b0316610571565b34801561063e57600080fd5b5061065261064d366004612c62565b611835565b604080519283526001600160a01b03909116602083015201610294565b61026661067d366004612c62565b6118b6565b34801561068e57600080fd5b506006546102889060ff1681565b3480156106a857600080fd5b506106bc6106b7366004612c62565b611cb1565b604051610294919061303a565b3480156106d557600080fd5b5061032960035481565b3480156106eb57600080fd5b506102e16106fa36600461311c565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b34801561073057600080fd5b506102e17f80ac58cd0000000000000000000000000000000000000000000000000000000081565b34801561076457600080fd5b506103296107733660046131c6565b611da6565b34801561078457600080fd5b50610266610793366004612f67565b612436565b3480156107a457600080fd5b506102666107b3366004612c62565b6125c9565b3480156107c457600080fd5b506102e16107d3366004613278565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b34801561080957600080fd5b50610266610818366004612e83565b6125d6565b34801561082957600080fd5b50610266610838366004612e83565b612666565b34801561084957600080fd5b50610266610858366004612e66565b6126a8565b600081815260076020526040902060088101546001600160a01b031633146108cc5760405162461bcd60e51b815260206004820152600e60248201527f4e6f7420746f702062696464657200000000000000000000000000000000000060448201526064015b60405180910390fd5b600034116109425760405162461bcd60e51b815260206004820152602560248201527f4e657720626964206d7573742062652067726561746572207468616e2070726560448201527f69766f757300000000000000000000000000000000000000000000000000000060648201526084016108c3565b6001600882015474010000000000000000000000000000000000000000900460ff16600381111561097557610975612e9e565b148015610986575042816006015410155b6109d25760405162461bcd60e51b815260206004820152601560248201527f41756374696f6e206973206e6f7420616374697665000000000000000000000060448201526064016108c3565b3415806109e25750806003015434105b15610a19576040517fc6388ef700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6007810154610a2890346126e7565b6007820155600160088201547501000000000000000000000000000000000000000000900460ff166001811115610a6157610a61612e9e565b03610a6f57610a6f826126fa565b600481015460078201546002830154604080518381529190921160208201526001600160a01b0390921691339185917f824a725b632caa58558cb4cd5885ceb11db552889642f87009c94b72f4b8b7f2910160405180910390a45050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e0000000000000000000000000000000000000000000000000000000001480610b6057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b610b6e612741565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b610ba7612741565b6001600160a01b038116610bfd5760405162461bcd60e51b815260206004820152601660248201527f43616e6e6f74206265206e756c6c20616464726573730000000000000000000060448201526064016108c3565b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600260015403610c895760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c3565b60026001908155819060008281526007602052604090206008015474010000000000000000000000000000000000000000900460ff166003811115610cd057610cd0612e9e565b14610d1d5760405162461bcd60e51b815260206004820152601360248201527f41756374696f6e206973206e6f74206f70656e0000000000000000000000000060448201526064016108c3565b60008281526007602052604090206006015482904211610d7f5760405162461bcd60e51b815260206004820152601b60248201527f41756374696f6e20686173206e6f74206578706972656420796574000000000060448201526064016108c3565b600083815260076020526040902060088101546001600160a01b031615610f52578060020154816007015410610e68576000610dbe826007015461279b565b6002546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015610df9573d6000803e3d6000fd5b50600482015460078301546001600160a01b03909116906108fc90610e1e90846127be565b6040518115909202916000818181858888f19350505050158015610e46573d6000803e3d6000fd5b506008820154610e6290869030906001600160a01b03166127ca565b50610f6d565b600881015460078201546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015610ea8573d6000803e3d6000fd5b50610f4d60086000868152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610f34576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101610edf565b50505060048401543091506001600160a01b0316612862565b610f6d565b6004810154610f6d90859030906001600160a01b03166127ca565b600881018054740200000000000000000000000000000000000000007fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff821617909155600482015460078301546040519081526001600160a01b03928316929091169086907f3e25c3675d003af5184b628dd8bd4775b9b3abc7351c3574c90870ca25b55f119060200160405180910390a45050600180555050565b611011612741565b600355565b61101e612741565b600555565b61102b612741565b600081815260076020526040902060060154819042111561108e5760405162461bcd60e51b815260206004820152601760248201527f41756374696f6e20616c7265616479206578706972656400000000000000000060448201526064016108c3565b81600160008281526007602052604090206008015474010000000000000000000000000000000000000000900460ff1660038111156110cf576110cf612e9e565b1461111c5760405162461bcd60e51b815260206004820152601360248201527f41756374696f6e206973206e6f74206f70656e0000000000000000000000000060448201526064016108c3565b600083815260076020526040902060088101546001600160a01b03161580159061114a575060008160070154115b1561119157600881015460078201546040516001600160a01b039092169181156108fc0291906000818181858888f1935050505015801561118f573d6000803e3d6000fd5b505b6008810180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167403000000000000000000000000000000000000000017905542600682015560048101546111f390859030906001600160a01b03166127ca565b60405184907fb8abfcd4209fc846d8ed83173a29417997f59b03ae7dc2d8ca80ba569e24188590600090a250505050565b6008602052816000526040600020818154811061124057600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116935090915083565b60006002600154036112c45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c3565b60026001553332146113185760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742062652063616c6c656420627920636f6e74726163740000000060448201526064016108c3565b81600160008281526007602052604090206008015474010000000000000000000000000000000000000000900460ff16600381111561135957611359612e9e565b146113a65760405162461bcd60e51b815260206004820152601360248201527f41756374696f6e206973206e6f74206f70656e0000000000000000000000000060448201526064016108c3565b60008381526007602052604090206004015483906001600160a01b031633036114115760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f742062652063616c6c65642062792073656c6c657200000000000060448201526064016108c3565b60008481526007602052604090206006015484904211156114745760405162461bcd60e51b815260206004820152601760248201527f41756374696f6e20616c7265616479206578706972656400000000000000000060448201526064016108c3565b600085815260076020526040902060088101546001600160a01b03166114d75780600101543410156114d2576040517fc6388ef700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611588565b60038101541580156114ed575080600701543411155b15611524576040517fc6388ef700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000816003015411801561155157503461154f826003015483600701546126e790919063ffffffff16565b115b15611588576040517fc6388ef700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600281015460088201543491909111906001600160a01b0316156115e857600882015460078301546040516001600160a01b039092169181156108fc0291906000818181858888f193505050501580156115e6573d6000803e3d6000fd5b505b3460078301556008820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055600160088301547501000000000000000000000000000000000000000000900460ff16600181111561164e5761164e612e9e565b0361165c5761165c876126fa565b60048201546040805134815283151560208201526001600160a01b039092169133918a917f824a725b632caa58558cb4cd5885ceb11db552889642f87009c94b72f4b8b7f2910160405180910390a4505050506001805550919050565b6116c1612741565b6116cb6000612b32565b565b6116d5612be6565b600082815260076020818152604080842081516101608101835281548152600182015493810193909352600281015491830191909152600380820154606084015260048201546001600160a01b039081166080850152600583015460a0850152600683015460c08501529382015460e084015260088201549384166101008401529192909161012084019174010000000000000000000000000000000000000000900460ff169081111561178b5761178b612e9e565b600381111561179c5761179c612e9e565b81526020016008820160159054906101000a900460ff1660018111156117c4576117c4612e9e565b60018111156117d5576117d5612e9e565b905250905082158015906117e95750805183145b610b605760405162461bcd60e51b815260206004820152601660248201527f41756374696f6e20646f6573206e6f742065786973740000000000000000000060448201526064016108c3565b6000806000611843846116cd565b90506000841180156118555750805115155b6118a15760405162461bcd60e51b815260206004820152601660248201527f41756374696f6e20646f6573206e6f742065786973740000000000000000000060448201526064016108c3565b8060e001518161010001519250925050915091565b6002600154036119085760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c3565b600260015560008181526007602052604090206006015481904211156119705760405162461bcd60e51b815260206004820152601760248201527f41756374696f6e20616c7265616479206578706972656400000000000000000060448201526064016108c3565b81600160008281526007602052604090206008015474010000000000000000000000000000000000000000900460ff1660038111156119b1576119b1612e9e565b146119fe5760405162461bcd60e51b815260206004820152601360248201527f41756374696f6e206973206e6f74206f70656e0000000000000000000000000060448201526064016108c3565b60008381526007602052604090206004015483906001600160a01b03163314611a695760405162461bcd60e51b815260206004820152600a60248201527f4e6f742073656c6c65720000000000000000000000000000000000000000000060448201526064016108c3565b6000848152600760209081526040808320600883528184208054835181860281018601909452808452919493909190849084015b82821015611af2576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101611a9d565b5050505090506000611b078360070154612b9a565b60088401549091506001600160a01b031615801590611b2a575060008360070154115b15611c175780341015611b7f5760405162461bcd60e51b815260206004820152601560248201527f496e636f72726563742070656e616c747920666565000000000000000000000060448201526064016108c3565b600883015460078401546001600160a01b03909116906108fc90611ba49084906126e7565b6040518115909202916000818181858888f19350505050158015611bcc573d6000803e3d6000fd5b506000611bd934836127be565b1115611c1757336108fc611bed34846127be565b6040518115909202916000818181858888f19350505050158015611c15573d6000803e3d6000fd5b505b6008830180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740300000000000000000000000000000000000000001790554260068401556004830154611c7990839030906001600160a01b0316612862565b60405187907f2809c7e17bf978fbc7194c0a694b638c4215e9140cacc6c38ca36010b45697df90600090a25050600180555050505050565b60606000611cbe836116cd565b9050600083118015611cd05750805183145b611d1c5760405162461bcd60e51b815260206004820152601660248201527f41756374696f6e20646f6573206e6f742065786973740000000000000000000060448201526064016108c3565b600083815260086020908152604080832080548251818502810185019093528083529193909284015b82821015611d9a576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101611d45565b50505050915050919050565b600654600090610100900460ff161580611e465750600b546040517f178d4de50000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b039091169063178d4de590602401602060405180830381865afa158015611e1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4091906132dd565b15156001145b611e925760405162461bcd60e51b815260206004820152600f60248201527f4e6f742077686974656c6973746564000000000000000000000000000000000060448201526064016108c3565b333214611ee15760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742062652063616c6c656420627920636f6e74726163740000000060448201526064016108c3565b428311611f565760405162461bcd60e51b815260206004820152602a60248201527f41756374696f6e20656e6420646174652063616e6e6f7420626520736574206960448201527f6e2074686520706173740000000000000000000000000000000000000000000060648201526084016108c3565b838311611fa55760405162461bcd60e51b815260206004820181905260248201527f537461727420646174652067726561746572207468616e20656e64206461746560448201526064016108c3565b60065460ff16611ff75760405162461bcd60e51b815260206004820152601760248201527f41756374696f6e206372656174696f6e2070617573656400000000000000000060448201526064016108c3565b6005548811156120495760405162461bcd60e51b815260206004820152601560248201527f4d6178206c6f742073697a65206578636565646564000000000000000000000060448201526064016108c3565b60018810156120c05760405162461bcd60e51b815260206004820152602660248201527f41756374696f6e206d75737420636f6e7461696e74206174206c65617374203160448201527f206173736574000000000000000000000000000000000000000000000000000060648201526084016108c3565b6120ce600980546001019055565b5060095460005b888110156121b857368a8a838181106120f0576120f06132fa565b9050606002019050600060405180606001604052808360000160208101906121189190612e83565b6001600160a01b039081168252602085810135818401526040958601359286019290925260008781526008835285812080546001808201835591835291849020855160039093020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001692909316919091178255918301519181019190915592015160029092019190915550806121b081613358565b9150506120d5565b50604051806101600160405280828152602001888152602001878152602001868152602001336001600160a01b031681526020016121f68642612bb7565b81526020810185905260408101899052600060608201526080016001815260200183612223576000612226565b60015b600181111561223757612237612e9e565b905260008281526007602081815260409283902084518155908401516001820155918301516002830155606083015160038084019190915560808401516004840180547fffffffffffffffffffffffff00000000000000000000000000000000000000009081166001600160a01b039384161790915560a0860151600586015560c0860151600686015560e0860151938501939093556101008501516008850180549485169190921690811782556101208601519391927fffffffffffffffffffffff00000000000000000000000000000000000000000090921617907401000000000000000000000000000000000000000090849081111561233c5761233c612e9e565b02179055506101408201516008820180547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16750100000000000000000000000000000000000000000083600181111561239857612398612e9e565b02179055509050506123fd8989808060200260200160405190810160405280939291908181526020016000905b828210156123f1576123e260608302860136819003810190613390565b815260200190600101906123c5565b50505050503330612862565b604051339082907f5d551e2a2cc977fd8c530317059b4f2d9f504fb82f7dfad736f8d56679bcdfd090600090a398975050505050505050565b60008281526007602052604090206004015482906001600160a01b031633146124a15760405162461bcd60e51b815260206004820152600a60248201527f4e6f742073656c6c65720000000000000000000000000000000000000000000060448201526064016108c3565b82600160008281526007602052604090206008015474010000000000000000000000000000000000000000900460ff1660038111156124e2576124e2612e9e565b1461252f5760405162461bcd60e51b815260206004820152601360248201527f41756374696f6e206973206e6f74206f70656e0000000000000000000000000060448201526064016108c3565b6000848152600760205260409020600281015484106125905760405162461bcd60e51b815260206004820152601a60248201527f4e6577207265736572766520707269636520746f6f206869676800000000000060448201526064016108c3565b6002810184905560405185907faed3e56ca017d9b02e523c2c7ba81ae5591f43f264dd5d603d70953a12d8079e90600090a25050505050565b6125d1612741565b600455565b6125de612741565b6001600160a01b03811661265a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016108c3565b61266381612b32565b50565b61266e612741565b600b80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6126b0612741565b60068054911515610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909216919091179055565b60006126f382846133f1565b9392505050565b60006127084261012c6126e7565b600083815260076020526040902060060154909150612728908290612bb7565b6000928352600760205260409092206006019190915550565b6000546001600160a01b031633146116cb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108c3565b6000610b606127106127b884600354612bce90919063ffffffff16565b90612bda565b60006126f38284613404565b600083815260086020908152604080832080548251818502810185019093528083529192909190849084015b8282101561284b576000848152602090819020604080516060810182526003860290920180546001600160a01b03168352600180820154848601526002909101549183019190915290835290920191016127f6565b50505050905061285c818484612862565b50505050565b825160005b81811015612b2b576000858281518110612883576128836132fa565b602090810291909101015180516040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527fd9b67a260000000000000000000000000000000000000000000000000000000060048201529192506001600160a01b0316906301ffc9a790602401602060405180830381865afa15801561290f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293391906132dd565b156129e3578051602082015160408084015190517ff242432a0000000000000000000000000000000000000000000000000000000081526001600160a01b03898116600483015288811660248301526044820193909352606481019190915260a06084820152600060a482015291169063f242432a9060c401600060405180830381600087803b1580156129c657600080fd5b505af11580156129da573d6000803e3d6000fd5b50505050612b18565b80516040517f01ffc9a70000000000000000000000000000000000000000000000000000000081527f80ac58cd0000000000000000000000000000000000000000000000000000000060048201526001600160a01b03909116906301ffc9a790602401602060405180830381865afa158015612a63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a8791906132dd565b15612b1857805160208201516040517f42842e0e0000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152878116602483015260448201929092529116906342842e0e90606401600060405180830381600087803b158015612aff57600080fd5b505af1158015612b13573d6000803e3d6000fd5b505050505b5080612b2381613358565b915050612867565b5050505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610b606127106127b884600454612bce90919063ffffffff16565b600081831015612bc757816126f3565b5090919050565b60006126f38284613417565b60006126f3828461342e565b6040518061016001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006003811115612c5657612c56612e9e565b81526020016000905290565b600060208284031215612c7457600080fd5b5035919050565b600060208284031215612c8d57600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146126f357600080fd5b80356001600160a01b0381168114612cd457600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612d4f57612d4f612cd9565b604052919050565b600082601f830112612d6857600080fd5b813567ffffffffffffffff811115612d8257612d82612cd9565b612db360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612d08565b818152846020838601011115612dc857600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215612dfb57600080fd5b612e0485612cbd565b9350612e1260208601612cbd565b925060408501359150606085013567ffffffffffffffff811115612e3557600080fd5b612e4187828801612d57565b91505092959194509250565b801515811461266357600080fd5b8035612cd481612e4d565b600060208284031215612e7857600080fd5b81356126f381612e4d565b600060208284031215612e9557600080fd5b6126f382612cbd565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110612edd57612edd612e9e565b9052565b60028110612edd57612edd612e9e565b6000610160820190508c82528b60208301528a60408301528960608301526001600160a01b03808a1660808401528860a08401528760c08401528660e084015280861661010084015250612f49610120830185612ecd565b612f57610140830184612ee1565b9c9b505050505050505050505050565b60008060408385031215612f7a57600080fd5b50508035926020909101359150565b600061016082019050825182526020830151602083015260408301516040830152606083015160608301526080830151612fce60808401826001600160a01b03169052565b5060a083015160a083015260c083015160c083015260e083015160e083015261010080840151613008828501826001600160a01b03169052565b50506101208084015161301d82850182612ecd565b50506101408084015161303282850182612ee1565b505092915050565b602080825282518282018190526000919060409081850190868401855b8281101561308f57815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101613057565b5091979650505050505050565b600082601f8301126130ad57600080fd5b8135602067ffffffffffffffff8211156130c9576130c9612cd9565b8160051b6130d8828201612d08565b92835284810182019282810190878511156130f257600080fd5b83870192505b84831015613111578235825291830191908301906130f8565b979650505050505050565b600080600080600060a0868803121561313457600080fd5b61313d86612cbd565b945061314b60208701612cbd565b9350604086013567ffffffffffffffff8082111561316857600080fd5b61317489838a0161309c565b9450606088013591508082111561318a57600080fd5b61319689838a0161309c565b935060808801359150808211156131ac57600080fd5b506131b988828901612d57565b9150509295509295909350565b60008060008060008060008060e0898b0312156131e257600080fd5b883567ffffffffffffffff808211156131fa57600080fd5b818b0191508b601f83011261320e57600080fd5b81358181111561321d57600080fd5b8c602060608302850101111561323257600080fd5b60209283019a50985050890135955060408901359450606089013593506080890135925060a0890135915061326960c08a01612e5b565b90509295985092959890939650565b600080600080600060a0868803121561329057600080fd5b61329986612cbd565b94506132a760208701612cbd565b93506040860135925060608601359150608086013567ffffffffffffffff8111156132d157600080fd5b6131b988828901612d57565b6000602082840312156132ef57600080fd5b81516126f381612e4d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361338957613389613329565b5060010190565b6000606082840312156133a257600080fd5b6040516060810181811067ffffffffffffffff821117156133c5576133c5612cd9565b6040526133d183612cbd565b815260208301356020820152604083013560408201528091505092915050565b80820180821115610b6057610b60613329565b81810381811115610b6057610b60613329565b8082028115828204841417610b6057610b60613329565b600082613464577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b50049056fea26469706673582212203797aa75f12a286016aa93eccae4a1a18da2d1834a4b3518e246e9e6cb883a1864736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000af5d6f971f26480f74384daec727d621ce55f6bd00000000000000000000000040a400a1a2910adf18ad28629ed8f629a86be5f8000000000000000000000000000000000000000000000000000000000000012c00000000000000000000000000000000000000000000000000000000000000960000000000000000000000000000000000000000000000000000000000000014
-----Decoded View---------------
Arg [0] : _protocolFeeRecipient (address): 0xAf5D6f971f26480F74384daec727d621CE55f6Bd
Arg [1] : _whitelistRegistry (address): 0x40a400a1a2910adf18ad28629eD8F629A86BE5f8
Arg [2] : _protocolFee (uint256): 300
Arg [3] : _penaltyFee (uint256): 150
Arg [4] : _maxLotSize (uint256): 20
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000af5d6f971f26480f74384daec727d621ce55f6bd
Arg [1] : 00000000000000000000000040a400a1a2910adf18ad28629ed8f629a86be5f8
Arg [2] : 000000000000000000000000000000000000000000000000000000000000012c
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000096
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000014
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.