IMarketPlace
Functions
initialize
Initializes the MarketPlace, setting the WCSB contract address.
function initialize(address wcsb_, address mira_, address admin) external;
Parameters
Name | Type | Description |
---|---|---|
wcsb_ | address | The address of WCSB contract. |
mira_ | address | The address of MIRA contract. |
admin | address | The address of the contract admin. |
pause
Pauses interaction with the contract. Requirements:
- The caller must have the ADMIN_ROLE.
function pause() external;
unpause
Resumes interaction with the contract. Requirements:
- The caller must have the ADMIN_ROLE.
function unpause() external;
ask
Creates an ask order for an NFT.
Emits the AskCreated
event.
function ask(address nftAddress, uint256 tokenId, address payToken, uint256 price, uint256 deadline)
external
returns (uint256 orderId);
Parameters
Name | Type | Description |
---|---|---|
nftAddress | address | The contract address of the NFT. |
tokenId | uint256 | The token id of the NFT to be sold. |
payToken | address | The ERC20 token address for buyers to pay. |
price | uint256 | The sale price for the NFT. |
deadline | uint256 | The expiration timestamp of the ask order. |
Returns
Name | Type | Description |
---|---|---|
orderId | uint256 | The id of the new generated ask order. |
updateAsk
Updates an ask order.
Emits the AskUpdated
event.
function updateAsk(uint256 orderId, address payToken, uint256 price, uint256 deadline) external;
Parameters
Name | Type | Description |
---|---|---|
orderId | uint256 | The id of the ask order to be updated. |
payToken | address | The ERC20 token address for buyers to pay. |
price | uint256 | The new sale price for the NFT. |
deadline | uint256 | The new expiration timestamp of the ask order. |
cancelAsk
Cancels an ask order.
Emits the AskCanceled
event.
function cancelAsk(uint256 orderId) external;
Parameters
Name | Type | Description |
---|---|---|
orderId | uint256 | The id of the ask order to be canceled. |
acceptAsk
Accepts an ask order.
Emits the OrdersMatched
event.
The amount of CSB to send must be specified in the msg.value
.
function acceptAsk(uint256 orderId) external payable;
Parameters
Name | Type | Description |
---|---|---|
orderId | uint256 | The id of the ask order to be accepted. |
bid
Creates a bid order for an NFT.
Emits the BidCreated
event.
function bid(address nftAddress, uint256 tokenId, address payToken, uint256 price, uint256 deadline)
external
returns (uint256 orderId);
Parameters
Name | Type | Description |
---|---|---|
nftAddress | address | The contract address of the NFT. |
tokenId | uint256 | The token id of the NFT to bid. |
payToken | address | The ERC20 token address for buyers to pay. |
price | uint256 | The bid price for the NFT. |
deadline | uint256 | The expiration timestamp of the bid order. |
Returns
Name | Type | Description |
---|---|---|
orderId | uint256 | The id of the new generated bid order. |
cancelBid
Cancels a bid order.
Emits the BidCanceled
event.
function cancelBid(uint256 orderId) external;
Parameters
Name | Type | Description |
---|---|---|
orderId | uint256 | The id of the bid order to be canceled. |
updateBid
Updates a bid order.
Emits the BidUpdated
event.
function updateBid(uint256 orderId, address payToken, uint256 price, uint256 deadline) external;
Parameters
Name | Type | Description |
---|---|---|
orderId | uint256 | The id of the bid order to be updated. |
payToken | address | The ERC20 token address for buyers to pay. |
price | uint256 | The new bid price for the NFT. |
deadline | uint256 | The new expiration timestamp of the ask order. |
acceptBid
Accepts a bid order.
Emits the OrdersMatched
event.
function acceptBid(uint256 orderId) external;
Parameters
Name | Type | Description |
---|---|---|
orderId | uint256 | The id of the bid order to be accepted. |
getAskOrder
Gets the detail info of an ask order.
function getAskOrder(uint256 orderId) external view returns (DataTypes.Order memory);
Parameters
Name | Type | Description |
---|---|---|
orderId | uint256 | The id of the ask order to query. |
getBidOrder
Gets the detail info of a bid order.
function getBidOrder(uint256 orderId) external view returns (DataTypes.Order memory);
Parameters
Name | Type | Description |
---|---|---|
orderId | uint256 | The id of the bid order to query. |
getAskOrderId
Gets ID of an ask order .
function getAskOrderId(address nftAddress, uint256 tokenId, address owner) external view returns (uint256 orderId);
Parameters
Name | Type | Description |
---|---|---|
nftAddress | address | The contract address of the NFT. |
tokenId | uint256 | The token id of the NFT to be sold. |
owner | address | The owner who creates the order. |
getBidOrderId
Gets ID of a bid order.
function getBidOrderId(address nftAddress, uint256 tokenId, address owner) external view returns (uint256 orderId);
Parameters
Name | Type | Description |
---|---|---|
nftAddress | address | The contract address of the NFT. |
tokenId | uint256 | The token id of the NFT to bid. |
owner | address | The owner who creates the order. |
wcsb
Returns the address of WCSB contract.
function wcsb() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of WCSB contract. |
mira
Returns the address of MIRA contract.
function mira() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of MIRA contract. |