tx · Hjs5FPWkYKmUj92kLC1xb52hmVT551A8c5zmkuvGxnYG 3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH: -0.01700000 Waves 2022.07.12 10:24 [2136212] smart account 3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH > SELF 0.00000000 Waves
{ "type": 13, "id": "Hjs5FPWkYKmUj92kLC1xb52hmVT551A8c5zmkuvGxnYG", "fee": 1700000, "feeAssetId": null, "timestamp": 1657610702124, "version": 2, "chainId": 84, "sender": "3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH", "senderPublicKey": "4hcnYaYoB2XaCzyJ7wfePpG7EfTd6st6aCAhkskJ9cQ5", "proofs": [ "2gZSPTnw8JJ2AdAoKnC9rBL34okzDF7ufX4KJFNV9y2SopwXBetLHgGK9znavd621TYPijxUsALXUNHj73dCce46" ], "script": "base64:AAIFAAAAAAAAAB4IAhIAEgASABIAEgASABIAEgASABIAEgASABIAEgAAAAAVAAAAAAh1c2RuVXNkdAEAAAAg202DNWRHG5bvnwwvoM991XmdkujhmzUPwT/MewJwKQsAAAAADXVzZG5Vc2R0TFBUQ0kBAAAAIAqBzantQGEdmEq4Oth6BGhTCCbAyZjxYcEpfvod3iryAAAAAAh3eFVzZG5MUAEAAAAgG7mhj3vOTKXN+s5HyQsWjk32W97C65PB1sWo0bGqCxwAAAAAC3d4VXNkbkxQVENJAQAAACC37N3mGwJ72rYTh/1V0NY8tseiNz1LiL3Be29IRACYLwAAAAALd2F2ZXNVc2RuTHABAAAAINUKknePcghEmMkNN/IegHNiilmrJ+abeEGdbsH03iJ2AAAAAA53YXZlc1VzZG5MUFRDSQEAAAAgxRp2zzmtZIv1fW7qZyCOpdLB08oGyQGtTSaCWHrWElkAAAAACWV0aFVzZG5MUAEAAAAgf0Ew/c/5+Zy9fq7UHSNMMuNJS4SB4kp3y/IQBPX7+eEAAAAADGV0aFVzZG5MUFRDSQEAAAAg4e0WyvKtIAu2EMEK2Ns8J2Bjlkj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0kFAAAAAmFtBgQAAAACdHIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAACYW0FAAAADGJ0Y1VzZG5MUFRDSQkABEwAAAACBQAAAAN1cGQJAARMAAAAAgUAAAAEdXBkSwkABEwAAAACBQAAAAdMUElzc3VlCQAETAAAAAIFAAAAAnRyBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmV9BMy", "height": 2136212, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FTtDGumEc1UADC4JpKSzqcWoe2MjnWmMKKE6LRtkjMcs Next: F8v7q2QdSSXmBiUzBLmApArQq7Va3PoAmCoJ6Mo25snM Diff:
Old | New | Differences | |
---|---|---|---|
121 | 121 | case _ => | |
122 | 122 | throw("Can't find asset") | |
123 | 123 | } | |
124 | - | let toIssue = (pmtAmount * (totalIssued / tkStaked)) | |
124 | + | let one = fraction(totalIssued, 100000000, tkStaked) | |
125 | + | let toIssue = (pmtAmount * one) | |
125 | 126 | let updateState = IntegerEntry(keyWXUSDN, (tkStaked + pmtAmount)) | |
126 | 127 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
127 | 128 | if ((LPstake == LPstake)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let usdnUsdt = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS' | |
5 | 5 | ||
6 | 6 | let usdnUsdtLPTCI = base58'i1snzKxSEZVokh9TWj8hTJQEDBsocnL2hRWsSbsMPK7' | |
7 | 7 | ||
8 | 8 | let wxUsdnLP = base58'2sEBVcyDFK2LupCf7MeA4vzHhGK4DC1WjbKGQCLYDqib' | |
9 | 9 | ||
10 | 10 | let wxUsdnLPTCI = base58'DNy6WBfhPE4y82RonGdHhZEunNotEDzmNfrBomWnsyGi' | |
11 | 11 | ||
12 | 12 | let wavesUsdnLp = base58'FLdC14nUVRyiSYjVrMo3X4g8rXQjLbNRaGAyQAm8V68V' | |
13 | 13 | ||
14 | 14 | let wavesUsdnLPTCI = base58'EGQiqw8jLjg6SVLUeeqMLjk3EjhEVHtjkJ6w46HyFfep' | |
15 | 15 | ||
16 | 16 | let ethUsdnLP = base58'9ZkS8GoUWn69QhgF1RsRtS9CFtc7ZbDNX5N238Jmqjdr' | |
17 | 17 | ||
18 | 18 | let ethUsdnLPTCI = base58'GCvR4BmCSjncVEEwr9psvhN5mctdNTGPs8Xp4b2oQNFZ' | |
19 | 19 | ||
20 | 20 | let btcUsdnLP = base58'2RmyyZ39ZoPoTWksM6urmjgx9mB8ksP8Ru6ba8u89mZm' | |
21 | 21 | ||
22 | 22 | let btcUsdnLPTCI = base58'4jarprgmcev38EU5p2duJAznZSLUxZ831jCT2vf95Hey' | |
23 | 23 | ||
24 | 24 | let isStopped = false | |
25 | 25 | ||
26 | 26 | let keyUsdtUsdn = "STAKED_LP" | |
27 | 27 | ||
28 | 28 | let keyUsdtUsdnCompound = "From_Compound" | |
29 | 29 | ||
30 | 30 | let keywxUsdnCompound = "WX_USDN_compound" | |
31 | 31 | ||
32 | 32 | let keyWXUSDN = "WX_USDN" | |
33 | 33 | ||
34 | 34 | let keyWAVESUSDN = "WAVES_USDN" | |
35 | 35 | ||
36 | 36 | let keyWavesCompound = "WAVES_USDN_COMPOUND" | |
37 | 37 | ||
38 | 38 | let keyBtcUsdn = "BTC_USDN" | |
39 | 39 | ||
40 | 40 | let keyBtcUsdnCompound = "BTC_USDN_COMPOUND" | |
41 | 41 | ||
42 | 42 | let keyEthUsdn = "ETH_USDN" | |
43 | 43 | ||
44 | 44 | let keyEthUsdnCompound = "ETH_USDN_COMPOUND" | |
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func depositBtcUsdnLP () = { | |
48 | 48 | let pmt = value(i.payments[0]) | |
49 | 49 | let pmtAmount = pmt.amount | |
50 | 50 | if ((pmt.assetId != btcUsdnLP)) | |
51 | 51 | then throw("attach BTCUSDNLP tokens only") | |
52 | 52 | else if (isStopped) | |
53 | 53 | then throw("smart contract is on lock") | |
54 | 54 | else { | |
55 | 55 | let tkStaked = valueOrElse(getInteger(this, keyBtcUsdn), 0) | |
56 | 56 | let totalIssued = match assetInfo(btcUsdnLPTCI) { | |
57 | 57 | case asset: Asset => | |
58 | 58 | asset.quantity | |
59 | 59 | case _ => | |
60 | 60 | throw("Can't find asset") | |
61 | 61 | } | |
62 | 62 | let toIssue = (pmtAmount * ((totalIssued - assetBalance(this, btcUsdnLPTCI)) / tkStaked)) | |
63 | 63 | let updateState = IntegerEntry(keyBtcUsdn, (tkStaked + pmtAmount)) | |
64 | 64 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
65 | 65 | if ((LPstake == LPstake)) | |
66 | 66 | then { | |
67 | 67 | let LPIssue = Reissue(btcUsdnLPTCI, toIssue, true) | |
68 | 68 | let transfer = ScriptTransfer(i.caller, toIssue, btcUsdnLPTCI) | |
69 | 69 | [LPIssue, transfer, updateState] | |
70 | 70 | } | |
71 | 71 | else throw("Strict value is not equal to itself.") | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | 77 | @Callable(i) | |
78 | 78 | func depositWavesUsdnLP () = { | |
79 | 79 | let pmt = value(i.payments[0]) | |
80 | 80 | let pmtAmount = pmt.amount | |
81 | 81 | if ((pmt.assetId != wavesUsdnLp)) | |
82 | 82 | then throw("attach WAVESUSDNLP tokens only") | |
83 | 83 | else if (isStopped) | |
84 | 84 | then throw("smart contract is on lock") | |
85 | 85 | else { | |
86 | 86 | let tkStaked = valueOrElse(getInteger(this, keyWAVESUSDN), 0) | |
87 | 87 | let totalIssued = match assetInfo(wavesUsdnLPTCI) { | |
88 | 88 | case asset: Asset => | |
89 | 89 | asset.quantity | |
90 | 90 | case _ => | |
91 | 91 | throw("Can't find asset") | |
92 | 92 | } | |
93 | 93 | let toIssue = (pmtAmount * (totalIssued / tkStaked)) | |
94 | 94 | let updateState = IntegerEntry(keyWAVESUSDN, (tkStaked + pmtAmount)) | |
95 | 95 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
96 | 96 | if ((LPstake == LPstake)) | |
97 | 97 | then { | |
98 | 98 | let LPIssue = Reissue(wavesUsdnLPTCI, toIssue, true) | |
99 | 99 | let transfer = ScriptTransfer(i.caller, toIssue, wavesUsdnLPTCI) | |
100 | 100 | [LPIssue, transfer, updateState] | |
101 | 101 | } | |
102 | 102 | else throw("Strict value is not equal to itself.") | |
103 | 103 | } | |
104 | 104 | } | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | ||
108 | 108 | @Callable(i) | |
109 | 109 | func depositWxUsdnLP () = { | |
110 | 110 | let pmt = value(i.payments[0]) | |
111 | 111 | let pmtAmount = pmt.amount | |
112 | 112 | if ((pmt.assetId != wxUsdnLP)) | |
113 | 113 | then throw("attach WXUSDNLP tokens only") | |
114 | 114 | else if (isStopped) | |
115 | 115 | then throw("smart contract is on lock") | |
116 | 116 | else { | |
117 | 117 | let tkStaked = valueOrElse(getInteger(this, keyWXUSDN), 0) | |
118 | 118 | let totalIssued = match assetInfo(wxUsdnLPTCI) { | |
119 | 119 | case asset: Asset => | |
120 | 120 | asset.quantity | |
121 | 121 | case _ => | |
122 | 122 | throw("Can't find asset") | |
123 | 123 | } | |
124 | - | let toIssue = (pmtAmount * (totalIssued / tkStaked)) | |
124 | + | let one = fraction(totalIssued, 100000000, tkStaked) | |
125 | + | let toIssue = (pmtAmount * one) | |
125 | 126 | let updateState = IntegerEntry(keyWXUSDN, (tkStaked + pmtAmount)) | |
126 | 127 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
127 | 128 | if ((LPstake == LPstake)) | |
128 | 129 | then { | |
129 | 130 | let LPIssue = Reissue(wxUsdnLPTCI, toIssue, true) | |
130 | 131 | let transfer = ScriptTransfer(i.caller, toIssue, wxUsdnLPTCI) | |
131 | 132 | [LPIssue, transfer, updateState] | |
132 | 133 | } | |
133 | 134 | else throw("Strict value is not equal to itself.") | |
134 | 135 | } | |
135 | 136 | } | |
136 | 137 | ||
137 | 138 | ||
138 | 139 | ||
139 | 140 | @Callable(i) | |
140 | 141 | func depositUsdtUsdnLP () = { | |
141 | 142 | let pmt = value(i.payments[0]) | |
142 | 143 | let pmtAmount = pmt.amount | |
143 | 144 | if ((pmt.assetId != usdnUsdt)) | |
144 | 145 | then throw("attach USDTUSDNLP tokens only") | |
145 | 146 | else if (isStopped) | |
146 | 147 | then throw("smart contract is on lock") | |
147 | 148 | else { | |
148 | 149 | let tkStaked = valueOrElse(getInteger(this, keyUsdtUsdn), 0) | |
149 | 150 | let totalIssued = match assetInfo(usdnUsdtLPTCI) { | |
150 | 151 | case asset: Asset => | |
151 | 152 | asset.quantity | |
152 | 153 | case _ => | |
153 | 154 | throw("Can't find asset") | |
154 | 155 | } | |
155 | 156 | let toIssue = (pmtAmount * (totalIssued / tkStaked)) | |
156 | 157 | let updateState = IntegerEntry(keyUsdtUsdn, (tkStaked + pmtAmount)) | |
157 | 158 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
158 | 159 | if ((LPstake == LPstake)) | |
159 | 160 | then { | |
160 | 161 | let LPIssue = Reissue(usdnUsdtLPTCI, toIssue, true) | |
161 | 162 | let transfer = ScriptTransfer(i.caller, toIssue, usdnUsdtLPTCI) | |
162 | 163 | [LPIssue, transfer, updateState] | |
163 | 164 | } | |
164 | 165 | else throw("Strict value is not equal to itself.") | |
165 | 166 | } | |
166 | 167 | } | |
167 | 168 | ||
168 | 169 | ||
169 | 170 | ||
170 | 171 | @Callable(i) | |
171 | 172 | func depositEthUsdnLP () = { | |
172 | 173 | let pmt = value(i.payments[0]) | |
173 | 174 | let pmtAmount = pmt.amount | |
174 | 175 | if ((pmt.assetId != ethUsdnLP)) | |
175 | 176 | then throw("attach ETHUSDNLP tokens only") | |
176 | 177 | else if (isStopped) | |
177 | 178 | then throw("smart contract is on lock") | |
178 | 179 | else { | |
179 | 180 | let tkStaked = valueOrElse(getInteger(this, keyEthUsdn), 0) | |
180 | 181 | let totalIssued = match assetInfo(ethUsdnLPTCI) { | |
181 | 182 | case asset: Asset => | |
182 | 183 | asset.quantity | |
183 | 184 | case _ => | |
184 | 185 | throw("Can't find asset") | |
185 | 186 | } | |
186 | 187 | let toIssue = (pmtAmount * ((totalIssued - assetBalance(this, ethUsdnLPTCI)) / tkStaked)) | |
187 | 188 | let updateState = IntegerEntry(keyEthUsdn, (tkStaked + pmtAmount)) | |
188 | 189 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
189 | 190 | if ((LPstake == LPstake)) | |
190 | 191 | then { | |
191 | 192 | let LPIssue = Reissue(ethUsdnLPTCI, toIssue, true) | |
192 | 193 | let transfer = ScriptTransfer(i.caller, toIssue, ethUsdnLPTCI) | |
193 | 194 | [LPIssue, transfer, updateState] | |
194 | 195 | } | |
195 | 196 | else throw("Strict value is not equal to itself.") | |
196 | 197 | } | |
197 | 198 | } | |
198 | 199 | ||
199 | 200 | ||
200 | 201 | ||
201 | 202 | @Callable(i) | |
202 | 203 | func compoundBTCUSDNLP () = { | |
203 | 204 | let compound = value(i.payments[0]) | |
204 | 205 | let ca = compound.amount | |
205 | 206 | if ((compound.assetId != btcUsdnLP)) | |
206 | 207 | then throw("attach BTCUSDNLP tokens only") | |
207 | 208 | else { | |
208 | 209 | let fromCompound = valueOrElse(getInteger(this, keyBtcUsdnCompound), 0) | |
209 | 210 | let totalStaked = valueOrElse(getInteger(this, keyBtcUsdn), 0) | |
210 | 211 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
211 | 212 | if ((stakeC == stakeC)) | |
212 | 213 | then { | |
213 | 214 | let updateState = IntegerEntry(keyBtcUsdn, (totalStaked + ca)) | |
214 | 215 | let tc = IntegerEntry(keyBtcUsdnCompound, (fromCompound + ca)) | |
215 | 216 | [updateState, tc] | |
216 | 217 | } | |
217 | 218 | else throw("Strict value is not equal to itself.") | |
218 | 219 | } | |
219 | 220 | } | |
220 | 221 | ||
221 | 222 | ||
222 | 223 | ||
223 | 224 | @Callable(i) | |
224 | 225 | func compoundETHUSDNLP () = { | |
225 | 226 | let compound = value(i.payments[0]) | |
226 | 227 | let ca = compound.amount | |
227 | 228 | if ((compound.assetId != ethUsdnLP)) | |
228 | 229 | then throw("attach ETHUSDNLP tokens only") | |
229 | 230 | else { | |
230 | 231 | let fromCompound = valueOrElse(getInteger(this, keyEthUsdnCompound), 0) | |
231 | 232 | let totalStaked = valueOrElse(getInteger(this, keyEthUsdn), 0) | |
232 | 233 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
233 | 234 | if ((stakeC == stakeC)) | |
234 | 235 | then { | |
235 | 236 | let updateState = IntegerEntry(keyEthUsdn, (totalStaked + ca)) | |
236 | 237 | let tc = IntegerEntry(keyEthUsdnCompound, (fromCompound + ca)) | |
237 | 238 | [updateState, tc] | |
238 | 239 | } | |
239 | 240 | else throw("Strict value is not equal to itself.") | |
240 | 241 | } | |
241 | 242 | } | |
242 | 243 | ||
243 | 244 | ||
244 | 245 | ||
245 | 246 | @Callable(i) | |
246 | 247 | func compoundWXUSDNLP () = { | |
247 | 248 | let compound = value(i.payments[0]) | |
248 | 249 | let ca = compound.amount | |
249 | 250 | if ((compound.assetId != wxUsdnLP)) | |
250 | 251 | then throw("attach WXUSDNLP tokens only") | |
251 | 252 | else { | |
252 | 253 | let fromCompound = valueOrElse(getInteger(this, keywxUsdnCompound), 0) | |
253 | 254 | let totalStaked = valueOrElse(getInteger(this, keyWXUSDN), 0) | |
254 | 255 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
255 | 256 | if ((stakeC == stakeC)) | |
256 | 257 | then { | |
257 | 258 | let updateState = IntegerEntry(keyWXUSDN, (totalStaked + ca)) | |
258 | 259 | let tc = IntegerEntry(keywxUsdnCompound, (fromCompound + ca)) | |
259 | 260 | [updateState, tc] | |
260 | 261 | } | |
261 | 262 | else throw("Strict value is not equal to itself.") | |
262 | 263 | } | |
263 | 264 | } | |
264 | 265 | ||
265 | 266 | ||
266 | 267 | ||
267 | 268 | @Callable(i) | |
268 | 269 | func compoundUSDTUSDNLP () = { | |
269 | 270 | let compound = value(i.payments[0]) | |
270 | 271 | let ca = compound.amount | |
271 | 272 | if ((compound.assetId != usdnUsdt)) | |
272 | 273 | then throw("attach USDTUSDNLP tokens only") | |
273 | 274 | else { | |
274 | 275 | let fromCompound = valueOrElse(getInteger(this, keyUsdtUsdnCompound), 0) | |
275 | 276 | let totalStaked = valueOrElse(getInteger(this, keyUsdtUsdn), 0) | |
276 | 277 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
277 | 278 | if ((stakeC == stakeC)) | |
278 | 279 | then { | |
279 | 280 | let updateState = IntegerEntry(keyUsdtUsdn, (totalStaked + ca)) | |
280 | 281 | let tc = IntegerEntry(keyUsdtUsdnCompound, (fromCompound + ca)) | |
281 | 282 | [updateState, tc] | |
282 | 283 | } | |
283 | 284 | else throw("Strict value is not equal to itself.") | |
284 | 285 | } | |
285 | 286 | } | |
286 | 287 | ||
287 | 288 | ||
288 | 289 | ||
289 | 290 | @Callable(i) | |
290 | 291 | func compoundWAVESUSDNLP () = { | |
291 | 292 | let compound = value(i.payments[0]) | |
292 | 293 | let ca = compound.amount | |
293 | 294 | if ((compound.assetId != wavesUsdnLp)) | |
294 | 295 | then throw("attach WAVESUSDNLP tokens only") | |
295 | 296 | else { | |
296 | 297 | let fromCompound = valueOrElse(getInteger(this, keyWavesCompound), 0) | |
297 | 298 | let totalStaked = valueOrElse(getInteger(this, keyWAVESUSDN), 0) | |
298 | 299 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
299 | 300 | if ((stakeC == stakeC)) | |
300 | 301 | then { | |
301 | 302 | let updateState = IntegerEntry(keyWAVESUSDN, (totalStaked + ca)) | |
302 | 303 | let tc = IntegerEntry(keyWavesCompound, (fromCompound + ca)) | |
303 | 304 | [updateState, tc] | |
304 | 305 | } | |
305 | 306 | else throw("Strict value is not equal to itself.") | |
306 | 307 | } | |
307 | 308 | } | |
308 | 309 | ||
309 | 310 | ||
310 | 311 | ||
311 | 312 | @Callable(i) | |
312 | 313 | func initWX () = { | |
313 | 314 | let pm = value(i.payments[0]) | |
314 | 315 | let am = pm.amount | |
315 | 316 | if ((pm.assetId != wxUsdnLP)) | |
316 | 317 | then throw("Unexpected token") | |
317 | 318 | else { | |
318 | 319 | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
319 | 320 | if ((s == s)) | |
320 | 321 | then { | |
321 | 322 | let upd = IntegerEntry(keyWXUSDN, am) | |
322 | 323 | let updK = IntegerEntry(keywxUsdnCompound, 0) | |
323 | 324 | [upd, updK] | |
324 | 325 | } | |
325 | 326 | else throw("Strict value is not equal to itself.") | |
326 | 327 | } | |
327 | 328 | } | |
328 | 329 | ||
329 | 330 | ||
330 | 331 | ||
331 | 332 | @Callable(i) | |
332 | 333 | func initWAVES () = { | |
333 | 334 | let pm = value(i.payments[0]) | |
334 | 335 | let am = pm.amount | |
335 | 336 | if ((pm.assetId != wavesUsdnLp)) | |
336 | 337 | then throw("Unexpected token") | |
337 | 338 | else { | |
338 | 339 | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
339 | 340 | if ((s == s)) | |
340 | 341 | then { | |
341 | 342 | let upd = IntegerEntry(keyWAVESUSDN, am) | |
342 | 343 | let updK = IntegerEntry(keyWavesCompound, 0) | |
343 | 344 | [upd, updK] | |
344 | 345 | } | |
345 | 346 | else throw("Strict value is not equal to itself.") | |
346 | 347 | } | |
347 | 348 | } | |
348 | 349 | ||
349 | 350 | ||
350 | 351 | ||
351 | 352 | @Callable(i) | |
352 | 353 | func initETH () = { | |
353 | 354 | let pm = value(i.payments[0]) | |
354 | 355 | let am = pm.amount | |
355 | 356 | if ((pm.assetId != ethUsdnLP)) | |
356 | 357 | then throw("Unexpected token") | |
357 | 358 | else { | |
358 | 359 | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
359 | 360 | if ((s == s)) | |
360 | 361 | then { | |
361 | 362 | let upd = IntegerEntry(keyEthUsdn, am) | |
362 | 363 | let updK = IntegerEntry(keyEthUsdnCompound, 0) | |
363 | 364 | let issue = Reissue(ethUsdnLPTCI, am, true) | |
364 | 365 | let send = ScriptTransfer(i.caller, am, ethUsdnLPTCI) | |
365 | 366 | [upd, updK, issue, send] | |
366 | 367 | } | |
367 | 368 | else throw("Strict value is not equal to itself.") | |
368 | 369 | } | |
369 | 370 | } | |
370 | 371 | ||
371 | 372 | ||
372 | 373 | ||
373 | 374 | @Callable(i) | |
374 | 375 | func initBTC () = { | |
375 | 376 | let pm = value(i.payments[0]) | |
376 | 377 | let am = pm.amount | |
377 | 378 | if ((pm.assetId != btcUsdnLP)) | |
378 | 379 | then throw("Unexpected token") | |
379 | 380 | else { | |
380 | 381 | let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm]) | |
381 | 382 | if ((s == s)) | |
382 | 383 | then { | |
383 | 384 | let upd = IntegerEntry(keyBtcUsdn, am) | |
384 | 385 | let updK = IntegerEntry(keyBtcUsdnCompound, 0) | |
385 | 386 | let LPIssue = Reissue(btcUsdnLPTCI, am, true) | |
386 | 387 | let tr = ScriptTransfer(i.caller, am, btcUsdnLPTCI) | |
387 | 388 | [upd, updK, LPIssue, tr] | |
388 | 389 | } | |
389 | 390 | else throw("Strict value is not equal to itself.") | |
390 | 391 | } | |
391 | 392 | } | |
392 | 393 | ||
393 | 394 | ||
394 | 395 | @Verifier(tx) | |
395 | 396 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
396 | 397 |
github/deemru/w8io/026f985 43.14 ms ◑