Skip to content

Commit 9f4d313

Browse files
goldnitenkrishang
andauthored
fixed typos and update event params order in EnglishAuctionsLogic.sol (#381)
* fixed typos * Update EnglishAuctionsLogic.sol Fix wrong event params order --------- Co-authored-by: nkrishang <62195808+nkrishang@users.noreply.github.com>
1 parent ec47cdb commit 9f4d313

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

contracts/old-marketplace/marketplace.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Marketplace design document.
22

3-
This is a live document that explains what the [thirdweb](https://thirdweb.com/) `Marketplace` smart contract is, how it works and can be used, and why it is written the way it is.
3+
This is a live document that explains what the [thirdweb](https://thirdweb.com/) `Marketplace` smart contract is, how it works and can be used, and why it is written the way it is.
44

55
The document is written for technical and non-technical readers. To ask further questions about `Marketplace`, please join the [thirdweb discord](https://discord.gg/thirdweb) or create a [github issue](https://github.com/thirdweb-dev/contracts/issues).
66

@@ -38,7 +38,7 @@ To make an offer to a direct listing, a buyer specifies —
3838

3939
When making an offer to a direct listing, the offer amount is not escrowed in the Marketplace. Instead, making an offer requires the buyer to approve Marketplace to transfer the appropriate amount of currency to let Marketplace transfer the offer amount from the buyer to the lister, in case the lister accepts the buyer's offer.
4040

41-
To buy NFTs from a direct listing buy paying the listing's specified price, a buyer specifes -
41+
To buy NFTs from a direct listing buy paying the listing's specified price, a buyer specifies -
4242

4343
| Parameter | Type | Description |
4444
| --- | --- | --- |
@@ -48,7 +48,7 @@ To buy NFTs from a direct listing buy paying the listing's specified price, a bu
4848
| `currency` | address | The currency in which to pay for the NFTs being bought. |
4949
| `totalPrice` | uint256 | The total price to pay for the NFTs being bought. |
5050

51-
A sale will fail to execute if either (1) the buyer does not own or has not approved Marketplace to transfer the appropriate amount of currency (or hasn't sent the appropriate amount of native tokens), or (2) the lister does not own or has removed Markeplace's approval to transfer the tokens listed for sale.
51+
A sale will fail to execute if either (1) the buyer does not own or has not approved Marketplace to transfer the appropriate amount of currency (or hasn't sent the appropriate amount of native tokens), or (2) the lister does not own or has removed Marketplace's approval to transfer the tokens listed for sale.
5252

5353
A sale is executed when either a buyer pays the fixed price, or the seller accepts an offer made to the listing.
5454

@@ -78,11 +78,11 @@ Every auction listing obeys two 'buffers' to make it a fair auction:
7878

7979
These buffer values are contract-wide, which means every auction conducted in the Marketplace obeys, at any given moment, the same buffers. These buffers can be configured by contract admins i.e. accounts with the `DEFAULT_ADMIN_ROLE` role.
8080

81-
The NFTs to list in an auction *do* leave the wallet of the lister, and are escrowed in the market until the closing of the auction. Whenever a new winning bid is made by a buyer, the buyer deposits this bid amount into the market; this bid amount is escrowed in the market until a new winning bid is made. The previous winning bid amount is automatically refunded to the respective bidder.
81+
The NFTs to list in an auction *do* leave the wallet of the lister, and are escrowed in the market until the closing of the auction. Whenever a new winning bid is made by a buyer, the buyer deposits this bid amount into the market; this bid amount is escrowed in the market until a new winning bid is made. The previous winning bid amount is automatically refunded to the respective bidder.
8282

8383
**Note:** As a result, the new winning bidder pays for the gas used in refunding the previous winning bidder. This trade-off is made for better UX for bidders — a bidder that has been outbid is automatically refunded, and does not need to pull out their deposited bid manually. This reduces bidding to a single action, instead of two actions — bidding, and pulling out the bid on being outbid.
8484

85-
If the lister sets a `buyoutPricePerToken`, the marketplace expects the `buyoutPricePerToken` to be greater than or equal to the `rerservePricePerToken` of the auction.
85+
If the lister sets a `buyoutPricePerToken`, the marketplace expects the `buyoutPricePerToken` to be greater than or equal to the `reservePricePerToken` of the auction.
8686

8787
Once the auction window ends, the seller collects the highest bid, and the buyer collects the auctioned NFTs.
8888

@@ -116,16 +116,16 @@ To thirdweb customers, the `Marketplace` can be set up like any of the other thi
116116
To the end users of thirdweb customers, the experience of using the marketplace will feel familiar to popular marketplace platforms like OpenSea, Zora, etc. The biggest difference in user experience will be that performing any action on the marketplace requires gas fees.
117117

118118
- Thirdweb's customers
119-
- Deploy the marketplace contract like any other thirdweb contract.
120-
- Can set a % 'platform fee'. This % is collected on every sale — when a buyer buys tokens from a direct listing, and when a seller collects the highest bid on auction closing. This platform fee is distributed to the platform fee recipient (set by a contract admin).
121-
- Can set auction buffers. These auction buffers apply to all auctions being conducted in the market.
122-
- End users of thirdweb customers
123-
- Can list NFTs for sale at a fixed price.
124-
- Can edit an existing listing's parameters, e.g. the currency accepted. An auction's parameters cannot be edited once it has started.
125-
- Can make offers to NFTs listed for a fixed price.
126-
- Can auction NFTs.
127-
- Can make bids to auctions.
128-
- Must pay gas fees to perform any actions, including the actions just listed.
119+
- Deploy the marketplace contract like any other thirdweb contract.
120+
- Can set a % 'platform fee'. This % is collected on every sale — when a buyer buys tokens from a direct listing, and when a seller collects the highest bid on auction closing. This platform fee is distributed to the platform fee recipient (set by a contract admin).
121+
- Can set auction buffers. These auction buffers apply to all auctions being conducted in the market.
122+
- End users of thirdweb customers
123+
- Can list NFTs for sale at a fixed price.
124+
- Can edit an existing listing's parameters, e.g. the currency accepted. An auction's parameters cannot be edited once it has started.
125+
- Can make offers to NFTs listed for a fixed price.
126+
- Can auction NFTs.
127+
- Can make bids to auctions.
128+
- Must pay gas fees to perform any actions, including the actions just listed.
129129

130130
## Technical details
131131

@@ -160,7 +160,7 @@ We use common functions and data structures wherever an (1) action is common to
160160
**Example**: Common action and data handled.
161161

162162
- Action: creating a listing | Data: `ListingParameters`
163-
163+
164164
```solidity
165165
struct ListingParameters {
166166
address assetContract;
@@ -183,9 +183,9 @@ An auction has the concept of formally being closed whereas a direct listing doe
183183

184184
### EIPs implemented / supported
185185

186-
To be able to escrow NFTs in the case of auctions, Marketplace implements the receiver interfaces for [ERC1155](https://eips.ethereum.org/EIPS/eip-1155) and [ERC721](https://eips.ethereum.org/EIPS/eip-721) tokens.
186+
To be able to escrow NFTs in the case of auctions, Marketplace implements the receiver interfaces for [ERC1155](https://eips.ethereum.org/EIPS/eip-1155) and [ERC721](https://eips.ethereum.org/EIPS/eip-721) tokens.
187187

188-
To enable meta-transactions (gasless), Marketplace implements [ERC2771](https://eips.ethereum.org/EIPS/eip-2771).
188+
To enable meta-transactions (gasless), Marketplace implements [ERC2771](https://eips.ethereum.org/EIPS/eip-2771).
189189

190190
Marketplace also honors [ERC2981](https://eips.ethereum.org/EIPS/eip-2981) for the distribution of royalties on direct and auction listings.
191191

@@ -200,15 +200,15 @@ The `Marketplace` contract supports both ERC20 currencies, and a chain's native
200200

201201
💡 **Note**: The only exception is offers to direct listings — these can only be made with ERC20 tokens, since Marketplace needs to transfer the offer amount from the buyer to the lister, in case the lister accepts the buyer's offer. This cannot be done with native tokens without escrowing the requisite amount of currency.
202202

203-
The contract wraps all native tokens deposited into it as the canonical ERC20 wrapped version of the native token (e.g. WETH for ether). The contract unwraps the wrapped native token when transferring native tokens to a given address.
203+
The contract wraps all native tokens deposited into it as the canonical ERC20 wrapped version of the native token (e.g. WETH for ether). The contract unwraps the wrapped native token when transferring native tokens to a given address.
204204

205205
If the contract fails to transfer out native tokens, it wraps them back to wrapped native tokens, and transfers the wrapped native tokens to the concerned address. The contract may fail to transfer out native tokens to an address, if the address represents a smart contract that cannot accept native tokens transferred to it directly.
206206

207207
### Alternative designs and trade-offs
208208

209209
**Two contracts instead of one:**
210210

211-
The main alternative design considered for the `Marketplace` was to split the smart contract into two smart contracts, where each handles (1) only direct listings + offers, or (2) only auction listings + bids.
211+
The main alternative design considered for the `Marketplace` was to split the smart contract into two smart contracts, where each handles (1) only direct listings + offers, or (2) only auction listings + bids.
212212

213213
Such a design gives us two 'lean' contracts instead of one large one, and the cost for deploying just one of these two contracts is less than deploying the single, large `Marketplace` contract. Having two separate contracts positions the thirdweb system to be more modular, where a thirdweb customer can only deploy the smart contract that gives them the specific functionality they want.
214214

@@ -220,4 +220,4 @@ Having a single, large contract gives us less room to add the ability for the ma
220220

221221
Marketplace platforms like OpenSea make actions like making an offer to a direct listing, gasless. End users of the marketplace sign messages expressing intent to perform an action (e.g. list *x* NFT for sale at the price of 10 ETH), and a centralized order-book infrastructure matches two seller-buyer intents, and send the respective signed messages by the seller and buyer to their market smart contract for the sale to be executed.
222222

223-
We're working on breaking up, sizing down and optimizing the `Marketplace` contract to accommodate such off-chain actions, and coming up with a central order-book infrastructure that each thirdweb customer can run on their own.
223+
We're working on breaking up, sizing down and optimizing the `Marketplace` contract to accommodate such off-chain actions, and coming up with a central order-book infrastructure that each thirdweb customer can run on their own.

0 commit comments

Comments
 (0)