44
55The [ Exchange contract] ( ../contracts/Exchange.sol ) is the entrypoint and main
66contract to the marketplace protocol. It safely offers a decentralized way to
7- exchange tokens of any nature (ERC20, ERC1155, ERC721) using signed orders.It
7+ exchange tokens of any nature (ERC20, ERC1155, ERC721) using signed orders. It
88also supports exchanging bundles of assets, which can include multiple ERC1155,
99ERC721, and Quads.
1010
@@ -29,23 +29,81 @@ seller is asking for (and more).
2929### Bundle Order
3030
3131In addition to single-asset orders, the protocol supports bundle orders, where
32- multiple assets are grouped together as a single entity for exchange. Let's
33- consider this use case :
32+ multiple assets are grouped together as a single entity for exchange. A bundle
33+ can contain :
3434
35- Order B
35+ - Multiple ERC721 tokens
36+ - Multiple ERC1155 tokens
37+ - Multiple Quads
38+ - Any combination of the above
39+
40+ Important restrictions for bundles:
41+
42+ - Bundles cannot contain ERC20 tokens
43+ - Bundles can only be exchanged for ERC20 tokens (not for other NFTs or bundles)
44+
45+ Each asset in the bundle can have its own individual price, and the total price
46+ of the bundle is the sum of all individual asset prices.
47+
48+ #### Bundle Examples
49+
50+ ##### Example 1: Simple Bundle with ERC721 and ERC1155
3651
3752```
38- Alice wants to sell a bundle of assets :
39- 1 LAND (ERC721) with token id 1000
53+ Alice wants to sell a bundle containing :
54+ - 1 LAND (ERC721) with token id 1000
4055 - Price: 1200 MATIC
41- 10 ASSET (ERC1155) with token id 2000
42- - Price: 700 MATIC
43- against 2000 MATIC (ERC20).
56+ - 10 ASSET (ERC1155) with token id 2000
57+ - Price: 800 MATIC
58+ Total bundle price: 2000 MATIC
4459```
4560
46- The order represents this intent and includes the address of the seller, the
47- address for the tokens(ERC721 and ERC1155), the token ids, the individual prices
48- of the assets, the address of the ERC20 and the amount the seller is asking for.
61+ ##### Example 2: Bundle with Quads
62+
63+ ```
64+ Alice wants to sell a bundle containing:
65+ - 2 Quads (3x3 size each)
66+ - First Quad: 500 MATIC
67+ - Second Quad: 500 MATIC
68+ - 1 LAND (ERC721) with token id 1000
69+ - Price: 4000 MATIC
70+ Total bundle price: 5000 MATIC
71+ ```
72+
73+ ##### Example 3: Bundle with Multiple ERC1155
74+
75+ ```
76+ Alice wants to sell a bundle containing:
77+ - 10 ASSET_A (ERC1155) with token id 1000
78+ - Price: 10000 MATIC
79+ - 5 ASSET_B (ERC1155) with token id 2000
80+ - Price: 5000 MATIC
81+ Total bundle price: 15000 MATIC
82+ ```
83+
84+ #### Invalid Bundle Examples
85+
86+ ##### Example 1: Bundle with ERC20 (Not Allowed)
87+
88+ ```
89+ - 1 LAND (ERC721)
90+ - 1000 SAND (ERC20) // ERC20 tokens cannot be part of a bundle
91+ ```
92+
93+ ##### Example 2: Bundle-to-Bundle Exchange (Not Allowed)
94+
95+ ```
96+ - Bundle A (containing ERC721) <-> Bundle B (containing ERC1155)
97+ // Bundles can only be exchanged for ERC20 tokens
98+ ```
99+
100+ ##### Example 3: Bundle with Value > 1 for ERC721 (Not Allowed)
101+
102+ ```
103+ - 2 LAND (ERC721) with token id 1000
104+ - Price: 1200 MATIC each
105+ // ERC721 tokens are unique and cannot have a value > 1 in a bundle
106+ ```
49107
50108### Maker & Taker
51109
0 commit comments