ETH Price: $2,576.06 (-2.33%)

Contract

0x46852869902d9F8A4D76195fC23Add15d921aBd9
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Grant Role204704752024-08-06 15:38:2314 days ago1722958703IN
0x46852869...5d921aBd9
0 ETH0.000687018.71755319
Grant Role203337352024-07-18 13:34:2333 days ago1721309663IN
0x46852869...5d921aBd9
0 ETH0.0010485313.30495809
Grant Role198139382024-05-06 22:11:23106 days ago1715033483IN
0x46852869...5d921aBd9
0 ETH0.000481016.10358511
Grant Role198138132024-05-06 21:46:11106 days ago1715031971IN
0x46852869...5d921aBd9
0 ETH0.000483866.13978099
Grant Role198076402024-05-06 1:02:23106 days ago1714957343IN
0x46852869...5d921aBd9
0 ETH0.00046475.89662112
Grant Role189490922024-01-06 15:38:47227 days ago1704555527IN
0x46852869...5d921aBd9
0 ETH0.0019968625.33831093
Grant Role189355062024-01-04 17:39:47229 days ago1704389987IN
0x46852869...5d921aBd9
0 ETH0.0022622528.70594958
Grant Role184462262023-10-28 4:09:59297 days ago1698466199IN
0x46852869...5d921aBd9
0 ETH0.0008961211.37104466
Grant Role182927412023-10-06 16:46:35319 days ago1696610795IN
0x46852869...5d921aBd9
0 ETH0.0010670613.54006927
Grant Role182429912023-09-29 17:54:47326 days ago1696010087IN
0x46852869...5d921aBd9
0 ETH0.0008628310.94856184
Grant Role179170212023-08-15 1:39:23371 days ago1692063563IN
0x46852869...5d921aBd9
0 ETH0.0011866615.05991141
Cancel Auction178754972023-08-09 6:15:59377 days ago1691561759IN
0x46852869...5d921aBd9
0 ETH0.0012482814.17126369
Cancel Auction178754942023-08-09 6:15:23377 days ago1691561723IN
0x46852869...5d921aBd9
0 ETH0.0010998812.48647556
Cancel Auction178754682023-08-09 6:09:59377 days ago1691561399IN
0x46852869...5d921aBd9
0 ETH0.0013802613.56313741
Cancel Auction176502642023-07-08 16:34:23409 days ago1688834063IN
0x46852869...5d921aBd9
0 ETH0.0020898923.72562948
Grant Role176416982023-07-07 11:42:23410 days ago1688730143IN
0x46852869...5d921aBd9
0 ETH0.0017578122.30503165
Cancel Auction173455272023-05-26 20:04:47452 days ago1685131487IN
0x46852869...5d921aBd9
0 ETH0.0047414146.59132519
Cancel Auction173223222023-05-23 13:46:59455 days ago1684849619IN
0x46852869...5d921aBd9
0 ETH0.0040256245.70107362
Cancel Auction173223192023-05-23 13:46:23455 days ago1684849583IN
0x46852869...5d921aBd9
0 ETH0.0040456645.92862234
Cancel Auction173223092023-05-23 13:44:23455 days ago1684849463IN
0x46852869...5d921aBd9
0 ETH0.004282742.08387652
Grant Role172060462023-05-07 3:37:35471 days ago1683430655IN
0x46852869...5d921aBd9
0 ETH0.00884364112.21755661
Grant Role171597502023-04-30 15:27:11478 days ago1682868431IN
0x46852869...5d921aBd9
0 ETH0.0049259562.50574015
Grant Role171315122023-04-26 16:11:47482 days ago1682525507IN
0x46852869...5d921aBd9
0 ETH0.0035675745.26922891
Cancel Auction170454962023-04-14 12:45:47494 days ago1681476347IN
0x46852869...5d921aBd9
0 ETH0.0024865724.43421679
Grant Role169198152023-03-27 16:09:35512 days ago1679933375IN
0x46852869...5d921aBd9
0 ETH0.0039878350.60194959
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
163025752022-12-31 5:12:11598 days ago1672463531
0x46852869...5d921aBd9
0.95 ETH
163025752022-12-31 5:12:11598 days ago1672463531
0x46852869...5d921aBd9
0.08 ETH
162446612022-12-23 3:15:11606 days ago1671765311
0x46852869...5d921aBd9
0.76 ETH
162446612022-12-23 3:15:11606 days ago1671765311
0x46852869...5d921aBd9
0.064 ETH
157235742022-10-11 8:08:11679 days ago1665475691
0x46852869...5d921aBd9
0.95 ETH
157235742022-10-11 8:08:11679 days ago1665475691
0x46852869...5d921aBd9
0.08 ETH
156049702022-09-24 18:19:47696 days ago1664043587
0x46852869...5d921aBd9
0.7125 ETH
156049702022-09-24 18:19:47696 days ago1664043587
0x46852869...5d921aBd9
0.06 ETH
153446222022-08-15 7:08:44736 days ago1660547324
0x46852869...5d921aBd9
2.147 ETH
153446222022-08-15 7:08:44736 days ago1660547324
0x46852869...5d921aBd9
0.1808 ETH
153445222022-08-15 6:46:35736 days ago1660545995
0x46852869...5d921aBd9
1.957 ETH
153432822022-08-15 1:54:09736 days ago1660528449
0x46852869...5d921aBd9
1.545 ETH
153431852022-08-15 1:34:49736 days ago1660527289
0x46852869...5d921aBd9
1.2875 ETH
153429792022-08-15 0:47:52736 days ago1660524472
0x46852869...5d921aBd9
1.133 ETH
153397342022-08-14 12:24:46737 days ago1660479886
0x46852869...5d921aBd9
1.03 ETH
153219572022-08-11 17:17:53740 days ago1660238273
0x46852869...5d921aBd9
0.475 ETH
153219572022-08-11 17:17:53740 days ago1660238273
0x46852869...5d921aBd9
0.04 ETH
153219532022-08-11 17:16:24740 days ago1660238184
0x46852869...5d921aBd9
0.475 ETH
153219532022-08-11 17:16:24740 days ago1660238184
0x46852869...5d921aBd9
0.04 ETH
152903842022-08-06 18:40:52745 days ago1659811252
0x46852869...5d921aBd9
0.3325 ETH
152903842022-08-06 18:40:52745 days ago1659811252
0x46852869...5d921aBd9
0.028 ETH
152850522022-08-05 22:35:32746 days ago1659738932
0x46852869...5d921aBd9
0.1995 ETH
152850522022-08-05 22:35:32746 days ago1659738932
0x46852869...5d921aBd9
0.0168 ETH
152774162022-08-04 18:19:53747 days ago1659637193
0x46852869...5d921aBd9
0.358815 ETH
152774162022-08-04 18:19:53747 days ago1659637193
0x46852869...5d921aBd9
0.030216 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FirstDibsAuction

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 1348 runs

Other Settings:
default evmVersion
File 1 of 16 : FirstDibsAuction.sol
//SPDX-License-Identifier: Unlicensed
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;

import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import '@openzeppelin/contracts/math/SafeMath.sol';
import '@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import '@openzeppelin/contracts/payment/PullPayment.sol';

import './IERC721TokenCreator.sol';
import './IFirstDibsMarketSettings.sol';

