tx · EVLfLcJMdRPW2dhVS3xF27Dej8Zqvym9N37pUcU6iRiw 3N3HtdnBkqSSc16DaydiwtrMBUv3DfqKjSW: -0.01400000 Waves 2021.11.22 15:19 [1802231] smart account 3N3HtdnBkqSSc16DaydiwtrMBUv3DfqKjSW > SELF 0.00000000 Waves
{ "type": 13, "id": "EVLfLcJMdRPW2dhVS3xF27Dej8Zqvym9N37pUcU6iRiw", "fee": 1400000, "feeAssetId": null, "timestamp": 1637583607964, "version": 2, "chainId": 84, "sender": "3N3HtdnBkqSSc16DaydiwtrMBUv3DfqKjSW", "senderPublicKey": "Aw1UftaEn1LLmCdG6VwWAuVtaSpcmPw18uZ4x2mvd9Wr", "proofs": [ "5wBdGbowmr57jeahXGejFRPwH66Rmy7vkYjZgec9Z2Y8LZ8ZpDsMvH8bU1f7hTyt69HdhJ7tz7ThYN9xCtoFkFgg", "5dZRRGUu5oGPGFb9DQy7xx3rjfmdAowVQCLzUMZBYgsv4KSZr2HJZYq5ktXQzZMWp5ekdu2vt53ot8QE3Snm1J3P" ], "script": "base64:AAIFAAAAAAAAAA4IAhIECgIIARIECgIRGAAAAA0AAAAAEGtleUFjaGlldmVtZW50SWQCAAAAA2lkXwAAAAAGb3JhY2xlCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFU6UWqHpAvOq7xug7mLpqSXxqYhOHzYrMIAAAAAA9rZXlBZG1pblB1YktleTECAAAAC2FkbWluX3B1Yl8xAAAAAA9rZXlBZG1pblB1YktleTICAAAAC2FkbWluX3B1Yl8yAAAAAA9rZXlBZG1pblB1YktleTMCAAAAC2FkbWluX3B1Yl8zAQAAAAtnZXRBZG1pblB1YgAAAAEAAAALa2V5QWRtaW5QdWIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAGb3JhY2xlBQAAAAtrZXlBZG1pblB1YgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAZzdHJpbmcFAAAAByRtYXRjaDAJAAJZAAAAAQUAAAAG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vZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAABJhZG1pblB1YktleVN0YWtpbmcEAAAAByRtYXRjaDAFAAAAAnR4BQAAABNtdWx0aVNpZ25lZEJ5QWRtaW5zsq0YYQ==", "height": 1802231, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9w66HneWdEhJBYUc3pmgP4yfjuejFtCfpTr9a3TLJvkZ Next: HdzT1Ntx7ce7hPVkHmBgwcpm4yZBL1kt6NzmdNC2HXWk Diff:
Old | New | Differences | |
---|---|---|---|
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Callable(v) | |
50 | - | func add (x,y) = if (!(containsElement(p, toString(this)))) | |
51 | - | then throw("Only achievment writer can call this function") | |
52 | - | else if (!(isDefined(getInteger(this, (a + x))))) | |
53 | - | then throw("Unknown achievement id") | |
54 | - | else { | |
55 | - | let z = toString(v.originCaller) | |
56 | - | let A = valueOrElse(getInteger(this, ((z + "_") + x)), 0) | |
57 | - | [IntegerEntry(((z + "_") + x), (A + y))] | |
58 | - | } | |
50 | + | func add (x,y) = { | |
51 | + | let z = (a + x) | |
52 | + | if (!(containsElement(p, toString(this)))) | |
53 | + | then throw("Only achievment writer can call this function") | |
54 | + | else if (!(isDefined(getInteger(this, z)))) | |
55 | + | then throw("Unknown achievement id") | |
56 | + | else { | |
57 | + | let A = toString(v.originCaller) | |
58 | + | let B = valueOrElse(getInteger(this, ((A + "_") + x)), 0) | |
59 | + | [IntegerEntry(((A + "_") + x), (B + y))] | |
60 | + | } | |
61 | + | } | |
59 | 62 | ||
60 | 63 | ||
61 | 64 | ||
62 | 65 | @Callable(v) | |
63 | - | func addAchievements ( | |
66 | + | func addAchievements (C,D) = if (!(containsElement([k, l, m], v.callerPublicKey))) | |
64 | 67 | then throw("Only admin can call this function") | |
65 | 68 | else { | |
66 | - | let | |
67 | - | let | |
68 | - | let | |
69 | - | let | |
70 | - | func | |
71 | - | then | |
72 | - | else q( | |
69 | + | let E = { | |
70 | + | let F = D | |
71 | + | let G = size(F) | |
72 | + | let H = $Tuple3(C, 0, nil) | |
73 | + | func I (J,K) = if ((K >= G)) | |
74 | + | then J | |
75 | + | else q(J, F[K]) | |
73 | 76 | ||
74 | - | func | |
75 | - | then | |
77 | + | func L (J,K) = if ((K >= G)) | |
78 | + | then J | |
76 | 79 | else throw("List size exceeds 20") | |
77 | 80 | ||
78 | - | | |
81 | + | L(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(H, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
79 | 82 | } | |
80 | - | | |
83 | + | E._3 | |
81 | 84 | } | |
82 | 85 | ||
83 | 86 | ||
84 | - | @Verifier( | |
85 | - | func | |
86 | - | let | |
87 | - | let | |
87 | + | @Verifier(M) | |
88 | + | func N () = { | |
89 | + | let O = { | |
90 | + | let P = if (sigVerify(M.bodyBytes, M.proofs[0], k)) | |
88 | 91 | then 1 | |
89 | 92 | else 0 | |
90 | - | let | |
93 | + | let Q = if (sigVerify(M.bodyBytes, M.proofs[1], l)) | |
91 | 94 | then 1 | |
92 | 95 | else 0 | |
93 | - | let | |
96 | + | let R = if (sigVerify(M.bodyBytes, M.proofs[2], m)) | |
94 | 97 | then 1 | |
95 | 98 | else 0 | |
96 | - | ((( | |
99 | + | (((P + Q) + R) >= 2) | |
97 | 100 | } | |
98 | - | let | |
101 | + | let S = if (if (if (sigVerify(M.bodyBytes, M.proofs[0], k)) | |
99 | 102 | then true | |
100 | - | else sigVerify( | |
103 | + | else sigVerify(M.bodyBytes, M.proofs[0], l)) | |
101 | 104 | then true | |
102 | - | else sigVerify( | |
105 | + | else sigVerify(M.bodyBytes, M.proofs[0], m)) | |
103 | 106 | then true | |
104 | - | else sigVerify( | |
105 | - | let h = | |
106 | - | | |
107 | + | else sigVerify(M.bodyBytes, M.proofs[0], n) | |
108 | + | let h = M | |
109 | + | O | |
107 | 110 | } | |
108 | 111 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "id_" | |
5 | 5 | ||
6 | 6 | let b = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
7 | 7 | ||
8 | 8 | let c = "admin_pub_1" | |
9 | 9 | ||
10 | 10 | let d = "admin_pub_2" | |
11 | 11 | ||
12 | 12 | let e = "admin_pub_3" | |
13 | 13 | ||
14 | 14 | func f (g) = { | |
15 | 15 | let h = getString(b, g) | |
16 | 16 | if ($isInstanceOf(h, "String")) | |
17 | 17 | then { | |
18 | 18 | let i = h | |
19 | 19 | fromBase58String(i) | |
20 | 20 | } | |
21 | 21 | else { | |
22 | 22 | let j = h | |
23 | 23 | throw("Admin public key is empty") | |
24 | 24 | } | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | let k = f(c) | |
29 | 29 | ||
30 | 30 | let l = f(d) | |
31 | 31 | ||
32 | 32 | let m = f(e) | |
33 | 33 | ||
34 | 34 | let n = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
35 | 35 | ||
36 | 36 | let o = "achievements_writers" | |
37 | 37 | ||
38 | 38 | let p = split(valueOrElse(getString(b, o), ""), ",") | |
39 | 39 | ||
40 | 40 | func q (r,s) = { | |
41 | 41 | let t = r | |
42 | 42 | let u = t._1 | |
43 | 43 | let v = t._2 | |
44 | 44 | let w = t._3 | |
45 | 45 | $Tuple3(u, (v + 1), (w :+ StringEntry((a + toString(u[v])), s))) | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Callable(v) | |
50 | - | func add (x,y) = if (!(containsElement(p, toString(this)))) | |
51 | - | then throw("Only achievment writer can call this function") | |
52 | - | else if (!(isDefined(getInteger(this, (a + x))))) | |
53 | - | then throw("Unknown achievement id") | |
54 | - | else { | |
55 | - | let z = toString(v.originCaller) | |
56 | - | let A = valueOrElse(getInteger(this, ((z + "_") + x)), 0) | |
57 | - | [IntegerEntry(((z + "_") + x), (A + y))] | |
58 | - | } | |
50 | + | func add (x,y) = { | |
51 | + | let z = (a + x) | |
52 | + | if (!(containsElement(p, toString(this)))) | |
53 | + | then throw("Only achievment writer can call this function") | |
54 | + | else if (!(isDefined(getInteger(this, z)))) | |
55 | + | then throw("Unknown achievement id") | |
56 | + | else { | |
57 | + | let A = toString(v.originCaller) | |
58 | + | let B = valueOrElse(getInteger(this, ((A + "_") + x)), 0) | |
59 | + | [IntegerEntry(((A + "_") + x), (B + y))] | |
60 | + | } | |
61 | + | } | |
59 | 62 | ||
60 | 63 | ||
61 | 64 | ||
62 | 65 | @Callable(v) | |
63 | - | func addAchievements ( | |
66 | + | func addAchievements (C,D) = if (!(containsElement([k, l, m], v.callerPublicKey))) | |
64 | 67 | then throw("Only admin can call this function") | |
65 | 68 | else { | |
66 | - | let | |
67 | - | let | |
68 | - | let | |
69 | - | let | |
70 | - | func | |
71 | - | then | |
72 | - | else q( | |
69 | + | let E = { | |
70 | + | let F = D | |
71 | + | let G = size(F) | |
72 | + | let H = $Tuple3(C, 0, nil) | |
73 | + | func I (J,K) = if ((K >= G)) | |
74 | + | then J | |
75 | + | else q(J, F[K]) | |
73 | 76 | ||
74 | - | func | |
75 | - | then | |
77 | + | func L (J,K) = if ((K >= G)) | |
78 | + | then J | |
76 | 79 | else throw("List size exceeds 20") | |
77 | 80 | ||
78 | - | | |
81 | + | L(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(I(H, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
79 | 82 | } | |
80 | - | | |
83 | + | E._3 | |
81 | 84 | } | |
82 | 85 | ||
83 | 86 | ||
84 | - | @Verifier( | |
85 | - | func | |
86 | - | let | |
87 | - | let | |
87 | + | @Verifier(M) | |
88 | + | func N () = { | |
89 | + | let O = { | |
90 | + | let P = if (sigVerify(M.bodyBytes, M.proofs[0], k)) | |
88 | 91 | then 1 | |
89 | 92 | else 0 | |
90 | - | let | |
93 | + | let Q = if (sigVerify(M.bodyBytes, M.proofs[1], l)) | |
91 | 94 | then 1 | |
92 | 95 | else 0 | |
93 | - | let | |
96 | + | let R = if (sigVerify(M.bodyBytes, M.proofs[2], m)) | |
94 | 97 | then 1 | |
95 | 98 | else 0 | |
96 | - | ((( | |
99 | + | (((P + Q) + R) >= 2) | |
97 | 100 | } | |
98 | - | let | |
101 | + | let S = if (if (if (sigVerify(M.bodyBytes, M.proofs[0], k)) | |
99 | 102 | then true | |
100 | - | else sigVerify( | |
103 | + | else sigVerify(M.bodyBytes, M.proofs[0], l)) | |
101 | 104 | then true | |
102 | - | else sigVerify( | |
105 | + | else sigVerify(M.bodyBytes, M.proofs[0], m)) | |
103 | 106 | then true | |
104 | - | else sigVerify( | |
105 | - | let h = | |
106 | - | | |
107 | + | else sigVerify(M.bodyBytes, M.proofs[0], n) | |
108 | + | let h = M | |
109 | + | O | |
107 | 110 | } | |
108 | 111 |
github/deemru/w8io/169f3d6 37.06 ms ◑