interface IOwnixMarket {
  struct Auction {
    // nft owner address
    address nftOwner;
    // ERC1155 address
    IOwnixERC1155 nft;
    // ERC1155 token id
    uint256 tokenId;
    // Amount
    uint256 amount;
    // NFT Index
    uint32 index;
    // Reserve price for the list in wei
    uint256 reservePrice;
    // List duration
    uint32 duration;
    // Time when this list expires at
    uint256 expiresAt;
    // Bidder address
    address bidder;
    // Price for the bid in wei
    uint256 bidPrice;
    // Time when this bid create at
    uint256 bidCreatedAt;
  }

  // EVENTS
  event NFTListed(
    address indexed _owner,
    IOwnixERC1155 indexed _nft,
    uint256 indexed _tokenId,
    uint256 _amount,
    uint256 _index,
    uint256 _reservePrice,
    uint256 _expiresAt
  );

  event NFTUnlisted(
    address indexed _owner,
    IOwnixERC1155 indexed _nft,
    uint256 indexed _tokenId,
    uint256 _amount,
    uint256 _index
  );

  event ReservePriceChanged(
    address indexed _owner,
    IOwnixERC1155 indexed _nft,
    uint256 indexed _tokenId,
    uint256 _amount,
    uint32 _index,
    uint256 _reservePrice
  );

  event BidCreated(
    IOwnixERC1155 indexed _nft,
    uint256 indexed _tokenId,
    uint256 _amount,
    uint32 _index,
    address indexed _bidder,
    uint256 _price,
    uint256 bidCreatedAt
  );

  event AuctionExtended(
    address indexed _owner,
    IOwnixERC1155 indexed _nft,
    uint256 indexed _tokenId,
    uint256 _amount,
    uint32 _index,
    uint256 _reservePrice,
    uint256 _expiresAt
  );

  event AuctionStarted(
    address _owner,
    IOwnixERC1155 _nft,
    uint256 _tokenId,
    uint256 _amount,
    uint32 _index,
    uint256 _reservePrice,
    uint256 _expiresAt
  );

  event BidAccepted(
    IOwnixERC1155 indexed _nft,
    uint256 indexed _tokenId,
    uint256 _amount,
    uint256 _index,
    address _bidder,
    address indexed _seller,
    uint256 _price
  );

  event InflationPerMillionChanged(uint256 _inflationFeePerMillion);
  event BidFeePerMillionChanged(uint256 _bidFeePerMillion);
  event OwnerSharePerMillionChanged(uint256 _ownerSharePerMillion);
  event BidMinimumRaisePerMillionChanged(uint256 _bidMinimumRaisePerMillion);
  event BidMinimumRaiseAmountChanged(uint256 _bidMinimumRaiseAmount);
  event RoyaltiesPerMillionChanged(uint256 _royaltiesPerMillion);
  event MinimumAuctionDurationChanged(uint256 _minimumAuctionDuration);
  event FeeCollectorChanged(address _feeCollector);
  event InflationCollectorChanged(address _inflationCollector);

  /**
   * @dev List NFT
   * @param _tokenId - The token id
   * @param _amount The amount of tokens being transferred
   * @param _reservePrice The reserve price
   * @param _duration The auction duration in seconds
   */
  function listNFT(uint256 _tokenId, uint256 _amount, uint256 _reservePrice, uint32 _duration) external;

  /**
   * @dev Unlist NFT
   * @param _tokenId - The token id
   * @param _index The index of tokens being transferred
   */
  function unlistNFT(uint256 _tokenId, uint32 _index) external;

   /**
   * @dev Change reserve price
   * @param _tokenId - The token id
   * @param _index - The index of tokens being transferred
   * @param _reservePrice - The new reserve price
   */
  function changeReservePrice(uint256 _tokenId, uint32 _index, uint256 _reservePrice) external;

  /**
   * @dev Place a bid for an ERC1155 token.
   * @notice Tokens can have multiple bids by different users.
   * Users can have only one bid per token.
   * If the user places a bid and has an active bid for that token,
   * the older one will be replaced with the new one.
   * @param _tokenId - The  token id
   * @param _index - The index of tokens being transferred
   * @param _price - The price for the bid
   */
  function placeBid(uint256 _tokenId, uint32 _index, uint256 _price) external;