contract FirstDibsAuction is PullPayment, AccessControl, ReentrancyGuard, IERC721Receiver {
    using SafeMath for uint256;
    using SafeMath for uint64;
    using Counters for Counters.Counter;

    bytes32 public constant BIDDER_ROLE = keccak256('BIDDER_ROLE');
    bytes32 public constant BIDDER_ROLE_ADMIN = keccak256('BIDDER_ROLE_ADMIN');

    /**
     * ========================
     * #Public state variables
     * ========================
     */
    bool public bidderRoleRequired; // if true, bids require bidder having BIDDER_ROLE role
    bool public globalPaused; // flag for pausing all auctions
    IERC721TokenCreator public iERC721TokenCreatorRegistry;
    IFirstDibsMarketSettings public iFirstDibsMarketSettings;
    // Mapping auction id => Auction
    mapping(uint256 => Auction) public auctions;
    // Map token address => tokenId => auctionId
    mapping(address => mapping(uint256 => uint256)) public auctionIds;

    /*
     * ========================
     * #Private state variables
     * ========================
     */
    Counters.Counter private auctionIdsCounter;

    /**
     * ========================
     * #Structs
     * ========================
     */
    struct AuctionSettings {
        uint32 buyerPremium; // percent; added on top of current bid
        uint32 duration; // defaults to globalDuration
        uint32 minimumBidIncrement; // defaults to globalMinimumBidIncrement
        uint32 commissionRate; // percent; defaults to globalMarketCommission
        uint128 creatorRoyaltyRate; // percent; defaults to globalCreatorRoyaltyRate
    }

    struct Bid {
        uint256 amount; // current winning bid of the auction
        uint256 buyerPremiumAmount; // current buyer premium associated with current bid
    }

    struct Auction {
        uint256 startTime; // auction start timestamp
        uint256 pausedTime; // when was the auction paused
        uint256 reservePrice; // minimum bid threshold for auction to begin
        uint256 tokenId; // id of the token
        bool paused; // is individual auction paused
        address nftAddress; // address of the token
        address payable payee; // address of auction proceeds recipient. NFT creator until secondary market is introduced.
        address payable currentBidder; // current winning bidder of the auction
        address auctionCreator; // address of the creator of the auction (whoever called the createAuction method)
        AuctionSettings settings;
        Bid currentBid;
    }

    /**
     * ========================
     * #Modifiers
     * ========================
     */
    modifier onlyAdmin() {
        require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), 'caller is not an admin');
        _;
    }

    modifier onlyBidder() {
        if (bidderRoleRequired == true) {
            require(hasRole(BIDDER_ROLE, _msgSender()), 'bidder role required');
        }
        _;
    }

    modifier notPaused(uint256 auctionId) {
        require(!globalPaused, 'Auctions are globally paused');
        require(!auctions[auctionId].paused, 'Auction is paused.');
        _;
    }

    modifier auctionExists(uint256 auctionId) {
        require(auctions[auctionId].payee != address(0), "Auction doesn't exist");
        _;
    }

    modifier senderIsAuctionCreatorOrAdmin(uint256 auctionId) {
        require(
            _msgSender() == auctions[auctionId].auctionCreator ||
                hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            'Must be auction creator or admin'
        );
        _;
    }

    /**
     * ========================
     * #Events
     * ========================
     */
    event AuctionCreated(
        uint256 indexed auctionId,
        address indexed nftAddress,
        uint256 indexed tokenId,
        address tokenSeller,
        uint256 reservePrice,
        bool isPaused,
        address auctionCreator,
        uint64 duration
    );

    event AuctionBid(
        uint256 indexed auctionId,
        address indexed bidder,
        uint256 bidAmount,
        uint256 bidBuyerPremium,
        uint64 duration,
        uint256 startTime
    );

    event AuctionEnded(
        uint256 indexed auctionId,
        address indexed tokenSeller,
        address indexed winningBidder,
        uint256 winningBid,
        uint256 winningBidBuyerPremium,
        uint256 adminCommissionFee,
        uint256 royaltyFee,
        uint256 sellerPayment
    );

    event AuctionPaused(
        uint256 indexed auctionId,
        address indexed tokenSeller,
        address toggledBy,
        bool isPaused,
        uint64 duration
    );

    event AuctionCanceled(uint256 indexed auctionId, address canceledBy, uint256 refundedAmount);

    /**
     * ========================
     * constructor
     * ========================
     */
    constructor(address _marketSettings, address _creatorRegistry) public {
        require(
            _marketSettings != address(0),
            'constructor: 0 address not allowed for _marketSettings'
        );
        require(
            _creatorRegistry != address(0),
            'constructor: 0 address not allowed for _creatorRegistry'
        );
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); // deployer of the contract gets admin permissions
        _setupRole(BIDDER_ROLE, _msgSender());
        _setupRole(BIDDER_ROLE_ADMIN, _msgSender());
        _setRoleAdmin(BIDDER_ROLE, BIDDER_ROLE_ADMIN);
        iERC721TokenCreatorRegistry = IERC721TokenCreator(_creatorRegistry);
        iFirstDibsMarketSettings = IFirstDibsMarketSettings(_marketSettings);
        bidderRoleRequired = true;
    }

    /**
     * @dev setter for creator registry address
     * @param _iERC721TokenCreatorRegistry address of the IERC721TokenCreator contract to set for the auction
     */
    function setIERC721TokenCreatorRegistry(address _iERC721TokenCreatorRegistry)
        external
        onlyAdmin
    {
        require(
            _iERC721TokenCreatorRegistry != address(0),
            'setIERC721TokenCreatorRegistry: 0 address not allowed'
        );
        iERC721TokenCreatorRegistry = IERC721TokenCreator(_iERC721TokenCreatorRegistry);
    }

    /**
     * @dev setter for market settings address
     * @param _iFirstDibsMarketSettings address of the FirstDibsMarketSettings contract to set for the auction
     */
    function setIFirstDibsMarketSettings(address _iFirstDibsMarketSettings) external onlyAdmin {
        require(
            _iFirstDibsMarketSettings != address(0),
            'setIFirstDibsMarketSettings: 0 address not allowed'
        );
        iFirstDibsMarketSettings = IFirstDibsMarketSettings(_iFirstDibsMarketSettings);
    }

    /**
     * @dev setter for setting bidder role being required to bid
     * @param _bidderRole bool If true, bidder must have bidder role to bid
     */
    function setBidderRoleRequired(bool _bidderRole) external onlyAdmin {
        bidderRoleRequired = _bidderRole;
    }

    /**
     * @dev setter for global pause state
     * @param _paused) true to pause all auctions, false to unpause all auctions
     */
    function setGlobalPaused(bool _paused) external onlyAdmin {
        globalPaused = _paused;
    }

    /**
     * @dev External function which creates an auction with a reserve price,
     * custom start time, custom duration, and custom minimum bid increment.
     *
     * @param _nftAddress address of ERC-721 contract
     * @param _tokenId uint256
     * @param _reservePrice uint256 reserve price in ETH
     * @param _pausedArg create the auction in a paused state
     * @param _startTimeArg admin-only unix timestamp; allow bidding to start at this time
     * @param _auctionDurationArg (optional) auction duration in seconds
     * @param _minimumBidIncrementArg (optional) minimum bid increment in percentage points
     */
    function createAuction(
        address _nftAddress,
        uint256 _tokenId,
        uint256 _reservePrice,
        bool _pausedArg,
        uint64 _startTimeArg,
        uint32 _auctionDurationArg,
        uint8 _minimumBidIncrementArg
    ) external {
        adminCreateAuction(
            _nftAddress,
            _tokenId,
            _reservePrice,
            _pausedArg,
            _startTimeArg,
            _auctionDurationArg,
            _minimumBidIncrementArg,
            101, // adminCreateAuction function ignores values > 100
            101 // adminCreateAuction function ignores values > 100
        );
    }

    /**
     * @dev External function which creates an auction with a reserve price,
     * custom start time, custom duration, custom minimum bid increment,
     * custom commission rate, and custom creator royalty rate.
     *
     * @param _nftAddress address of ERC-721 contract (latest FirstDibsToken address)
     * @param _tokenId uint256
     * @param _reservePrice reserve price in ETH
     * @param _pausedArg create the auction in a paused state
     * @param _startTimeArg (optional) admin-only; unix timestamp; allow bidding to start at this time
     * @param _auctionDurationArg (optional) admin-only; auction duration in seconds
     * @param _minimumBidIncrementArg (optional) admin-only; minimum bid increment in percentage points
     * @param _commissionRateArg (optional) admin-only; pass in a custom marketplace commission rate
     * @param _creatorRoyaltyRateArg (optional) admin-only; pass in a custom creator royalty rate
     */
    function adminCreateAuction(
        address _nftAddress,
        uint256 _tokenId,
        uint256 _reservePrice,
        bool _pausedArg,
        uint64 _startTimeArg,
        uint32 _auctionDurationArg,
        uint8 _minimumBidIncrementArg,
        uint8 _commissionRateArg,
        uint8 _creatorRoyaltyRateArg
    ) public nonReentrant {
        require(!globalPaused, 'adminCreateAuction: auctions are globally paused');

        // May not create auctions unless you are the token owner or
        // an admin of this contract
        require(
            _msgSender() == IERC721(_nftAddress).ownerOf(_tokenId) ||
                hasRole(DEFAULT_ADMIN_ROLE, _msgSender()),
            'adminCreateAuction: must be token owner or admin'
        );

        require(
            auctionIds[_nftAddress][_tokenId] == 0,
            'adminCreateAuction: auction already exists'
        );

        require(_reservePrice > 0, 'adminCreateAuction: Reserve must be > 0');

        Auction memory auction = Auction({
            currentBid: Bid({ amount: 0, buyerPremiumAmount: 0 }),
            nftAddress: _nftAddress,
            tokenId: _tokenId,
            payee: payable(IERC721(_nftAddress).ownerOf(_tokenId)), // payee is the token owner
            auctionCreator: _msgSender(),
            reservePrice: _reservePrice, // minimum bid threshold for auction to begin
            startTime: 0,
            currentBidder: address(0), // there is no bidder at auction creation
            paused: _pausedArg, // is individual auction paused
            pausedTime: 0, // when the auction was paused
            settings: AuctionSettings({ // Defaults to global market settings; admins may override
                buyerPremium: iFirstDibsMarketSettings.globalBuyerPremium(),
                duration: iFirstDibsMarketSettings.globalAuctionDuration(),
                minimumBidIncrement: iFirstDibsMarketSettings.globalMinimumBidIncrement(),
                commissionRate: iFirstDibsMarketSettings.globalMarketCommission(),
                creatorRoyaltyRate: iFirstDibsMarketSettings.globalCreatorRoyaltyRate()
            })
        });

        if (hasRole(DEFAULT_ADMIN_ROLE, _msgSender())) {
            if (_auctionDurationArg > 0) {
                require(
                    _auctionDurationArg >= iFirstDibsMarketSettings.globalTimeBuffer(),
                    'adminCreateAuction: duration must be >= time buffer'
                );
                auction.settings.duration = _auctionDurationArg;
            }

            if (_startTimeArg > 0) {
                require(
                    block.timestamp < _startTimeArg,
                    'adminCreateAuction: start time must be in the future'
                );
                auction.startTime = _startTimeArg;
                // since `bid` is gated by `notPaused` modifier
                // and a start time in the future means that a bid
                // must be allowed after that time, we can't have
                // the auction paused if there is a start time > 0
                auction.paused = false;
            }

            if (_minimumBidIncrementArg > 0) {
                auction.settings.minimumBidIncrement = _minimumBidIncrementArg;
            }

            if (_commissionRateArg <= 100) {
                auction.settings.commissionRate = _commissionRateArg;
            }

            if (_creatorRoyaltyRateArg <= 100) {
                auction.settings.creatorRoyaltyRate = _creatorRoyaltyRateArg;
            }
        }

        require(
            uint256(auction.settings.commissionRate).add(auction.settings.creatorRoyaltyRate) <=
                100,
            'adminCreateAuction: commission rate + royalty rate must be <= 100'
        );

        auctionIdsCounter.increment();
        auctions[auctionIdsCounter.current()] = auction;
        auctionIds[_nftAddress][_tokenId] = auctionIdsCounter.current();

        // transfer the NFT to the auction contract to hold in escrow for the duration of the auction
        IERC721(_nftAddress).safeTransferFrom(auction.payee, address(this), _tokenId);

        emit AuctionCreated(
            auctionIdsCounter.current(),
            _nftAddress,
            _tokenId,
            auction.payee,
            _reservePrice,
            auction.paused,
            _msgSender(),
            auction.settings.duration
        );
    }

    /**
     * @dev Retrieves the bid and buyer premium amount from the _amount based on _buyerPremiumRate
     *
     * @param _amount The entire amount (bid amount + buyer premium amount)
     * @param _buyerPremiumRate The buyer premium rate used to calculate _amount
     * @return The bid sent and the premium sent
     */
    function getSentBidAndPremium(uint256 _amount, uint64 _buyerPremiumRate)
        public
        pure
        returns (
            uint256, /*sentBid*/
            uint256 /*sentPremium*/
        )
    {
        uint256 bpRate = _buyerPremiumRate.add(100);
        uint256 _sentBid = uint256(_amount.mul(100).div(bpRate));
        uint256 _sentPremium = uint256(_amount.sub(_sentBid));
        return (_sentBid, _sentPremium);
    }

    /**
     * @dev Validates that the total amount sent is valid for the current state of the auction
     *  and returns the bid amount and buyer premium amount sent
     *
     * @param _auctionId The id of the auction on which to validate the amount sent
     * @param _totalAmount The total amount sent (bid amount + buyer premium amount)
     * @return boolean true if the amount satisfies the state of the auction; the sent bid; and the sent premium
     */
    function _validateAndGetBid(uint256 _auctionId, uint256 _totalAmount)
        internal
        view
        returns (
            uint256, /*sentBid*/
            uint256 /*sentPremium*/
        )
    {
        (uint256 _sentBid, uint256 _sentPremium) = getSentBidAndPremium(
            _totalAmount,
            auctions[_auctionId].settings.buyerPremium
        );
        if (auctions[_auctionId].currentBidder == address(0)) {
            // This is the first bid against reserve price
            require(
                _sentBid >= auctions[_auctionId].reservePrice,
                '_validateAndGetBid: reserve not met'
            );
        } else {
            // Subsequent bids must meet minimum bid increment
            require(
                _sentBid >=
                    auctions[_auctionId].currentBid.amount.add(
                        auctions[_auctionId]
                        .currentBid
                        .amount
                        .mul(auctions[_auctionId].settings.minimumBidIncrement)
                        .div(100)
                    ),
                '_validateAndGetBid: minimum bid not met'
            );
        }
        return (_sentBid, _sentPremium);
    }

    /**
     * @dev external function that can be called by any address which submits a bid to an auction
     * @param _auctionId uint256 id of the auction
     * @param _amount uint256 bid in WEI
     */
    function bid(uint256 _auctionId, uint256 _amount)
        external
        payable
        nonReentrant
        onlyBidder
        auctionExists(_auctionId)
        notPaused(_auctionId)
    {
        require(msg.value > 0, 'bid: value must be > 0');
        require(_amount == msg.value, 'bid: amount/value mismatch');
        // Auctions with a start time of 0 may accept bids
        // Auctions with a start time can't accept bids until now is greater than start time
        require(
            auctions[_auctionId].startTime == 0 ||
                block.timestamp >= auctions[_auctionId].startTime,
            'bid: auction not started'
        );
        // Auctions with a start time of 0 may accept bids
        // Auctions with an end time less than now may accept a bid
        require(
            auctions[_auctionId].startTime == 0 || block.timestamp < _endTime(_auctionId),
            'bid: auction expired'
        );
        require(
            auctions[_auctionId].payee != _msgSender(),
            'bid: token owner may not bid on own auction'
        );
        require(
            auctions[_auctionId].currentBidder != _msgSender(),
            'bid: sender is current highest bidder'
        );

        // Validate the amount sent and get sent bid and sent premium
        (uint256 _sentBid, uint256 _sentPremium) = _validateAndGetBid(_auctionId, _amount);

        // bid amount is OK, if not first bid, then transfer funds
        // back to previous bidder & update current bidder to the current sender
        if (auctions[_auctionId].startTime == 0) {
            auctions[_auctionId].startTime = uint64(block.timestamp);
        } else if (auctions[_auctionId].currentBidder != address(0)) {
            uint256 refundAmount = auctions[_auctionId].currentBid.amount.add(
                auctions[_auctionId].currentBid.buyerPremiumAmount
            );
            address priorBidder = auctions[_auctionId].currentBidder;
            _tryTransferThenEscrow(priorBidder, refundAmount);
        }
        auctions[_auctionId].currentBid.amount = _sentBid;
        auctions[_auctionId].currentBid.buyerPremiumAmount = _sentPremium;
        auctions[_auctionId].currentBidder = _msgSender();

        // extend countdown for bids within the time buffer of the auction
        if (
            // if auction ends less than globalTimeBuffer from now
            _endTime(_auctionId) < block.timestamp.add(iFirstDibsMarketSettings.globalTimeBuffer())
        ) {
            // increment the duration by the difference between the new end time and the old end time
            auctions[_auctionId].settings.duration += uint32(
                block.timestamp.add(iFirstDibsMarketSettings.globalTimeBuffer()).sub(
                    _endTime(_auctionId)
                )
            );
        }

        emit AuctionBid(
            _auctionId,
            _msgSender(),
            _sentBid,
            _sentPremium,
            auctions[_auctionId].settings.duration,
            auctions[_auctionId].startTime
        );
    }

    /**
     * @dev method for ending an auction which has expired. Distrubutes payment to all parties & send
     * token to winning bidder (or returns it to the auction creator if there was no winner)
     * @param _auctionId uint256 id of the token
     */
    function endAuction(uint256 _auctionId)
        external
        nonReentrant
        auctionExists(_auctionId)
        notPaused(_auctionId)
    {
        require(
            auctions[_auctionId].currentBidder != address(0),
            'endAuction: no bidders; use cancelAuction'
        );

        require(
            auctions[_auctionId].startTime > 0 && //  auction has started
                block.timestamp >= _endTime(_auctionId), // past the endtime of the auction,
            'endAuction: auction is not complete'
        );

        Auction memory auction = auctions[_auctionId];

        // send commission fee & buyer premium to commission address
        uint256 commissionFee = auction.currentBid.amount.mul(auction.settings.commissionRate).div(
            100
        );
        // don't attempt to transfer fees if there are none
        if (commissionFee.add(auction.currentBid.buyerPremiumAmount) > 0) {
            _tryTransferThenEscrow(
                iFirstDibsMarketSettings.commissionAddress(),
                commissionFee.add(auction.currentBid.buyerPremiumAmount)
            );
        }

        address nftCreator = iERC721TokenCreatorRegistry.tokenCreator(
            auction.nftAddress,
            auction.tokenId
        );

        // send payout to token owner & token creator (they might be the same)
        uint256 creatorRoyaltyFee = 0;
        if (nftCreator == auction.payee) {
            // Primary sale
            _asyncTransfer(auction.payee, auction.currentBid.amount.sub(commissionFee));
        } else {
            // Secondary sale
            // calculate & send creator royalty to escrow
            creatorRoyaltyFee = auction
            .currentBid
            .amount
            .mul(auction.settings.creatorRoyaltyRate)
            .div(100);
            _asyncTransfer(nftCreator, creatorRoyaltyFee);

            // send remaining funds to the seller in escrow
            _asyncTransfer(
                auction.payee,
                auction.currentBid.amount.sub(creatorRoyaltyFee).sub(commissionFee)
            );
        }

        // send the NFT to the winning bidder
        IERC721(auction.nftAddress).safeTransferFrom(
            address(this), // from
            auction.currentBidder, // to
            auction.tokenId
        );

        _delete(_auctionId);

        emit AuctionEnded(
            _auctionId,
            auction.payee,
            auction.currentBidder,
            auction.currentBid.amount,
            auction.currentBid.buyerPremiumAmount,
            commissionFee,
            creatorRoyaltyFee,
            auction.currentBid.amount.sub(creatorRoyaltyFee).sub(commissionFee) // seller payment
        );
    }

    /**
     * @dev external function to cancel an auction & return the NFT to the creator of the auction
     * @param _auctionId uint256 auction id
     */
    function cancelAuction(uint256 _auctionId)
        external
        nonReentrant
        auctionExists(_auctionId)
        senderIsAuctionCreatorOrAdmin(_auctionId)
    {
        if (!hasRole(DEFAULT_ADMIN_ROLE, _msgSender())) {
            // only admin may cancel an auction with bids
            require(
                auctions[_auctionId].currentBidder == address(0),
                'cancelAuction: auction with bids may not be canceled'
            );
        }

        // return the token back to the original owner
        IERC721(auctions[_auctionId].nftAddress).safeTransferFrom(
            address(this),
            auctions[_auctionId].payee,
            auctions[_auctionId].tokenId
        );

        uint256 refundAmount = 0;
        if (auctions[_auctionId].currentBidder != address(0)) {
            // If there's a bidder, return funds to them
            refundAmount = auctions[_auctionId].currentBid.amount.add(
                auctions[_auctionId].currentBid.buyerPremiumAmount
            );
            _tryTransferThenEscrow(auctions[_auctionId].currentBidder, refundAmount);
        }

        _delete(_auctionId);
        emit AuctionCanceled(_auctionId, _msgSender(), refundAmount);
    }

    /**
     * @dev external function for pausing / unpausing an auction
     * @param _auctionId uint256 auction id
     * @param _paused true to pause the auction, false to unpause the auction
     */
    function setAuctionPause(uint256 _auctionId, bool _paused)
        external
        auctionExists(_auctionId)
        senderIsAuctionCreatorOrAdmin(_auctionId)
    {
        if (_paused == auctions[_auctionId].paused) {
            // no-op, auction is already in this state
            return;
        }
        if (_paused) {
            auctions[_auctionId].pausedTime = uint64(block.timestamp);
        } else if (
            !_paused && auctions[_auctionId].pausedTime > 0 && auctions[_auctionId].startTime > 0
        ) {
            // if the auction has started, increment duration by difference between current time and paused time
            auctions[_auctionId].settings.duration += uint32(
                block.timestamp.sub(auctions[_auctionId].pausedTime)
            );
            auctions[_auctionId].pausedTime = 0;
        }
        auctions[_auctionId].paused = _paused;
        emit AuctionPaused(
            _auctionId,
            auctions[_auctionId].payee,
            _msgSender(),
            _paused,
            auctions[_auctionId].settings.duration
        );
    }

    /**
     * @notice Handle the receipt of an NFT
     * @dev Per erc721 spec this interface must be implemented to receive NFTs via
     *      the safeTransferFrom function. See: https://eips.ethereum.org/EIPS/eip-721 for more.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) external override returns (bytes4) {
        return IERC721Receiver(address(this)).onERC721Received.selector;
    }

    /**
     * @dev utility function for calculating an auctions end time
     * @param _auctionId uint256
     */
    function _endTime(uint256 _auctionId) private view returns (uint256) {
        return auctions[_auctionId].startTime + auctions[_auctionId].settings.duration;
    }

    /**
     * @dev Delete auctionId for current auction for token+id & delete auction struct
     * @param _auctionId uint256
     */
    function _delete(uint256 _auctionId) private {
        address nftAddress = auctions[_auctionId].nftAddress;
        uint256 tokenId = auctions[_auctionId].tokenId;
        // delete auctionId for current address+id token combo
        // only one auction at a time per token allowed
        delete auctionIds[nftAddress][tokenId];
        // Delete auction struct
        delete auctions[_auctionId];
    }

    /**
     * @dev Sending ether is not guaranteed complete, and the method used here will
     * escrow the value if it fails. For example, a contract can block transfer, or might use
     * an excessive amount of gas, thereby griefing a bidder.
     * We limit the gas used in transfers, and handle failure with escrowing.
     * @param _to address to transfer ETH to
     * @param _amount uint256 WEI amount to transfer
     */
    function _tryTransferThenEscrow(address _to, uint256 _amount) private {
        // increase the gas limit a reasonable amount above the default, and try
        // to send ether to the recipient.
        (bool success, ) = _to.call{ value: _amount, gas: 30000 }('');
        if (!success) {
            _asyncTransfer(_to, _amount);
        }
    }
}

