tx · 6jmXJHpXx2K6YY2uUoaf5a5wYZ2mVbK4UdrB3MNnkZ5A

3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH:  -0.01700000 Waves

2022.07.12 11:29 [2136277] smart account 3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH > SELF 0.00000000 Waves

{ "type": 13, "id": "6jmXJHpXx2K6YY2uUoaf5a5wYZ2mVbK4UdrB3MNnkZ5A", "fee": 1700000, "feeAssetId": null, "timestamp": 1657614569324, "version": 2, "chainId": 84, "sender": "3N8n6BtTBKRZBoPuMzaPBH9FyJhfv9xDFJH", "senderPublicKey": "4hcnYaYoB2XaCzyJ7wfePpG7EfTd6st6aCAhkskJ9cQ5", "proofs": [ "Qi9Y5sdEUcztNuGpsAwXHQJ7BRSbZGdCEhkUo3DZ42AVSBtJZeQiFZofqM34PCVEFK5zNt7P5USRBj4pkt3bWwj" ], "script": "base64:AAIFAAAAAAAAAB4IAhIAEgASABIAEgASABIAEgASABIAEgASABIAEgAAAAAVAAAAAAh1c2RuVXNkdAEAAAAg202DNWRHG5bvnwwvoM991XmdkujhmzUPwT/MewJwKQsAAAAADXVzZG5Vc2R0TFBUQ0kBAAAAIAqBzantQGEdmEq4Oth6BGhTCCbAyZjxYcEpfvod3iryAAAAAAh3eFVzZG5MUAEAAAAgG7mhj3vOTKXN+s5HyQsWjk32W97C65PB1sWo0bGqCxwAAAAAC3d4VXNkbkxQVENJAQAAACC37N3mGwJ72rYTh/1V0NY8tseiNz1LiL3Be29IRACYLwAAAAALd2F2ZXNVc2RuTHABAAAAINUKknePcghEmMkNN/IegHNiilmrJ+abeEGdbsH03iJ2AAAAAA53YXZlc1VzZG5MUFRDSQEAAAAgxRp2zzmtZIv1fW7qZyCOpdLB08oGyQGtTSaCWHrWElkAAAAACWV0aFVzZG5MUAEAAAAgf0Ew/c/5+Zy9fq7UHSNMMuNJS4SB4kp3y/IQBPX7+eEAAAAADGV0aFVzZG5MUFRDSQEAAAAg4e0Wyv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aWwJAARMAAAAAgUAAAACcG0FAAAAA25pbAMJAAAAAAAAAgUAAAABcwUAAAABcwQAAAADdXBkCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAKa2V5QnRjVXNkbgUAAAACYW0EAAAABHVwZEsJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAABJrZXlCdGNVc2RuQ29tcG91bmQAAAAAAAAAAAAEAAAAB0xQSXNzdWUJAQAAAAdSZWlzc3VlAAAAAwUAAAAMYnRjVXNkbkxQVENJBQAAAAJhbQYEAAAAAnRyCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAAmFtBQAAAAxidGNVc2RuTFBUQ0kJAARMAAAAAgUAAAADdXBkCQAETAAAAAIFAAAABHVwZEsJAARMAAAAAgUAAAAHTFBJc3N1ZQkABEwAAAACBQAAAAJ0cgUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V50JfmDQ==", "height": 2136277, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5HhAwVotTmKjHeffwqu8ffJKxcq4ZggZgAKmZUgoVmzq Next: GdLzyVURca9Gv6i57jA1vuQNkdMUhNJ6j5dvoGY4fD2p Diff:
OldNewDifferences
155155 case _ =>
156156 throw("Can't find asset")
157157 }
158- let toIssue = (pmtAmount * (totalIssued / tkStaked))
158+ let one = fraction(totalIssued, 100000000, tkStaked)
159+ let toIssue = fraction(pmtAmount, one, 100000000)
159160 let updateState = IntegerEntry(keyUsdtUsdn, (tkStaked + pmtAmount))
160161 let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt])
161162 if ((LPstake == LPstake))
186187 case _ =>
187188 throw("Can't find asset")
188189 }
189- let toIssue = (pmtAmount * ((totalIssued - assetBalance(this, ethUsdnLPTCI)) / tkStaked))
190+ let one = fraction((totalIssued - assetBalance(this, btcUsdnLPTCI)), 100000000, tkStaked)
191+ let toIssue = fraction(pmtAmount, one, 100000000)
190192 let updateState = IntegerEntry(keyEthUsdn, (tkStaked + pmtAmount))
191193 let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt])
192194 if ((LPstake == LPstake))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let usdnUsdt = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS'
55
66 let usdnUsdtLPTCI = base58'i1snzKxSEZVokh9TWj8hTJQEDBsocnL2hRWsSbsMPK7'
77
88 let wxUsdnLP = base58'2sEBVcyDFK2LupCf7MeA4vzHhGK4DC1WjbKGQCLYDqib'
99
1010 let wxUsdnLPTCI = base58'DNy6WBfhPE4y82RonGdHhZEunNotEDzmNfrBomWnsyGi'
1111
1212 let wavesUsdnLp = base58'FLdC14nUVRyiSYjVrMo3X4g8rXQjLbNRaGAyQAm8V68V'
1313
1414 let wavesUsdnLPTCI = base58'EGQiqw8jLjg6SVLUeeqMLjk3EjhEVHtjkJ6w46HyFfep'
1515
1616 let ethUsdnLP = base58'9ZkS8GoUWn69QhgF1RsRtS9CFtc7ZbDNX5N238Jmqjdr'
1717
1818 let ethUsdnLPTCI = base58'GCvR4BmCSjncVEEwr9psvhN5mctdNTGPs8Xp4b2oQNFZ'
1919
2020 let btcUsdnLP = base58'2RmyyZ39ZoPoTWksM6urmjgx9mB8ksP8Ru6ba8u89mZm'
2121
2222 let btcUsdnLPTCI = base58'4jarprgmcev38EU5p2duJAznZSLUxZ831jCT2vf95Hey'
2323
2424 let isStopped = false
2525
2626 let keyUsdtUsdn = "STAKED_LP"
2727
2828 let keyUsdtUsdnCompound = "From_Compound"
2929
3030 let keywxUsdnCompound = "WX_USDN_compound"
3131
3232 let keyWXUSDN = "WX_USDN"
3333
3434 let keyWAVESUSDN = "WAVES_USDN"
3535
3636 let keyWavesCompound = "WAVES_USDN_COMPOUND"
3737
3838 let keyBtcUsdn = "BTC_USDN"
3939
4040 let keyBtcUsdnCompound = "BTC_USDN_COMPOUND"
4141
4242 let keyEthUsdn = "ETH_USDN"
4343
4444 let keyEthUsdnCompound = "ETH_USDN_COMPOUND"
4545
4646 @Callable(i)
4747 func depositBtcUsdnLP () = {
4848 let pmt = value(i.payments[0])
4949 let pmtAmount = pmt.amount
5050 if ((pmt.assetId != btcUsdnLP))
5151 then throw("attach BTCUSDNLP tokens only")
5252 else if (isStopped)
5353 then throw("smart contract is on lock")
5454 else {
5555 let tkStaked = valueOrElse(getInteger(this, keyBtcUsdn), 0)
5656 let totalIssued = match assetInfo(btcUsdnLPTCI) {
5757 case asset: Asset =>
5858 asset.quantity
5959 case _ =>
6060 throw("Can't find asset")
6161 }
6262 let one = fraction((totalIssued - assetBalance(this, btcUsdnLPTCI)), 100000000, tkStaked)
6363 let toIssue = fraction(pmtAmount, one, 100000000)
6464 let updateState = IntegerEntry(keyBtcUsdn, (tkStaked + pmtAmount))
6565 let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt])
6666 if ((LPstake == LPstake))
6767 then {
6868 let LPIssue = Reissue(btcUsdnLPTCI, toIssue, true)
6969 let transfer = ScriptTransfer(i.caller, toIssue, btcUsdnLPTCI)
7070 [LPIssue, transfer, updateState]
7171 }
7272 else throw("Strict value is not equal to itself.")
7373 }
7474 }
7575
7676
7777
7878 @Callable(i)
7979 func depositWavesUsdnLP () = {
8080 let pmt = value(i.payments[0])
8181 let pmtAmount = pmt.amount
8282 if ((pmt.assetId != wavesUsdnLp))
8383 then throw("attach WAVESUSDNLP tokens only")
8484 else if (isStopped)
8585 then throw("smart contract is on lock")
8686 else {
8787 let tkStaked = valueOrElse(getInteger(this, keyWAVESUSDN), 0)
8888 let totalIssued = match assetInfo(wavesUsdnLPTCI) {
8989 case asset: Asset =>
9090 asset.quantity
9191 case _ =>
9292 throw("Can't find asset")
9393 }
9494 let one = fraction(totalIssued, 100000000, tkStaked)
9595 let toIssue = fraction(pmtAmount, one, 100000000)
9696 let updateState = IntegerEntry(keyWAVESUSDN, (tkStaked + pmtAmount))
9797 let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt])
9898 if ((LPstake == LPstake))
9999 then {
100100 let LPIssue = Reissue(wavesUsdnLPTCI, toIssue, true)
101101 let transfer = ScriptTransfer(i.caller, toIssue, wavesUsdnLPTCI)
102102 [LPIssue, transfer, updateState]
103103 }
104104 else throw("Strict value is not equal to itself.")
105105 }
106106 }
107107
108108
109109
110110 @Callable(i)
111111 func depositWxUsdnLP () = {
112112 let pmt = value(i.payments[0])
113113 let pmtAmount = pmt.amount
114114 if ((pmt.assetId != wxUsdnLP))
115115 then throw("attach WXUSDNLP tokens only")
116116 else if (isStopped)
117117 then throw("smart contract is on lock")
118118 else {
119119 let tkStaked = valueOrElse(getInteger(this, keyWXUSDN), 0)
120120 let totalIssued = match assetInfo(wxUsdnLPTCI) {
121121 case asset: Asset =>
122122 asset.quantity
123123 case _ =>
124124 throw("Can't find asset")
125125 }
126126 let one = fraction(totalIssued, 100000000, tkStaked)
127127 let toIssue = fraction(pmtAmount, one, 100000000)
128128 let updateState = IntegerEntry(keyWXUSDN, (tkStaked + pmtAmount))
129129 let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt])
130130 if ((LPstake == LPstake))
131131 then {
132132 let LPIssue = Reissue(wxUsdnLPTCI, toIssue, true)
133133 let transfer = ScriptTransfer(i.caller, toIssue, wxUsdnLPTCI)
134134 [LPIssue, transfer, updateState]
135135 }
136136 else throw("Strict value is not equal to itself.")
137137 }
138138 }
139139
140140
141141
142142 @Callable(i)
143143 func depositUsdtUsdnLP () = {
144144 let pmt = value(i.payments[0])
145145 let pmtAmount = pmt.amount
146146 if ((pmt.assetId != usdnUsdt))
147147 then throw("attach USDTUSDNLP tokens only")
148148 else if (isStopped)
149149 then throw("smart contract is on lock")
150150 else {
151151 let tkStaked = valueOrElse(getInteger(this, keyUsdtUsdn), 0)
152152 let totalIssued = match assetInfo(usdnUsdtLPTCI) {
153153 case asset: Asset =>
154154 asset.quantity
155155 case _ =>
156156 throw("Can't find asset")
157157 }
158- let toIssue = (pmtAmount * (totalIssued / tkStaked))
158+ let one = fraction(totalIssued, 100000000, tkStaked)
159+ let toIssue = fraction(pmtAmount, one, 100000000)
159160 let updateState = IntegerEntry(keyUsdtUsdn, (tkStaked + pmtAmount))
160161 let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt])
161162 if ((LPstake == LPstake))
162163 then {
163164 let LPIssue = Reissue(usdnUsdtLPTCI, toIssue, true)
164165 let transfer = ScriptTransfer(i.caller, toIssue, usdnUsdtLPTCI)
165166 [LPIssue, transfer, updateState]
166167 }
167168 else throw("Strict value is not equal to itself.")
168169 }
169170 }
170171
171172
172173
173174 @Callable(i)
174175 func depositEthUsdnLP () = {
175176 let pmt = value(i.payments[0])
176177 let pmtAmount = pmt.amount
177178 if ((pmt.assetId != ethUsdnLP))
178179 then throw("attach ETHUSDNLP tokens only")
179180 else if (isStopped)
180181 then throw("smart contract is on lock")
181182 else {
182183 let tkStaked = valueOrElse(getInteger(this, keyEthUsdn), 0)
183184 let totalIssued = match assetInfo(ethUsdnLPTCI) {
184185 case asset: Asset =>
185186 asset.quantity
186187 case _ =>
187188 throw("Can't find asset")
188189 }
189- let toIssue = (pmtAmount * ((totalIssued - assetBalance(this, ethUsdnLPTCI)) / tkStaked))
190+ let one = fraction((totalIssued - assetBalance(this, btcUsdnLPTCI)), 100000000, tkStaked)
191+ let toIssue = fraction(pmtAmount, one, 100000000)
190192 let updateState = IntegerEntry(keyEthUsdn, (tkStaked + pmtAmount))
191193 let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt])
192194 if ((LPstake == LPstake))
193195 then {
194196 let LPIssue = Reissue(ethUsdnLPTCI, toIssue, true)
195197 let transfer = ScriptTransfer(i.caller, toIssue, ethUsdnLPTCI)
196198 [LPIssue, transfer, updateState]
197199 }
198200 else throw("Strict value is not equal to itself.")
199201 }
200202 }
201203
202204
203205
204206 @Callable(i)
205207 func compoundBTCUSDNLP () = {
206208 let compound = value(i.payments[0])
207209 let ca = compound.amount
208210 if ((compound.assetId != btcUsdnLP))
209211 then throw("attach BTCUSDNLP tokens only")
210212 else {
211213 let fromCompound = valueOrElse(getInteger(this, keyBtcUsdnCompound), 0)
212214 let totalStaked = valueOrElse(getInteger(this, keyBtcUsdn), 0)
213215 let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound])
214216 if ((stakeC == stakeC))
215217 then {
216218 let updateState = IntegerEntry(keyBtcUsdn, (totalStaked + ca))
217219 let tc = IntegerEntry(keyBtcUsdnCompound, (fromCompound + ca))
218220 [updateState, tc]
219221 }
220222 else throw("Strict value is not equal to itself.")
221223 }
222224 }
223225
224226
225227
226228 @Callable(i)
227229 func compoundETHUSDNLP () = {
228230 let compound = value(i.payments[0])
229231 let ca = compound.amount
230232 if ((compound.assetId != ethUsdnLP))
231233 then throw("attach ETHUSDNLP tokens only")
232234 else {
233235 let fromCompound = valueOrElse(getInteger(this, keyEthUsdnCompound), 0)
234236 let totalStaked = valueOrElse(getInteger(this, keyEthUsdn), 0)
235237 let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound])
236238 if ((stakeC == stakeC))
237239 then {
238240 let updateState = IntegerEntry(keyEthUsdn, (totalStaked + ca))
239241 let tc = IntegerEntry(keyEthUsdnCompound, (fromCompound + ca))
240242 [updateState, tc]
241243 }
242244 else throw("Strict value is not equal to itself.")
243245 }
244246 }
245247
246248
247249
248250 @Callable(i)
249251 func compoundWXUSDNLP () = {
250252 let compound = value(i.payments[0])
251253 let ca = compound.amount
252254 if ((compound.assetId != wxUsdnLP))
253255 then throw("attach WXUSDNLP tokens only")
254256 else {
255257 let fromCompound = valueOrElse(getInteger(this, keywxUsdnCompound), 0)
256258 let totalStaked = valueOrElse(getInteger(this, keyWXUSDN), 0)
257259 let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound])
258260 if ((stakeC == stakeC))
259261 then {
260262 let updateState = IntegerEntry(keyWXUSDN, (totalStaked + ca))
261263 let tc = IntegerEntry(keywxUsdnCompound, (fromCompound + ca))
262264 [updateState, tc]
263265 }
264266 else throw("Strict value is not equal to itself.")
265267 }
266268 }
267269
268270
269271
270272 @Callable(i)
271273 func compoundUSDTUSDNLP () = {
272274 let compound = value(i.payments[0])
273275 let ca = compound.amount
274276 if ((compound.assetId != usdnUsdt))
275277 then throw("attach USDTUSDNLP tokens only")
276278 else {
277279 let fromCompound = valueOrElse(getInteger(this, keyUsdtUsdnCompound), 0)
278280 let totalStaked = valueOrElse(getInteger(this, keyUsdtUsdn), 0)
279281 let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound])
280282 if ((stakeC == stakeC))
281283 then {
282284 let updateState = IntegerEntry(keyUsdtUsdn, (totalStaked + ca))
283285 let tc = IntegerEntry(keyUsdtUsdnCompound, (fromCompound + ca))
284286 [updateState, tc]
285287 }
286288 else throw("Strict value is not equal to itself.")
287289 }
288290 }
289291
290292
291293
292294 @Callable(i)
293295 func compoundWAVESUSDNLP () = {
294296 let compound = value(i.payments[0])
295297 let ca = compound.amount
296298 if ((compound.assetId != wavesUsdnLp))
297299 then throw("attach WAVESUSDNLP tokens only")
298300 else {
299301 let fromCompound = valueOrElse(getInteger(this, keyWavesCompound), 0)
300302 let totalStaked = valueOrElse(getInteger(this, keyWAVESUSDN), 0)
301303 let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound])
302304 if ((stakeC == stakeC))
303305 then {
304306 let updateState = IntegerEntry(keyWAVESUSDN, (totalStaked + ca))
305307 let tc = IntegerEntry(keyWavesCompound, (fromCompound + ca))
306308 [updateState, tc]
307309 }
308310 else throw("Strict value is not equal to itself.")
309311 }
310312 }
311313
312314
313315
314316 @Callable(i)
315317 func initWX () = {
316318 let pm = value(i.payments[0])
317319 let am = pm.amount
318320 if ((pm.assetId != wxUsdnLP))
319321 then throw("Unexpected token")
320322 else {
321323 let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm])
322324 if ((s == s))
323325 then {
324326 let upd = IntegerEntry(keyWXUSDN, am)
325327 let updK = IntegerEntry(keywxUsdnCompound, 0)
326328 [upd, updK]
327329 }
328330 else throw("Strict value is not equal to itself.")
329331 }
330332 }
331333
332334
333335
334336 @Callable(i)
335337 func initWAVES () = {
336338 let pm = value(i.payments[0])
337339 let am = pm.amount
338340 if ((pm.assetId != wavesUsdnLp))
339341 then throw("Unexpected token")
340342 else {
341343 let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm])
342344 if ((s == s))
343345 then {
344346 let upd = IntegerEntry(keyWAVESUSDN, am)
345347 let updK = IntegerEntry(keyWavesCompound, 0)
346348 [upd, updK]
347349 }
348350 else throw("Strict value is not equal to itself.")
349351 }
350352 }
351353
352354
353355
354356 @Callable(i)
355357 func initETH () = {
356358 let pm = value(i.payments[0])
357359 let am = pm.amount
358360 if ((pm.assetId != ethUsdnLP))
359361 then throw("Unexpected token")
360362 else {
361363 let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm])
362364 if ((s == s))
363365 then {
364366 let upd = IntegerEntry(keyEthUsdn, am)
365367 let updK = IntegerEntry(keyEthUsdnCompound, 0)
366368 let issue = Reissue(ethUsdnLPTCI, am, true)
367369 let send = ScriptTransfer(i.caller, am, ethUsdnLPTCI)
368370 [upd, updK, issue, send]
369371 }
370372 else throw("Strict value is not equal to itself.")
371373 }
372374 }
373375
374376
375377
376378 @Callable(i)
377379 func initBTC () = {
378380 let pm = value(i.payments[0])
379381 let am = pm.amount
380382 if ((pm.assetId != btcUsdnLP))
381383 then throw("Unexpected token")
382384 else {
383385 let s = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pm])
384386 if ((s == s))
385387 then {
386388 let upd = IntegerEntry(keyBtcUsdn, am)
387389 let updK = IntegerEntry(keyBtcUsdnCompound, 0)
388390 let LPIssue = Reissue(btcUsdnLPTCI, am, true)
389391 let tr = ScriptTransfer(i.caller, am, btcUsdnLPTCI)
390392 [upd, updK, LPIssue, tr]
391393 }
392394 else throw("Strict value is not equal to itself.")
393395 }
394396 }
395397
396398
397399 @Verifier(tx)
398400 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
399401

github/deemru/w8io/026f985 
44.48 ms