2
2
3
3
## SwapFactory
4
4
5
- _ - SwapFactory is a helper for creating Swaps and making asset structs.
5
+ SwapFactory is a helper for creating Swaps and making asset structs.
6
6
7
7
This helper can be used on and off-chain to easily create a Swap struct to be
8
8
used in the {Swaplace-createSwap} function.
9
9
10
10
Swaplace uses a {ISwap-Swap} struct to represent a Swap. This struct is
11
11
composed of:
12
12
13
- - The ` owner ` of the Swap is the address that created the Swap.
14
- - The ` allowed ` address is the address that can accept the Swap. If the allowed
15
- address is the zero address, then anyone can accept the Swap.
16
- - The ` expiry ` date is the timestamp that the Swap will be available to accept.
17
- - The ` biding ` are the assets that the owner is offering.
18
- - The ` asking ` are the assets that the owner wants in exchange.
13
+ - The ` owner ` of the Swap is the address that created the Swap.
14
+ - The ` allowed ` address is the address that can accept the Swap. If the allowed
15
+ address is the zero address, then anyone can accept the Swap.
16
+ - The ` expiry ` date is the timestamp that the Swap will be available to accept.
17
+ - The ` biding ` are the assets that the owner is offering.
18
+ - The ` asking ` are the assets that the owner wants in exchange.
19
19
20
20
The Swap struct uses an {Asset} struct to represent the asset. This struct is
21
21
composed of:
22
22
23
- - The ` address ` of the asset. This address can be from an ERC20 or ERC721 contract.
24
- - The ` amount ` or ` id ` of the asset. This amount can be the amount of ERC20 tokens
25
- or the id of an ERC721 token.
23
+ - The ` address ` of the asset. This address can be from an ERC20 or ERC721 contract.
24
+ - The ` amount ` or ` id ` of the asset. This amount can be the amount of ERC20 tokens
25
+ or the id of an ERC721 token.
26
26
27
27
To use other standards, like ERC1155, you can wrap the ownership of the asset
28
28
in an a trusted contract and Swap as an ERC721. This way, you can tokenize any
29
- on-chain execution and trade on Swaplace._
29
+ on-chain execution and trade on Swaplace.
30
30
31
31
### makeAsset
32
32
@@ -42,5 +42,4 @@ _See {ISwapFactory-makeAsset}._
42
42
function makeSwap(address owner, address allowed, uint256 expiry, struct ISwap.Asset[] biding, struct ISwap.Asset[] asking) public view virtual returns (struct ISwap.Swap)
43
43
```
44
44
45
- @dev See {ISwapFactory-makeSwap}.
46
-
45
+ _ See {ISwapFactory-makeSwap}._
0 commit comments