tx · BhG9uVgDuymBUrkvZf89ipSJ4XSUW28GRWWDDhtjwjXz 3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD: -0.00200000 Waves 2022.07.17 17:47 [2143895] smart account 3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD > SELF 0.00000000 Waves
{ "type": 13, "id": "BhG9uVgDuymBUrkvZf89ipSJ4XSUW28GRWWDDhtjwjXz", "fee": 200000, "feeAssetId": null, "timestamp": 1658069253554, "version": 2, "chainId": 84, "sender": "3N2HzcM61QM3LsUrsq4UBvi2btJMHyxvVMD", "senderPublicKey": "CU5wMqCBg4bC4Zgs8QGiqjjvmeMkSiKo3Ff6k5axJZwr", "proofs": [ "6z2Ezx9VJhrTiCe5ShuWL6Jbvwgxs4gNQ9LtSZ1f69pUaqtzTwV3MDmVmZktpwLiQxUkQmQ8kmW7pfM7mGnujkH" ], "script": "base64:AAIFAAAAAAAAABMIAhIDCgEBEgMKAQESBQoDAQgIAAAAAwAAAAAFZ3dVc2QBAAAAINbXd8leUlf/bE0Zz7m+2f/PuYFvN2bQwIvTCLxCdiWNAAAAAAR1c2RuAQAAACAP8hwSrOTEPJrsRhqrJaiw7LoHK0bMbYhy8LXikkkBtAAAAAAIdXNkbkRhcHABAAAAGgFU+6vqWU0WAAbWyOYKOjtwWsCYI4JyWk1VAAAAAwAAAAFpAQAAAA9zd2FwR0d1c2RUb1VzZG4AAAABAAAABmFtb3VudAQAAAADcG10CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAAAiE9AAAAAggFAAAAA3BtdAAAAAdhc3NldElkBQAAAAVnd1VzZAkAAAIAAAABAgAAAClPbmx5IGd3VXNkIHRva2VuIGlzIGFsbG93ZWQgZm9yIHN3YXBwaW5nLgQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAA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yIHN0YWtpbmcuBAAAAANyZXMJAAP8AAAABAkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM05Dcm9LeHBDV0NZaWp3amlWQmc2aGMyVDdEYWFqckh1QnICAAAAA3B1dAkABEwAAAACBQAAAAFhBQAAAANuaWwIBQAAAAFpAAAACHBheW1lbnRzAwkAAAAAAAACBQAAAANyZXMFAAAAA3JlcwQAAAAHJG1hdGNoMAUAAAADcmVzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXIFAAAAByRtYXRjaDAJAAUUAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAEa2V5MQUAAAABcgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAEa2V5MggJAAPvAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM05Dcm9LeHBDV0NZaWp3amlWQmc2aGMyVDdEYWFqckh1QnIAAAAHcmVndWxhcgUAAAADbmlsBQAAAAR1bml0CQAAAgAAAAECAAAAF0luY29ycmVjdCBpbnZva2UgcmVzdWx0CQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAADt60I6", "height": 2143895, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6WEM4fJuGM4VhVN5KnQ9LuvqmEEUNHwkbMJfghbAGJA7 Next: FjNu8RwmfwC2T3vrWvnffK1GQG6RA4GTAFvRd8GYH9MF Diff:
Old | New | Differences | |
---|---|---|---|
46 | 46 | ||
47 | 47 | ||
48 | 48 | @Callable(i) | |
49 | - | func putUsdnLp (key1,key2) = { | |
49 | + | func putUsdnLp (a,key1,key2) = { | |
50 | 50 | let pmt = value(i.payments[0]) | |
51 | 51 | if ((pmt.assetId != usdn)) | |
52 | 52 | then throw("Only usdn token is allowed for staking.") | |
53 | 53 | else { | |
54 | - | let res = invoke(addressFromStringValue("3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr"), "put", | |
54 | + | let res = invoke(addressFromStringValue("3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr"), "put", [a], i.payments) | |
55 | 55 | if ((res == res)) | |
56 | 56 | then match res { | |
57 | 57 | case r: Int => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let gwUsd = base58'FTeosv2BmZED7kBcGnqDy9tba1VdkeodQveSAATMQusJ' | |
5 | 5 | ||
6 | 6 | let usdn = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
7 | 7 | ||
8 | 8 | let usdnDapp = base58'3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr' | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | 11 | func swapGGusdToUsdn (amount) = { | |
12 | 12 | let pmt = value(i.payments[0]) | |
13 | 13 | if ((pmt.assetId != gwUsd)) | |
14 | 14 | then throw("Only gwUsd token is allowed for swapping.") | |
15 | 15 | else { | |
16 | 16 | let currentKey = toBase58String(i.caller.bytes) | |
17 | 17 | let currentAmount = match getInteger(this, currentKey) { | |
18 | 18 | case a: Int => | |
19 | 19 | a | |
20 | 20 | case _ => | |
21 | 21 | 0 | |
22 | 22 | } | |
23 | 23 | [ScriptTransfer(i.caller, amount, usdn)] | |
24 | 24 | } | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | ||
29 | 29 | @Callable(i) | |
30 | 30 | func swapUsdnToGGusd (amount) = { | |
31 | 31 | let pmt = value(i.payments[0]) | |
32 | 32 | if ((pmt.assetId != usdn)) | |
33 | 33 | then throw("Only usdn token is allowed for swapping.") | |
34 | 34 | else { | |
35 | 35 | let currentKey = toBase58String(i.caller.bytes) | |
36 | 36 | let currentAmount = match getInteger(this, currentKey) { | |
37 | 37 | case a: Int => | |
38 | 38 | a | |
39 | 39 | case _ => | |
40 | 40 | 0 | |
41 | 41 | } | |
42 | 42 | [ScriptTransfer(i.caller, amount, gwUsd)] | |
43 | 43 | } | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | ||
48 | 48 | @Callable(i) | |
49 | - | func putUsdnLp (key1,key2) = { | |
49 | + | func putUsdnLp (a,key1,key2) = { | |
50 | 50 | let pmt = value(i.payments[0]) | |
51 | 51 | if ((pmt.assetId != usdn)) | |
52 | 52 | then throw("Only usdn token is allowed for staking.") | |
53 | 53 | else { | |
54 | - | let res = invoke(addressFromStringValue("3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr"), "put", | |
54 | + | let res = invoke(addressFromStringValue("3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr"), "put", [a], i.payments) | |
55 | 55 | if ((res == res)) | |
56 | 56 | then match res { | |
57 | 57 | case r: Int => | |
58 | 58 | $Tuple2([IntegerEntry(key1, r), IntegerEntry(key2, wavesBalance(addressFromStringValue("3NCroKxpCWCYijwjiVBg6hc2T7DaajrHuBr")).regular)], unit) | |
59 | 59 | case _ => | |
60 | 60 | throw("Incorrect invoke result") | |
61 | 61 | } | |
62 | 62 | else throw("Strict value is not equal to itself.") | |
63 | 63 | } | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 |
github/deemru/w8io/169f3d6 28.60 ms ◑