tx · 7iU9gBEsWhUE1KukstT8UbW1HAXUivVtsjqYMAK9Uhn4 3PG7CHvBatHpChwm8reH74wfEwk1PHc8Rqy: -0.01000000 Waves 2023.01.08 21:00 [3461813] smart account 3PG7CHvBatHpChwm8reH74wfEwk1PHc8Rqy > SELF 0.00000000 Waves
{ "type": 13, "id": "7iU9gBEsWhUE1KukstT8UbW1HAXUivVtsjqYMAK9Uhn4", "fee": 1000000, "feeAssetId": null, "timestamp": 1673200923143, "version": 2, "chainId": 87, "sender": "3PG7CHvBatHpChwm8reH74wfEwk1PHc8Rqy", "senderPublicKey": "9KXfR1iJDN9MLTf7rgrygpRA3HG53KCgWyxzqk4m25Qd", "proofs": [ "3EuZgjUGhqaBxUeZ2KKQytLyZCTLWTbwYv4oKHvMbrzo4xd7SEyEHrfRBn6SA5X2q2QN12DcCwnrcBTtnGE3cx6n" ], "script": "base64:BgIGCAISABIACAAZV1hfTFBfV0FWRVNfVVNETl9BU1NFVF9JRAEgXedtbkamxzmxtK4hQ1NqaJeqmQ+fWxX6vGpRDRxJGSAAF1dYX1BPT0xfV0FWRVNfVVNETl9EQVBQCQEHQWRkcmVzcwEBGgFX7UefzUI8k75LIc37An4fyC37loB6w699ABtORVVUUklOT19SRVNUX1JFQURPTkxZX0RBUFAJAQdBZGRyZXNzAQEaAVc2mMwFV8eubgPH9X8mVUOITa4f15p3UlEAFU5FVVRSSU5PX01FVFJJQ1NfREFQUAkBB0FkZHJlc3MBARoBVzjkpo76YXsJPSIs33Rbs+CIsp0VDzoUtgANVVNETl9BU1NFVF9JRAEgtiYpwwT1zlORpA5LdSQvZIxRsfrfr1QpvUjSHSqyqtEBCWFzQW55TGlzdAEBdgQHJG1hdGNoMAUBdgMJAAECBQckbWF0Y2gwAglMaXN0W0FueV0EAWwFByRtYXRjaDAFAWwJAAIBAgQjZXJyAQVhc0ludAEBdgQHJG1hdGNoMAUBdgMJAAECBQckbWF0Y2gwAgNJbnQEAXgFByRtYXRjaDAFAXgEAXQFByRt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TRE5fQVNTRVRfSUQEBWNhbGwyCQD8BwQFF1dYX1BPT0xfV0FWRVNfVVNETl9EQVBQAglnZXRPbmVUa24JAMwIAgUNVVNETl9BU1NFVF9JRAkAzAgCAAEFA25pbAkAzAgCCQEPQXR0YWNoZWRQYXltZW50AgUZV1hfTFBfV0FWRVNfVVNETl9BU1NFVF9JRAUObHBUb2tlbkJhbGFuY2UFA25pbAMJAAACBQVjYWxsMgUFY2FsbDIFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAMgTAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXnKADnB", "height": 3461813, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BKdZsqYvp6rWgQSiXTNupguA9QAyWb35o1ug4mRCaayM Next: 6cJhGsmuuJKze3eHbnNPPfbnYqEN2XzWe4fzadxjNCJU Diff:
Old | New | Differences | |
---|---|---|---|
54 | 54 | if ((call == call)) | |
55 | 55 | then { | |
56 | 56 | let neutrino_data_arr = split(call, "__") | |
57 | - | let alreadySwappedUnderLimit = asInt(neutrino_data_arr[11]) | |
58 | - | let maxAvailableToSwapNow = asInt(neutrino_data_arr[10]) | |
59 | - | if ((alreadySwappedUnderLimit != 0)) | |
60 | - | then throw("Can't swap yet") | |
57 | + | if (true) | |
58 | + | then throw("toto") | |
61 | 59 | else { | |
62 | - | let amounOfUsdnToSwap = if ((amount > maxAvailableToSwapNow)) | |
63 | - | then maxAvailableToSwapNow | |
64 | - | else amount | |
65 | - | if (true) | |
66 | - | then throw("toto") | |
60 | + | let alreadySwappedUnderLimit = asInt(neutrino_data_arr[11]) | |
61 | + | let maxAvailableToSwapNow = asInt(neutrino_data_arr[10]) | |
62 | + | if ((alreadySwappedUnderLimit != 0)) | |
63 | + | then throw("Can't swap yet") | |
67 | 64 | else { | |
65 | + | let amounOfUsdnToSwap = if ((amount > maxAvailableToSwapNow)) | |
66 | + | then maxAvailableToSwapNow | |
67 | + | else amount | |
68 | 68 | let swapUsdnToWaves_SC = invoke(Address(base58'3P4v7QaMk6us7PdxSuoR5LmZmemv5ruD6oj'), "swapNeutrinoToWaves", nil, [AttachedPayment(USDN_ASSET_ID, amounOfUsdnToSwap)]) | |
69 | 69 | if ((swapUsdnToWaves_SC == swapUsdnToWaves_SC)) | |
70 | 70 | then nil |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let WX_LP_WAVES_USDN_ASSET_ID = base58'7KZbJrVopwJhkdwbe1eFDBbex4dkY63MxjTNjqXtrzj1' | |
5 | 5 | ||
6 | 6 | let WX_POOL_WAVES_USDN_DAPP = Address(base58'3PPZWgFNRKHLvM51pwS934C8VZ7d2F4Z58g') | |
7 | 7 | ||
8 | 8 | let NEUTRINO_REST_READONLY_DAPP = Address(base58'3P6uaG88jjcLYZQrvJHLWPbFFRnChnAzmcU') | |
9 | 9 | ||
10 | 10 | let NEUTRINO_METRICS_DAPP = Address(base58'3P77iUusNwMMzWFdC8f7bftwpHyG1PBs1gq') | |
11 | 11 | ||
12 | 12 | let USDN_ASSET_ID = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
13 | 13 | ||
14 | 14 | func asAnyList (v) = match v { | |
15 | 15 | case l: List[Any] => | |
16 | 16 | l | |
17 | 17 | case _ => | |
18 | 18 | throw("#err") | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func asInt (v) = match v { | |
23 | 23 | case x: Int => | |
24 | 24 | x | |
25 | 25 | case t => | |
26 | 26 | throw("#err") | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func asStr (v) = match v { | |
31 | 31 | case x: String => | |
32 | 32 | x | |
33 | 33 | case t => | |
34 | 34 | throw("#err") | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | @Callable(i) | |
39 | 39 | func default () = if ((i.caller != this)) | |
40 | 40 | then throw("Not allowed") | |
41 | 41 | else if (if (!(isDefined(i.payments[0].assetId))) | |
42 | 42 | then true | |
43 | 43 | else (i.payments[0].assetId != USDN_ASSET_ID)) | |
44 | 44 | then throw("USDN Only") | |
45 | 45 | else { | |
46 | 46 | let amount = i.payments[0].amount | |
47 | 47 | let neutrinoMetrics = asAnyList(invoke(NEUTRINO_METRICS_DAPP, "calcNeutinoMetricsREADONLY", nil, nil)) | |
48 | 48 | if ((neutrinoMetrics == neutrinoMetrics)) | |
49 | 49 | then { | |
50 | 50 | let BR = asInt(neutrinoMetrics[8]) | |
51 | 51 | if ((BR > 100500)) | |
52 | 52 | then { | |
53 | 53 | let call = asStr(invoke(NEUTRINO_REST_READONLY_DAPP, "swapInfoREADONLY", ["3PG7CHvBatHpChwm8reH74wfEwk1PHc8Rqy"], nil)) | |
54 | 54 | if ((call == call)) | |
55 | 55 | then { | |
56 | 56 | let neutrino_data_arr = split(call, "__") | |
57 | - | let alreadySwappedUnderLimit = asInt(neutrino_data_arr[11]) | |
58 | - | let maxAvailableToSwapNow = asInt(neutrino_data_arr[10]) | |
59 | - | if ((alreadySwappedUnderLimit != 0)) | |
60 | - | then throw("Can't swap yet") | |
57 | + | if (true) | |
58 | + | then throw("toto") | |
61 | 59 | else { | |
62 | - | let amounOfUsdnToSwap = if ((amount > maxAvailableToSwapNow)) | |
63 | - | then maxAvailableToSwapNow | |
64 | - | else amount | |
65 | - | if (true) | |
66 | - | then throw("toto") | |
60 | + | let alreadySwappedUnderLimit = asInt(neutrino_data_arr[11]) | |
61 | + | let maxAvailableToSwapNow = asInt(neutrino_data_arr[10]) | |
62 | + | if ((alreadySwappedUnderLimit != 0)) | |
63 | + | then throw("Can't swap yet") | |
67 | 64 | else { | |
65 | + | let amounOfUsdnToSwap = if ((amount > maxAvailableToSwapNow)) | |
66 | + | then maxAvailableToSwapNow | |
67 | + | else amount | |
68 | 68 | let swapUsdnToWaves_SC = invoke(Address(base58'3P4v7QaMk6us7PdxSuoR5LmZmemv5ruD6oj'), "swapNeutrinoToWaves", nil, [AttachedPayment(USDN_ASSET_ID, amounOfUsdnToSwap)]) | |
69 | 69 | if ((swapUsdnToWaves_SC == swapUsdnToWaves_SC)) | |
70 | 70 | then nil | |
71 | 71 | else throw("Strict value is not equal to itself.") | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | } | |
75 | 75 | else throw("Strict value is not equal to itself.") | |
76 | 76 | } | |
77 | 77 | else throw("Br under 10") | |
78 | 78 | } | |
79 | 79 | else throw("Strict value is not equal to itself.") | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Callable(i) | |
85 | 85 | func wavesToUdn () = if ((i.caller != this)) | |
86 | 86 | then throw("Not allowed") | |
87 | 87 | else if (isDefined(i.payments[0].assetId)) | |
88 | 88 | then throw("WAVES Only") | |
89 | 89 | else { | |
90 | 90 | let amount = i.payments[0].amount | |
91 | 91 | let call1 = invoke(WX_POOL_WAVES_USDN_DAPP, "putOneTkn", [1, false], [AttachedPayment(unit, amount)]) | |
92 | 92 | if ((call1 == call1)) | |
93 | 93 | then { | |
94 | 94 | let lpTokenBalance = assetBalance(this, WX_LP_WAVES_USDN_ASSET_ID) | |
95 | 95 | let call2 = invoke(WX_POOL_WAVES_USDN_DAPP, "getOneTkn", [USDN_ASSET_ID, 1], [AttachedPayment(WX_LP_WAVES_USDN_ASSET_ID, lpTokenBalance)]) | |
96 | 96 | if ((call2 == call2)) | |
97 | 97 | then nil | |
98 | 98 | else throw("Strict value is not equal to itself.") | |
99 | 99 | } | |
100 | 100 | else throw("Strict value is not equal to itself.") | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | @Verifier(tx) | |
105 | 105 | func verify () = sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
106 | 106 |
github/deemru/w8io/026f985 43.22 ms ◑