tx · Hv7YiNefmYKXVf3Pkej8b1qNvPMkzrabYSaq21yRV8oo 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez: -0.00600000 Waves 2023.10.30 15:33 [2821380] smart account 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez > SELF 0.00000000 Waves
{ "type": 13, "id": "Hv7YiNefmYKXVf3Pkej8b1qNvPMkzrabYSaq21yRV8oo", "fee": 600000, "feeAssetId": null, "timestamp": 1698669208902, "version": 2, "chainId": 84, "sender": "3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez", "senderPublicKey": "Brp6cacBXyKUcZr5Uc6VDKsnFcaEeQ8nQzrZQyobDsuf", "proofs": [ "2zwXscn4d2cu1wfRE8zdqeJ5VuDgjDVxAPzBvxVfK2Ro1XmDjFqSZyXcaE8p12b8vVs5c2bTLHhco4b2cwN3S31M" ], "script": "base64:AAIFAAAAAAAAAA8IAhIECgIIARIDCgEIEgAAAAAIAAAAAAJsaQkABEwAAAACAgAAAAExCQAETAAAAAICAAAAATIJAARMAAAAAgIAAAABMwkABEwAAAACAgAAAAE0CQAETAAAAAICAAAAATUJAARMAAAAAgIAAAABNgUAAAADbmlsAAAAAAVob3VycwAAAAAAAAAAAQAAAAAHbWludXRlcwAAAAAAAAAACgEAAAANdHJ5R2V0SW50ZWdlcgAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAAAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAAAQAAAA5nZXRBc3NldFN0cmluZwAAAAEAAAAHYXNzZXRJZ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kAAAAAAAAAABoAAAAAAAAAABsAAAAAAAAAABwAAAAAAAAAAB0AAAAAAAAAAB4AAAAAAAAAAB8AAAAAAAAAACAAAAAAAAAAACEAAAAAAAAAACIAAAAAAAAAACMAAAAAAAAAACQAAAAAAAAAACUAAAAAAAAAACYAAAAAAAAAACcAAAAAAAAAACgAAAAAAAAAACkAAAAAAAAAACoAAAAAAAAAACsAAAAAAAAAACwAAAAAAAAAAC0AAAAAAAAAAC4AAAAAAAAAAC8AAAAAAAAAADAAAAAAAAAAADEAAAAAAAAAADIAAAAAAAAAADMAAAAAAAAAADQAAAAAAAAAADUAAAAAAAAAADYAAAAAAAAAADcAAAAAAAAAADgAAAAAAAAAADkAAAAAAAAAADoAAAAAAAAAADsAAAAAAAAAADwDCQAAAAAAAAIFAAAACHBheW1lbnRzBQAAAAhwYXltZW50cwUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAACYp4gK", "height": 2821380, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4XpiPHdyVqzwJhTAKqAUk2u4FJ6wVDi2E3EMdLJRRvi4 Next: AHNrdL7KFa7VSGegZLnBzkCJpRcyC6ft5GRixyq3bRHu Diff:
Old | New | Differences | |
---|---|---|---|
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(s) | |
64 | - | func addBoosting (t,u) = if (if (if ((s.caller != this)) | |
65 | - | then (s.caller != Address(base58'3PEtLVxDT8mxAh1SDAn8m7JTGNkdpkaFxBk')) | |
66 | - | else false) | |
67 | - | then (s.caller != Address(base58'3P8qVX189qpoTJZQQQdKS9endHK5sxWsvrd')) | |
68 | - | else false) | |
69 | - | then throw("under maintenance until further notice") | |
70 | - | else { | |
71 | - | let v = s.payments[0].amount | |
72 | - | let j = i(s.payments[0].assetId) | |
73 | - | let w = (d("global_boostingsAmount") + 1) | |
74 | - | let n = toString(w) | |
75 | - | if ((addressFromString(t) == unit)) | |
76 | - | then throw("incorrect pool address") | |
77 | - | else [IntegerEntry("global_boostingsAmount", w), IntegerEntry((("boosting_" + n) + "_days"), u), IntegerEntry((("boosting_" + n) + "_totalAmount"), v), IntegerEntry((("boosting_" + n) + "_dailyAmount"), (v / u)), IntegerEntry((("boosting_" + n) + "_blockAmount"), (v / ((u * b) * c))), IntegerEntry((("boosting_" + n) + "_startHeight"), height), IntegerEntry((("boosting_" + n) + "_finishHeight"), (height + ((u * b) * c))), IntegerEntry((("boosting_" + n) + "_finishTimestamp"), (lastBlock.timestamp + ((((u * b) * c) * 60) * 1000))), IntegerEntry((("boosting_" + n) + "_lastHeight"), height), StringEntry((("boosting_" + n) + "_assetId"), j), StringEntry((("boosting_" + n) + "_owner"), toString(s.caller)), StringEntry((("boosting_" + n) + "_poolId"), t), StringEntry((("pool_" + t) + "_boostings"), ((h((("pool_" + t) + "_boostings")) + n) + ","))] | |
78 | - | } | |
64 | + | func addBoosting (t,u) = { | |
65 | + | let v = s.payments[0].amount | |
66 | + | let j = i(s.payments[0].assetId) | |
67 | + | let w = (d("global_boostingsAmount") + 1) | |
68 | + | let n = toString(w) | |
69 | + | if ((addressFromString(t) == unit)) | |
70 | + | then throw("incorrect pool address") | |
71 | + | else [IntegerEntry("global_boostingsAmount", w), IntegerEntry((("boosting_" + n) + "_days"), u), IntegerEntry((("boosting_" + n) + "_totalAmount"), v), IntegerEntry((("boosting_" + n) + "_dailyAmount"), (v / u)), IntegerEntry((("boosting_" + n) + "_blockAmount"), (v / ((u * b) * c))), IntegerEntry((("boosting_" + n) + "_startHeight"), height), IntegerEntry((("boosting_" + n) + "_finishHeight"), (height + ((u * b) * c))), IntegerEntry((("boosting_" + n) + "_finishTimestamp"), (lastBlock.timestamp + ((((u * b) * c) * 60) * 1000))), IntegerEntry((("boosting_" + n) + "_lastHeight"), height), StringEntry((("boosting_" + n) + "_assetId"), j), StringEntry((("boosting_" + n) + "_owner"), toString(s.caller)), StringEntry((("boosting_" + n) + "_poolId"), t), StringEntry((("pool_" + t) + "_boostings"), ((h((("pool_" + t) + "_boostings")) + n) + ","))] | |
72 | + | } | |
79 | 73 | ||
80 | 74 | ||
81 | 75 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = ["1", "2", "3", "4", "5", "6"] | |
5 | 5 | ||
6 | 6 | let b = 1 | |
7 | 7 | ||
8 | 8 | let c = 10 | |
9 | 9 | ||
10 | 10 | func d (e) = { | |
11 | 11 | let f = getInteger(this, e) | |
12 | 12 | if ($isInstanceOf(f, "Int")) | |
13 | 13 | then { | |
14 | 14 | let g = f | |
15 | 15 | g | |
16 | 16 | } | |
17 | 17 | else 0 | |
18 | 18 | } | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func h (e) = { | |
22 | 22 | let f = getString(this, e) | |
23 | 23 | if ($isInstanceOf(f, "String")) | |
24 | 24 | then { | |
25 | 25 | let g = f | |
26 | 26 | g | |
27 | 27 | } | |
28 | 28 | else "" | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func i (j) = { | |
33 | 33 | let f = j | |
34 | 34 | if ($isInstanceOf(f, "ByteVector")) | |
35 | 35 | then { | |
36 | 36 | let g = f | |
37 | 37 | toBase58String(g) | |
38 | 38 | } | |
39 | 39 | else "WAVES" | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func k (l) = if ((l == "WAVES")) | |
44 | 44 | then unit | |
45 | 45 | else fromBase58String(l) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func m (n) = { | |
49 | 49 | let o = d((("boosting_" + n) + "_lastHeight")) | |
50 | 50 | let p = d((("boosting_" + n) + "_finishHeight")) | |
51 | 51 | if (if ((o != 0)) | |
52 | 52 | then (p > o) | |
53 | 53 | else false) | |
54 | 54 | then { | |
55 | 55 | let q = d((("boosting_" + n) + "_blockAmount")) | |
56 | 56 | let r = ((min([p, height]) - o) * q) | |
57 | 57 | [IntegerEntry((("boosting_" + n) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(h((("boosting_" + n) + "_poolId"))), r, k(h((("boosting_" + n) + "_assetId"))))] | |
58 | 58 | } | |
59 | 59 | else nil | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(s) | |
64 | - | func addBoosting (t,u) = if (if (if ((s.caller != this)) | |
65 | - | then (s.caller != Address(base58'3PEtLVxDT8mxAh1SDAn8m7JTGNkdpkaFxBk')) | |
66 | - | else false) | |
67 | - | then (s.caller != Address(base58'3P8qVX189qpoTJZQQQdKS9endHK5sxWsvrd')) | |
68 | - | else false) | |
69 | - | then throw("under maintenance until further notice") | |
70 | - | else { | |
71 | - | let v = s.payments[0].amount | |
72 | - | let j = i(s.payments[0].assetId) | |
73 | - | let w = (d("global_boostingsAmount") + 1) | |
74 | - | let n = toString(w) | |
75 | - | if ((addressFromString(t) == unit)) | |
76 | - | then throw("incorrect pool address") | |
77 | - | else [IntegerEntry("global_boostingsAmount", w), IntegerEntry((("boosting_" + n) + "_days"), u), IntegerEntry((("boosting_" + n) + "_totalAmount"), v), IntegerEntry((("boosting_" + n) + "_dailyAmount"), (v / u)), IntegerEntry((("boosting_" + n) + "_blockAmount"), (v / ((u * b) * c))), IntegerEntry((("boosting_" + n) + "_startHeight"), height), IntegerEntry((("boosting_" + n) + "_finishHeight"), (height + ((u * b) * c))), IntegerEntry((("boosting_" + n) + "_finishTimestamp"), (lastBlock.timestamp + ((((u * b) * c) * 60) * 1000))), IntegerEntry((("boosting_" + n) + "_lastHeight"), height), StringEntry((("boosting_" + n) + "_assetId"), j), StringEntry((("boosting_" + n) + "_owner"), toString(s.caller)), StringEntry((("boosting_" + n) + "_poolId"), t), StringEntry((("pool_" + t) + "_boostings"), ((h((("pool_" + t) + "_boostings")) + n) + ","))] | |
78 | - | } | |
64 | + | func addBoosting (t,u) = { | |
65 | + | let v = s.payments[0].amount | |
66 | + | let j = i(s.payments[0].assetId) | |
67 | + | let w = (d("global_boostingsAmount") + 1) | |
68 | + | let n = toString(w) | |
69 | + | if ((addressFromString(t) == unit)) | |
70 | + | then throw("incorrect pool address") | |
71 | + | else [IntegerEntry("global_boostingsAmount", w), IntegerEntry((("boosting_" + n) + "_days"), u), IntegerEntry((("boosting_" + n) + "_totalAmount"), v), IntegerEntry((("boosting_" + n) + "_dailyAmount"), (v / u)), IntegerEntry((("boosting_" + n) + "_blockAmount"), (v / ((u * b) * c))), IntegerEntry((("boosting_" + n) + "_startHeight"), height), IntegerEntry((("boosting_" + n) + "_finishHeight"), (height + ((u * b) * c))), IntegerEntry((("boosting_" + n) + "_finishTimestamp"), (lastBlock.timestamp + ((((u * b) * c) * 60) * 1000))), IntegerEntry((("boosting_" + n) + "_lastHeight"), height), StringEntry((("boosting_" + n) + "_assetId"), j), StringEntry((("boosting_" + n) + "_owner"), toString(s.caller)), StringEntry((("boosting_" + n) + "_poolId"), t), StringEntry((("pool_" + t) + "_boostings"), ((h((("pool_" + t) + "_boostings")) + n) + ","))] | |
72 | + | } | |
79 | 73 | ||
80 | 74 | ||
81 | 75 | ||
82 | 76 | @Callable(s) | |
83 | 77 | func payBoosting (n) = m(n) | |
84 | 78 | ||
85 | 79 | ||
86 | 80 | ||
87 | 81 | @Callable(s) | |
88 | 82 | func payBoostings () = { | |
89 | 83 | func x (y,z) = { | |
90 | 84 | let A = invoke(this, "payBoosting", [z], nil) | |
91 | 85 | if ((A == A)) | |
92 | 86 | then A | |
93 | 87 | else throw("Strict value is not equal to itself.") | |
94 | 88 | } | |
95 | 89 | ||
96 | 90 | let B = { | |
97 | 91 | let C = a | |
98 | 92 | let D = size(C) | |
99 | 93 | let E = 0 | |
100 | 94 | func F (G,H) = if ((H >= D)) | |
101 | 95 | then G | |
102 | 96 | else x(G, C[H]) | |
103 | 97 | ||
104 | 98 | func I (G,H) = if ((H >= D)) | |
105 | 99 | then G | |
106 | 100 | else throw("List size exceeds 60") | |
107 | 101 | ||
108 | 102 | I(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(F(E, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60) | |
109 | 103 | } | |
110 | 104 | if ((B == B)) | |
111 | 105 | then nil | |
112 | 106 | else throw("Strict value is not equal to itself.") | |
113 | 107 | } | |
114 | 108 | ||
115 | 109 |
github/deemru/w8io/026f985 33.32 ms ◑