Order types

APENFT market is built on a hybrid system (off-chain/on-chain), which incorporates off-chain signatures (these are called Maker Orders) and on-chain orders (called Taker Orders).
A maker order is a passive order, which can be executed (if not cancelled!) against a taker order after it is signed.
Parameters that are defined in a Solidity struct named Order described as below.

Order Struct

struct Order {
    address exchange;
    address maker;
    address taker;
    uint256 makerRelayerFee;
    uint256 takerRelayerFee;
    uint256 makerProtocolFee;
    uint256 takerProtocolFee;
    address feeRecipient;
    FeeMethod feeMethod;
    SaleKindInterface.Side side;
    SaleKindInterface.SaleKind saleKind;
    address target;
    HowToCall howToCall;
    bytes dataToCall;
    bytes replacementPattern;
    address staticTarget;
    bytes staticExtradata;
    address paymentToken;
    uint256 basePrice;
    uint256 extra;
    uint256 listingTime;
    uint256 expirationTime;
    uint256 salt;
}

Overview of parameters

  • exchange - APENFTExchange contract address
  • maker - wallet address used to make offer
  • taker - wallet address used to take offer
  • makerRelayerFee - royalty fee ratio for maker
  • takerRelayerFee - royalty fee ratio for taker
  • makerProtocolFee - APENFT service fee (paid by the seller to the platform)
  • takerProtocolFee - APENFT service fee (paid by the buyer to the platform)
  • feeMethod - fee method, set the value at 1
  • feeRecipient - Address for the royalty payment, designated by the project team (creator)
  • side - Buy/sell order identifier. Set the value at 0 for a buy order, and 1 for a sell order.
  • saleKind - Selling method, set the value at 0 (sell at a "fixed price")
  • target - NFT collection address
  • howToCall - how to call contract, set the value at 0
  • dataToCall - Encoded data of function name and parameters when making a transfer
  • replacementPattern - The replacement pattern for dataToCall
  • staticTarget - Set the extra parameter value as zero address for fixed-priced orders
  • staticExtradata - Extra parameter for an English auction, set the value as "0x"
  • paymentToken - Tokens used for order payment, set the value to token's contract address
  • basePrice - The listing price of order
  • extra - Extra auction parameter, set the value at 0
  • listingTime - Timestamp of listing
  • expirationTime - Timestamp of order expiration
  • salt - Order's salt,a string of random numbers with a length of 77 digits to prevent duplicate hash

Breakdown of parameters

exchange

APENFTExchange contract address
APENFTExchange contract address on mainnet:TQr5axvJzETeHsUiXv6QjBEh1BKH571AZu

maker

Seller's wallet address, in base58 format.

taker

Buyer's wallet address, in base58 format

makerRelayerFee

Author royalty (paid by the seller to the creator), maxium value is 50%

takerRelayerFee

Author royalty (paid by the buyer to the creator), maxium value is 50%

makerProtocolFee

APENFT service fee (paid by the seller to the platform)

takerProtocolFee

APENFT service fee (paid by the buyer to the platform)

feeMethod

Fee method, set the value at 1

feeRecipient

Address for the royalty payment, designated by the project team (creator)

side

Buy/sell order identifier. Set the value at 0 for a buy order, and 1 for a sell order.

saleKind

Selling method, set the value at 0 (sell at a "fixed price")

target

NFT collection address

howToCall

There are two types for call: 'call' and 'proxy call'. It is fixed value 0 (means 'call') for now.

dataToCall

Encoded data when making a transfer. Its structure as below:

function parseERC721DataToCall(
  bytes memory b
)internal pure
returns (
  bytes4 methodId,
  address to,
  uint256 tokenId
)

replacementPattern

When the sellOrder's replacementPattern is pattern one, the buyOrder's replacementPattern will be pattern two, and vice versa.

Pattern One: 0x000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000

Pattern Two: 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

staticTarget

Set the extra parameter value as zero-address: T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb for fixed-priced orders

staticExtradata

Extra parameter for an English auction, set the value as "0x"

paymentToken

Tokens used for order payment, zero-address: T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb for TRX

basePrice

The price of order, unit is wei, 100000000 = 100 TRX

extra

Extra auction parameter, set the value at 0

listingTime

Timestamp for listing time. Ten digits long, e.g., 1651040633.

expirationTime

Timestamp for order expiration. Ten digits long, e.g. 1651334400.

salt

A string of random numbers with a length of 77 digits, e.g., 76431802940535634443859288223886227759190472848754102518674791180720213667853; 0 cannot be used as the initial character