diff --git a/docs/SamWitchOrderBook.md b/docs/SamWitchOrderBook.md index 55da6c2..fa88bc2 100644 --- a/docs/SamWitchOrderBook.md +++ b/docs/SamWitchOrderBook.md @@ -1,12 +1,10 @@ # SamWitchOrderBook -*Sam Witch (PaintSwap & Estfor Kingdom)0xDoubleSharp* +_Sam Witch (PaintSwap & Estfor Kingdom)0xDoubleSharp_ > SamWitchOrderBook (SWOB) -This efficient ERC1155 order book is an upgradeable UUPS proxy contract. It has functions for bulk placing limit orders, cancelling limit orders, and claiming NFTs and tokens from filled or partially filled orders. It suppports ERC2981 royalties, and optional dev & burn fees on successful trades. - - +This efficient ERC1155 order book is an upgradeable UUPS proxy contract. It has functions for bulk placing limit orders, cancelling limit orders, and claiming NFTs and tokens from filled or partially filled orders. It suppports ERC2981 royalties, and optional dev & burn fees on successful trades. ## Methods @@ -16,16 +14,11 @@ This efficient ERC1155 order book is an upgradeable UUPS proxy contract. It has function UPGRADE_INTERFACE_VERSION() external view returns (string) ``` - - - - - #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | string | undefined | +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | string | undefined | ### allOrdersAtPrice @@ -35,21 +28,19 @@ function allOrdersAtPrice(enum ISamWitchOrderBook.OrderSide _side, uint256 _toke Get all orders at a specific price level - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _side | enum ISamWitchOrderBook.OrderSide | The side of the order book to get orders from | -| _tokenId | uint256 | The token ID to get orders for | -| _price | uint72 | The price level to get orders for | +| Name | Type | Description | +| --------- | --------------------------------- | --------------------------------------------- | +| \_side | enum ISamWitchOrderBook.OrderSide | The side of the order book to get orders from | +| \_tokenId | uint256 | The token ID to get orders for | +| \_price | uint72 | The price level to get orders for | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | ISamWitchOrderBook.OrderBookEntryHelper[] | undefined | +| Name | Type | Description | +| ---- | ----------------------------------------- | ----------- | +| \_0 | ISamWitchOrderBook.OrderBookEntryHelper[] | undefined | ### cancelOrders @@ -57,16 +48,12 @@ Get all orders at a specific price level function cancelOrders(uint256[] _orderIds, ISamWitchOrderBook.CancelOrder[] _orders) external nonpayable ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _orderIds | uint256[] | undefined | -| _orders | ISamWitchOrderBook.CancelOrder[] | undefined | +| Name | Type | Description | +| ---------- | -------------------------------- | ----------- | +| \_orderIds | uint256[] | undefined | +| \_orders | ISamWitchOrderBook.CancelOrder[] | undefined | ### claimAll @@ -74,17 +61,15 @@ function cancelOrders(uint256[] _orderIds, ISamWitchOrderBook.CancelOrder[] _ord function claimAll(uint256[] _brushOrderIds, uint256[] _nftOrderIds, uint256[] _tokenIds) external nonpayable ``` -Convience function to claim both tokens and nfts in filled or partially filled orders. Must be the maker of these orders. - - +Convience function to claim both tokens and nfts in filled or partially filled orders. Must be the maker of these orders. #### Parameters -| Name | Type | Description | -|---|---|---| -| _brushOrderIds | uint256[] | Array of order IDs from which to claim tokens | -| _nftOrderIds | uint256[] | Array of order IDs from which to claim NFTs | -| _tokenIds | uint256[] | Array of token IDs to claim NFTs for | +| Name | Type | Description | +| --------------- | --------- | --------------------------------------------- | +| \_brushOrderIds | uint256[] | Array of order IDs from which to claim tokens | +| \_nftOrderIds | uint256[] | Array of order IDs from which to claim NFTs | +| \_tokenIds | uint256[] | Array of token IDs to claim NFTs for | ### claimNFTs @@ -92,16 +77,14 @@ Convience function to claim both tokens and nfts in filled or partially filled o function claimNFTs(uint256[] _orderIds, uint256[] _tokenIds) external nonpayable ``` -Claim NFTs associated with filled or partially filled orders Must be the maker of these orders. - - +Claim NFTs associated with filled or partially filled orders Must be the maker of these orders. #### Parameters -| Name | Type | Description | -|---|---|---| -| _orderIds | uint256[] | Array of order IDs from which to claim NFTs | -| _tokenIds | uint256[] | Array of token IDs to claim NFTs for | +| Name | Type | Description | +| ---------- | --------- | ------------------------------------------- | +| \_orderIds | uint256[] | Array of order IDs from which to claim NFTs | +| \_tokenIds | uint256[] | Array of token IDs to claim NFTs for | ### claimTokens @@ -109,15 +92,13 @@ Claim NFTs associated with filled or partially filled orders Must be the function claimTokens(uint256[] _orderIds) external nonpayable ``` -Claim NFTs associated with filled or partially filled orders. Must be the maker of these orders. - - +Claim tokens associated with filled or partially filled orders. Must be the maker of these orders. #### Parameters -| Name | Type | Description | -|---|---|---| -| _orderIds | uint256[] | Array of order IDs from which to claim NFTs | +| Name | Type | Description | +| ---------- | --------- | ------------------------------------------- | +| \_orderIds | uint256[] | Array of order IDs from which to claim NFTs | ### getHighestBid @@ -127,19 +108,17 @@ function getHighestBid(uint256 _tokenId) external view returns (uint72) Get the highest bid for a specific token ID - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _tokenId | uint256 | The token ID to get the highest bid for | +| Name | Type | Description | +| --------- | ------- | --------------------------------------- | +| \_tokenId | uint256 | The token ID to get the highest bid for | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | uint72 | undefined | +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint72 | undefined | ### getLowestAsk @@ -149,41 +128,17 @@ function getLowestAsk(uint256 _tokenId) external view returns (uint72) Get the lowest ask for a specific token ID - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _tokenId | uint256 | The token ID to get the lowest ask for | +| Name | Type | Description | +| --------- | ------- | -------------------------------------- | +| \_tokenId | uint256 | The token ID to get the lowest ask for | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | uint72 | undefined | - -### getMinAmount - -```solidity -function getMinAmount(uint256 _tokenId) external view returns (uint256) -``` - -The minimum amount that can be added to the order book for a specific token ID, to keep the order book healthy - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _tokenId | uint256 | The token ID to get the minimum quantity for | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint72 | undefined | ### getNode @@ -193,43 +148,19 @@ function getNode(enum ISamWitchOrderBook.OrderSide _side, uint256 _tokenId, uint Get the order book entry for a specific order ID - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _side | enum ISamWitchOrderBook.OrderSide | The side of the order book to get the order from | -| _tokenId | uint256 | The token ID to get the order for | -| _price | uint72 | The price level to get the order for | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | BokkyPooBahsRedBlackTreeLibrary.Node | undefined | - -### getTick - -```solidity -function getTick(uint256 _tokenId) external view returns (uint256) -``` - -Get the tick size for a specific token ID - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _tokenId | uint256 | The token ID to get the tick size for | +| Name | Type | Description | +| --------- | --------------------------------- | ------------------------------------------------ | +| \_side | enum ISamWitchOrderBook.OrderSide | The side of the order book to get the order from | +| \_tokenId | uint256 | The token ID to get the order for | +| \_price | uint72 | The price level to get the order for | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | +| Name | Type | Description | +| ---- | ------------------------------------ | ----------- | +| \_0 | BokkyPooBahsRedBlackTreeLibrary.Node | undefined | ### initialize @@ -239,18 +170,16 @@ function initialize(contract IERC1155 _nft, address _token, address _devAddr, ui Initialize the contract as part of the proxy contract deployment - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _nft | contract IERC1155 | Address of the nft | -| _token | address | The quote token | -| _devAddr | address | The address to receive trade fees | -| _devFee | uint16 | The fee to send to the dev address (max 10%) | -| _burntFee | uint8 | The fee to burn (max 2.55%) | -| _maxOrdersPerPrice | uint16 | The maximum number of orders allowed at each price level | +| Name | Type | Description | +| ------------------- | ----------------- | -------------------------------------------------------- | +| \_nft | contract IERC1155 | Address of the nft | +| \_token | address | The quote token | +| \_devAddr | address | The address to receive trade fees | +| \_devFee | uint16 | The fee to send to the dev address (max 10%) | +| \_burntFee | uint8 | The fee to burn (max 2.55%) | +| \_maxOrdersPerPrice | uint16 | The maximum number of orders allowed at each price level | ### limitOrders @@ -258,32 +187,11 @@ Initialize the contract as part of the proxy contract deployment function limitOrders(ISamWitchOrderBook.LimitOrder[] _orders) external nonpayable ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _orders | ISamWitchOrderBook.LimitOrder[] | undefined | - -### nextOrderId - -```solidity -function nextOrderId() external view returns (uint40) -``` - - - - - - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint40 | undefined | +| Name | Type | Description | +| -------- | ------------------------------- | ----------- | +| \_orders | ISamWitchOrderBook.LimitOrder[] | undefined | ### nftsClaimable @@ -293,20 +201,18 @@ function nftsClaimable(uint40[] _orderIds, uint256[] _tokenIds) external view re Get the amount of NFTs claimable for these orders - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _orderIds | uint40[] | The order IDs to get the claimable NFTs for | -| _tokenIds | uint256[] | The token IDs to get the claimable NFTs for | +| Name | Type | Description | +| ---------- | --------- | ------------------------------------------- | +| \_orderIds | uint40[] | The order IDs to get the claimable NFTs for | +| \_tokenIds | uint256[] | The token IDs to get the claimable NFTs for | #### Returns -| Name | Type | Description | -|---|---|---| -| amounts_ | uint256[] | undefined | +| Name | Type | Description | +| --------- | --------- | ----------- | +| amounts\_ | uint256[] | undefined | ### nodeExists @@ -316,21 +222,19 @@ function nodeExists(enum ISamWitchOrderBook.OrderSide _side, uint256 _tokenId, u Check if the node exists - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _side | enum ISamWitchOrderBook.OrderSide | The side of the order book to get the order from | -| _tokenId | uint256 | The token ID to get the order for | -| _price | uint72 | The price level to get the order for | +| Name | Type | Description | +| --------- | --------------------------------- | ------------------------------------------------ | +| \_side | enum ISamWitchOrderBook.OrderSide | The side of the order book to get the order from | +| \_tokenId | uint256 | The token ID to get the order for | +| \_price | uint72 | The price level to get the order for | #### Returns | Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | ### onERC1155BatchReceived @@ -338,25 +242,21 @@ Check if the node exists function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external nonpayable returns (bytes4) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | -| _1 | address | undefined | -| _2 | uint256[] | undefined | -| _3 | uint256[] | undefined | -| _4 | bytes | undefined | +| Name | Type | Description | +| ---- | --------- | ----------- | +| \_0 | address | undefined | +| \_1 | address | undefined | +| \_2 | uint256[] | undefined | +| \_3 | uint256[] | undefined | +| \_4 | bytes | undefined | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | undefined | +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | ### onERC1155Received @@ -364,25 +264,21 @@ function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) e function onERC1155Received(address, address, uint256, uint256, bytes) external nonpayable returns (bytes4) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | -| _1 | address | undefined | -| _2 | uint256 | undefined | -| _3 | uint256 | undefined | -| _4 | bytes | undefined | +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | +| \_1 | address | undefined | +| \_2 | uint256 | undefined | +| \_3 | uint256 | undefined | +| \_4 | bytes | undefined | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | undefined | +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | bytes4 | undefined | ### owner @@ -390,16 +286,13 @@ function onERC1155Received(address, address, uint256, uint256, bytes) external n function owner() external view returns (address) ``` - - -*Returns the address of the current owner.* - +_Returns the address of the current owner._ #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | address | undefined | +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | address | undefined | ### proxiableUUID @@ -407,16 +300,13 @@ function owner() external view returns (address) function proxiableUUID() external view returns (bytes32) ``` - - -*Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.* - +_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | bytes32 | undefined | +| Name | Type | Description | +| ---- | ------- | ----------- | +| \_0 | bytes32 | undefined | ### renounceOwnership @@ -424,10 +314,23 @@ function proxiableUUID() external view returns (bytes32) function renounceOwnership() external nonpayable ``` +_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner._ + +### setFees +```solidity +function setFees(address _devAddr, uint16 _devFee, uint8 _burntFee) external nonpayable +``` -*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.* +Set the fees for the contract +#### Parameters + +| Name | Type | Description | +| ---------- | ------- | -------------------------------------------- | +| \_devAddr | address | The address to receive trade fees | +| \_devFee | uint16 | The fee to send to the dev address (max 10%) | +| \_burntFee | uint8 | The fee to burn (max 2%) | ### setMaxOrdersPerPrice @@ -437,13 +340,11 @@ function setMaxOrdersPerPrice(uint16 _maxOrdersPerPrice) external payable The maximum amount of orders allowed at a specific price level - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _maxOrdersPerPrice | uint16 | The new maximum amount of orders allowed at a specific price level | +| Name | Type | Description | +| ------------------- | ------ | ------------------------------------------------------------------ | +| \_maxOrdersPerPrice | uint16 | The new maximum amount of orders allowed at a specific price level | ### setTokenIdInfos @@ -451,16 +352,12 @@ The maximum amount of orders allowed at a specific price level function setTokenIdInfos(uint256[] _tokenIds, ISamWitchOrderBook.TokenIdInfo[] _tokenIdInfos) external payable ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _tokenIds | uint256[] | undefined | -| _tokenIdInfos | ISamWitchOrderBook.TokenIdInfo[] | undefined | +| Name | Type | Description | +| -------------- | -------------------------------- | ----------- | +| \_tokenIds | uint256[] | undefined | +| \_tokenIdInfos | ISamWitchOrderBook.TokenIdInfo[] | undefined | ### supportsInterface @@ -468,21 +365,19 @@ function setTokenIdInfos(uint256[] _tokenIds, ISamWitchOrderBook.TokenIdInfo[] _ function supportsInterface(bytes4 interfaceId) external view returns (bool) ``` - - -*See {IERC165-supportsInterface}.* +_See {IERC165-supportsInterface}._ #### Parameters -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | #### Returns | Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | ### tokenIdInfos @@ -490,45 +385,39 @@ function supportsInterface(bytes4 interfaceId) external view returns (bool) function tokenIdInfos(uint256 tokenId) external view returns (uint128 tick, uint128 minQuantity) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenId | uint256 | undefined | #### Returns -| Name | Type | Description | -|---|---|---| -| tick | uint128 | undefined | -| minQuantity | uint128 | undefined | +| Name | Type | Description | +| ----------- | ------- | ----------- | +| tick | uint128 | undefined | +| minQuantity | uint128 | undefined | ### tokensClaimable ```solidity -function tokensClaimable(uint40[] _orderIds, bool takeAwayFees) external view returns (uint256 amount_) +function tokensClaimable(uint40[] _orderIds, bool _takeAwayFees) external view returns (uint256 amount_) ``` Get the amount of tokens claimable for these orders - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _orderIds | uint40[] | The order IDs to get the claimable tokens for | -| takeAwayFees | bool | Whether to take away the fees from the claimable amount | +| Name | Type | Description | +| -------------- | -------- | ------------------------------------------------------- | +| \_orderIds | uint40[] | The order IDs to get the claimable tokens for | +| \_takeAwayFees | bool | Whether to take away the fees from the claimable amount | #### Returns -| Name | Type | Description | -|---|---|---| -| amount_ | uint256 | undefined | +| Name | Type | Description | +| -------- | ------- | ----------- | +| amount\_ | uint256 | undefined | ### transferOwnership @@ -536,15 +425,13 @@ Get the amount of tokens claimable for these orders function transferOwnership(address newOwner) external nonpayable ``` - - -*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.* +_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ #### Parameters -| Name | Type | Description | -|---|---|---| -| newOwner | address | undefined | +| Name | Type | Description | +| -------- | ------- | ----------- | +| newOwner | address | undefined | ### updateRoyaltyFee @@ -554,27 +441,20 @@ function updateRoyaltyFee() external nonpayable When the nft royalty changes this updates the fee and recipient. Assumes all token ids have the same royalty - - - ### upgradeToAndCall ```solidity function upgradeToAndCall(address newImplementation, bytes data) external payable ``` - - -*Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.* +_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ #### Parameters -| Name | Type | Description | -|---|---|---| -| newImplementation | address | undefined | -| data | bytes | undefined | - - +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| newImplementation | address | undefined | +| data | bytes | undefined | ## Events @@ -584,20 +464,16 @@ function upgradeToAndCall(address newImplementation, bytes data) external payabl event AddedToBook(address maker, enum ISamWitchOrderBook.OrderSide side, uint256 orderId, uint256 tokenId, uint256 price, uint256 quantity) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| maker | address | undefined | -| side | enum ISamWitchOrderBook.OrderSide | undefined | -| orderId | uint256 | undefined | -| tokenId | uint256 | undefined | -| price | uint256 | undefined | -| quantity | uint256 | undefined | +| Name | Type | Description | +| -------- | --------------------------------- | ----------- | +| maker | address | undefined | +| side | enum ISamWitchOrderBook.OrderSide | undefined | +| orderId | uint256 | undefined | +| tokenId | uint256 | undefined | +| price | uint256 | undefined | +| quantity | uint256 | undefined | ### ClaimedNFTs @@ -605,18 +481,14 @@ event AddedToBook(address maker, enum ISamWitchOrderBook.OrderSide side, uint256 event ClaimedNFTs(address user, uint256[] orderIds, uint256[] tokenIds, uint256[] amounts) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| user | address | undefined | -| orderIds | uint256[] | undefined | -| tokenIds | uint256[] | undefined | -| amounts | uint256[] | undefined | +| Name | Type | Description | +| -------- | --------- | ----------- | +| user | address | undefined | +| orderIds | uint256[] | undefined | +| tokenIds | uint256[] | undefined | +| amounts | uint256[] | undefined | ### ClaimedTokens @@ -624,18 +496,14 @@ event ClaimedNFTs(address user, uint256[] orderIds, uint256[] tokenIds, uint256[ event ClaimedTokens(address user, uint256[] orderIds, uint256 amount, uint256 fees) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| user | address | undefined | -| orderIds | uint256[] | undefined | -| amount | uint256 | undefined | -| fees | uint256 | undefined | +| Name | Type | Description | +| -------- | --------- | ----------- | +| user | address | undefined | +| orderIds | uint256[] | undefined | +| amount | uint256 | undefined | +| fees | uint256 | undefined | ### FailedToAddToBook @@ -643,19 +511,15 @@ event ClaimedTokens(address user, uint256[] orderIds, uint256 amount, uint256 fe event FailedToAddToBook(address maker, enum ISamWitchOrderBook.OrderSide side, uint256 tokenId, uint256 price, uint256 quantity) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| maker | address | undefined | -| side | enum ISamWitchOrderBook.OrderSide | undefined | -| tokenId | uint256 | undefined | -| price | uint256 | undefined | -| quantity | uint256 | undefined | +| Name | Type | Description | +| -------- | --------------------------------- | ----------- | +| maker | address | undefined | +| side | enum ISamWitchOrderBook.OrderSide | undefined | +| tokenId | uint256 | undefined | +| price | uint256 | undefined | +| quantity | uint256 | undefined | ### Initialized @@ -663,15 +527,13 @@ event FailedToAddToBook(address maker, enum ISamWitchOrderBook.OrderSide side, u event Initialized(uint64 version) ``` - - -*Triggered when the contract has been initialized or reinitialized.* +_Triggered when the contract has been initialized or reinitialized._ #### Parameters -| Name | Type | Description | -|---|---|---| -| version | uint64 | undefined | +| Name | Type | Description | +| ------- | ------ | ----------- | +| version | uint64 | undefined | ### OrdersCancelled @@ -679,16 +541,12 @@ event Initialized(uint64 version) event OrdersCancelled(address maker, uint256[] orderIds) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| maker | address | undefined | -| orderIds | uint256[] | undefined | +| Name | Type | Description | +| -------- | --------- | ----------- | +| maker | address | undefined | +| orderIds | uint256[] | undefined | ### OrdersMatched @@ -696,17 +554,13 @@ event OrdersCancelled(address maker, uint256[] orderIds) event OrdersMatched(address taker, uint256[] orderIds, uint256[] quantities) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| taker | address | undefined | -| orderIds | uint256[] | undefined | -| quantities | uint256[] | undefined | +| Name | Type | Description | +| ---------- | --------- | ----------- | +| taker | address | undefined | +| orderIds | uint256[] | undefined | +| quantities | uint256[] | undefined | ### OwnershipTransferred @@ -714,16 +568,26 @@ event OrdersMatched(address taker, uint256[] orderIds, uint256[] quantities) event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) ``` +#### Parameters +| Name | Type | Description | +| ----------------------- | ------- | ----------- | +| previousOwner `indexed` | address | undefined | +| newOwner `indexed` | address | undefined | +### SetFees +```solidity +event SetFees(address devAddr, uint256 devFee, uint256 burntFee) +``` #### Parameters -| Name | Type | Description | -|---|---|---| -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | +| Name | Type | Description | +| -------- | ------- | ----------- | +| devAddr | address | undefined | +| devFee | uint256 | undefined | +| burntFee | uint256 | undefined | ### SetMaxOrdersPerPriceLevel @@ -731,15 +595,11 @@ event OwnershipTransferred(address indexed previousOwner, address indexed newOwn event SetMaxOrdersPerPriceLevel(uint256 maxOrdersPerPrice) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| maxOrdersPerPrice | uint256 | undefined | +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| maxOrdersPerPrice | uint256 | undefined | ### SetTokenIdInfos @@ -747,16 +607,12 @@ event SetMaxOrdersPerPriceLevel(uint256 maxOrdersPerPrice) event SetTokenIdInfos(uint256[] tokenIds, ISamWitchOrderBook.TokenIdInfo[] tokenIdInfos) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| tokenIds | uint256[] | undefined | -| tokenIdInfos | ISamWitchOrderBook.TokenIdInfo[] | undefined | +| Name | Type | Description | +| ------------ | -------------------------------- | ----------- | +| tokenIds | uint256[] | undefined | +| tokenIdInfos | ISamWitchOrderBook.TokenIdInfo[] | undefined | ### Upgraded @@ -764,17 +620,13 @@ event SetTokenIdInfos(uint256[] tokenIds, ISamWitchOrderBook.TokenIdInfo[] token event Upgraded(address indexed implementation) ``` - - -*Emitted when the implementation is upgraded.* +_Emitted when the implementation is upgraded._ #### Parameters -| Name | Type | Description | -|---|---|---| -| implementation `indexed` | address | undefined | - - +| Name | Type | Description | +| ------------------------ | ------- | ----------- | +| implementation `indexed` | address | undefined | ## Errors @@ -784,15 +636,13 @@ event Upgraded(address indexed implementation) error AddressEmptyCode(address target) ``` - - -*There's no code at `target` (it is not a contract).* +_There's no code at `target` (it is not a contract)._ #### Parameters -| Name | Type | Description | -|---|---|---| -| target | address | undefined | +| Name | Type | Description | +| ------ | ------- | ----------- | +| target | address | undefined | ### AddressInsufficientBalance @@ -800,15 +650,13 @@ error AddressEmptyCode(address target) error AddressInsufficientBalance(address account) ``` - - -*The ETH balance of the account is not enough to perform the operation.* +_The ETH balance of the account is not enough to perform the operation._ #### Parameters -| Name | Type | Description | -|---|---|---| -| account | address | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | ### DeadlineExpired @@ -816,15 +664,11 @@ error AddressInsufficientBalance(address account) error DeadlineExpired(uint256 deadline) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| deadline | uint256 | undefined | +| Name | Type | Description | +| -------- | ------- | ----------- | +| deadline | uint256 | undefined | ### DevFeeNotSet @@ -832,10 +676,11 @@ error DeadlineExpired(uint256 deadline) error DevFeeNotSet() ``` +### DevFeeTooHigh - - - +```solidity +error DevFeeTooHigh() +``` ### ERC1967InvalidImplementation @@ -843,15 +688,13 @@ error DevFeeNotSet() error ERC1967InvalidImplementation(address implementation) ``` - - -*The `implementation` of the proxy is invalid.* +_The `implementation` of the proxy is invalid._ #### Parameters -| Name | Type | Description | -|---|---|---| -| implementation | address | undefined | +| Name | Type | Description | +| -------------- | ------- | ----------- | +| implementation | address | undefined | ### ERC1967NonPayable @@ -859,10 +702,7 @@ error ERC1967InvalidImplementation(address implementation) error ERC1967NonPayable() ``` - - -*An upgrade function sees `msg.value > 0` that may be lost.* - +_An upgrade function sees `msg.value > 0` that may be lost._ ### FailedInnerCall @@ -870,10 +710,7 @@ error ERC1967NonPayable() error FailedInnerCall() ``` - - -*A call to an address target failed. The target may have reverted.* - +_A call to an address target failed. The target may have reverted._ ### InvalidInitialization @@ -881,10 +718,7 @@ error FailedInnerCall() error InvalidInitialization() ``` - - -*The contract is already initialized.* - +_The contract is already initialized._ ### InvalidNonce @@ -892,16 +726,12 @@ error InvalidInitialization() error InvalidNonce(uint256 invalid, uint256 nonce) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| invalid | uint256 | undefined | -| nonce | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| invalid | uint256 | undefined | +| nonce | uint256 | undefined | ### InvalidSignature @@ -909,16 +739,12 @@ error InvalidNonce(uint256 invalid, uint256 nonce) error InvalidSignature(address sender, address recoveredAddress) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| sender | address | undefined | -| recoveredAddress | address | undefined | +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| sender | address | undefined | +| recoveredAddress | address | undefined | ### LengthMismatch @@ -926,43 +752,25 @@ error InvalidSignature(address sender, address recoveredAddress) error LengthMismatch() ``` - - - - - ### NoQuantity ```solidity error NoQuantity() ``` - - - - - ### NotERC1155 ```solidity error NotERC1155() ``` - - - - - ### NotInitializing ```solidity error NotInitializing() ``` - - -*The contract is not initializing.* - +_The contract is not initializing._ ### NotMaker @@ -970,38 +778,24 @@ error NotInitializing() error NotMaker() ``` - - - - - ### NothingToClaim ```solidity error NothingToClaim() ``` - - - - - ### OrderNotFound ```solidity error OrderNotFound(uint256 orderId, uint256 price) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| orderId | uint256 | undefined | -| price | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| orderId | uint256 | undefined | +| price | uint256 | undefined | ### OrderNotFoundInTree @@ -1009,16 +803,12 @@ error OrderNotFound(uint256 orderId, uint256 price) error OrderNotFoundInTree(uint256 orderId, uint256 price) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| orderId | uint256 | undefined | -| price | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| orderId | uint256 | undefined | +| price | uint256 | undefined | ### OwnableInvalidOwner @@ -1026,15 +816,13 @@ error OrderNotFoundInTree(uint256 orderId, uint256 price) error OwnableInvalidOwner(address owner) ``` - - -*The owner is not a valid owner account. (eg. `address(0)`)* +_The owner is not a valid owner account. (eg. `address(0)`)_ #### Parameters -| Name | Type | Description | -|---|---|---| -| owner | address | undefined | +| Name | Type | Description | +| ----- | ------- | ----------- | +| owner | address | undefined | ### OwnableUnauthorizedAccount @@ -1042,15 +830,13 @@ error OwnableInvalidOwner(address owner) error OwnableUnauthorizedAccount(address account) ``` - - -*The caller account is not authorized to perform an operation.* +_The caller account is not authorized to perform an operation._ #### Parameters -| Name | Type | Description | -|---|---|---| -| account | address | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| account | address | undefined | ### PriceNotMultipleOfTick @@ -1058,15 +844,11 @@ error OwnableUnauthorizedAccount(address account) error PriceNotMultipleOfTick(uint256 tick) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| tick | uint256 | undefined | +| Name | Type | Description | +| ---- | ------- | ----------- | +| tick | uint256 | undefined | ### PriceZero @@ -1074,26 +856,19 @@ error PriceNotMultipleOfTick(uint256 tick) error PriceZero() ``` - - - - - ### SafeERC20FailedOperation ```solidity error SafeERC20FailedOperation(address token) ``` - - -*An operation with an ERC20 token failed.* +_An operation with an ERC20 token failed._ #### Parameters -| Name | Type | Description | -|---|---|---| -| token | address | undefined | +| Name | Type | Description | +| ----- | ------- | ----------- | +| token | address | undefined | ### TokenDoesntExist @@ -1101,15 +876,11 @@ error SafeERC20FailedOperation(address token) error TokenDoesntExist(uint256 tokenId) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenId | uint256 | undefined | ### TooManyOrdersHit @@ -1117,21 +888,13 @@ error TokenDoesntExist(uint256 tokenId) error TooManyOrdersHit() ``` - - - - - ### UUPSUnauthorizedCallContext ```solidity error UUPSUnauthorizedCallContext() ``` - - -*The call is from an unauthorized context.* - +_The call is from an unauthorized context._ ### UUPSUnsupportedProxiableUUID @@ -1139,25 +902,16 @@ error UUPSUnauthorizedCallContext() error UUPSUnsupportedProxiableUUID(bytes32 slot) ``` - - -*The storage `slot` is unsupported as a UUID.* +_The storage `slot` is unsupported as a UUID._ #### Parameters -| Name | Type | Description | -|---|---|---| -| slot | bytes32 | undefined | +| Name | Type | Description | +| ---- | ------- | ----------- | +| slot | bytes32 | undefined | ### ZeroAddress ```solidity error ZeroAddress() ``` - - - - - - - diff --git a/docs/interfaces/ISamWitchOrderBook.md b/docs/interfaces/ISamWitchOrderBook.md index 4844b59..5861abc 100644 --- a/docs/interfaces/ISamWitchOrderBook.md +++ b/docs/interfaces/ISamWitchOrderBook.md @@ -1,90 +1,66 @@ # ISamWitchOrderBook - - - - - - - - ## Methods ### allOrdersAtPrice ```solidity -function allOrdersAtPrice(enum ISamWitchOrderBook.OrderSide _side, uint256 _tokenId, uint72 _price) external view returns (struct ISamWitchOrderBook.OrderBookEntryHelper[] orderBookEntries) +function allOrdersAtPrice(enum ISamWitchOrderBook.OrderSide side, uint256 tokenId, uint72 price) external view returns (struct ISamWitchOrderBook.OrderBookEntryHelper[] orderBookEntries) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _side | enum ISamWitchOrderBook.OrderSide | undefined | -| _tokenId | uint256 | undefined | -| _price | uint72 | undefined | +| Name | Type | Description | +| ------- | --------------------------------- | ----------- | +| side | enum ISamWitchOrderBook.OrderSide | undefined | +| tokenId | uint256 | undefined | +| price | uint72 | undefined | #### Returns -| Name | Type | Description | -|---|---|---| -| orderBookEntries | ISamWitchOrderBook.OrderBookEntryHelper[] | undefined | +| Name | Type | Description | +| ---------------- | ----------------------------------------- | ----------- | +| orderBookEntries | ISamWitchOrderBook.OrderBookEntryHelper[] | undefined | ### cancelOrders ```solidity -function cancelOrders(uint256[] _orderIds, ISamWitchOrderBook.CancelOrder[] _cancelOrderInfos) external nonpayable +function cancelOrders(uint256[] orderIds, ISamWitchOrderBook.CancelOrder[] cancelOrderInfos) external nonpayable ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _orderIds | uint256[] | undefined | -| _cancelOrderInfos | ISamWitchOrderBook.CancelOrder[] | undefined | +| Name | Type | Description | +| ---------------- | -------------------------------- | ----------- | +| orderIds | uint256[] | undefined | +| cancelOrderInfos | ISamWitchOrderBook.CancelOrder[] | undefined | ### claimAll ```solidity -function claimAll(uint256[] _brushOrderIds, uint256[] _nftOrderIds, uint256[] _tokenIds) external nonpayable +function claimAll(uint256[] brushOrderIds, uint256[] nftOrderIds, uint256[] tokenIds) external nonpayable ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _brushOrderIds | uint256[] | undefined | -| _nftOrderIds | uint256[] | undefined | -| _tokenIds | uint256[] | undefined | +| Name | Type | Description | +| ------------- | --------- | ----------- | +| brushOrderIds | uint256[] | undefined | +| nftOrderIds | uint256[] | undefined | +| tokenIds | uint256[] | undefined | ### claimNFTs ```solidity -function claimNFTs(uint256[] _orderIds, uint256[] _tokenIds) external nonpayable +function claimNFTs(uint256[] orderIds, uint256[] tokenIds) external nonpayable ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _orderIds | uint256[] | undefined | -| _tokenIds | uint256[] | undefined | +| Name | Type | Description | +| -------- | --------- | ----------- | +| orderIds | uint256[] | undefined | +| tokenIds | uint256[] | undefined | ### claimTokens @@ -92,190 +68,118 @@ function claimNFTs(uint256[] _orderIds, uint256[] _tokenIds) external nonpayable function claimTokens(uint256[] _orderIds) external nonpayable ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _orderIds | uint256[] | undefined | +| Name | Type | Description | +| ---------- | --------- | ----------- | +| \_orderIds | uint256[] | undefined | ### getHighestBid ```solidity -function getHighestBid(uint256 _tokenId) external view returns (uint72) +function getHighestBid(uint256 tokenId) external view returns (uint72) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _tokenId | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenId | uint256 | undefined | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | uint72 | undefined | +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint72 | undefined | ### getLowestAsk ```solidity -function getLowestAsk(uint256 _tokenId) external view returns (uint72) +function getLowestAsk(uint256 tokenId) external view returns (uint72) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _tokenId | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenId | uint256 | undefined | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | uint72 | undefined | - -### getMinAmount - -```solidity -function getMinAmount(uint256 _tokenId) external view returns (uint256) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _tokenId | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | +| Name | Type | Description | +| ---- | ------ | ----------- | +| \_0 | uint72 | undefined | ### getNode ```solidity -function getNode(enum ISamWitchOrderBook.OrderSide _side, uint256 _tokenId, uint72 _price) external view returns (struct BokkyPooBahsRedBlackTreeLibrary.Node) -``` - - - - - -#### Parameters - -| Name | Type | Description | -|---|---|---| -| _side | enum ISamWitchOrderBook.OrderSide | undefined | -| _tokenId | uint256 | undefined | -| _price | uint72 | undefined | - -#### Returns - -| Name | Type | Description | -|---|---|---| -| _0 | BokkyPooBahsRedBlackTreeLibrary.Node | undefined | - -### getTick - -```solidity -function getTick(uint256 _tokenId) external view returns (uint256) +function getNode(enum ISamWitchOrderBook.OrderSide side, uint256 tokenId, uint72 price) external view returns (struct BokkyPooBahsRedBlackTreeLibrary.Node) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _tokenId | uint256 | undefined | +| Name | Type | Description | +| ------- | --------------------------------- | ----------- | +| side | enum ISamWitchOrderBook.OrderSide | undefined | +| tokenId | uint256 | undefined | +| price | uint72 | undefined | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | uint256 | undefined | +| Name | Type | Description | +| ---- | ------------------------------------ | ----------- | +| \_0 | BokkyPooBahsRedBlackTreeLibrary.Node | undefined | ### limitOrders ```solidity -function limitOrders(ISamWitchOrderBook.LimitOrder[] _orders) external nonpayable +function limitOrders(ISamWitchOrderBook.LimitOrder[] orders) external nonpayable ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _orders | ISamWitchOrderBook.LimitOrder[] | undefined | +| Name | Type | Description | +| ------ | ------------------------------- | ----------- | +| orders | ISamWitchOrderBook.LimitOrder[] | undefined | ### nftsClaimable ```solidity -function nftsClaimable(uint40[] _orderIds, uint256[] _tokenIds) external view returns (uint256[] amounts) +function nftsClaimable(uint40[] orderIds, uint256[] tokenIds) external view returns (uint256[] amounts) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _orderIds | uint40[] | undefined | -| _tokenIds | uint256[] | undefined | +| Name | Type | Description | +| -------- | --------- | ----------- | +| orderIds | uint40[] | undefined | +| tokenIds | uint256[] | undefined | #### Returns -| Name | Type | Description | -|---|---|---| -| amounts | uint256[] | undefined | +| Name | Type | Description | +| ------- | --------- | ----------- | +| amounts | uint256[] | undefined | ### nodeExists ```solidity -function nodeExists(enum ISamWitchOrderBook.OrderSide _side, uint256 _tokenId, uint72 _price) external view returns (bool) +function nodeExists(enum ISamWitchOrderBook.OrderSide side, uint256 tokenId, uint72 price) external view returns (bool) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _side | enum ISamWitchOrderBook.OrderSide | undefined | -| _tokenId | uint256 | undefined | -| _price | uint72 | undefined | +| Name | Type | Description | +| ------- | --------------------------------- | ----------- | +| side | enum ISamWitchOrderBook.OrderSide | undefined | +| tokenId | uint256 | undefined | +| price | uint72 | undefined | #### Returns | Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | ### onERC1155BatchReceived @@ -283,25 +187,23 @@ function nodeExists(enum ISamWitchOrderBook.OrderSide _side, uint256 _tokenId, u function onERC1155BatchReceived(address operator, address from, uint256[] ids, uint256[] values, bytes data) external nonpayable returns (bytes4) ``` - - -*Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. NOTE: To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector).* +_Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. NOTE: To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector)._ #### Parameters -| Name | Type | Description | -|---|---|---| -| operator | address | The address which initiated the batch transfer (i.e. msg.sender) | -| from | address | The address which previously owned the token | -| ids | uint256[] | An array containing ids of each token being transferred (order and length must match values array) | -| values | uint256[] | An array containing amounts of each token being transferred (order and length must match ids array) | -| data | bytes | Additional data with no specified format | +| Name | Type | Description | +| -------- | --------- | --------------------------------------------------------------------------------------------------- | +| operator | address | The address which initiated the batch transfer (i.e. msg.sender) | +| from | address | The address which previously owned the token | +| ids | uint256[] | An array containing ids of each token being transferred (order and length must match values array) | +| values | uint256[] | An array containing amounts of each token being transferred (order and length must match ids array) | +| data | bytes | Additional data with no specified format | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed | +| Name | Type | Description | +| ---- | ------ | ------------------------------------------------------------------------------------------------------------------------- | +| \_0 | bytes4 | `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed | ### onERC1155Received @@ -309,25 +211,23 @@ function onERC1155BatchReceived(address operator, address from, uint256[] ids, u function onERC1155Received(address operator, address from, uint256 id, uint256 value, bytes data) external nonpayable returns (bytes4) ``` - - -*Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. NOTE: To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector).* +_Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. NOTE: To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector)._ #### Parameters -| Name | Type | Description | -|---|---|---| +| Name | Type | Description | +| -------- | ------- | ---------------------------------------------------------- | | operator | address | The address which initiated the transfer (i.e. msg.sender) | -| from | address | The address which previously owned the token | -| id | uint256 | The ID of the token being transferred | -| value | uint256 | The amount of tokens being transferred | -| data | bytes | Additional data with no specified format | +| from | address | The address which previously owned the token | +| id | uint256 | The ID of the token being transferred | +| value | uint256 | The amount of tokens being transferred | +| data | bytes | Additional data with no specified format | #### Returns -| Name | Type | Description | -|---|---|---| -| _0 | bytes4 | `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed | +| Name | Type | Description | +| ---- | ------ | ---------------------------------------------------------------------------------------------------------------- | +| \_0 | bytes4 | `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed | ### supportsInterface @@ -335,46 +235,38 @@ function onERC1155Received(address operator, address from, uint256 id, uint256 v function supportsInterface(bytes4 interfaceId) external view returns (bool) ``` - - -*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.* +_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._ #### Parameters -| Name | Type | Description | -|---|---|---| -| interfaceId | bytes4 | undefined | +| Name | Type | Description | +| ----------- | ------ | ----------- | +| interfaceId | bytes4 | undefined | #### Returns | Name | Type | Description | -|---|---|---| -| _0 | bool | undefined | +| ---- | ---- | ----------- | +| \_0 | bool | undefined | ### tokensClaimable ```solidity -function tokensClaimable(uint40[] _orderIds, bool takeAwayFees) external view returns (uint256 amount) +function tokensClaimable(uint40[] orderIds, bool takeAwayFees) external view returns (uint256 amount) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| _orderIds | uint40[] | undefined | -| takeAwayFees | bool | undefined | +| Name | Type | Description | +| ------------ | -------- | ----------- | +| orderIds | uint40[] | undefined | +| takeAwayFees | bool | undefined | #### Returns -| Name | Type | Description | -|---|---|---| -| amount | uint256 | undefined | - - +| Name | Type | Description | +| ------ | ------- | ----------- | +| amount | uint256 | undefined | ## Events @@ -384,20 +276,16 @@ function tokensClaimable(uint40[] _orderIds, bool takeAwayFees) external view re event AddedToBook(address maker, enum ISamWitchOrderBook.OrderSide side, uint256 orderId, uint256 tokenId, uint256 price, uint256 quantity) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| maker | address | undefined | -| side | enum ISamWitchOrderBook.OrderSide | undefined | -| orderId | uint256 | undefined | -| tokenId | uint256 | undefined | -| price | uint256 | undefined | -| quantity | uint256 | undefined | +| Name | Type | Description | +| -------- | --------------------------------- | ----------- | +| maker | address | undefined | +| side | enum ISamWitchOrderBook.OrderSide | undefined | +| orderId | uint256 | undefined | +| tokenId | uint256 | undefined | +| price | uint256 | undefined | +| quantity | uint256 | undefined | ### ClaimedNFTs @@ -405,18 +293,14 @@ event AddedToBook(address maker, enum ISamWitchOrderBook.OrderSide side, uint256 event ClaimedNFTs(address user, uint256[] orderIds, uint256[] tokenIds, uint256[] amounts) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| user | address | undefined | -| orderIds | uint256[] | undefined | -| tokenIds | uint256[] | undefined | -| amounts | uint256[] | undefined | +| Name | Type | Description | +| -------- | --------- | ----------- | +| user | address | undefined | +| orderIds | uint256[] | undefined | +| tokenIds | uint256[] | undefined | +| amounts | uint256[] | undefined | ### ClaimedTokens @@ -424,18 +308,14 @@ event ClaimedNFTs(address user, uint256[] orderIds, uint256[] tokenIds, uint256[ event ClaimedTokens(address user, uint256[] orderIds, uint256 amount, uint256 fees) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| user | address | undefined | -| orderIds | uint256[] | undefined | -| amount | uint256 | undefined | -| fees | uint256 | undefined | +| Name | Type | Description | +| -------- | --------- | ----------- | +| user | address | undefined | +| orderIds | uint256[] | undefined | +| amount | uint256 | undefined | +| fees | uint256 | undefined | ### FailedToAddToBook @@ -443,19 +323,15 @@ event ClaimedTokens(address user, uint256[] orderIds, uint256 amount, uint256 fe event FailedToAddToBook(address maker, enum ISamWitchOrderBook.OrderSide side, uint256 tokenId, uint256 price, uint256 quantity) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| maker | address | undefined | -| side | enum ISamWitchOrderBook.OrderSide | undefined | -| tokenId | uint256 | undefined | -| price | uint256 | undefined | -| quantity | uint256 | undefined | +| Name | Type | Description | +| -------- | --------------------------------- | ----------- | +| maker | address | undefined | +| side | enum ISamWitchOrderBook.OrderSide | undefined | +| tokenId | uint256 | undefined | +| price | uint256 | undefined | +| quantity | uint256 | undefined | ### OrdersCancelled @@ -463,16 +339,12 @@ event FailedToAddToBook(address maker, enum ISamWitchOrderBook.OrderSide side, u event OrdersCancelled(address maker, uint256[] orderIds) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| maker | address | undefined | -| orderIds | uint256[] | undefined | +| Name | Type | Description | +| -------- | --------- | ----------- | +| maker | address | undefined | +| orderIds | uint256[] | undefined | ### OrdersMatched @@ -480,17 +352,27 @@ event OrdersCancelled(address maker, uint256[] orderIds) event OrdersMatched(address taker, uint256[] orderIds, uint256[] quantities) ``` +#### Parameters +| Name | Type | Description | +| ---------- | --------- | ----------- | +| taker | address | undefined | +| orderIds | uint256[] | undefined | +| quantities | uint256[] | undefined | +### SetFees +```solidity +event SetFees(address devAddr, uint256 devFee, uint256 burntFee) +``` #### Parameters -| Name | Type | Description | -|---|---|---| -| taker | address | undefined | -| orderIds | uint256[] | undefined | -| quantities | uint256[] | undefined | +| Name | Type | Description | +| -------- | ------- | ----------- | +| devAddr | address | undefined | +| devFee | uint256 | undefined | +| burntFee | uint256 | undefined | ### SetMaxOrdersPerPriceLevel @@ -498,15 +380,11 @@ event OrdersMatched(address taker, uint256[] orderIds, uint256[] quantities) event SetMaxOrdersPerPriceLevel(uint256 maxOrdersPerPrice) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| maxOrdersPerPrice | uint256 | undefined | +| Name | Type | Description | +| ----------------- | ------- | ----------- | +| maxOrdersPerPrice | uint256 | undefined | ### SetTokenIdInfos @@ -514,18 +392,12 @@ event SetMaxOrdersPerPriceLevel(uint256 maxOrdersPerPrice) event SetTokenIdInfos(uint256[] tokenIds, ISamWitchOrderBook.TokenIdInfo[] tokenIdInfos) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| tokenIds | uint256[] | undefined | -| tokenIdInfos | ISamWitchOrderBook.TokenIdInfo[] | undefined | - - +| Name | Type | Description | +| ------------ | -------------------------------- | ----------- | +| tokenIds | uint256[] | undefined | +| tokenIdInfos | ISamWitchOrderBook.TokenIdInfo[] | undefined | ## Errors @@ -535,15 +407,11 @@ event SetTokenIdInfos(uint256[] tokenIds, ISamWitchOrderBook.TokenIdInfo[] token error DeadlineExpired(uint256 deadline) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| deadline | uint256 | undefined | +| Name | Type | Description | +| -------- | ------- | ----------- | +| deadline | uint256 | undefined | ### DevFeeNotSet @@ -551,10 +419,11 @@ error DeadlineExpired(uint256 deadline) error DevFeeNotSet() ``` +### DevFeeTooHigh - - - +```solidity +error DevFeeTooHigh() +``` ### InvalidNonce @@ -562,16 +431,12 @@ error DevFeeNotSet() error InvalidNonce(uint256 invalid, uint256 nonce) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| invalid | uint256 | undefined | -| nonce | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| invalid | uint256 | undefined | +| nonce | uint256 | undefined | ### InvalidSignature @@ -579,16 +444,12 @@ error InvalidNonce(uint256 invalid, uint256 nonce) error InvalidSignature(address sender, address recoveredAddress) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| sender | address | undefined | -| recoveredAddress | address | undefined | +| Name | Type | Description | +| ---------------- | ------- | ----------- | +| sender | address | undefined | +| recoveredAddress | address | undefined | ### LengthMismatch @@ -596,71 +457,42 @@ error InvalidSignature(address sender, address recoveredAddress) error LengthMismatch() ``` - - - - - ### NoQuantity ```solidity error NoQuantity() ``` - - - - - ### NotERC1155 ```solidity error NotERC1155() ``` - - - - - ### NotMaker ```solidity error NotMaker() ``` - - - - - ### NothingToClaim ```solidity error NothingToClaim() ``` - - - - - ### OrderNotFound ```solidity error OrderNotFound(uint256 orderId, uint256 price) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| orderId | uint256 | undefined | -| price | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| orderId | uint256 | undefined | +| price | uint256 | undefined | ### OrderNotFoundInTree @@ -668,16 +500,12 @@ error OrderNotFound(uint256 orderId, uint256 price) error OrderNotFoundInTree(uint256 orderId, uint256 price) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| orderId | uint256 | undefined | -| price | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| orderId | uint256 | undefined | +| price | uint256 | undefined | ### PriceNotMultipleOfTick @@ -685,15 +513,11 @@ error OrderNotFoundInTree(uint256 orderId, uint256 price) error PriceNotMultipleOfTick(uint256 tick) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| tick | uint256 | undefined | +| Name | Type | Description | +| ---- | ------- | ----------- | +| tick | uint256 | undefined | ### PriceZero @@ -701,26 +525,17 @@ error PriceNotMultipleOfTick(uint256 tick) error PriceZero() ``` - - - - - ### TokenDoesntExist ```solidity error TokenDoesntExist(uint256 tokenId) ``` - - - - #### Parameters -| Name | Type | Description | -|---|---|---| -| tokenId | uint256 | undefined | +| Name | Type | Description | +| ------- | ------- | ----------- | +| tokenId | uint256 | undefined | ### TooManyOrdersHit @@ -728,20 +543,8 @@ error TokenDoesntExist(uint256 tokenId) error TooManyOrdersHit() ``` - - - - - ### ZeroAddress ```solidity error ZeroAddress() ``` - - - - - - -