tx · Dra7GYaUbgMR2uGiNVW16typtL9prFbxorBsHLg7tWJU 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.09.09 23:53 [2748358] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "Dra7GYaUbgMR2uGiNVW16typtL9prFbxorBsHLg7tWJU", "fee": 1000000, "feeAssetId": null, "timestamp": 1694292831585, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "5DW22KaZBkpbHeJePdWyqUqyvqcFTLL8ZTLJRi9BSuqWoD6DbGG4w6LhBb5beXMS5ch4gF2K6NBbpDwVzRN7VEQV" ], "script": "base64:BgIJCAISABIDCgEBBwAGdXNkbklkASAP8hwSrOTEPJrsRhqrJaiw7LoHK0bMbYhy8LXikkkBtAAOd2F2ZXMyTFRva2VuSWQBIOTNKeq7wReVNlE2S+RpfYhOUVOtu4YUhfwJjtl3b86xAAxwdXp6bGVMZW5kU0MCIzNOM0RuVmZmblV5WnR6Mk1SYms1VTdnaU4xMTJXZW1wTU5kABBmYWtlUHV6emxlU3dhcFNDAiMzTXM4ZnFiWE00UmhtTTZDUFRyNDRoVXdIZTJDQ21WQ2ZWQQAOdXNkbkFkZHJlc3NTdHICLDI1RkVxRWpSa3FLNnlDa2lUN0x6NlNBWXo3Z1VGQ3R4ZkNDaG5yVkZENUFUAA93YXZlczJMVG9rZW5TdHICLEdROVFOVkxHZllTYk5aNGRTOE5SeXZHR0VMWkw0c1dQS2lWajg4Q1YxckpMAQ10cnlHZXRJbnRlZ2VyAQNrZXkEByRtYXRjaDAJAJoIAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACA0ludAQBYgUHJG1hdGNoMAUBYgAAAgFpAQltaW50TG9uZzIAAwMJAQIhPQIJAJADAQg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WwJAAIBAhdJbmNvcnJlY3QgaW52b2tlIHJlc3VsdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmVcsqC", "height": 2748358, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8XHE7DxvNxvN1wzaWffBaWU3L2xxh4BfyhXKfiuYZfmN Next: FyPhDQjYN3azXKN9GPniFdnDBEvAu3gvYknzq8wpvB2R Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | else { | |
30 | 30 | let firstAmountIn = i.payments[0].amount | |
31 | 31 | let callerId = toString(i.caller) | |
32 | - | let firstSwappedWavesAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), | |
32 | + | let firstSwappedWavesAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), i.payments[0].amount], nil) | |
33 | 33 | if ((firstSwappedWavesAmount == firstSwappedWavesAmount)) | |
34 | 34 | then match firstSwappedWavesAmount { | |
35 | 35 | case firstSwappedAmountValue: Int => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let usdnId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
5 | 5 | ||
6 | 6 | let waves2LTokenId = base58'GQ9QNVLGfYSbNZ4dS8NRyvGGELZL4sWPKiVj88CV1rJL' | |
7 | 7 | ||
8 | 8 | let puzzleLendSC = "3N3DnVffnUyZtz2MRbk5U7giN112WempMNd" | |
9 | 9 | ||
10 | 10 | let fakePuzzleSwapSC = "3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA" | |
11 | 11 | ||
12 | 12 | let usdnAddressStr = "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT" | |
13 | 13 | ||
14 | 14 | let waves2LTokenStr = "GQ9QNVLGfYSbNZ4dS8NRyvGGELZL4sWPKiVj88CV1rJL" | |
15 | 15 | ||
16 | 16 | func tryGetInteger (key) = match getInteger(this, key) { | |
17 | 17 | case b: Int => | |
18 | 18 | b | |
19 | 19 | case _ => | |
20 | 20 | 0 | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | @Callable(i) | |
25 | 25 | func mintLong2 () = if (if ((size(i.payments) != 1)) | |
26 | 26 | then true | |
27 | 27 | else (i.payments[0].amount == 0)) | |
28 | 28 | then throw("1 payment has to be attached mint") | |
29 | 29 | else { | |
30 | 30 | let firstAmountIn = i.payments[0].amount | |
31 | 31 | let callerId = toString(i.caller) | |
32 | - | let firstSwappedWavesAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), | |
32 | + | let firstSwappedWavesAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), i.payments[0].amount], nil) | |
33 | 33 | if ((firstSwappedWavesAmount == firstSwappedWavesAmount)) | |
34 | 34 | then match firstSwappedWavesAmount { | |
35 | 35 | case firstSwappedAmountValue: Int => | |
36 | 36 | let firstDepositedWavesAmount = invoke(addressFromStringValue(puzzleLendSC), "supply", nil, [AttachedPayment(unit, firstSwappedAmountValue)]) | |
37 | 37 | if ((firstDepositedWavesAmount == firstDepositedWavesAmount)) | |
38 | 38 | then { | |
39 | 39 | let listPercentage = [70000, 49000, 34300, 24010, 16807] | |
40 | 40 | func repeatFunc (accum,next) = { | |
41 | 41 | let borrowedUsdn = invoke(addressFromStringValue(puzzleLendSC), "borrow", [usdnAddressStr, ((firstAmountIn * accum) / 100000)], nil) | |
42 | 42 | if ((borrowedUsdn == borrowedUsdn)) | |
43 | 43 | then { | |
44 | 44 | let swappedAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller)], [AttachedPayment(usdnId, ((firstSwappedAmountValue * accum) / 100000))]) | |
45 | 45 | if ((swappedAmount == swappedAmount)) | |
46 | 46 | then match swappedAmount { | |
47 | 47 | case swappedAmountValue: Int => | |
48 | 48 | let depositedWaves = invoke(addressFromStringValue(puzzleLendSC), "supply", nil, [AttachedPayment(unit, swappedAmountValue)]) | |
49 | 49 | if ((depositedWaves == depositedWaves)) | |
50 | 50 | then (((firstSwappedAmountValue * accum) / 100000) + ((firstSwappedAmountValue * next) / 100000)) | |
51 | 51 | else throw("Strict value is not equal to itself.") | |
52 | 52 | case _ => | |
53 | 53 | throw("Incorrect invoke result") | |
54 | 54 | } | |
55 | 55 | else throw("Strict value is not equal to itself.") | |
56 | 56 | } | |
57 | 57 | else throw("Strict value is not equal to itself.") | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | let res = { | |
61 | 61 | let $l = listPercentage | |
62 | 62 | let $s = size($l) | |
63 | 63 | let $acc0 = 0 | |
64 | 64 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
65 | 65 | then $a | |
66 | 66 | else repeatFunc($a, $l[$i]) | |
67 | 67 | ||
68 | 68 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
69 | 69 | then $a | |
70 | 70 | else throw("List size exceeds 5") | |
71 | 71 | ||
72 | 72 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
73 | 73 | } | |
74 | 74 | [ScriptTransfer(i.caller, res, waves2LTokenId)] | |
75 | 75 | } | |
76 | 76 | else throw("Strict value is not equal to itself.") | |
77 | 77 | case _ => | |
78 | 78 | throw("Incorrect invoke result") | |
79 | 79 | } | |
80 | 80 | else throw("Strict value is not equal to itself.") | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | ||
85 | 85 | @Callable(i) | |
86 | 86 | func redeem (wavesAmount) = { | |
87 | 87 | let userAddress = toString(i.caller) | |
88 | 88 | let redeemedUSDNAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToUSDN", [wavesAmount, userAddress], nil) | |
89 | 89 | if ((redeemedUSDNAmount == redeemedUSDNAmount)) | |
90 | 90 | then match redeemedUSDNAmount { | |
91 | 91 | case redeemedAmountValue: Int => | |
92 | 92 | [IntegerEntry((userAddress + "_redeemed"), redeemedAmountValue)] | |
93 | 93 | case _ => | |
94 | 94 | throw("Incorrect invoke result") | |
95 | 95 | } | |
96 | 96 | else throw("Strict value is not equal to itself.") | |
97 | 97 | } | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | @Verifier(tx) | |
101 | 101 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
102 | 102 |
github/deemru/w8io/026f985 31.20 ms ◑