tx · B6DXvYGgchaGZba71Hnk4BbYteXe2SD8pduXMomVqvvV 3MvhbvSm4f3m7BHS2YsKVPPpRZCB5qBPWrB: -0.01000000 Waves 2021.11.01 15:27 [1771932] smart account 3MvhbvSm4f3m7BHS2YsKVPPpRZCB5qBPWrB > SELF 0.00000000 Waves
{ "type": 13, "id": "B6DXvYGgchaGZba71Hnk4BbYteXe2SD8pduXMomVqvvV", "fee": 1000000, "feeAssetId": null, "timestamp": 1635769674804, "version": 1, "sender": "3MvhbvSm4f3m7BHS2YsKVPPpRZCB5qBPWrB", "senderPublicKey": "8apL73EWyKeioNcFF9zCGNMBVmtx2muqJZEF34QDGEU7", "proofs": [ "28JP1zpxGN9kG7q4PF4EaZK3tHvM2iiy7nNoTGFwQqRgorhpUNKisHkaqqZSGTiv9hkYtQ2V4CpVuuWYcmdF9GbK" ], "script": "base64:AAIFAAAAAAAAABAIAhIFCgMBAQgSABIDCgECAAAADAAAAAAJc2VwYXJhdG9yAgAAAAJfXwEAAAAPZ2V0U3RyaW5nT3JGYWlsAAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAptYW5kYXRvcnkgCQAEJQAAAAEFAAAAB2FkZHJlc3MCAAAAAS4FAAAAA2tleQIAAAAPIGlzIG5vdCBkZWZpbmVkAAAAAAhrZXlTdGFydAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAABXN0YXJ0BQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAALa2V5RHVyYXRpb24JAAS5AAAAAgkABEwAAAACAgAAAAIlcwkABEwAAAACAgAAAAhkdXJhdGlvbgUAAAADbmlsBQAAAAlzZXBhcmF0b3IAAAAACGtleUFzc2V0CQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAAF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ldFVzZXJSZXdhcmRzAAAAAQkBAAAAB0FkZHJlc3MAAAABBQAAAAxhZGRyZXNzQnl0ZXMEAAAABXRvdGFsCAUAAAALJHQwMzA1NTMxMjcAAAACXzEEAAAAB2NsYWltZWQIBQAAAAskdDAzMDU1MzEyNwAAAAJfMgQAAAAJYXZhaWxhYmxlCAUAAAALJHQwMzA1NTMxMjcAAAACXzMJAAUUAAAAAgUAAAADbmlsCQAEuQAAAAIJAARMAAAAAgIAAAAGJWQlZCVkCQAETAAAAAIJAAGkAAAAAQUAAAAFdG90YWwJAARMAAAAAgkAAaQAAAABBQAAAAdjbGFpbWVkCQAETAAAAAIJAAGkAAAAAQUAAAAJYXZhaWxhYmxlBQAAAANuaWwFAAAACXNlcGFyYXRvcgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAxzcm7g==", "chainId": 84, "height": 1771932, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CutsjVuimjekvJ7npM7QPqHSJjHB95NwNxDJ7zNohXtn Next: G8sQzgYWyEutXuA2UYuJG7gWdHwHN7YBTpZf5k4F35GS Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | - | let b = makeString(["%s", "start"], a) | |
7 | - | ||
8 | - | let c = makeString(["%s", "duration"], a) | |
9 | - | ||
10 | - | let d = makeString(["%s", "asset"], a) | |
11 | - | ||
12 | - | let e = makeString(["%s", "isDataReady"], a) | |
13 | - | ||
14 | - | func f (g) = makeString(["%s%s", "userRewardTotal", toString(g)], a) | |
6 | + | func b (c,d) = valueOrErrorMessage(getString(c, d), (((("mandatory " + toString(c)) + ".") + d) + " is not defined")) | |
15 | 7 | ||
16 | 8 | ||
17 | - | func h (g) = makeString(["%s%s", "userRewardClaimed", toString(g)], a) | |
9 | + | let e = makeString(["%s", "start"], a) | |
10 | + | ||
11 | + | let f = makeString(["%s", "duration"], a) | |
12 | + | ||
13 | + | let g = makeString(["%s", "asset"], a) | |
14 | + | ||
15 | + | let h = makeString(["%s", "isDataReady"], a) | |
16 | + | ||
17 | + | func i (c) = makeString(["%s%s", "userRewardTotal", toString(c)], a) | |
18 | 18 | ||
19 | 19 | ||
20 | - | func | |
20 | + | func j (c) = makeString(["%s%s", "userRewardClaimed", toString(c)], a) | |
21 | 21 | ||
22 | 22 | ||
23 | - | func k (l) = makeString(["% | |
23 | + | func k (c,l) = makeString(["%s%s%s", "claimHistoryRecord", toString(c), toBase58String(l)], a) | |
24 | 24 | ||
25 | 25 | ||
26 | - | func m () = { | |
27 | - | let n = valueOrElse(getBoolean(this, e), false) | |
28 | - | if (n) | |
26 | + | func m (n) = makeString(["%d%d%d", toString(height), toString(lastBlock.timestamp), toString(n)], a) | |
27 | + | ||
28 | + | ||
29 | + | func o () = { | |
30 | + | let p = valueOrElse(getBoolean(this, h), false) | |
31 | + | if (p) | |
29 | 32 | then true | |
30 | 33 | else throw("Data is not ready") | |
31 | 34 | } | |
32 | 35 | ||
33 | 36 | ||
34 | - | func | |
35 | - | let | |
36 | - | let | |
37 | - | let | |
38 | - | let | |
39 | - | let | |
40 | - | let | |
41 | - | $Tuple3( | |
37 | + | func q (c) = { | |
38 | + | let r = valueOrErrorMessage(getInteger(this, e), "Start block is not specified") | |
39 | + | let s = valueOrErrorMessage(getInteger(this, f), "Duration is not specified") | |
40 | + | let t = valueOrElse(getInteger(this, i(c)), 0) | |
41 | + | let u = valueOrElse(getInteger(this, j(c)), 0) | |
42 | + | let v = fraction(t, min([s, max([0, (height - r)])]), s) | |
43 | + | let w = max([0, (v - u)]) | |
44 | + | $Tuple3(t, u, w) | |
42 | 45 | } | |
43 | 46 | ||
44 | 47 | ||
45 | - | @Callable( | |
46 | - | func constructor ( | |
47 | - | let | |
48 | - | let | |
48 | + | @Callable(x) | |
49 | + | func constructor (r,s,y) = { | |
50 | + | let z = 1 | |
51 | + | let A = [if ((x.caller == this)) | |
49 | 52 | then true | |
50 | - | else throw("Access denied"), if ((size(v.payments) == w)) | |
51 | - | then true | |
52 | - | else throw("Exactly 1 payment must be attached")] | |
53 | - | if ((x == x)) | |
54 | - | then { | |
55 | - | let y = valueOrErrorMessage(value(v.payments[0]).assetId, "WAVES can't be used") | |
56 | - | [IntegerEntry(b, p), IntegerEntry(c, q), BinaryEntry(d, y), BooleanEntry(e, false)] | |
57 | - | } | |
53 | + | else throw("Access denied")] | |
54 | + | if ((A == A)) | |
55 | + | then [IntegerEntry(e, r), IntegerEntry(f, s), StringEntry(g, y), BooleanEntry(h, false)] | |
58 | 56 | else throw("Strict value is not equal to itself.") | |
59 | 57 | } | |
60 | 58 | ||
61 | 59 | ||
62 | 60 | ||
63 | - | @Callable( | |
61 | + | @Callable(x) | |
64 | 62 | func claim () = { | |
65 | - | let | |
66 | - | let | |
67 | - | let | |
68 | - | let | |
69 | - | let | |
70 | - | let | |
71 | - | let | |
63 | + | let B = q(x.caller) | |
64 | + | let t = B._1 | |
65 | + | let u = B._2 | |
66 | + | let w = B._3 | |
67 | + | let C = fromBase58String(b(this, g)) | |
68 | + | let D = assetBalance(this, C) | |
69 | + | let A = [o(), if ((w > 0)) | |
72 | 70 | then true | |
73 | - | else throw("No reward available"), if (( | |
71 | + | else throw("No reward available"), if ((D >= w)) | |
74 | 72 | then true | |
75 | 73 | else throw("Insufficient funds. Contact support")] | |
76 | - | if (( | |
77 | - | then [ScriptTransfer( | |
74 | + | if ((A == A)) | |
75 | + | then [ScriptTransfer(x.caller, w, C), IntegerEntry(j(x.caller), (u + w)), StringEntry(k(x.caller, x.transactionId), m(w))] | |
78 | 76 | else throw("Strict value is not equal to itself.") | |
79 | 77 | } | |
80 | 78 | ||
81 | 79 | ||
82 | 80 | ||
83 | - | @Callable( | |
84 | - | func getUserRewardsREADONLY ( | |
85 | - | let | |
86 | - | if (( | |
81 | + | @Callable(x) | |
82 | + | func getUserRewardsREADONLY (E) = { | |
83 | + | let A = [o()] | |
84 | + | if ((A == A)) | |
87 | 85 | then { | |
88 | - | let | |
89 | - | let | |
90 | - | let | |
91 | - | let | |
92 | - | $Tuple2(nil, makeString(["%d%d%d", toString( | |
86 | + | let F = q(Address(E)) | |
87 | + | let t = F._1 | |
88 | + | let u = F._2 | |
89 | + | let w = F._3 | |
90 | + | $Tuple2(nil, makeString(["%d%d%d", toString(t), toString(u), toString(w)], a)) | |
93 | 91 | } | |
94 | 92 | else throw("Strict value is not equal to itself.") | |
95 | 93 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | - | let b = makeString(["%s", "start"], a) | |
7 | - | ||
8 | - | let c = makeString(["%s", "duration"], a) | |
9 | - | ||
10 | - | let d = makeString(["%s", "asset"], a) | |
11 | - | ||
12 | - | let e = makeString(["%s", "isDataReady"], a) | |
13 | - | ||
14 | - | func f (g) = makeString(["%s%s", "userRewardTotal", toString(g)], a) | |
6 | + | func b (c,d) = valueOrErrorMessage(getString(c, d), (((("mandatory " + toString(c)) + ".") + d) + " is not defined")) | |
15 | 7 | ||
16 | 8 | ||
17 | - | func h (g) = makeString(["%s%s", "userRewardClaimed", toString(g)], a) | |
9 | + | let e = makeString(["%s", "start"], a) | |
10 | + | ||
11 | + | let f = makeString(["%s", "duration"], a) | |
12 | + | ||
13 | + | let g = makeString(["%s", "asset"], a) | |
14 | + | ||
15 | + | let h = makeString(["%s", "isDataReady"], a) | |
16 | + | ||
17 | + | func i (c) = makeString(["%s%s", "userRewardTotal", toString(c)], a) | |
18 | 18 | ||
19 | 19 | ||
20 | - | func | |
20 | + | func j (c) = makeString(["%s%s", "userRewardClaimed", toString(c)], a) | |
21 | 21 | ||
22 | 22 | ||
23 | - | func k (l) = makeString(["% | |
23 | + | func k (c,l) = makeString(["%s%s%s", "claimHistoryRecord", toString(c), toBase58String(l)], a) | |
24 | 24 | ||
25 | 25 | ||
26 | - | func m () = { | |
27 | - | let n = valueOrElse(getBoolean(this, e), false) | |
28 | - | if (n) | |
26 | + | func m (n) = makeString(["%d%d%d", toString(height), toString(lastBlock.timestamp), toString(n)], a) | |
27 | + | ||
28 | + | ||
29 | + | func o () = { | |
30 | + | let p = valueOrElse(getBoolean(this, h), false) | |
31 | + | if (p) | |
29 | 32 | then true | |
30 | 33 | else throw("Data is not ready") | |
31 | 34 | } | |
32 | 35 | ||
33 | 36 | ||
34 | - | func | |
35 | - | let | |
36 | - | let | |
37 | - | let | |
38 | - | let | |
39 | - | let | |
40 | - | let | |
41 | - | $Tuple3( | |
37 | + | func q (c) = { | |
38 | + | let r = valueOrErrorMessage(getInteger(this, e), "Start block is not specified") | |
39 | + | let s = valueOrErrorMessage(getInteger(this, f), "Duration is not specified") | |
40 | + | let t = valueOrElse(getInteger(this, i(c)), 0) | |
41 | + | let u = valueOrElse(getInteger(this, j(c)), 0) | |
42 | + | let v = fraction(t, min([s, max([0, (height - r)])]), s) | |
43 | + | let w = max([0, (v - u)]) | |
44 | + | $Tuple3(t, u, w) | |
42 | 45 | } | |
43 | 46 | ||
44 | 47 | ||
45 | - | @Callable( | |
46 | - | func constructor ( | |
47 | - | let | |
48 | - | let | |
48 | + | @Callable(x) | |
49 | + | func constructor (r,s,y) = { | |
50 | + | let z = 1 | |
51 | + | let A = [if ((x.caller == this)) | |
49 | 52 | then true | |
50 | - | else throw("Access denied"), if ((size(v.payments) == w)) | |
51 | - | then true | |
52 | - | else throw("Exactly 1 payment must be attached")] | |
53 | - | if ((x == x)) | |
54 | - | then { | |
55 | - | let y = valueOrErrorMessage(value(v.payments[0]).assetId, "WAVES can't be used") | |
56 | - | [IntegerEntry(b, p), IntegerEntry(c, q), BinaryEntry(d, y), BooleanEntry(e, false)] | |
57 | - | } | |
53 | + | else throw("Access denied")] | |
54 | + | if ((A == A)) | |
55 | + | then [IntegerEntry(e, r), IntegerEntry(f, s), StringEntry(g, y), BooleanEntry(h, false)] | |
58 | 56 | else throw("Strict value is not equal to itself.") | |
59 | 57 | } | |
60 | 58 | ||
61 | 59 | ||
62 | 60 | ||
63 | - | @Callable( | |
61 | + | @Callable(x) | |
64 | 62 | func claim () = { | |
65 | - | let | |
66 | - | let | |
67 | - | let | |
68 | - | let | |
69 | - | let | |
70 | - | let | |
71 | - | let | |
63 | + | let B = q(x.caller) | |
64 | + | let t = B._1 | |
65 | + | let u = B._2 | |
66 | + | let w = B._3 | |
67 | + | let C = fromBase58String(b(this, g)) | |
68 | + | let D = assetBalance(this, C) | |
69 | + | let A = [o(), if ((w > 0)) | |
72 | 70 | then true | |
73 | - | else throw("No reward available"), if (( | |
71 | + | else throw("No reward available"), if ((D >= w)) | |
74 | 72 | then true | |
75 | 73 | else throw("Insufficient funds. Contact support")] | |
76 | - | if (( | |
77 | - | then [ScriptTransfer( | |
74 | + | if ((A == A)) | |
75 | + | then [ScriptTransfer(x.caller, w, C), IntegerEntry(j(x.caller), (u + w)), StringEntry(k(x.caller, x.transactionId), m(w))] | |
78 | 76 | else throw("Strict value is not equal to itself.") | |
79 | 77 | } | |
80 | 78 | ||
81 | 79 | ||
82 | 80 | ||
83 | - | @Callable( | |
84 | - | func getUserRewardsREADONLY ( | |
85 | - | let | |
86 | - | if (( | |
81 | + | @Callable(x) | |
82 | + | func getUserRewardsREADONLY (E) = { | |
83 | + | let A = [o()] | |
84 | + | if ((A == A)) | |
87 | 85 | then { | |
88 | - | let | |
89 | - | let | |
90 | - | let | |
91 | - | let | |
92 | - | $Tuple2(nil, makeString(["%d%d%d", toString( | |
86 | + | let F = q(Address(E)) | |
87 | + | let t = F._1 | |
88 | + | let u = F._2 | |
89 | + | let w = F._3 | |
90 | + | $Tuple2(nil, makeString(["%d%d%d", toString(t), toString(u), toString(w)], a)) | |
93 | 91 | } | |
94 | 92 | else throw("Strict value is not equal to itself.") | |
95 | 93 | } | |
96 | 94 | ||
97 | 95 |
github/deemru/w8io/026f985 36.19 ms ◑