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