  /**
   * @dev Place a bid for an ERC1155 token.
   * @notice Tokens can have multiple bids by different users.
   * Users can have only one bid per token.
   * If the user places a bid and has an active bid for that token,
   * the older one will be replaced with the new one.
   * @param _bidder - The bidder address 
   * @param _tokenId - The token id
   * @param _index - The index of tokens being transferred
   * @param _price - The price for the bid
   * @param _deadline A timestamp, the current blocktime must be less than or equal to this timestamp
   * @param _v - Must produce valid secp256k1 signature from the holder along with `r` and `s`
   * @param _r - Must produce valid secp256k1 signature from the holder along with `v` and `s`
   * @param _s - Must produce valid secp256k1 signature from the holder along with `r` and `v`
   */
  function placeBidWithPermit(address _bidder, uint256 _tokenId, uint32 _index, uint256 _price, uint256 _deadline, uint8 _v, bytes32 _r, bytes32 _s) external;
  
 /**
  * @dev Finish auction
  * @param _tokenId - The token id
  * @param _index - The index of tokens being transferred
  */
  function finishAuction(uint256 _tokenId, uint32 _index) external;

   /**
   * @dev Sets the inflation that's we mint every transfer
   * @param _inflationPerMillion - The inflation amount from 0 to 999,999
   */
  function setInflationPerMillion(uint256 _inflationPerMillion) external;

   /**
   * @dev Sets the bid fee that's charged to users to bid
   * @param _bidFeePerMillion - The fee amount from 0 to 999,999
   */
  function setBidFeePerMillion(uint256 _bidFeePerMillion) external;

   /**
   * @dev Sets the share Share for the owner of the contract that's
   * charged to the seller on a successful sale
   * @param _ownerSharePerMillion - The amount, from 0 to 999,999
   */
  function setOwnerSharePerMillion(uint256 _ownerSharePerMillion) external;

  /**
   * @dev Sets bid minimum raise percentage value
   * @param _bidMinimumRaisePerMillion - amount, from 0 to 999,999
   */
  function setBidMinimumRaisePerMillion(uint256 _bidMinimumRaisePerMillion) external;

  /**
   * @dev Sets bid minimum raise token amount value
   * @param _bidMinimumRaiseAmount - The raise token amount, bigger then 0
   */
  function setBidMinimumRaiseAmount(uint256 _bidMinimumRaiseAmount) external;

  /**
   * @dev Sets the fee collector address
   * @param _feeCollector - The fee collector address
   */
  function setFeeCollector(address _feeCollector) external;

   /**
   * @dev Sets the inflation collector address
   * @param _inflationCollector - The fee collector address
   */
  function setInflationCollector(address _inflationCollector) external;

   /**
   * @dev Sets royalties percentage value
   * @param _royaltiesPerMillion - The royalties amount, from 0 to 999,999
   */
  function setRoyaltiesPerMillion(uint256 _royaltiesPerMillion) external;

  /**
   * @dev Sets minimum auction duration
   * @param _minimumAuctionDuration - The minimum auction duration, bigger then 0
   */
  function setMinimumAuctionDuration(uint256 _minimumAuctionDuration) external;
  
   /**
   * @dev withdraw the erc20 tokens from the contract
   * @param _withdrawAddress - The withdraw address
   * @param _amount - The withdrawal amount
   */
  function withdrawERC20(address _withdrawAddress, uint256 _amount) external;

  /**
   * @dev withdraw the erc1155 tokens from the contract
   * @param _tokenAddress - The address of the ERC1155 token
   * @param _tokenId - The token id
   * @param _withdrawAddress - The withdraw address
   * @param _amount - The withdrawal amount
   */
  function withdrawERC1155(address _tokenAddress, uint256 _tokenId, address _withdrawAddress, uint256 _amount) external;

  /**
   * @dev Get auction by token id and index
   * @param _tokenId - The token id
   * @param _index - token index
   * @return auction
   */
  function getAuction(uint256 _tokenId, uint32 _index) external returns (Auction memory);
}
function setBidFeePerMillion(uint256 _bidFeePerMillion) external;

/**
 * @dev Sets the bid fee that's charged to users to bid
 * @param _bidFeePerMillion - The fee amount from 0 to 999,999
 */