File 2 of 16 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../math/SafeMath.sol";

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented or decremented by one. 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;`
 * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}
 * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
 * directly accessed.
 */
library Counters {
    using SafeMath for uint256;

    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 {
        // The {SafeMath} overflow check can be skipped here, see the comment at the top
        counter._value += 1;
    }

    function decrement(Counter storage counter) internal {
        counter._value = counter._value.sub(1);
    }
}

File 3 of 16 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

import "../../introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
      * @dev Safely transfers `tokenId` token from `from` to `to`.
      *
      * Requirements:
      *
      * - `from` cannot be the zero address.
      * - `to` cannot be the zero address.
      * - `tokenId` token must exist and be owned by `from`.
      * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
      * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
      *
      * Emits a {Transfer} event.
      */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}

File 4 of 16 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}

File 5 of 16 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;
    using Address for address;

    struct RoleData {
        EnumerableSet.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view returns (bool) {
        return _roles[role].members.contains(account);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 6 of 16 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
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) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        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) {
        // 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) {
        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) {
        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) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @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) {
        require(b <= a, "SafeMath: subtraction overflow");
        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) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @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. 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) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        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) {
        require(b > 0, "SafeMath: modulo by zero");
        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) {
        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.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * 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) {
        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) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 7 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        _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 make 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;
    }
}

File 8 of 16 : PullPayment.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

import "./escrow/Escrow.sol";

/**
 * @dev Simple implementation of a
 * https://consensys.github.io/smart-contract-best-practices/recommendations/#favor-pull-over-push-for-external-calls[pull-payment]
 * strategy, where the paying contract doesn't interact directly with the
 * receiver account, which must withdraw its payments itself.
 *
 * Pull-payments are often considered the best practice when it comes to sending
 * Ether, security-wise. It prevents recipients from blocking execution, and
 * eliminates reentrancy concerns.
 *
 * 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].
 *
 * To use, derive from the `PullPayment` contract, and use {_asyncTransfer}
 * instead of Solidity's `transfer` function. Payees can query their due
 * payments with {payments}, and retrieve them with {withdrawPayments}.
 */
abstract contract PullPayment {
    Escrow private _escrow;

    constructor () internal {
        _escrow = new Escrow();
    }

    /**
     * @dev Withdraw accumulated payments, forwarding all gas to the recipient.
     *
     * Note that _any_ account can call this function, not just the `payee`.
     * This means that contracts unaware of the `PullPayment` protocol can still
     * receive funds this way, by having a separate account call
     * {withdrawPayments}.
     *
     * WARNING: Forwarding all gas opens the door to reentrancy vulnerabilities.
     * Make sure you trust the recipient, or are either following the
     * checks-effects-interactions pattern or using {ReentrancyGuard}.
     *
     * @param payee Whose payments will be withdrawn.
     */
    function withdrawPayments(address payable payee) public virtual {
        _escrow.withdraw(payee);
    }

    /**
     * @dev Returns the payments owed to an address.
     * @param dest The creditor's address.
     */
    function payments(address dest) public view returns (uint256) {
        return _escrow.depositsOf(dest);
    }

    /**
     * @dev Called by the payer to store the sent amount as credit to be pulled.
     * Funds sent in this way are stored in an intermediate {Escrow} contract, so
     * there is no danger of them being spent before withdrawal.
     *
     * @param dest The destination address of the funds.
     * @param amount The amount to transfer.
     */
    function _asyncTransfer(address dest, uint256 amount) internal virtual {
        _escrow.deposit{ value: amount }(dest);
    }
}

File 9 of 16 : IERC721TokenCreator.sol
//SPDX-License-Identifier: BSD 3-Clause
pragma solidity 0.6.12;

/**
 * @title IERC721 Non-Fungible Token Creator basic interface
 * @dev Interop with other systems supporting this interface
 * @notice Original license and source here: https://github.com/Pixura/pixura-contracts
 */
interface IERC721TokenCreator {
    /**
     * @dev Gets the creator of the _tokenId on _nftAddress
     * @param _nftAddress address of the ERC721 contract
     * @param _tokenId uint256 ID of the token
     * @return address of the creator
     */
    function tokenCreator(address _nftAddress, uint256 _tokenId)
        external
        view
        returns (address payable);
}

File 10 of 16 : IFirstDibsMarketSettings.sol
//SPDX-License-Identifier: Unlicensed
pragma solidity 0.6.12;

interface IFirstDibsMarketSettings {
    function globalBuyerPremium() external view returns (uint32);

    function globalMarketCommission() external view returns (uint32);

    function globalCreatorRoyaltyRate() external view returns (uint32);

    function globalMinimumBidIncrement() external view returns (uint32);

    function globalTimeBuffer() external view returns (uint32);

    function globalAuctionDuration() external view returns (uint32);

    function commissionAddress() external view returns (address);
}

File 11 of 16 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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);
}

File 12 of 16 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 13 of 16 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 14 of 16 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 15 of 16 : Escrow.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../math/SafeMath.sol";
import "../../access/Ownable.sol";
import "../../utils/Address.sol";

 /**
  * @title Escrow
  * @dev Base escrow contract, holds funds designated for a payee until they
  * withdraw them.
  *
  * Intended usage: This contract (and derived escrow contracts) should be a
  * standalone contract, that only interacts with the contract that instantiated
  * it. That way, it is guaranteed that all Ether will be handled according to
  * the `Escrow` rules, and there is no need to check for payable functions or
  * transfers in the inheritance tree. The contract that uses the escrow as its
  * payment method should be its owner, and provide public methods redirecting
  * to the escrow's deposit and withdraw.
  */
contract Escrow is Ownable {
    using SafeMath for uint256;
    using Address for address payable;

    event Deposited(address indexed payee, uint256 weiAmount);
    event Withdrawn(address indexed payee, uint256 weiAmount);

    mapping(address => uint256) private _deposits;

    function depositsOf(address payee) public view returns (uint256) {
        return _deposits[payee];
    }

    /**
     * @dev Stores the sent amount as credit to be withdrawn.
     * @param payee The destination address of the funds.
     */
    function deposit(address payee) public payable virtual onlyOwner {
        uint256 amount = msg.value;
        _deposits[payee] = _deposits[payee].add(amount);

        emit Deposited(payee, amount);
    }

    /**
     * @dev Withdraw accumulated balance for a payee, forwarding all gas to the
     * recipient.
     *
     * WARNING: Forwarding all gas opens the door to reentrancy vulnerabilities.
     * Make sure you trust the recipient, or are either following the
     * checks-effects-interactions pattern or using {ReentrancyGuard}.
     *
     * @param payee The address whose funds will be withdrawn and transferred to.
     */
    function withdraw(address payable payee) public virtual onlyOwner {
        uint256 payment = _deposits[payee];

        _deposits[payee] = 0;

        payee.sendValue(payment);

        emit Withdrawn(payee, payment);
    }
}

File 16 of 16 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1348
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_marketSettings","type":"address"},{"internalType":"address","name":"_creatorRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":false,"internalType":"uint256","name":"bidAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bidBuyerPremium","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"duration","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"AuctionBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":false,"internalType":"address","name":"canceledBy","type":"address"},{"indexed":false,"internalType":"uint256","name":"refundedAmount","type":"uint256"}],"name":"AuctionCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenSeller","type":"address"},{"indexed":false,"internalType":"uint256","name":"reservePrice","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"},{"indexed":false,"internalType":"address","name":"auctionCreator","type":"address"},{"indexed":false,"internalType":"uint64","name":"duration","type":"uint64"}],"name":"AuctionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"tokenSeller","type":"address"},{"indexed":true,"internalType":"address","name":"winningBidder","type":"address"},{"indexed":false,"internalType":"uint256","name":"winningBid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"winningBidBuyerPremium","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"adminCommissionFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"royaltyFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sellerPayment","type":"uint256"}],"name":"AuctionEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"auctionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"tokenSeller","type":"address"},{"indexed":false,"internalType":"address","name":"toggledBy","type":"address"},{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"},{"indexed":false,"internalType":"uint64","name":"duration","type":"uint64"}],"name":"AuctionPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"BIDDER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BIDDER_ROLE_ADMIN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_reservePrice","type":"uint256"},{"internalType":"bool","name":"_pausedArg","type":"bool"},{"internalType":"uint64","name":"_startTimeArg","type":"uint64"},{"internalType":"uint32","name":"_auctionDurationArg","type":"uint32"},{"internalType":"uint8","name":"_minimumBidIncrementArg","type":"uint8"},{"internalType":"uint8","name":"_commissionRateArg","type":"uint8"},{"internalType":"uint8","name":"_creatorRoyaltyRateArg","type":"uint8"}],"name":"adminCreateAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctionIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctions","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"pausedTime","type":"uint256"},{"internalType":"uint256","name":"reservePrice","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bool","name":"paused","type":"bool"},{"internalType":"address","name":"nftAddress","type":"address"},{"internalType":"address payable","name":"payee","type":"address"},{"internalType":"address payable","name":"currentBidder","type":"address"},{"internalType":"address","name":"auctionCreator","type":"address"},{"components":[{"internalType":"uint32","name":"buyerPremium","type":"uint32"},{"internalType":"uint32","name":"duration","type":"uint32"},{"internalType":"uint32","name":"minimumBidIncrement","type":"uint32"},{"internalType":"uint32","name":"commissionRate","type":"uint32"},{"internalType":"uint128","name":"creatorRoyaltyRate","type":"uint128"}],"internalType":"struct FirstDibsAuction.AuctionSettings","name":"settings","type":"tuple"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"buyerPremiumAmount","type":"uint256"}],"internalType":"struct FirstDibsAuction.Bid","name":"currentBid","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"bid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"bidderRoleRequired","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"}],"name":"cancelAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_reservePrice","type":"uint256"},{"internalType":"bool","name":"_pausedArg","type":"bool"},{"internalType":"uint64","name":"_startTimeArg","type":"uint64"},{"internalType":"uint32","name":"_auctionDurationArg","type":"uint32"},{"internalType":"uint8","name":"_minimumBidIncrementArg","type":"uint8"}],"name":"createAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"}],"name":"endAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint64","name":"_buyerPremiumRate","type":"uint64"}],"name":"getSentBidAndPremium","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"globalPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"iERC721TokenCreatorRegistry","outputs":[{"internalType":"contract IERC721TokenCreator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"iFirstDibsMarketSettings","outputs":[{"internalType":"contract IFirstDibsMarketSettings","name":"","type":"address"}],"stateMutability":"view","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":[{"internalType":"address","name":"dest","type":"address"}],"name":"payments","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_auctionId","type":"uint256"},{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setAuctionPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_bidderRole","type":"bool"}],"name":"setBidderRoleRequired","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setGlobalPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_iERC721TokenCreatorRegistry","type":"address"}],"name":"setIERC721TokenCreatorRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_iFirstDibsMarketSettings","type":"address"}],"name":"setIFirstDibsMarketSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"payee","type":"address"}],"name":"withdrawPayments","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200497438038062004974833981016040819052620000349162000311565b604051620000429062000303565b604051809103906000f0801580156200005f573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b0392831617905560016002558216620000ab5760405162461bcd60e51b8152600401620000a2906200039b565b60405180910390fd5b6001600160a01b038116620000d45760405162461bcd60e51b8152600401620000a2906200034f565b620000ea6000620000e46200019b565b6200019f565b6200010860008051602062004954833981519152620000e46200019b565b6200012660008051602062004934833981519152620000e46200019b565b620001506000805160206200495483398151915260008051602062004934833981519152620001af565b60038054600480546001600160a01b0319166001600160a01b0395861617905562010000600160b01b0319166201000092909316919091029190911760ff1916600117905562000400565b3390565b620001ab828262000201565b5050565b600082815260016020526040808220600201549051839285917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a460009182526001602052604090912060020155565b600082815260016020908152604090912062000228918390620025406200027c821b17901c565b15620001ab57620002386200019b565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600062000293836001600160a01b0384166200029c565b90505b92915050565b6000620002aa8383620002eb565b620002e25750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000296565b50600062000296565b60009081526001919091016020526040902054151590565b6107c9806200414b83390190565b6000806040838503121562000324578182fd5b82516200033181620003e7565b60208401519092506200034481620003e7565b809150509250929050565b60208082526037908201526000805160206200491483398151915260408201527f656420666f72205f63726561746f725265676973747279000000000000000000606082015260800190565b60208082526036908201526000805160206200491483398151915260408201527f656420666f72205f6d61726b657453657474696e677300000000000000000000606082015260800190565b6001600160a01b0381168114620003fd57600080fd5b50565b613d3b80620004106000396000f3fe6080604052600436106101cd5760003560e01c806376cad834116100f7578063a217fddf11610095578063ca15c87311610064578063ca15c8731461051c578063d547741f1461053c578063e2982c211461055c578063e597a2091461057c576101cd565b8063a217fddf14610499578063b6105df4146104ae578063b9a2de3a146104dc578063c40119f8146104fc576101cd565b80639010d07c116100d15780639010d07c1461042457806391d148541461044457806396b5a7551461046457806396e978ff14610484576101cd565b806376cad834146103cf5780637ccfdbfe146103ef5780637f8c75f014610404576101cd565b806336568abe1161016f5780634199e02b1161013e5780634199e02b14610350578063571a26a014610370578063598647f8146103a757806361a552dc146103ba576101cd565b806336568abe146102ce578063398109a3146102ee5780633a80e8931461030e5780633dd0a7e414610330576101cd565b8063248a9ca3116101ab578063248a9ca31461024c5780632badf25c1461026c5780632f2ff15d1461028e57806331b3eb94146102ae576101cd565b80630ce526d1146101d2578063150b7a02146101fd5780631af356491461022a575b600080fd5b3480156101de57600080fd5b506101e761059c565b6040516101f491906130bc565b60405180910390f35b34801561020957600080fd5b5061021d610218366004612cc5565b6105c0565b6040516101f491906130c5565b34801561023657600080fd5b5061024a610245366004612db8565b6105e9565b005b34801561025857600080fd5b506101e7610267366004612f03565b610604565b34801561027857600080fd5b50610281610619565b6040516101f491906130b1565b34801561029a57600080fd5b5061024a6102a9366004612f1b565b610622565b3480156102ba57600080fd5b5061024a6102c9366004612c8d565b610673565b3480156102da57600080fd5b5061024a6102e9366004612f1b565b6106f1565b3480156102fa57600080fd5b5061024a610309366004612ee7565b610733565b34801561031a57600080fd5b5061032361076f565b6040516101f49190613001565b34801561033c57600080fd5b5061024a61034b366004612c8d565b610784565b34801561035c57600080fd5b506101e761036b366004612d8d565b610813565b34801561037c57600080fd5b5061039061038b366004612f03565b610830565b6040516101f49b9a99989796959493929190613bc7565b61024a6103b5366004612f4a565b610925565b3480156103c657600080fd5b50610281610e53565b3480156103db57600080fd5b5061024a6103ea366004612ee7565b610e61565b3480156103fb57600080fd5b50610323610ea4565b34801561041057600080fd5b5061024a61041f366004612e44565b610eb3565b34801561043057600080fd5b5061032361043f366004612f4a565b61190e565b34801561045057600080fd5b5061028161045f366004612f1b565b61192f565b34801561047057600080fd5b5061024a61047f366004612f03565b611947565b34801561049057600080fd5b506101e7611b95565b3480156104a557600080fd5b506101e7611bb9565b3480156104ba57600080fd5b506104ce6104c9366004612fa7565b611bbe565b6040516101f4929190613bb9565b3480156104e857600080fd5b5061024a6104f7366004612f03565b611c0c565b34801561050857600080fd5b5061024a610517366004612c8d565b6121ba565b34801561052857600080fd5b506101e7610537366004612f03565b612238565b34801561054857600080fd5b5061024a610557366004612f1b565b61224f565b34801561056857600080fd5b506101e7610577366004612c8d565b612289565b34801561058857600080fd5b5061024a610597366004612f83565b612323565b7f80f9b792196f21120f021903634877a78a3dd5e8ef643701b99dae7bb938062d81565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6105fb87878787878787606580610eb3565b50505050505050565b60009081526001602052604090206002015490565b60035460ff1681565b6000828152600160205260409020600201546106409061045f612555565b6106655760405162461bcd60e51b815260040161065c9061314f565b60405180910390fd5b61066f8282612559565b5050565b6000546040517f51cff8d90000000000000000000000000000000000000000000000000000000081526001600160a01b03909116906351cff8d9906106bc908490600401613001565b600060405180830381600087803b1580156106d657600080fd5b505af11580156106ea573d6000803e3d6000fd5b5050505050565b6106f9612555565b6001600160a01b0316816001600160a01b0316146107295760405162461bcd60e51b815260040161065c90613b5c565b61066f82826125c2565b610740600061045f612555565b61075c5760405162461bcd60e51b815260040161065c90613604565b6003805460ff1916911515919091179055565b6003546201000090046001600160a01b031681565b610791600061045f612555565b6107ad5760405162461bcd60e51b815260040161065c90613604565b6001600160a01b0381166107d35760405162461bcd60e51b815260040161065c906139a2565b600380546001600160a01b0390921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff909216919091179055565b600660209081526000928352604080842090915290825290205481565b6005602081815260009283526040928390208054600182015460028301546003840154600485015496850154600686015460078701548a5160a081018c52600889015463ffffffff808216835264010000000082048116838d01526801000000000000000082048116838f01526c01000000000000000000000000820416606083015270010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1660808201528b51808d01909c5260098901548c52600a90980154988b0198909852949893979296919560ff8416956101009094046001600160a01b03908116959281169481169316918b565b6002805414156109475760405162461bcd60e51b815260040161065c90613af0565b6002805560035460ff161515600114156109a3576109877f80f9b792196f21120f021903634877a78a3dd5e8ef643701b99dae7bb938062d61045f612555565b6109a35760405162461bcd60e51b815260040161065c906135cd565b6000828152600560208190526040909120015482906001600160a01b03166109dd5760405162461bcd60e51b815260040161065c9061372c565b6003548390610100900460ff1615610a075760405162461bcd60e51b815260040161065c906138e8565b60008181526005602052604090206004015460ff1615610a395760405162461bcd60e51b815260040161065c906138b1565b60003411610a595760405162461bcd60e51b815260040161065c90613448565b348314610a785760405162461bcd60e51b815260040161065c9061381d565b6000848152600560205260409020541580610aa157506000848152600560205260409020544210155b610abd5760405162461bcd60e51b815260040161065c90613ab9565b6000848152600560205260409020541580610adf5750610adc8461262b565b42105b610afb5760405162461bcd60e51b815260040161065c90613698565b610b03612555565b600085815260056020819052604090912001546001600160a01b0390811691161415610b415760405162461bcd60e51b815260040161065c906133eb565b610b49612555565b6000858152600560205260409020600601546001600160a01b0390811691161415610b865760405162461bcd60e51b815260040161065c90613a5c565b600080610b938686612653565b6000888152600560205260409020549193509150610bcb57600086815260056020526040902067ffffffffffffffff42169055610c38565b6000868152600560205260409020600601546001600160a01b031615610c38576000868152600560205260408120600a810154600990910154610c0d9161275c565b6000888152600560205260409020600601549091506001600160a01b0316610c358183612781565b50505b600086815260056020526040902060098101839055600a01819055610c5b612555565b600087815260056020908152604091829020600601805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0394851617905560048054835163e536f52360e01b81529351610d2095919091169363e536f5239381840193909291829003018186803b158015610cd357600080fd5b505afa158015610ce7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0b9190612fd3565b63ffffffff164261275c90919063ffffffff16565b610d298761262b565b1015610dd057610d92610d3b8761262b565b610d8c600460009054906101000a90046001600160a01b03166001600160a01b031663e536f5236040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd357600080fd5b906127f9565b6000878152600560205260409020600801805463ffffffff64010000000080830482169094011690920267ffffffff00000000199092169190911790555b610dd8612555565b600087815260056020526040908190206008810154905491516001600160a01b03939093169289927fd66b5764c67c36e32461c93c76dc6bd7a7a8d9ec4ed13647a30f88b9b5f3aef192610e3e9288928892640100000000900463ffffffff1691613cac565b60405180910390a35050600160025550505050565b600354610100900460ff1681565b610e6e600061045f612555565b610e8a5760405162461bcd60e51b815260040161065c90613604565b600380549115156101000261ff0019909216919091179055565b6004546001600160a01b031681565b600280541415610ed55760405162461bcd60e51b815260040161065c90613af0565b60028055600354610100900460ff1615610f015760405162461bcd60e51b815260040161065c9061363b565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526001600160a01b038a1690636352211e90610f46908b906004016130bc565b60206040518083038186803b158015610f5e57600080fd5b505afa158015610f72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f969190612ca9565b6001600160a01b0316610fa7612555565b6001600160a01b03161480610fc45750610fc4600061045f612555565b610fe05760405162461bcd60e51b815260040161065c9061338e565b6001600160a01b03891660009081526006602090815260408083208b8452909152902054156110215760405162461bcd60e51b815260040161065c90613763565b600087116110415760405162461bcd60e51b815260040161065c906139ff565b611049612b91565b60405180610160016040528060008152602001600081526020018981526020018a815260200188151581526020018b6001600160a01b031681526020018b6001600160a01b0316636352211e8c6040518263ffffffff1660e01b81526004016110b291906130bc565b60206040518083038186803b1580156110ca57600080fd5b505afa1580156110de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111029190612ca9565b6001600160a01b031681526000602082015260400161111f612555565b6001600160a01b031681526020016040518060a00160405280600460009054906101000a90046001600160a01b03166001600160a01b031663e092c7fd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561118657600080fd5b505afa15801561119a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111be9190612fd3565b63ffffffff168152602001600460009054906101000a90046001600160a01b03166001600160a01b031663f309051c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561121757600080fd5b505afa15801561122b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124f9190612fd3565b63ffffffff168152602001600460009054906101000a90046001600160a01b03166001600160a01b03166346d3eb356040518163ffffffff1660e01b815260040160206040518083038186803b1580156112a857600080fd5b505afa1580156112bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e09190612fd3565b63ffffffff168152602001600460009054906101000a90046001600160a01b03166001600160a01b0316637cdd2a566040518163ffffffff1660e01b815260040160206040518083038186803b15801561133957600080fd5b505afa15801561134d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113719190612fd3565b63ffffffff168152602001600460009054906101000a90046001600160a01b03166001600160a01b031663cf9a95f66040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ca57600080fd5b505afa1580156113de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114029190612fd3565b63ffffffff16905281526040805180820190915260008082526020828101829052909201529091506114369061045f612555565b156115a05763ffffffff85161561150057600480546040805163e536f52360e01b815290516001600160a01b039092169263e536f523928282019260209290829003018186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190612fd3565b63ffffffff168563ffffffff1610156114ec5760405162461bcd60e51b815260040161065c906131ac565b61012081015163ffffffff86166020909101525b67ffffffffffffffff86161561154e578567ffffffffffffffff1642106115395760405162461bcd60e51b815260040161065c90613570565b67ffffffffffffffff86168152600060808201525b60ff8416156115685761012081015160ff85166040909101525b60648360ff16116115845761012081015160ff84166060909101525b60648260ff16116115a05761012081015160ff83166080909101525b60646115df826101200151608001516fffffffffffffffffffffffffffffffff168361012001516060015163ffffffff1661275c90919063ffffffff16565b11156115fd5760405162461bcd60e51b815260040161065c9061391f565b6116076007612821565b8060056000611616600761282a565b8152602080820192909252604090810160002083518155838301516001820155838201516002820155606080850151600383015560808086015160048401805460a089015160ff19909116921515929092177fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101006001600160a01b0393841681029190911790915560c088015160058601805473ffffffffffffffffffffffffffffffffffffffff1990811692851692909217905560e089015160068701805483169185169190911790559088015160078087018054909316919093161790556101208701518051600886018054838a01519884015196840151939095015163ffffffff1990951663ffffffff9283161767ffffffff00000000191664010000000098831698909802979097177fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff166801000000000000000095821695909502949094177fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c010000000000000000000000009490911693909302929092176fffffffffffffffffffffffffffffffff908116700100000000000000000000000000000000919092160217909255610140909301518051600985015590910151600a9092019190915561180c9061282a565b6001600160a01b038b1660008181526006602090815260408083208e8452909152908190209290925560c08301519151632142170760e11b815290916342842e0e9161185f919030908e90600401613015565b600060405180830381600087803b15801561187957600080fd5b505af115801561188d573d6000803e3d6000fd5b50505050888a6001600160a01b03166118a6600761282a565b7f3379874afd33ac61edf4b8af3a03c30f782441d9481f3a36833d3be8022e50018460c001518c86608001516118da612555565b886101200151602001516040516118f5959493929190613079565b60405180910390a4505060016002555050505050505050565b6000828152600160205260408120611926908361282e565b90505b92915050565b6000828152600160205260408120611926908361283a565b6002805414156119695760405162461bcd60e51b815260040161065c90613af0565b600280556000818152600560208190526040909120015481906001600160a01b03166119a75760405162461bcd60e51b815260040161065c9061372c565b60008281526005602052604090206007015482906001600160a01b03166119cc612555565b6001600160a01b031614806119e957506119e9600061045f612555565b611a055760405162461bcd60e51b815260040161065c90613b27565b611a12600061045f612555565b611a4e576000838152600560205260409020600601546001600160a01b031615611a4e5760405162461bcd60e51b815260040161065c9061329d565b600083815260056020819052604091829020600480820154928201546003909201549351632142170760e11b81526001600160a01b036101009094048416946342842e0e94611aa294309491169201613015565b600060405180830381600087803b158015611abc57600080fd5b505af1158015611ad0573d6000803e3d6000fd5b5050506000848152600560205260408120600601549091506001600160a01b031615611b40576000848152600560205260409020600a810154600990910154611b189161275c565b600085815260056020526040902060060154909150611b40906001600160a01b031682612781565b611b498461284f565b837fc326dcfb5d4e924f5e3e717c0f667b0eecb5abb73fc0b33236b6107c1fd48a57611b73612555565b83604051611b82929190613060565b60405180910390a2505060016002555050565b7f98f1c4e464b303704202467b140ea646a0f96c35a8a703da15a07bc5c3f952ed81565b600081565b60008080611bd767ffffffffffffffff8516606461275c565b90506000611bf082611bea886064612920565b9061295a565b90506000611bfe87836127f9565b919791965090945050505050565b600280541415611c2e5760405162461bcd60e51b815260040161065c90613af0565b600280556000818152600560208190526040909120015481906001600160a01b0316611c6c5760405162461bcd60e51b815260040161065c9061372c565b6003548290610100900460ff1615611c965760405162461bcd60e51b815260040161065c906138e8565b60008181526005602052604090206004015460ff1615611cc85760405162461bcd60e51b815260040161065c906138b1565b6000838152600560205260409020600601546001600160a01b0316611cff5760405162461bcd60e51b815260040161065c90613240565b60008381526005602052604090205415801590611d245750611d208361262b565b4210155b611d405760405162461bcd60e51b815260040161065c90613854565b611d48612b91565b506000838152600560208181526040808420815161016081018352815481526001820154818501526002820154818401526003820154606080830191909152600483015460ff81161515608080850191909152610100918290046001600160a01b0390811660a08087019190915298860154811660c08601526006860154811660e08601526007860154169184019190915284519687018552600884015463ffffffff808216895264010000000082048116898901526801000000000000000082048116898801526c0100000000000000000000000082048116898501527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff16918801919091526101208301968752845180860190955260098401548552600a909301549484019490945261014081018390529351909201519051929392611ea192606492611bea92919081169061292016565b90506000611ec1836101400151602001518361275c90919063ffffffff16565b1115611f6a57611f6a600460009054906101000a90046001600160a01b03166001600160a01b031663931742d36040518163ffffffff1660e01b815260040160206040518083038186803b158015611f1857600080fd5b505afa158015611f2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f509190612ca9565b61014084015160200151611f6590849061275c565b612781565b60035460a083015160608401516040517fb85ed7e40000000000000000000000000000000000000000000000000000000081526000936201000090046001600160a01b03169263b85ed7e492611fc292600401613060565b60206040518083038186803b158015611fda57600080fd5b505afa158015611fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120129190612ca9565b905060008360c001516001600160a01b0316826001600160a01b031614156120595760c084015161014085015151612054919061204f90866127f9565b61298c565b6120c0565b610120840151608001516101408501515161208c91606491611bea916fffffffffffffffffffffffffffffffff16612920565b9050612098828261298c565b6120c08460c0015161204f85610d8c85896101400151600001516127f990919063ffffffff16565b60a084015160e08501516060860151604051632142170760e11b81526001600160a01b03909316926342842e0e926120fc923092600401613015565b600060405180830381600087803b15801561211657600080fd5b505af115801561212a573d6000803e3d6000fd5b505050506121378761284f565b60e084015160c085015161014086015180516020909101516001600160a01b0393841693909216918a917f5266f731bbd4fe6f9a1fb89425bfacb9adca3695584d4398361c2a5a32f97c6f91888761219382610d8c86846127f9565b6040516121a4959493929190613c89565b60405180910390a4505060016002555050505050565b6121c7600061045f612555565b6121e35760405162461bcd60e51b815260040161065c90613604565b6001600160a01b0381166122095760405162461bcd60e51b815260040161065c90613513565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600081815260016020526040812061192990612a04565b60008281526001602052604090206002015461226d9061045f612555565b6107295760405162461bcd60e51b815260040161065c906134b6565b600080546040517fe3a9db1a0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063e3a9db1a906122d3908590600401613001565b60206040518083038186803b1580156122eb57600080fd5b505afa1580156122ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119299190612f6b565b6000828152600560208190526040909120015482906001600160a01b031661235d5760405162461bcd60e51b815260040161065c9061372c565b60008381526005602052604090206007015483906001600160a01b0316612382612555565b6001600160a01b0316148061239f575061239f600061045f612555565b6123bb5760405162461bcd60e51b815260040161065c90613b27565b60008481526005602052604090206004015460ff16151583151514156123e05761253a565b821561240a57600084815260056020526040902067ffffffffffffffff42166001909101556124a9565b82158015612428575060008481526005602052604090206001015415155b8015612441575060008481526005602052604090205415155b156124a9576000848152600560205260409020600101546124639042906127f9565b600085815260056020526040812060088101805463ffffffff64010000000080830482169096011690940267ffffffff0000000019909416939093179092556001909101555b600084815260056020819052604090912060048101805460ff191686151517905501546001600160a01b0316847fae3de7f7c5462d334767296a417566554b9cc3078ea4d932182f55a4556cb4006124ff612555565b600088815260056020526040908190206008015490516125319291899164010000000090910463ffffffff1690613039565b60405180910390a35b50505050565b6000611926836001600160a01b038416612a0f565b3390565b60008281526001602052604090206125719082612540565b1561066f5761257e612555565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526001602052604090206125da9082612a59565b1561066f576125e7612555565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60009081526005602052604090206008810154905464010000000090910463ffffffff160190565b60008281526005602052604081206008015481908190819061267c90869063ffffffff16611bbe565b60008881526005602052604090206006015491935091506001600160a01b03166126d6576000868152600560205260409020600201548210156126d15760405162461bcd60e51b815260040161065c906132fa565b612751565b600086815260056020526040902060088101546009909101546127329161271a91606491611bea919063ffffffff6801000000000000000090910481169061292016565b6000888152600560205260409020600901549061275c565b8210156127515760405162461bcd60e51b815260040161065c906137c0565b909590945092505050565b6000828201838110156119265760405162461bcd60e51b815260040161065c90613209565b6000826001600160a01b0316826175309060405161279e90612ffe565b600060405180830381858888f193505050503d80600081146127dc576040519150601f19603f3d011682016040523d82523d6000602084013e6127e1565b606091505b50509050806127f4576127f4838361298c565b505050565b60008282111561281b5760405162461bcd60e51b815260040161065c90613357565b50900390565b80546001019055565b5490565b60006119268383612a6e565b6000611926836001600160a01b038416612ab3565b60008181526005602081815260408084206004810180546003830180546101009092046001600160a01b0316885260068087528589209289529186529387208790559686529284905284815560018101859055600281018590559084905581547fffffffffffffffffffffff00000000000000000000000000000000000000000016909155908101805473ffffffffffffffffffffffffffffffffffffffff199081169091559281018054841690556007810180549093169092556008820181905560098201819055600a90910155565b60008261292f57506000611929565b8282028284828161293c57fe5b04146119265760405162461bcd60e51b815260040161065c906136cf565b600080821161297b5760405162461bcd60e51b815260040161065c9061347f565b81838161298457fe5b049392505050565b6000546040517ff340fa010000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063f340fa019083906129d7908690600401613001565b6000604051808303818588803b1580156129f057600080fd5b505af11580156105fb573d6000803e3d6000fd5b60006119298261282a565b6000612a1b8383612ab3565b612a5157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611929565b506000611929565b6000611926836001600160a01b038416612acb565b81546000908210612a915760405162461bcd60e51b815260040161065c906130f2565b826000018281548110612aa057fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b60008181526001830160205260408120548015612b875783546000198083019190810190600090879083908110612afe57fe5b9060005260206000200154905080876000018481548110612b1b57fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080612b4b57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611929565b6000915050611929565b6040518061016001604052806000815260200160008152602001600081526020016000815260200160001515815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001612c0a612c1c565b8152602001612c17612c4a565b905290565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b604051806040016040528060008152602001600081525090565b803567ffffffffffffffff8116811461192957600080fd5b803560ff8116811461192957600080fd5b600060208284031215612c9e578081fd5b813561192681613ccd565b600060208284031215612cba578081fd5b815161192681613ccd565b60008060008060808587031215612cda578283fd5b8435612ce581613ccd565b9350602085810135612cf681613ccd565b935060408601359250606086013567ffffffffffffffff80821115612d19578384fd5b818801915088601f830112612d2c578384fd5b813581811115612d3a578485fd5b604051601f8201601f1916810185018381118282101715612d59578687fd5b60405281815283820185018b1015612d6f578586fd5b81858501868301379081019093019390935250939692955090935050565b60008060408385031215612d9f578182fd5b8235612daa81613ccd565b946020939093013593505050565b600080600080600080600060e0888a031215612dd2578283fd5b8735612ddd81613ccd565b965060208801359550604088013594506060880135612dfb81613ce5565b9350608088013567ffffffffffffffff81168114612e17578384fd5b925060a0880135612e2781613cf3565b9150612e368960c08a01612c7c565b905092959891949750929550565b60008060008060008060008060006101208a8c031215612e62578182fd5b8935612e6d81613ccd565b985060208a0135975060408a0135965060608a0135612e8b81613ce5565b9550612e9a8b60808c01612c64565b945060a08a0135612eaa81613cf3565b9350612eb98b60c08c01612c7c565b9250612ec88b60e08c01612c7c565b9150612ed88b6101008c01612c7c565b90509295985092959850929598565b600060208284031215612ef8578081fd5b813561192681613ce5565b600060208284031215612f14578081fd5b5035919050565b60008060408385031215612f2d578182fd5b823591506020830135612f3f81613ccd565b809150509250929050565b60008060408385031215612f5c578182fd5b50508035926020909101359150565b600060208284031215612f7c578081fd5b5051919050565b60008060408385031215612f95578182fd5b823591506020830135612f3f81613ce5565b60008060408385031215612fb9578182fd5b82359150612fca8460208501612c64565b90509250929050565b600060208284031215612fe4578081fd5b815161192681613cf3565b80518252602090810151910152565b90565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03939093168352901515602083015263ffffffff16604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b03958616815260208101949094529115156040840152909216606082015263ffffffff909116608082015260a00190565b901515815260200190565b90815260200190565b7fffffffff0000000000000000000000000000000000000000000000000000000091909116815260200190565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60408201527f6473000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201527f2061646d696e20746f206772616e740000000000000000000000000000000000606082015260800190565b60208082526033908201527f61646d696e43726561746541756374696f6e3a206475726174696f6e206d757360408201527f74206265203e3d2074696d652062756666657200000000000000000000000000606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526029908201527f656e6441756374696f6e3a206e6f20626964646572733b207573652063616e6360408201527f656c41756374696f6e0000000000000000000000000000000000000000000000606082015260800190565b60208082526034908201527f63616e63656c41756374696f6e3a2061756374696f6e2077697468206269647360408201527f206d6179206e6f742062652063616e63656c6564000000000000000000000000606082015260800190565b60208082526023908201527f5f76616c6964617465416e644765744269643a2072657365727665206e6f742060408201527f6d65740000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526030908201527f61646d696e43726561746541756374696f6e3a206d75737420626520746f6b6560408201527f6e206f776e6572206f722061646d696e00000000000000000000000000000000606082015260800190565b6020808252602b908201527f6269643a20746f6b656e206f776e6572206d6179206e6f7420626964206f6e2060408201527f6f776e2061756374696f6e000000000000000000000000000000000000000000606082015260800190565b60208082526016908201527f6269643a2076616c7565206d757374206265203e203000000000000000000000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526030908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201527f2061646d696e20746f207265766f6b6500000000000000000000000000000000606082015260800190565b60208082526032908201527f736574494669727374446962734d61726b657453657474696e67733a2030206160408201527f646472657373206e6f7420616c6c6f7765640000000000000000000000000000606082015260800190565b60208082526034908201527f61646d696e43726561746541756374696f6e3a2073746172742074696d65206d60408201527f75737420626520696e2074686520667574757265000000000000000000000000606082015260800190565b60208082526014908201527f62696464657220726f6c65207265717569726564000000000000000000000000604082015260600190565b60208082526016908201527f63616c6c6572206973206e6f7420616e2061646d696e00000000000000000000604082015260600190565b60208082526030908201527f61646d696e43726561746541756374696f6e3a2061756374696f6e732061726560408201527f20676c6f62616c6c792070617573656400000000000000000000000000000000606082015260800190565b60208082526014908201527f6269643a2061756374696f6e2065787069726564000000000000000000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526015908201527f41756374696f6e20646f65736e27742065786973740000000000000000000000604082015260600190565b6020808252602a908201527f61646d696e43726561746541756374696f6e3a2061756374696f6e20616c726560408201527f6164792065786973747300000000000000000000000000000000000000000000606082015260800190565b60208082526027908201527f5f76616c6964617465416e644765744269643a206d696e696d756d206269642060408201527f6e6f74206d657400000000000000000000000000000000000000000000000000606082015260800190565b6020808252601a908201527f6269643a20616d6f756e742f76616c7565206d69736d61746368000000000000604082015260600190565b60208082526023908201527f656e6441756374696f6e3a2061756374696f6e206973206e6f7420636f6d706c60408201527f6574650000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526012908201527f41756374696f6e206973207061757365642e0000000000000000000000000000604082015260600190565b6020808252601c908201527f41756374696f6e732061726520676c6f62616c6c792070617573656400000000604082015260600190565b60208082526041908201527f61646d696e43726561746541756374696f6e3a20636f6d6d697373696f6e207260408201527f617465202b20726f79616c74792072617465206d757374206265203c3d20313060608201527f3000000000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526035908201527f73657449455243373231546f6b656e43726561746f7252656769737472793a2060408201527f302061646472657373206e6f7420616c6c6f7765640000000000000000000000606082015260800190565b60208082526027908201527f61646d696e43726561746541756374696f6e3a2052657365727665206d75737460408201527f206265203e203000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f6269643a2073656e6465722069732063757272656e742068696768657374206260408201527f6964646572000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526018908201527f6269643a2061756374696f6e206e6f7420737461727465640000000000000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252818101527f4d7573742062652061756374696f6e2063726561746f72206f722061646d696e604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201527f20726f6c657320666f722073656c660000000000000000000000000000000000606082015260800190565b918252602082015260400190565b6000610200820190508c82528b60208301528a604083015289606083015288151560808301526001600160a01b0380891660a084015280881660c084015280871660e08401528086166101008401525063ffffffff80855116610120840152806020860151166101408401528060408601511661016084015280606086015116610180840152506fffffffffffffffffffffffffffffffff6080850151166101a0830152613c796101c0830184612fef565b9c9b505050505050505050505050565b948552602085019390935260408401919091526060830152608082015260a00190565b938452602084019290925263ffffffff166040830152606082015260800190565b6001600160a01b0381168114613ce257600080fd5b50565b8015158114613ce257600080fd5b63ffffffff81168114613ce257600080fdfea2646970667358221220a7bea0099d0bc9950ff774211c17d67c9c7a0ef57900c3c9fec14c46d0e9c10764736f6c634300060c0033608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b61074c8061007d6000396000f3fe6080604052600436106100655760003560e01c8063e3a9db1a11610043578063e3a9db1a146100e5578063f2fde38b1461012a578063f340fa011461015d57610065565b806351cff8d91461006a578063715018a61461009f5780638da5cb5b146100b4575b600080fd5b34801561007657600080fd5b5061009d6004803603602081101561008d57600080fd5b50356001600160a01b0316610183565b005b3480156100ab57600080fd5b5061009d610262565b3480156100c057600080fd5b506100c961032d565b604080516001600160a01b039092168252519081900360200190f35b3480156100f157600080fd5b506101186004803603602081101561010857600080fd5b50356001600160a01b031661033c565b60408051918252519081900360200190f35b34801561013657600080fd5b5061009d6004803603602081101561014d57600080fd5b50356001600160a01b0316610357565b61009d6004803603602081101561017357600080fd5b50356001600160a01b0316610478565b61018b610567565b6001600160a01b031661019c61032d565b6001600160a01b0316146101f7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040812080549190559061021f908261056b565b6040805182815290516001600160a01b038416917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a25050565b61026a610567565b6001600160a01b031661027b61032d565b6001600160a01b0316146102d6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6000546001600160a01b031690565b6001600160a01b031660009081526001602052604090205490565b61035f610567565b6001600160a01b031661037061032d565b6001600160a01b0316146103cb576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166104105760405162461bcd60e51b81526004018080602001828103825260268152602001806106b76026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b610480610567565b6001600160a01b031661049161032d565b6001600160a01b0316146104ec576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811660009081526001602052604090205434906105119082610655565b6001600160a01b038316600081815260016020908152604091829020939093558051848152905191927f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c492918290030190a25050565b3390565b804710156105c0576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b6040516000906001600160a01b0384169083908381818185875af1925050503d806000811461060b576040519150601f19603f3d011682016040523d82523d6000602084013e610610565b606091505b50509050806106505760405162461bcd60e51b815260040180806020018281038252603a8152602001806106dd603a913960400191505060405180910390fd5b505050565b6000828201838110156106af576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564a26469706673582212204e75e906e114d4826d2c80612d1d3c65fd67e6d681579dc36f95a1110c854a6564736f6c634300060c0033636f6e7374727563746f723a20302061646472657373206e6f7420616c6c6f7798f1c4e464b303704202467b140ea646a0f96c35a8a703da15a07bc5c3f952ed80f9b792196f21120f021903634877a78a3dd5e8ef643701b99dae7bb938062d00000000000000000000000075affe4580cd74ab7258572ebcc15d6727c864bd0000000000000000000000002a9699de82f9f057638fcaed65e886847a17c4ef

Deployed Bytecode

0x6080604052600436106101cd5760003560e01c806376cad834116100f7578063a217fddf11610095578063ca15c87311610064578063ca15c8731461051c578063d547741f1461053c578063e2982c211461055c578063e597a2091461057c576101cd565b8063a217fddf14610499578063b6105df4146104ae578063b9a2de3a146104dc578063c40119f8146104fc576101cd565b80639010d07c116100d15780639010d07c1461042457806391d148541461044457806396b5a7551461046457806396e978ff14610484576101cd565b806376cad834146103cf5780637ccfdbfe146103ef5780637f8c75f014610404576101cd565b806336568abe1161016f5780634199e02b1161013e5780634199e02b14610350578063571a26a014610370578063598647f8146103a757806361a552dc146103ba576101cd565b806336568abe146102ce578063398109a3146102ee5780633a80e8931461030e5780633dd0a7e414610330576101cd565b8063248a9ca3116101ab578063248a9ca31461024c5780632badf25c1461026c5780632f2ff15d1461028e57806331b3eb94146102ae576101cd565b80630ce526d1146101d2578063150b7a02146101fd5780631af356491461022a575b600080fd5b3480156101de57600080fd5b506101e761059c565b6040516101f491906130bc565b60405180910390f35b34801561020957600080fd5b5061021d610218366004612cc5565b6105c0565b6040516101f491906130c5565b34801561023657600080fd5b5061024a610245366004612db8565b6105e9565b005b34801561025857600080fd5b506101e7610267366004612f03565b610604565b34801561027857600080fd5b50610281610619565b6040516101f491906130b1565b34801561029a57600080fd5b5061024a6102a9366004612f1b565b610622565b3480156102ba57600080fd5b5061024a6102c9366004612c8d565b610673565b3480156102da57600080fd5b5061024a6102e9366004612f1b565b6106f1565b3480156102fa57600080fd5b5061024a610309366004612ee7565b610733565b34801561031a57600080fd5b5061032361076f565b6040516101f49190613001565b34801561033c57600080fd5b5061024a61034b366004612c8d565b610784565b34801561035c57600080fd5b506101e761036b366004612d8d565b610813565b34801561037c57600080fd5b5061039061038b366004612f03565b610830565b6040516101f49b9a99989796959493929190613bc7565b61024a6103b5366004612f4a565b610925565b3480156103c657600080fd5b50610281610e53565b3480156103db57600080fd5b5061024a6103ea366004612ee7565b610e61565b3480156103fb57600080fd5b50610323610ea4565b34801561041057600080fd5b5061024a61041f366004612e44565b610eb3565b34801561043057600080fd5b5061032361043f366004612f4a565b61190e565b34801561045057600080fd5b5061028161045f366004612f1b565b61192f565b34801561047057600080fd5b5061024a61047f366004612f03565b611947565b34801561049057600080fd5b506101e7611b95565b3480156104a557600080fd5b506101e7611bb9565b3480156104ba57600080fd5b506104ce6104c9366004612fa7565b611bbe565b6040516101f4929190613bb9565b3480156104e857600080fd5b5061024a6104f7366004612f03565b611c0c565b34801561050857600080fd5b5061024a610517366004612c8d565b6121ba565b34801561052857600080fd5b506101e7610537366004612f03565b612238565b34801561054857600080fd5b5061024a610557366004612f1b565b61224f565b34801561056857600080fd5b506101e7610577366004612c8d565b612289565b34801561058857600080fd5b5061024a610597366004612f83565b612323565b7f80f9b792196f21120f021903634877a78a3dd5e8ef643701b99dae7bb938062d81565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6105fb87878787878787606580610eb3565b50505050505050565b60009081526001602052604090206002015490565b60035460ff1681565b6000828152600160205260409020600201546106409061045f612555565b6106655760405162461bcd60e51b815260040161065c9061314f565b60405180910390fd5b61066f8282612559565b5050565b6000546040517f51cff8d90000000000000000000000000000000000000000000000000000000081526001600160a01b03909116906351cff8d9906106bc908490600401613001565b600060405180830381600087803b1580156106d657600080fd5b505af11580156106ea573d6000803e3d6000fd5b5050505050565b6106f9612555565b6001600160a01b0316816001600160a01b0316146107295760405162461bcd60e51b815260040161065c90613b5c565b61066f82826125c2565b610740600061045f612555565b61075c5760405162461bcd60e51b815260040161065c90613604565b6003805460ff1916911515919091179055565b6003546201000090046001600160a01b031681565b610791600061045f612555565b6107ad5760405162461bcd60e51b815260040161065c90613604565b6001600160a01b0381166107d35760405162461bcd60e51b815260040161065c906139a2565b600380546001600160a01b0390921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff909216919091179055565b600660209081526000928352604080842090915290825290205481565b6005602081815260009283526040928390208054600182015460028301546003840154600485015496850154600686015460078701548a5160a081018c52600889015463ffffffff808216835264010000000082048116838d01526801000000000000000082048116838f01526c01000000000000000000000000820416606083015270010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1660808201528b51808d01909c5260098901548c52600a90980154988b0198909852949893979296919560ff8416956101009094046001600160a01b03908116959281169481169316918b565b6002805414156109475760405162461bcd60e51b815260040161065c90613af0565b6002805560035460ff161515600114156109a3576109877f80f9b792196f21120f021903634877a78a3dd5e8ef643701b99dae7bb938062d61045f612555565b6109a35760405162461bcd60e51b815260040161065c906135cd565b6000828152600560208190526040909120015482906001600160a01b03166109dd5760405162461bcd60e51b815260040161065c9061372c565b6003548390610100900460ff1615610a075760405162461bcd60e51b815260040161065c906138e8565b60008181526005602052604090206004015460ff1615610a395760405162461bcd60e51b815260040161065c906138b1565b60003411610a595760405162461bcd60e51b815260040161065c90613448565b348314610a785760405162461bcd60e51b815260040161065c9061381d565b6000848152600560205260409020541580610aa157506000848152600560205260409020544210155b610abd5760405162461bcd60e51b815260040161065c90613ab9565b6000848152600560205260409020541580610adf5750610adc8461262b565b42105b610afb5760405162461bcd60e51b815260040161065c90613698565b610b03612555565b600085815260056020819052604090912001546001600160a01b0390811691161415610b415760405162461bcd60e51b815260040161065c906133eb565b610b49612555565b6000858152600560205260409020600601546001600160a01b0390811691161415610b865760405162461bcd60e51b815260040161065c90613a5c565b600080610b938686612653565b6000888152600560205260409020549193509150610bcb57600086815260056020526040902067ffffffffffffffff42169055610c38565b6000868152600560205260409020600601546001600160a01b031615610c38576000868152600560205260408120600a810154600990910154610c0d9161275c565b6000888152600560205260409020600601549091506001600160a01b0316610c358183612781565b50505b600086815260056020526040902060098101839055600a01819055610c5b612555565b600087815260056020908152604091829020600601805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0394851617905560048054835163e536f52360e01b81529351610d2095919091169363e536f5239381840193909291829003018186803b158015610cd357600080fd5b505afa158015610ce7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0b9190612fd3565b63ffffffff164261275c90919063ffffffff16565b610d298761262b565b1015610dd057610d92610d3b8761262b565b610d8c600460009054906101000a90046001600160a01b03166001600160a01b031663e536f5236040518163ffffffff1660e01b815260040160206040518083038186803b158015610cd357600080fd5b906127f9565b6000878152600560205260409020600801805463ffffffff64010000000080830482169094011690920267ffffffff00000000199092169190911790555b610dd8612555565b600087815260056020526040908190206008810154905491516001600160a01b03939093169289927fd66b5764c67c36e32461c93c76dc6bd7a7a8d9ec4ed13647a30f88b9b5f3aef192610e3e9288928892640100000000900463ffffffff1691613cac565b60405180910390a35050600160025550505050565b600354610100900460ff1681565b610e6e600061045f612555565b610e8a5760405162461bcd60e51b815260040161065c90613604565b600380549115156101000261ff0019909216919091179055565b6004546001600160a01b031681565b600280541415610ed55760405162461bcd60e51b815260040161065c90613af0565b60028055600354610100900460ff1615610f015760405162461bcd60e51b815260040161065c9061363b565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526001600160a01b038a1690636352211e90610f46908b906004016130bc565b60206040518083038186803b158015610f5e57600080fd5b505afa158015610f72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f969190612ca9565b6001600160a01b0316610fa7612555565b6001600160a01b03161480610fc45750610fc4600061045f612555565b610fe05760405162461bcd60e51b815260040161065c9061338e565b6001600160a01b03891660009081526006602090815260408083208b8452909152902054156110215760405162461bcd60e51b815260040161065c90613763565b600087116110415760405162461bcd60e51b815260040161065c906139ff565b611049612b91565b60405180610160016040528060008152602001600081526020018981526020018a815260200188151581526020018b6001600160a01b031681526020018b6001600160a01b0316636352211e8c6040518263ffffffff1660e01b81526004016110b291906130bc565b60206040518083038186803b1580156110ca57600080fd5b505afa1580156110de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111029190612ca9565b6001600160a01b031681526000602082015260400161111f612555565b6001600160a01b031681526020016040518060a00160405280600460009054906101000a90046001600160a01b03166001600160a01b031663e092c7fd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561118657600080fd5b505afa15801561119a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111be9190612fd3565b63ffffffff168152602001600460009054906101000a90046001600160a01b03166001600160a01b031663f309051c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561121757600080fd5b505afa15801561122b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124f9190612fd3565b63ffffffff168152602001600460009054906101000a90046001600160a01b03166001600160a01b03166346d3eb356040518163ffffffff1660e01b815260040160206040518083038186803b1580156112a857600080fd5b505afa1580156112bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e09190612fd3565b63ffffffff168152602001600460009054906101000a90046001600160a01b03166001600160a01b0316637cdd2a566040518163ffffffff1660e01b815260040160206040518083038186803b15801561133957600080fd5b505afa15801561134d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113719190612fd3565b63ffffffff168152602001600460009054906101000a90046001600160a01b03166001600160a01b031663cf9a95f66040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ca57600080fd5b505afa1580156113de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114029190612fd3565b63ffffffff16905281526040805180820190915260008082526020828101829052909201529091506114369061045f612555565b156115a05763ffffffff85161561150057600480546040805163e536f52360e01b815290516001600160a01b039092169263e536f523928282019260209290829003018186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190612fd3565b63ffffffff168563ffffffff1610156114ec5760405162461bcd60e51b815260040161065c906131ac565b61012081015163ffffffff86166020909101525b67ffffffffffffffff86161561154e578567ffffffffffffffff1642106115395760405162461bcd60e51b815260040161065c90613570565b67ffffffffffffffff86168152600060808201525b60ff8416156115685761012081015160ff85166040909101525b60648360ff16116115845761012081015160ff84166060909101525b60648260ff16116115a05761012081015160ff83166080909101525b60646115df826101200151608001516fffffffffffffffffffffffffffffffff168361012001516060015163ffffffff1661275c90919063ffffffff16565b11156115fd5760405162461bcd60e51b815260040161065c9061391f565b6116076007612821565b8060056000611616600761282a565b8152602080820192909252604090810160002083518155838301516001820155838201516002820155606080850151600383015560808086015160048401805460a089015160ff19909116921515929092177fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101006001600160a01b0393841681029190911790915560c088015160058601805473ffffffffffffffffffffffffffffffffffffffff1990811692851692909217905560e089015160068701805483169185169190911790559088015160078087018054909316919093161790556101208701518051600886018054838a01519884015196840151939095015163ffffffff1990951663ffffffff9283161767ffffffff00000000191664010000000098831698909802979097177fffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff166801000000000000000095821695909502949094177fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff166c010000000000000000000000009490911693909302929092176fffffffffffffffffffffffffffffffff908116700100000000000000000000000000000000919092160217909255610140909301518051600985015590910151600a9092019190915561180c9061282a565b6001600160a01b038b1660008181526006602090815260408083208e8452909152908190209290925560c08301519151632142170760e11b815290916342842e0e9161185f919030908e90600401613015565b600060405180830381600087803b15801561187957600080fd5b505af115801561188d573d6000803e3d6000fd5b50505050888a6001600160a01b03166118a6600761282a565b7f3379874afd33ac61edf4b8af3a03c30f782441d9481f3a36833d3be8022e50018460c001518c86608001516118da612555565b886101200151602001516040516118f5959493929190613079565b60405180910390a4505060016002555050505050505050565b6000828152600160205260408120611926908361282e565b90505b92915050565b6000828152600160205260408120611926908361283a565b6002805414156119695760405162461bcd60e51b815260040161065c90613af0565b600280556000818152600560208190526040909120015481906001600160a01b03166119a75760405162461bcd60e51b815260040161065c9061372c565b60008281526005602052604090206007015482906001600160a01b03166119cc612555565b6001600160a01b031614806119e957506119e9600061045f612555565b611a055760405162461bcd60e51b815260040161065c90613b27565b611a12600061045f612555565b611a4e576000838152600560205260409020600601546001600160a01b031615611a4e5760405162461bcd60e51b815260040161065c9061329d565b600083815260056020819052604091829020600480820154928201546003909201549351632142170760e11b81526001600160a01b036101009094048416946342842e0e94611aa294309491169201613015565b600060405180830381600087803b158015611abc57600080fd5b505af1158015611ad0573d6000803e3d6000fd5b5050506000848152600560205260408120600601549091506001600160a01b031615611b40576000848152600560205260409020600a810154600990910154611b189161275c565b600085815260056020526040902060060154909150611b40906001600160a01b031682612781565b611b498461284f565b837fc326dcfb5d4e924f5e3e717c0f667b0eecb5abb73fc0b33236b6107c1fd48a57611b73612555565b83604051611b82929190613060565b60405180910390a2505060016002555050565b7f98f1c4e464b303704202467b140ea646a0f96c35a8a703da15a07bc5c3f952ed81565b600081565b60008080611bd767ffffffffffffffff8516606461275c565b90506000611bf082611bea886064612920565b9061295a565b90506000611bfe87836127f9565b919791965090945050505050565b600280541415611c2e5760405162461bcd60e51b815260040161065c90613af0565b600280556000818152600560208190526040909120015481906001600160a01b0316611c6c5760405162461bcd60e51b815260040161065c9061372c565b6003548290610100900460ff1615611c965760405162461bcd60e51b815260040161065c906138e8565b60008181526005602052604090206004015460ff1615611cc85760405162461bcd60e51b815260040161065c906138b1565b6000838152600560205260409020600601546001600160a01b0316611cff5760405162461bcd60e51b815260040161065c90613240565b60008381526005602052604090205415801590611d245750611d208361262b565b4210155b611d405760405162461bcd60e51b815260040161065c90613854565b611d48612b91565b506000838152600560208181526040808420815161016081018352815481526001820154818501526002820154818401526003820154606080830191909152600483015460ff81161515608080850191909152610100918290046001600160a01b0390811660a08087019190915298860154811660c08601526006860154811660e08601526007860154169184019190915284519687018552600884015463ffffffff808216895264010000000082048116898901526801000000000000000082048116898801526c0100000000000000000000000082048116898501527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff16918801919091526101208301968752845180860190955260098401548552600a909301549484019490945261014081018390529351909201519051929392611ea192606492611bea92919081169061292016565b90506000611ec1836101400151602001518361275c90919063ffffffff16565b1115611f6a57611f6a600460009054906101000a90046001600160a01b03166001600160a01b031663931742d36040518163ffffffff1660e01b815260040160206040518083038186803b158015611f1857600080fd5b505afa158015611f2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f509190612ca9565b61014084015160200151611f6590849061275c565b612781565b60035460a083015160608401516040517fb85ed7e40000000000000000000000000000000000000000000000000000000081526000936201000090046001600160a01b03169263b85ed7e492611fc292600401613060565b60206040518083038186803b158015611fda57600080fd5b505afa158015611fee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120129190612ca9565b905060008360c001516001600160a01b0316826001600160a01b031614156120595760c084015161014085015151612054919061204f90866127f9565b61298c565b6120c0565b610120840151608001516101408501515161208c91606491611bea916fffffffffffffffffffffffffffffffff16612920565b9050612098828261298c565b6120c08460c0015161204f85610d8c85896101400151600001516127f990919063ffffffff16565b60a084015160e08501516060860151604051632142170760e11b81526001600160a01b03909316926342842e0e926120fc923092600401613015565b600060405180830381600087803b15801561211657600080fd5b505af115801561212a573d6000803e3d6000fd5b505050506121378761284f565b60e084015160c085015161014086015180516020909101516001600160a01b0393841693909216918a917f5266f731bbd4fe6f9a1fb89425bfacb9adca3695584d4398361c2a5a32f97c6f91888761219382610d8c86846127f9565b6040516121a4959493929190613c89565b60405180910390a4505060016002555050505050565b6121c7600061045f612555565b6121e35760405162461bcd60e51b815260040161065c90613604565b6001600160a01b0381166122095760405162461bcd60e51b815260040161065c90613513565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600081815260016020526040812061192990612a04565b60008281526001602052604090206002015461226d9061045f612555565b6107295760405162461bcd60e51b815260040161065c906134b6565b600080546040517fe3a9db1a0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063e3a9db1a906122d3908590600401613001565b60206040518083038186803b1580156122eb57600080fd5b505afa1580156122ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119299190612f6b565b6000828152600560208190526040909120015482906001600160a01b031661235d5760405162461bcd60e51b815260040161065c9061372c565b60008381526005602052604090206007015483906001600160a01b0316612382612555565b6001600160a01b0316148061239f575061239f600061045f612555565b6123bb5760405162461bcd60e51b815260040161065c90613b27565b60008481526005602052604090206004015460ff16151583151514156123e05761253a565b821561240a57600084815260056020526040902067ffffffffffffffff42166001909101556124a9565b82158015612428575060008481526005602052604090206001015415155b8015612441575060008481526005602052604090205415155b156124a9576000848152600560205260409020600101546124639042906127f9565b600085815260056020526040812060088101805463ffffffff64010000000080830482169096011690940267ffffffff0000000019909416939093179092556001909101555b600084815260056020819052604090912060048101805460ff191686151517905501546001600160a01b0316847fae3de7f7c5462d334767296a417566554b9cc3078ea4d932182f55a4556cb4006124ff612555565b600088815260056020526040908190206008015490516125319291899164010000000090910463ffffffff1690613039565b60405180910390a35b50505050565b6000611926836001600160a01b038416612a0f565b3390565b60008281526001602052604090206125719082612540565b1561066f5761257e612555565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526001602052604090206125da9082612a59565b1561066f576125e7612555565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60009081526005602052604090206008810154905464010000000090910463ffffffff160190565b60008281526005602052604081206008015481908190819061267c90869063ffffffff16611bbe565b60008881526005602052604090206006015491935091506001600160a01b03166126d6576000868152600560205260409020600201548210156126d15760405162461bcd60e51b815260040161065c906132fa565b612751565b600086815260056020526040902060088101546009909101546127329161271a91606491611bea919063ffffffff6801000000000000000090910481169061292016565b6000888152600560205260409020600901549061275c565b8210156127515760405162461bcd60e51b815260040161065c906137c0565b909590945092505050565b6000828201838110156119265760405162461bcd60e51b815260040161065c90613209565b6000826001600160a01b0316826175309060405161279e90612ffe565b600060405180830381858888f193505050503d80600081146127dc576040519150601f19603f3d011682016040523d82523d6000602084013e6127e1565b606091505b50509050806127f4576127f4838361298c565b505050565b60008282111561281b5760405162461bcd60e51b815260040161065c90613357565b50900390565b80546001019055565b5490565b60006119268383612a6e565b6000611926836001600160a01b038416612ab3565b60008181526005602081815260408084206004810180546003830180546101009092046001600160a01b0316885260068087528589209289529186529387208790559686529284905284815560018101859055600281018590559084905581547fffffffffffffffffffffff00000000000000000000000000000000000000000016909155908101805473ffffffffffffffffffffffffffffffffffffffff199081169091559281018054841690556007810180549093169092556008820181905560098201819055600a90910155565b60008261292f57506000611929565b8282028284828161293c57fe5b04146119265760405162461bcd60e51b815260040161065c906136cf565b600080821161297b5760405162461bcd60e51b815260040161065c9061347f565b81838161298457fe5b049392505050565b6000546040517ff340fa010000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063f340fa019083906129d7908690600401613001565b6000604051808303818588803b1580156129f057600080fd5b505af11580156105fb573d6000803e3d6000fd5b60006119298261282a565b6000612a1b8383612ab3565b612a5157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611929565b506000611929565b6000611926836001600160a01b038416612acb565b81546000908210612a915760405162461bcd60e51b815260040161065c906130f2565b826000018281548110612aa057fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b60008181526001830160205260408120548015612b875783546000198083019190810190600090879083908110612afe57fe5b9060005260206000200154905080876000018481548110612b1b57fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080612b4b57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611929565b6000915050611929565b6040518061016001604052806000815260200160008152602001600081526020016000815260200160001515815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b03168152602001612c0a612c1c565b8152602001612c17612c4a565b905290565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b604051806040016040528060008152602001600081525090565b803567ffffffffffffffff8116811461192957600080fd5b803560ff8116811461192957600080fd5b600060208284031215612c9e578081fd5b813561192681613ccd565b600060208284031215612cba578081fd5b815161192681613ccd565b60008060008060808587031215612cda578283fd5b8435612ce581613ccd565b9350602085810135612cf681613ccd565b935060408601359250606086013567ffffffffffffffff80821115612d19578384fd5b818801915088601f830112612d2c578384fd5b813581811115612d3a578485fd5b604051601f8201601f1916810185018381118282101715612d59578687fd5b60405281815283820185018b1015612d6f578586fd5b81858501868301379081019093019390935250939692955090935050565b60008060408385031215612d9f578182fd5b8235612daa81613ccd565b946020939093013593505050565b600080600080600080600060e0888a031215612dd2578283fd5b8735612ddd81613ccd565b965060208801359550604088013594506060880135612dfb81613ce5565b9350608088013567ffffffffffffffff81168114612e17578384fd5b925060a0880135612e2781613cf3565b9150612e368960c08a01612c7c565b905092959891949750929550565b60008060008060008060008060006101208a8c031215612e62578182fd5b8935612e6d81613ccd565b985060208a0135975060408a0135965060608a0135612e8b81613ce5565b9550612e9a8b60808c01612c64565b945060a08a0135612eaa81613cf3565b9350612eb98b60c08c01612c7c565b9250612ec88b60e08c01612c7c565b9150612ed88b6101008c01612c7c565b90509295985092959850929598565b600060208284031215612ef8578081fd5b813561192681613ce5565b600060208284031215612f14578081fd5b5035919050565b60008060408385031215612f2d578182fd5b823591506020830135612f3f81613ccd565b809150509250929050565b60008060408385031215612f5c578182fd5b50508035926020909101359150565b600060208284031215612f7c578081fd5b5051919050565b60008060408385031215612f95578182fd5b823591506020830135612f3f81613ce5565b60008060408385031215612fb9578182fd5b82359150612fca8460208501612c64565b90509250929050565b600060208284031215612fe4578081fd5b815161192681613cf3565b80518252602090810151910152565b90565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03939093168352901515602083015263ffffffff16604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b03958616815260208101949094529115156040840152909216606082015263ffffffff909116608082015260a00190565b901515815260200190565b90815260200190565b7fffffffff0000000000000000000000000000000000000000000000000000000091909116815260200190565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60408201527f6473000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201527f2061646d696e20746f206772616e740000000000000000000000000000000000606082015260800190565b60208082526033908201527f61646d696e43726561746541756374696f6e3a206475726174696f6e206d757360408201527f74206265203e3d2074696d652062756666657200000000000000000000000000606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526029908201527f656e6441756374696f6e3a206e6f20626964646572733b207573652063616e6360408201527f656c41756374696f6e0000000000000000000000000000000000000000000000606082015260800190565b60208082526034908201527f63616e63656c41756374696f6e3a2061756374696f6e2077697468206269647360408201527f206d6179206e6f742062652063616e63656c6564000000000000000000000000606082015260800190565b60208082526023908201527f5f76616c6964617465416e644765744269643a2072657365727665206e6f742060408201527f6d65740000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526030908201527f61646d696e43726561746541756374696f6e3a206d75737420626520746f6b6560408201527f6e206f776e6572206f722061646d696e00000000000000000000000000000000606082015260800190565b6020808252602b908201527f6269643a20746f6b656e206f776e6572206d6179206e6f7420626964206f6e2060408201527f6f776e2061756374696f6e000000000000000000000000000000000000000000606082015260800190565b60208082526016908201527f6269643a2076616c7565206d757374206265203e203000000000000000000000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526030908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201527f2061646d696e20746f207265766f6b6500000000000000000000000000000000606082015260800190565b60208082526032908201527f736574494669727374446962734d61726b657453657474696e67733a2030206160408201527f646472657373206e6f7420616c6c6f7765640000000000000000000000000000606082015260800190565b60208082526034908201527f61646d696e43726561746541756374696f6e3a2073746172742074696d65206d60408201527f75737420626520696e2074686520667574757265000000000000000000000000606082015260800190565b60208082526014908201527f62696464657220726f6c65207265717569726564000000000000000000000000604082015260600190565b60208082526016908201527f63616c6c6572206973206e6f7420616e2061646d696e00000000000000000000604082015260600190565b60208082526030908201527f61646d696e43726561746541756374696f6e3a2061756374696f6e732061726560408201527f20676c6f62616c6c792070617573656400000000000000000000000000000000606082015260800190565b60208082526014908201527f6269643a2061756374696f6e2065787069726564000000000000000000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526015908201527f41756374696f6e20646f65736e27742065786973740000000000000000000000604082015260600190565b6020808252602a908201527f61646d696e43726561746541756374696f6e3a2061756374696f6e20616c726560408201527f6164792065786973747300000000000000000000000000000000000000000000606082015260800190565b60208082526027908201527f5f76616c6964617465416e644765744269643a206d696e696d756d206269642060408201527f6e6f74206d657400000000000000000000000000000000000000000000000000606082015260800190565b6020808252601a908201527f6269643a20616d6f756e742f76616c7565206d69736d61746368000000000000604082015260600190565b60208082526023908201527f656e6441756374696f6e3a2061756374696f6e206973206e6f7420636f6d706c60408201527f6574650000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526012908201527f41756374696f6e206973207061757365642e0000000000000000000000000000604082015260600190565b6020808252601c908201527f41756374696f6e732061726520676c6f62616c6c792070617573656400000000604082015260600190565b60208082526041908201527f61646d696e43726561746541756374696f6e3a20636f6d6d697373696f6e207260408201527f617465202b20726f79616c74792072617465206d757374206265203c3d20313060608201527f3000000000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526035908201527f73657449455243373231546f6b656e43726561746f7252656769737472793a2060408201527f302061646472657373206e6f7420616c6c6f7765640000000000000000000000606082015260800190565b60208082526027908201527f61646d696e43726561746541756374696f6e3a2052657365727665206d75737460408201527f206265203e203000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f6269643a2073656e6465722069732063757272656e742068696768657374206260408201527f6964646572000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526018908201527f6269643a2061756374696f6e206e6f7420737461727465640000000000000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252818101527f4d7573742062652061756374696f6e2063726561746f72206f722061646d696e604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201527f20726f6c657320666f722073656c660000000000000000000000000000000000606082015260800190565b918252602082015260400190565b6000610200820190508c82528b60208301528a604083015289606083015288151560808301526001600160a01b0380891660a084015280881660c084015280871660e08401528086166101008401525063ffffffff80855116610120840152806020860151166101408401528060408601511661016084015280606086015116610180840152506fffffffffffffffffffffffffffffffff6080850151166101a0830152613c796101c0830184612fef565b9c9b505050505050505050505050565b948552602085019390935260408401919091526060830152608082015260a00190565b938452602084019290925263ffffffff166040830152606082015260800190565b6001600160a01b0381168114613ce257600080fd5b50565b8015158114613ce257600080fd5b63ffffffff81168114613ce257600080fdfea2646970667358221220a7bea0099d0bc9950ff774211c17d67c9c7a0ef57900c3c9fec14c46d0e9c10764736f6c634300060c0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000075affe4580cd74ab7258572ebcc15d6727c864bd0000000000000000000000002a9699de82f9f057638fcaed65e886847a17c4ef

-----Decoded View---------------
Arg [0] : _marketSettings (address): 0x75AFfe4580cd74AB7258572ebCC15D6727c864BD
Arg [1] : _creatorRegistry (address): 0x2a9699dE82f9F057638fCaED65E886847A17c4EF

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000075affe4580cd74ab7258572ebcc15d6727c864bd
Arg [1] : 0000000000000000000000002a9699de82f9f057638fcaed65e886847a17c4ef


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.