tx · DSgTqxw9vomsU4KfLjjYLMDUdJW3rkYPafHn4q1sR39k 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos: -0.01100000 Waves 2024.05.14 15:34 [3105693] smart account 3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos > SELF 0.00000000 Waves
{ "type": 13, "id": "DSgTqxw9vomsU4KfLjjYLMDUdJW3rkYPafHn4q1sR39k", "fee": 1100000, "feeAssetId": null, "timestamp": 1715690012471, "version": 2, "chainId": 84, "sender": "3N8YkRZsgDVNAxtmwU1F65EpcYMb8f7QPos", "senderPublicKey": "F7SLwr7RYVQpyocmVScFC6ooaAwewaGq6wNRDYvyiPj1", "proofs": [ "S9S1jQY2n7VQqorZbqPVPSBAXFgSKuX3bRuUUjUnMdgwtY7GYsE9Madi8AZDZAB6UDqysEABxoCXb3PjSTb7UPh" ], "script": "base64:AAIFAAAAAAAAAAoIAhIECgIICBIAAAAABAAAAAAKbWF4Q291bnRlcgAAAAAAAAAAAwAAAAANZGVmYXVsdFJhdGluZwAAAAAAAAAAZAEAAAAUc2VhcmNoRm9yUHJlZGljdGlvbnMAAAACAAAABml0ZW1JZAAAAAdjb3VudGVyBAAAABBzZWFyY2hGb3JDb3VudGVyBAAAAAckbWF0Y2gwCQAEIgAAAAEJAAEsAAAAAgkAASwAAAACBQAAAAZpdGVtSWQCAAAAAV8JAAGkAAAAAQUAAAAHY291bnRlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAgAAAAdObyBVc2VyBQAAABBzZWFyY2hGb3JDb3VudGVyAQAAABZmaW5kUHJlZGljdGlvbkFkcmVzc2VzAAAAAgAAAAZpdGVtSWQAAAAHY291bnRlcgQAAAAKYWRyZXNzTGlzdAUAAAADbmlsAwkAAGcAAAACBQAAAAdjb3VudGVyAAAAAAAAAAABBAAAAAdhZHJlc3MxCQEAAAAUc2VhcmNoRm9yUHJlZGljdGlvbnM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eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXl13gjJ", "height": 3105693, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CfPFMxDkvxFr4BNcWpW6bPkg8vErv18DZzvLyPdKLwaA Next: 3LznDyEZnroS5VU5YsA1EM8VP4seozQ42jUfKGmdFDu5 Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 3 | |
5 | 5 | ||
6 | - | func b (c,d) = { | |
7 | - | let e = { | |
8 | - | let f = getString(((c + "_") + toString(d))) | |
9 | - | if ($isInstanceOf(f, "String")) | |
6 | + | let b = 100 | |
7 | + | ||
8 | + | func c (d,e) = { | |
9 | + | let f = { | |
10 | + | let g = getString(((d + "_") + toString(e))) | |
11 | + | if ($isInstanceOf(g, "String")) | |
10 | 12 | then { | |
11 | - | let | |
12 | - | | |
13 | + | let h = g | |
14 | + | h | |
13 | 15 | } | |
14 | 16 | else "No User" | |
15 | 17 | } | |
16 | - | | |
18 | + | f | |
17 | 19 | } | |
18 | 20 | ||
19 | 21 | ||
20 | - | func | |
21 | - | let | |
22 | - | if (( | |
22 | + | func i (d,e) = { | |
23 | + | let j = nil | |
24 | + | if ((e >= 1)) | |
23 | 25 | then { | |
24 | - | let | |
25 | - | ( | |
26 | + | let k = c(d, 1) | |
27 | + | (j :+ k) | |
26 | 28 | } | |
27 | - | else if (( | |
29 | + | else if ((e >= 2)) | |
28 | 30 | then { | |
29 | - | let | |
30 | - | let | |
31 | - | (( | |
31 | + | let k = c(d, 1) | |
32 | + | let l = c(d, 2) | |
33 | + | ((j :+ k) :+ l) | |
32 | 34 | } | |
33 | - | else if (( | |
35 | + | else if ((e >= 3)) | |
34 | 36 | then { | |
35 | - | let | |
36 | - | let | |
37 | - | let | |
38 | - | ((( | |
37 | + | let k = c(d, 1) | |
38 | + | let l = c(d, 2) | |
39 | + | let m = c(d, 3) | |
40 | + | (((j :+ k) :+ l) :+ m) | |
39 | 41 | } | |
40 | - | else if (( | |
42 | + | else if ((e >= 4)) | |
41 | 43 | then { | |
42 | - | let | |
43 | - | let | |
44 | - | let | |
45 | - | let | |
46 | - | (((( | |
44 | + | let k = c(d, 1) | |
45 | + | let l = c(d, 2) | |
46 | + | let m = c(d, 3) | |
47 | + | let n = c(d, 4) | |
48 | + | ((((j :+ k) :+ l) :+ m) :+ n) | |
47 | 49 | } | |
48 | 50 | else { | |
49 | - | let | |
50 | - | let | |
51 | - | let | |
52 | - | let | |
53 | - | let | |
54 | - | ((((( | |
51 | + | let k = c(d, 1) | |
52 | + | let l = c(d, 2) | |
53 | + | let m = c(d, 3) | |
54 | + | let n = c(d, 4) | |
55 | + | let o = c(d, 5) | |
56 | + | (((((j :+ k) :+ l) :+ m) :+ n) :+ o) | |
55 | 57 | } | |
56 | 58 | } | |
57 | 59 | ||
58 | 60 | ||
59 | - | @Callable( | |
60 | - | func savePrediction ( | |
61 | - | let | |
62 | - | let | |
63 | - | let | |
64 | - | if ($isInstanceOf( | |
61 | + | @Callable(p) | |
62 | + | func savePrediction (d,q) = { | |
63 | + | let r = toString(p.caller) | |
64 | + | let s = { | |
65 | + | let g = getString(d) | |
66 | + | if ($isInstanceOf(g, "String")) | |
65 | 67 | then { | |
66 | - | let | |
67 | - | | |
68 | + | let h = g | |
69 | + | h | |
68 | 70 | } | |
69 | 71 | else "no Data exists" | |
70 | 72 | } | |
71 | - | if (( | |
73 | + | if ((s == "no Data exists")) | |
72 | 74 | then throw("This ItemID does not exist!") | |
73 | 75 | else { | |
74 | - | let | |
75 | - | let | |
76 | - | if ($isInstanceOf( | |
76 | + | let t = { | |
77 | + | let g = getInteger(r) | |
78 | + | if ($isInstanceOf(g, "Int")) | |
77 | 79 | then { | |
78 | - | let | |
79 | - | | |
80 | + | let h = g | |
81 | + | h | |
80 | 82 | } | |
81 | 83 | else "no User exists" | |
82 | 84 | } | |
83 | - | if (( | |
85 | + | if ((t == "no User exists")) | |
84 | 86 | then throw("User does not exist") | |
85 | 87 | else { | |
86 | - | let | |
87 | - | let | |
88 | - | if ($isInstanceOf( | |
88 | + | let f = { | |
89 | + | let g = getInteger((d + "_counter")) | |
90 | + | if ($isInstanceOf(g, "Int")) | |
89 | 91 | then { | |
90 | - | let | |
91 | - | | |
92 | + | let h = g | |
93 | + | h | |
92 | 94 | } | |
93 | 95 | else -1 | |
94 | 96 | } | |
95 | - | let | |
96 | - | if (containsElement( | |
97 | + | let j = i(d, f) | |
98 | + | if (containsElement(j, r)) | |
97 | 99 | then throw("This User already gave a Prediction") | |
98 | - | else if (( | |
100 | + | else if ((f >= 1)) | |
99 | 101 | then { | |
100 | - | let | |
101 | - | let | |
102 | - | if ($isInstanceOf( | |
102 | + | let u = { | |
103 | + | let g = getInteger((d + "_predictionCounter")) | |
104 | + | if ($isInstanceOf(g, "Int")) | |
103 | 105 | then { | |
104 | - | let | |
105 | - | | |
106 | + | let h = g | |
107 | + | h | |
106 | 108 | } | |
107 | 109 | else -1 | |
108 | 110 | } | |
109 | - | let | |
110 | - | let | |
111 | - | let | |
112 | - | if ($isInstanceOf( | |
111 | + | let v = j[(size(j) - 1)] | |
112 | + | let w = { | |
113 | + | let g = getString(((d + "_") + v)) | |
114 | + | if ($isInstanceOf(g, "String")) | |
113 | 115 | then { | |
114 | - | let | |
115 | - | | |
116 | + | let h = g | |
117 | + | h | |
116 | 118 | } | |
117 | 119 | else "no Prediction Found" | |
118 | 120 | } | |
119 | - | let | |
120 | - | if (( | |
121 | - | then if ((( | |
122 | - | then [StringEntry((( | |
123 | - | else [StringEntry((( | |
124 | - | else if (( | |
125 | - | then [StringEntry((( | |
126 | - | else [StringEntry((( | |
121 | + | let x = (f + 1) | |
122 | + | if ((w == q)) | |
123 | + | then if (((u + 1) == a)) | |
124 | + | then [StringEntry(((d + "_") + toString(x)), r), StringEntry(((d + "_") + r), q), IntegerEntry((d + "_counter"), x), IntegerEntry((d + "_predictionCounter"), (u + 1)), BooleanEntry((d + "_final"), true), BooleanEntry((d + "_cancelled"), false)] | |
125 | + | else [StringEntry(((d + "_") + toString(x)), r), StringEntry(((d + "_") + r), q), IntegerEntry((d + "_counter"), x), IntegerEntry((d + "_predictionCounter"), (u + 1)), BooleanEntry((d + "_final"), false), BooleanEntry((d + "_cancelled"), false)] | |
126 | + | else if ((x >= 6)) | |
127 | + | then [StringEntry(((d + "_") + toString(x)), r), StringEntry(((d + "_") + r), q), IntegerEntry((d + "_counter"), x), IntegerEntry((d + "_predictionCounter"), (u - 1)), BooleanEntry((d + "_cancelled"), true), BooleanEntry((d + "_final"), false)] | |
128 | + | else [StringEntry(((d + "_") + toString(x)), r), StringEntry(((d + "_") + r), q), IntegerEntry((d + "_counter"), x), IntegerEntry((d + "_predictionCounter"), (u - 1)), BooleanEntry((d + "_cancelled"), false), BooleanEntry((d + "_final"), false)] | |
127 | 129 | } | |
128 | - | else [StringEntry((( | |
130 | + | else [StringEntry(((d + "_") + toString(1)), r), StringEntry(((d + "_") + r), q), IntegerEntry((d + "_counter"), 1), IntegerEntry((d + "_predictionCounter"), 1)] | |
129 | 131 | } | |
130 | 132 | } | |
131 | 133 | } | |
132 | 134 | ||
133 | 135 | ||
134 | - | @Verifier(x) | |
135 | - | func y () = sigVerify(x.bodyBytes, x.proofs[0], x.senderPublicKey) | |
136 | + | ||
137 | + | @Callable(p) | |
138 | + | func registerUser () = { | |
139 | + | let r = toString(p.caller) | |
140 | + | let t = { | |
141 | + | let g = getInteger(r) | |
142 | + | if ($isInstanceOf(g, "Int")) | |
143 | + | then { | |
144 | + | let h = g | |
145 | + | h | |
146 | + | } | |
147 | + | else "No user found" | |
148 | + | } | |
149 | + | if ((t != "No user Found")) | |
150 | + | then throw("User already exists") | |
151 | + | else [IntegerEntry(r, b)] | |
152 | + | } | |
153 | + | ||
154 | + | ||
155 | + | @Verifier(y) | |
156 | + | func z () = sigVerify(y.bodyBytes, y.proofs[0], y.senderPublicKey) | |
136 | 157 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 3 | |
5 | 5 | ||
6 | - | func b (c,d) = { | |
7 | - | let e = { | |
8 | - | let f = getString(((c + "_") + toString(d))) | |
9 | - | if ($isInstanceOf(f, "String")) | |
6 | + | let b = 100 | |
7 | + | ||
8 | + | func c (d,e) = { | |
9 | + | let f = { | |
10 | + | let g = getString(((d + "_") + toString(e))) | |
11 | + | if ($isInstanceOf(g, "String")) | |
10 | 12 | then { | |
11 | - | let | |
12 | - | | |
13 | + | let h = g | |
14 | + | h | |
13 | 15 | } | |
14 | 16 | else "No User" | |
15 | 17 | } | |
16 | - | | |
18 | + | f | |
17 | 19 | } | |
18 | 20 | ||
19 | 21 | ||
20 | - | func | |
21 | - | let | |
22 | - | if (( | |
22 | + | func i (d,e) = { | |
23 | + | let j = nil | |
24 | + | if ((e >= 1)) | |
23 | 25 | then { | |
24 | - | let | |
25 | - | ( | |
26 | + | let k = c(d, 1) | |
27 | + | (j :+ k) | |
26 | 28 | } | |
27 | - | else if (( | |
29 | + | else if ((e >= 2)) | |
28 | 30 | then { | |
29 | - | let | |
30 | - | let | |
31 | - | (( | |
31 | + | let k = c(d, 1) | |
32 | + | let l = c(d, 2) | |
33 | + | ((j :+ k) :+ l) | |
32 | 34 | } | |
33 | - | else if (( | |
35 | + | else if ((e >= 3)) | |
34 | 36 | then { | |
35 | - | let | |
36 | - | let | |
37 | - | let | |
38 | - | ((( | |
37 | + | let k = c(d, 1) | |
38 | + | let l = c(d, 2) | |
39 | + | let m = c(d, 3) | |
40 | + | (((j :+ k) :+ l) :+ m) | |
39 | 41 | } | |
40 | - | else if (( | |
42 | + | else if ((e >= 4)) | |
41 | 43 | then { | |
42 | - | let | |
43 | - | let | |
44 | - | let | |
45 | - | let | |
46 | - | (((( | |
44 | + | let k = c(d, 1) | |
45 | + | let l = c(d, 2) | |
46 | + | let m = c(d, 3) | |
47 | + | let n = c(d, 4) | |
48 | + | ((((j :+ k) :+ l) :+ m) :+ n) | |
47 | 49 | } | |
48 | 50 | else { | |
49 | - | let | |
50 | - | let | |
51 | - | let | |
52 | - | let | |
53 | - | let | |
54 | - | ((((( | |
51 | + | let k = c(d, 1) | |
52 | + | let l = c(d, 2) | |
53 | + | let m = c(d, 3) | |
54 | + | let n = c(d, 4) | |
55 | + | let o = c(d, 5) | |
56 | + | (((((j :+ k) :+ l) :+ m) :+ n) :+ o) | |
55 | 57 | } | |
56 | 58 | } | |
57 | 59 | ||
58 | 60 | ||
59 | - | @Callable( | |
60 | - | func savePrediction ( | |
61 | - | let | |
62 | - | let | |
63 | - | let | |
64 | - | if ($isInstanceOf( | |
61 | + | @Callable(p) | |
62 | + | func savePrediction (d,q) = { | |
63 | + | let r = toString(p.caller) | |
64 | + | let s = { | |
65 | + | let g = getString(d) | |
66 | + | if ($isInstanceOf(g, "String")) | |
65 | 67 | then { | |
66 | - | let | |
67 | - | | |
68 | + | let h = g | |
69 | + | h | |
68 | 70 | } | |
69 | 71 | else "no Data exists" | |
70 | 72 | } | |
71 | - | if (( | |
73 | + | if ((s == "no Data exists")) | |
72 | 74 | then throw("This ItemID does not exist!") | |
73 | 75 | else { | |
74 | - | let | |
75 | - | let | |
76 | - | if ($isInstanceOf( | |
76 | + | let t = { | |
77 | + | let g = getInteger(r) | |
78 | + | if ($isInstanceOf(g, "Int")) | |
77 | 79 | then { | |
78 | - | let | |
79 | - | | |
80 | + | let h = g | |
81 | + | h | |
80 | 82 | } | |
81 | 83 | else "no User exists" | |
82 | 84 | } | |
83 | - | if (( | |
85 | + | if ((t == "no User exists")) | |
84 | 86 | then throw("User does not exist") | |
85 | 87 | else { | |
86 | - | let | |
87 | - | let | |
88 | - | if ($isInstanceOf( | |
88 | + | let f = { | |
89 | + | let g = getInteger((d + "_counter")) | |
90 | + | if ($isInstanceOf(g, "Int")) | |
89 | 91 | then { | |
90 | - | let | |
91 | - | | |
92 | + | let h = g | |
93 | + | h | |
92 | 94 | } | |
93 | 95 | else -1 | |
94 | 96 | } | |
95 | - | let | |
96 | - | if (containsElement( | |
97 | + | let j = i(d, f) | |
98 | + | if (containsElement(j, r)) | |
97 | 99 | then throw("This User already gave a Prediction") | |
98 | - | else if (( | |
100 | + | else if ((f >= 1)) | |
99 | 101 | then { | |
100 | - | let | |
101 | - | let | |
102 | - | if ($isInstanceOf( | |
102 | + | let u = { | |
103 | + | let g = getInteger((d + "_predictionCounter")) | |
104 | + | if ($isInstanceOf(g, "Int")) | |
103 | 105 | then { | |
104 | - | let | |
105 | - | | |
106 | + | let h = g | |
107 | + | h | |
106 | 108 | } | |
107 | 109 | else -1 | |
108 | 110 | } | |
109 | - | let | |
110 | - | let | |
111 | - | let | |
112 | - | if ($isInstanceOf( | |
111 | + | let v = j[(size(j) - 1)] | |
112 | + | let w = { | |
113 | + | let g = getString(((d + "_") + v)) | |
114 | + | if ($isInstanceOf(g, "String")) | |
113 | 115 | then { | |
114 | - | let | |
115 | - | | |
116 | + | let h = g | |
117 | + | h | |
116 | 118 | } | |
117 | 119 | else "no Prediction Found" | |
118 | 120 | } | |
119 | - | let | |
120 | - | if (( | |
121 | - | then if ((( | |
122 | - | then [StringEntry((( | |
123 | - | else [StringEntry((( | |
124 | - | else if (( | |
125 | - | then [StringEntry((( | |
126 | - | else [StringEntry((( | |
121 | + | let x = (f + 1) | |
122 | + | if ((w == q)) | |
123 | + | then if (((u + 1) == a)) | |
124 | + | then [StringEntry(((d + "_") + toString(x)), r), StringEntry(((d + "_") + r), q), IntegerEntry((d + "_counter"), x), IntegerEntry((d + "_predictionCounter"), (u + 1)), BooleanEntry((d + "_final"), true), BooleanEntry((d + "_cancelled"), false)] | |
125 | + | else [StringEntry(((d + "_") + toString(x)), r), StringEntry(((d + "_") + r), q), IntegerEntry((d + "_counter"), x), IntegerEntry((d + "_predictionCounter"), (u + 1)), BooleanEntry((d + "_final"), false), BooleanEntry((d + "_cancelled"), false)] | |
126 | + | else if ((x >= 6)) | |
127 | + | then [StringEntry(((d + "_") + toString(x)), r), StringEntry(((d + "_") + r), q), IntegerEntry((d + "_counter"), x), IntegerEntry((d + "_predictionCounter"), (u - 1)), BooleanEntry((d + "_cancelled"), true), BooleanEntry((d + "_final"), false)] | |
128 | + | else [StringEntry(((d + "_") + toString(x)), r), StringEntry(((d + "_") + r), q), IntegerEntry((d + "_counter"), x), IntegerEntry((d + "_predictionCounter"), (u - 1)), BooleanEntry((d + "_cancelled"), false), BooleanEntry((d + "_final"), false)] | |
127 | 129 | } | |
128 | - | else [StringEntry((( | |
130 | + | else [StringEntry(((d + "_") + toString(1)), r), StringEntry(((d + "_") + r), q), IntegerEntry((d + "_counter"), 1), IntegerEntry((d + "_predictionCounter"), 1)] | |
129 | 131 | } | |
130 | 132 | } | |
131 | 133 | } | |
132 | 134 | ||
133 | 135 | ||
134 | - | @Verifier(x) | |
135 | - | func y () = sigVerify(x.bodyBytes, x.proofs[0], x.senderPublicKey) | |
136 | + | ||
137 | + | @Callable(p) | |
138 | + | func registerUser () = { | |
139 | + | let r = toString(p.caller) | |
140 | + | let t = { | |
141 | + | let g = getInteger(r) | |
142 | + | if ($isInstanceOf(g, "Int")) | |
143 | + | then { | |
144 | + | let h = g | |
145 | + | h | |
146 | + | } | |
147 | + | else "No user found" | |
148 | + | } | |
149 | + | if ((t != "No user Found")) | |
150 | + | then throw("User already exists") | |
151 | + | else [IntegerEntry(r, b)] | |
152 | + | } | |
153 | + | ||
154 | + | ||
155 | + | @Verifier(y) | |
156 | + | func z () = sigVerify(y.bodyBytes, y.proofs[0], y.senderPublicKey) | |
136 | 157 |
github/deemru/w8io/026f985 72.64 ms ◑