Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Commit c884f92

Browse files
committed
Update README
1 parent 65c7930 commit c884f92

File tree

1 file changed

+0
-64
lines changed

1 file changed

+0
-64
lines changed

README.md

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -28,67 +28,3 @@ yarn global add truffle
2828
```
2929
yarn run test
3030
```
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:
52-
53-
**Issue Function Parameters**
54-
55-
Parameter | Type | Description
56-
------------ | ------------- | -------------
57-
quantity | uint | The quantity of {Set}s to issue
58-
59-
There are 7 steps to issuing a {Set} token:
60-
61-
<p align="center"><strong>Figure 1: {Set} Issuance Process</strong></p>
62-
<p align="center"><img src="diagrams/SetIssuance.png" alt="Set Issuance" height="300"/></p>
63-
64-
Figure 1 steps explained
65-
66-
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
83-
84-
There are 4 steps to issuing a {Set} token:
85-
86-
<p align="center"><strong>Figure 2: {Set} Redemption Process</strong></p>
87-
<p align="center"><img src="diagrams/SetRedemption.png" alt="Set Redemption" height="200"/></p>
88-
89-
Figure steps explained
90-
1. Issuer decides the quantity of {Set} tokens to redeem
91-
2. Issuer calls the `redeem` function with the quantity to redeem
92-
3. The contract checks to ensure that the user has enough Index tokens. The function reverts if not.
93-
4. The contract transfers the underlying tokens to the sender and then decrements the sender's index token balance
94-

0 commit comments

Comments
 (0)