-
Notifications
You must be signed in to change notification settings - Fork 45
/
cUSDC.xml
165 lines (153 loc) · 5.79 KB
/
cUSDC.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE token [
<!ENTITY style SYSTEM "../shared.css">
<!ENTITY mint.en SYSTEM "supply.en.shtml">
<!ENTITY redeem.en SYSTEM "withdraw.en.shtml">
<!ENTITY enable.en SYSTEM "enable.en.shtml">
]>
<ts:token xmlns:ts="http://tokenscript.org/2019/10/tokenscript"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xsi:schemaLocation="http://tokenscript.org/2019/10/tokenscript http://tokenscript.org/2019/10/tokenscript/tokenscript.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
custodian="false"
>
<ts:name>
<ts:string xml:lang="en">cUSDC</ts:string>
</ts:name>
<ts:contract name="cUSDC" interface="erc20">
<ts:address network="1">0x39AA39c021dfbaE8faC545936693aC917d5E7563</ts:address>
</ts:contract>
<ts:contract name="USDC" interface="erc20">
<ts:address network="1">0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48</ts:address>
</ts:contract>
<ts:origins>
<ts:ethereum contract="cUSDC"/>
</ts:origins>
<ts:cards>
<ts:token-card>
<ts:view-iconified/>
<ts:view>
</ts:view>
</ts:token-card>
<ts:action>
<ts:name>
<ts:string xml:lang="en">Enable</ts:string>
</ts:name>
<ts:transaction>
<ts:ethereum function="approve" contract="USDC" as="bool">
<ts:data>
<ts:address>0x39AA39c021dfbaE8faC545936693aC917d5E7563</ts:address>
<ts:uint256>115792089237316195423570985008687907853269984665640564039457584007913129639935</ts:uint256>
</ts:data>
</ts:ethereum>
</ts:transaction>
<style type="text/css">&style;</style>
<ts:view xml:lang="en">&enable.en;</ts:view>
</ts:action>
<ts:action>
<ts:name>
<ts:string xml:lang="en">Supply</ts:string>
</ts:name>
<ts:attribute-type id="mintAmount" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:name>
<ts:string xml:lang="en">Amount to supply</ts:string>
</ts:name>
<ts:origins>
<!-- e18 is a hard coded multiplier.
rationale for hardcoding: avoiding over-design -->
<ts:user-entry as="e18"/>
</ts:origins>
</ts:attribute-type>
<ts:transaction>
<ts:ethereum function="mint" contract="cETH" as="uint">
<ts:data>
<ts:uint256 ref="mintAmount"/>
</ts:data>
</ts:ethereum>
</ts:transaction>
<style type="text/css">&style;</style>
<ts:view xml:lang="en">&mint.en;</ts:view>
</ts:action>
<ts:action>
<ts:name>
<ts:string xml:lang="en">Withdraw</ts:string>
</ts:name>
<ts:attribute-type id="redeemAmount" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:name>
<ts:string xml:lang="en">Amount to withdraw</ts:string>
</ts:name>
<ts:origins>
<ts:user-entry as="e8"/>
</ts:origins>
</ts:attribute-type>
<ts:transaction>
<ts:ethereum function="redeem" contract="cETH" as="uint">
<ts:data>
<ts:uint256 ref="redeemAmount"/>
</ts:data>
</ts:ethereum>
</ts:transaction>
<style type="text/css">&style;</style>
<ts:view xml:lang="en">&redeem.en;</ts:view>
</ts:action>
</ts:cards>
<ts:attribute-types>
<ts:attribute-type id="allowance" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:origins>
<ts:ethereum function="allowance" contract="USDC" as="uint">
<ts:data>
<ts:address ref="ownerAddress"/>
<ts:address>0x39AA39c021dfbaE8faC545936693aC917d5E7563</ts:address>
</ts:data>
</ts:ethereum>
</ts:origins>
</ts:attribute-type>
<!-- your balance in USDC (not compound USDC) -->
<ts:attribute-type id="tokenBalance" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:name>
<ts:string xml:lang="en">Balance</ts:string>
<ts:string xml:lang="zh">餘額</ts:string>
</ts:name>
<ts:origins>
<ts:ethereum function="balanceOf" contract="USDC" as="uint">
<ts:data>
<ts:address ref="ownerAddress"/>
</ts:data>
</ts:ethereum>
</ts:origins>
</ts:attribute-type>
<!-- USDC to cUSDC exchange rate -->
<ts:attribute-type id="exchangeRate" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:name>
<ts:string xml:lang="en">Exchange Rate</ts:string>
</ts:name>
<ts:origins>
<ts:ethereum function="exchangeRateCurrent" contract="cUSDC" as="uint">
</ts:ethereum>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type id="cTokenBalance" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:name>
<ts:string xml:lang="en">Balance</ts:string>
<ts:string xml:lang="zh">餘額</ts:string>
</ts:name>
<ts:origins>
<ts:ethereum function="balanceOf" contract="cUSDC" as="uint">
<ts:data>
<ts:address ref="ownerAddress"/>
</ts:data>
</ts:ethereum>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type id="supplyInterestRate" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:name>
<ts:string xml:lang="en">Supply Interest Rate</ts:string>
</ts:name>
<ts:origins>
<ts:ethereum function="supplyRatePerBlock" contract="cUSDC" as="uint">
</ts:ethereum>
</ts:origins>
</ts:attribute-type>
</ts:attribute-types>
</ts:token>