.. index:: ! contract .. _contract: ########## Contract ########## .. autosolinterface:: IDEXConstants :members: .. autosolinterface:: IDEXAccessControl :members: .. autosolinterface:: INFTProtocolDEX :members: .. sol:struct:: Component Datastructure of a swap component representing an asset of ERC1155, ERC721, ERC20, or ETH. ERC1155 batches are supported through tokenIds and amounts as arrays. :member uint8 assetType: 0 - `ERC1155`, 1 - `ERC721`, 2 - `ERC20`, 3 - `Ether`. :member address tokenAddress: address of the token. :member uint256[] tokenIDs: array if token ids. Multiple token ids can be specified for ERC1155 batch transfers. For ERC721 transfers, this array holds one value. :member uint256[] amounts: array if amounts. Multiple amounts can be specified for ERC1155 batch transfers. For ERC721 transfers, this arrray holds one value. .. sol:struct:: Swap Datastructure representing a swap, which allows for exchanging arbitrary lists of ERC1155, ERC721, ERC20, and Ether assets. Example: Offer [ERC721, ERC721, ERC1155 Batch, ERC1155 Batch, ERC20, ..., ERC20, Ether] for [ERC20, ..., ERC20, ERC721, ..., ERC721]. :member uint256 id: id of the swap. :member uint8 status: swap status: 0 - `open`, 1 - `closed`, 2 - `dropped`. :member Component[][2] components: Two arrays of :sol:struct:`Component`, one for the maker side and one for the taker side. :member address maker: address of the maker account. :member address taker: address of the taker account. :member bool whitelist: `true` if whitelist for this swap is enabled, `false` otherwise. :member bool custodial: `true` if the swap is custodial, `false` otherwise. :member uint256 expiration: block where the swap expires, 0 for no expiration. .. autosolcontract:: DEXConstants :members: .. autosolcontract:: DEXAccessControl :members: .. autosolcontract:: NFTProtocolDEX :members: :exclude-members: LEFT, RIGHT, checkValues, checkEqualLength, checkSingleAmount, checkSingleTokenId, reduceUsersFunds, transferAsset, transferAssetIn, transfer1155, transfer721, transfer20, swapsEnd, pendingWithdrawals, usersEthBalance, users20Balances, users721Ownerships, users1155Balances, validSwap, validSide, _addSwap, _transferAssetsIn, _transferAssetsOut, _setEtherAsset, _getEtherAsset, _transferAsset, _requireComponents, _requireAssets, _requireERC1155Assets, _requireERC721Asset, _requireERC20Asset, _requireSufficientValue, _requiredValue, _checkComponents, _checkComponent, _takerSwapAndValues, _updateBalance, _withdraw, _notExpired, unlocked, amount, sender