tx · 6LQ842oK4K9JRvCq7uWYBbuwvpSkKsPJrGdgkjHRqdfX 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.09.18 22:28 [2761255] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "6LQ842oK4K9JRvCq7uWYBbuwvpSkKsPJrGdgkjHRqdfX", "fee": 1000000, "feeAssetId": null, "timestamp": 1695065340471, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "4mpUFe9r2akSLjGEhfgvSdLDwDkvxAVPca4iwQSEXbnHrPxtyusyngNWFsUPBM3ZjbscP8rGQKeeyJqfdhoHKtSZ" ], "script": "base64:BgILCAISABIAEgMKAQEHAAZ1c2RuSWQBIA/yHBKs5MQ8muxGGqslqLDsugcrRsxtiHLwteKSSQG0AA53YXZlczJMVG9rZW5JZAEg5M0p6rvBF5U2UTZL5Gl9iE5RU627hhSF/AmO2XdvzrEADHB1enpsZUxlbmRTQwIjM04zRG5WZmZuVXladHoyTVJiazVVN2dpTjExMldlbXBNTmQAEGZha2VQdXp6bGVTd2FwU0MCIzNNczhmcWJYTTRSaG1NNkNQVHI0NGhVd0hlMkNDbVZDZlZBAA51c2RuQWRkcmVzc1N0cgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQAD3dhdmVzMkxUb2tlblN0cgIsR1E5UU5WTEdmWVNiTlo0ZFM4TlJ5dkdHRUxaTDRzV1BLaVZqODhDVjFySkwBDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAFiBQckbWF0Y2gwBQFiAAADAWkBCW1pbnRMb25nMgADAwkBAiE9AgkAkAMBCAUB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HJG1hdGNoMAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQt1c2VyQWRkcmVzcwIJX3JlZGVlbWVkBRNyZWRlZW1lZEFtb3VudFZhbHVlBQNuaWwJAAIBAhdJbmNvcnJlY3QgaW52b2tlIHJlc3VsdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlaLamm", "height": 2761255, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Fuhqu4tfnX2mAgBY8AnwK7jfX2RrmnBN82hzetXaKqVb Next: A44whh6sSJckeuCdPtNijTdWGFnTeBY4tFbVM2BE15rZ Diff:
Old | New | Differences | |
---|---|---|---|
38 | 38 | then { | |
39 | 39 | let listPercentage = [70, 49, 34, 24, 17] | |
40 | 40 | func repeatFunc (accum,next) = { | |
41 | - | let borrowedUsdn = invoke(addressFromStringValue(puzzleLendSC), "borrow", [usdnAddressStr, ((firstAmountIn * accum) / 100)], nil) | |
42 | - | if ((borrowedUsdn == borrowedUsdn)) | |
43 | - | then { | |
44 | - | let swappedAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), ((firstSwappedAmountValue * accum) / 100)], nil) | |
45 | - | if ((swappedAmount == swappedAmount)) | |
46 | - | then match swappedAmount { | |
47 | - | case swappedAmountValue: Int => | |
48 | - | (accum + next) | |
49 | - | case _ => | |
50 | - | throw("Incorrect invoke result") | |
51 | - | } | |
52 | - | else throw("Strict value is not equal to itself.") | |
53 | - | } | |
41 | + | let swappedAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), ((firstSwappedAmountValue * accum) / 100)], nil) | |
42 | + | if ((swappedAmount == swappedAmount)) | |
43 | + | then match swappedAmount { | |
44 | + | case swappedAmountValue: Int => | |
45 | + | (accum + next) | |
46 | + | case _ => | |
47 | + | throw("Incorrect invoke result") | |
48 | + | } | |
54 | 49 | else throw("Strict value is not equal to itself.") | |
55 | 50 | } | |
56 | 51 |
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 | 32 | let firstSwappedWavesAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), firstAmountIn], 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 = [70, 49, 34, 24, 17] | |
40 | 40 | func repeatFunc (accum,next) = { | |
41 | - | let borrowedUsdn = invoke(addressFromStringValue(puzzleLendSC), "borrow", [usdnAddressStr, ((firstAmountIn * accum) / 100)], nil) | |
42 | - | if ((borrowedUsdn == borrowedUsdn)) | |
43 | - | then { | |
44 | - | let swappedAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), ((firstSwappedAmountValue * accum) / 100)], nil) | |
45 | - | if ((swappedAmount == swappedAmount)) | |
46 | - | then match swappedAmount { | |
47 | - | case swappedAmountValue: Int => | |
48 | - | (accum + next) | |
49 | - | case _ => | |
50 | - | throw("Incorrect invoke result") | |
51 | - | } | |
52 | - | else throw("Strict value is not equal to itself.") | |
53 | - | } | |
41 | + | let swappedAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), ((firstSwappedAmountValue * accum) / 100)], nil) | |
42 | + | if ((swappedAmount == swappedAmount)) | |
43 | + | then match swappedAmount { | |
44 | + | case swappedAmountValue: Int => | |
45 | + | (accum + next) | |
46 | + | case _ => | |
47 | + | throw("Incorrect invoke result") | |
48 | + | } | |
54 | 49 | else throw("Strict value is not equal to itself.") | |
55 | 50 | } | |
56 | 51 | ||
57 | 52 | let res = { | |
58 | 53 | let $l = listPercentage | |
59 | 54 | let $s = size($l) | |
60 | 55 | let $acc0 = 0 | |
61 | 56 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
62 | 57 | then $a | |
63 | 58 | else repeatFunc($a, $l[$i]) | |
64 | 59 | ||
65 | 60 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
66 | 61 | then $a | |
67 | 62 | else throw("List size exceeds 5") | |
68 | 63 | ||
69 | 64 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
70 | 65 | } | |
71 | 66 | [ScriptTransfer(i.caller, ((firstSwappedAmountValue * res) / 100), waves2LTokenId)] | |
72 | 67 | } | |
73 | 68 | else throw("Strict value is not equal to itself.") | |
74 | 69 | case _ => | |
75 | 70 | throw("Incorrect invoke result") | |
76 | 71 | } | |
77 | 72 | else throw("Strict value is not equal to itself.") | |
78 | 73 | } | |
79 | 74 | ||
80 | 75 | ||
81 | 76 | ||
82 | 77 | @Callable(i) | |
83 | 78 | func mintLong2_test () = if (if ((size(i.payments) != 1)) | |
84 | 79 | then true | |
85 | 80 | else (i.payments[0].amount == 0)) | |
86 | 81 | then throw("1 payment has to be attached mint") | |
87 | 82 | else { | |
88 | 83 | let firstAmountIn = i.payments[0].amount | |
89 | 84 | let callerId = toString(i.caller) | |
90 | 85 | let firstSwappedWavesAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), firstAmountIn], nil) | |
91 | 86 | if ((firstSwappedWavesAmount == firstSwappedWavesAmount)) | |
92 | 87 | then match firstSwappedWavesAmount { | |
93 | 88 | case firstSwappedAmountValue: Int => | |
94 | 89 | let firstDepositedWavesAmount = invoke(addressFromStringValue(puzzleLendSC), "supply", nil, [AttachedPayment(unit, firstSwappedAmountValue)]) | |
95 | 90 | if ((firstDepositedWavesAmount == firstDepositedWavesAmount)) | |
96 | 91 | then { | |
97 | 92 | let listPercentage = [70, 49, 34, 24, 17] | |
98 | 93 | func repeatFunc (accum,next) = (accum + next) | |
99 | 94 | ||
100 | 95 | let res = { | |
101 | 96 | let $l = listPercentage | |
102 | 97 | let $s = size($l) | |
103 | 98 | let $acc0 = 0 | |
104 | 99 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
105 | 100 | then $a | |
106 | 101 | else repeatFunc($a, $l[$i]) | |
107 | 102 | ||
108 | 103 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
109 | 104 | then $a | |
110 | 105 | else throw("List size exceeds 5") | |
111 | 106 | ||
112 | 107 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
113 | 108 | } | |
114 | 109 | [IntegerEntry("res", res), IntegerEntry("firstAmountIn", firstAmountIn), IntegerEntry("firstSwappedAmountValue", firstSwappedAmountValue), ScriptTransfer(i.caller, ((firstSwappedAmountValue * res) / 100), waves2LTokenId)] | |
115 | 110 | } | |
116 | 111 | else throw("Strict value is not equal to itself.") | |
117 | 112 | case _ => | |
118 | 113 | throw("Incorrect invoke result") | |
119 | 114 | } | |
120 | 115 | else throw("Strict value is not equal to itself.") | |
121 | 116 | } | |
122 | 117 | ||
123 | 118 | ||
124 | 119 | ||
125 | 120 | @Callable(i) | |
126 | 121 | func redeem (wavesAmount) = { | |
127 | 122 | let userAddress = toString(i.caller) | |
128 | 123 | let redeemedUSDNAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToUSDN", [wavesAmount, userAddress], nil) | |
129 | 124 | if ((redeemedUSDNAmount == redeemedUSDNAmount)) | |
130 | 125 | then match redeemedUSDNAmount { | |
131 | 126 | case redeemedAmountValue: Int => | |
132 | 127 | [IntegerEntry((userAddress + "_redeemed"), redeemedAmountValue)] | |
133 | 128 | case _ => | |
134 | 129 | throw("Incorrect invoke result") | |
135 | 130 | } | |
136 | 131 | else throw("Strict value is not equal to itself.") | |
137 | 132 | } | |
138 | 133 | ||
139 | 134 | ||
140 | 135 | @Verifier(tx) | |
141 | 136 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
142 | 137 |
github/deemru/w8io/169f3d6 35.58 ms ◑