You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 18, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
-64Lines changed: 0 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,67 +28,3 @@ yarn global add truffle
28
28
```
29
29
yarn run test
30
30
```
31
-
32
-
33
-
34
-
## Smart Contract
35
-
The {Set} contract has three functions, which are the constructor, issue, and redeem.
36
-
37
-
### Underwriting (constructor)
38
-
Underwriting is the process of creating a new {Set} contract. Anybody can create an Index Token by deploying a new {Set} contract that follows the {Set} specification to an Ethereum network. The constructor function is only called once during deployment. The required constructor parameters are below:
39
-
40
-
**Token Creation Parameters**
41
-
42
-
Parameter | Type | Description
43
-
------------ | ------------- | -------------
44
-
tokens | address[] | A list of ERC20 token addresses
45
-
units | uint[] | A list of quantities for each token
46
-
47
-
There are no restrictions to how many different ERC20 tokens can be included, aside from the transaction gas limit and data input limits. Since {Set}s are ERC20 tokens, {Set}s could be composed of other {Set}s. Deploying a {Set} creates a clean-slate contract with 0 tokens.
48
-
49
-
50
-
### Token Issuance (issue)
51
-
Token issuance is the process of generating new tokens from a {Set} Contract. Given the {Set} contract has been deployed, anybody can call the contract's `issue` function to convert a specified mix of ERC20 tokens into a token that represents its underlying parts. There only exists as many {Set} tokens as there are tokens issued less redemptions. The issue function parameters are:
1. Issuer decides the quantity of {Set} tokens to issue
67
-
2. Issuer calls Token A's `approve` function for the specified unit of Token A required multiplied by the quantity desired to issue
68
-
3. Issuer calls Token B's `approve` function for the specified unit of Token B required multiplied by the quantity desired to issue
69
-
4. Issue continues to call `approve` for the correct amount to all remaining tokens
70
-
5. Issuer calls the {Set} Contract's `issue` function with the desired quantity of Index Tokens to issue
71
-
6. The contract transfers the required quantities of tokens to the contracts. If any transfer is unsuccessful, the whole transaction is reverted.
72
-
7. If the previous step was sucessful, the contract increments the corresponding quantity of tokens to the issuer
73
-
74
-
75
-
### Token Redemption (redeem)
76
-
Token Redemption is the process of converting an Index Token into its underlying component tokens. Redeeming tokens reduces the token supply of {Set} tokens in the contract. The issue function parameters are:
77
-
78
-
**Redeem Function Parameters**
79
-
80
-
Parameter | Type | Description
81
-
------------ | ------------- | -------------
82
-
quantity | uint | The quantity of {Set}s to redeem
0 commit comments