tx · 45ZZNqrw9UT9PdNW6d36kFL8WQmotksgYCw4TSW8LfHo 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB: -0.01400000 Waves 2021.06.01 03:53 [1550596] smart account 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB > SELF 0.00000000 Waves
{ "type": 13, "id": "45ZZNqrw9UT9PdNW6d36kFL8WQmotksgYCw4TSW8LfHo", "fee": 1400000, "feeAssetId": null, "timestamp": 1622508876211, "version": 2, "chainId": 84, "sender": "3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB", "senderPublicKey": "CQ7vntBAYh2QZcKcqiiyEnQWWXsr98ysDptD23Wgxmvb", "proofs": [ "22fvxnvUgWFLYHq8VXBo89Q4H5bYyHHE4Wf1nZhUSWj19ksUhf6G7VgvLJHfAK3xLgLz3h7csq4ct8Jgn1ewtZM4" ], "script": "base64:AAIEAAAAAAAAAAkIAhIDCgEBEgAAAAAFAAAAAAhraXR0ZW5JZAIAAAAsR3VvYmNIdlc5V3FvdG5rR1VqN0prcGNiWHRnVmZCMzdUQTRKa2dTajlRYmIBAAAAD2dldFJhbmRvbU51bWJlcgAAAAQAAAAIdmFyaWFudHMAAAAEdHhJZAAAABRoYXRjaGluZ0ZpbmlzaEhlaWdodAAAAAZvZmZzZXQEAAAAD3JhbmRvbVNlZWRCbG9jawkBAAAABXZhbHVlAAAAAQkAA+0AAAABCQAAZQAAAAIFAAAAFGhhdGNoaW5nRmluaXNoSGVpZ2h0AAAAAAAAAAABBAAAAApyYW5kb21IYXNoCQAB9wAAAAEJAADLAAAAAgUAAAAEdHhJZAkBAAAABXZhbHVlAAAAAQgFAAAAD3JhbmRvbVNlZWRCbG9jawAAAAN2cmYJAABqAAAAAgkABLIAAAACBQAAAApyYW5kb21IYXNoCQAAaAAAAAIFAAAABm9mZnNldAAAAAAAAAAACAUAAAAIdmFyaWFudHMBAAAACmdlbmVyYXRpb24AAAABAAAAA251bQMDCQAAZgAAAAIFAAAAA251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zc3VlTmZ0CQAETAAAAAIFAAAAC25mdFRyYW5zZmVyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQUAAAAKaXNzdWVOZnRJZAUAAAAIZ2VuZUNvZGUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADWlzc3VlUXVhbnRpdHkFAAAAC25ld1F1YW50aXR5BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQ4lJMI=", "height": 1550596, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ABaqmFA2AAKDZZqyrEXPrCCjxNRnsriyvGxnVYYRspr Next: H9wVYAkyxVazSsacyfk1L7MpNAyDkmUDUttX2kDAwuua Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "GuobcHvW9WqotnkGUj7JkpcbXtgVfB37TA4JkgSj9Qbb" | |
5 | 5 | ||
6 | - | func b (c) = if (if ((c > 0)) | |
6 | + | func b (c,d,e,f) = { | |
7 | + | let g = value(blockInfoByHeight((e - 1))) | |
8 | + | let h = sha256((d + value(g.vrf))) | |
9 | + | (toInt(h, (f * 8)) % c) | |
10 | + | } | |
11 | + | ||
12 | + | ||
13 | + | func i (j) = if (if ((j > 0)) | |
7 | 14 | then true | |
8 | - | else (300 >= | |
15 | + | else (300 >= j)) | |
9 | 16 | then "G1" | |
10 | - | else if (if (( | |
17 | + | else if (if ((j > 300)) | |
11 | 18 | then true | |
12 | - | else (1000 >= | |
19 | + | else (1000 >= j)) | |
13 | 20 | then "G2" | |
14 | 21 | else "G3" | |
15 | 22 | ||
16 | 23 | ||
17 | - | func | |
18 | - | let | |
19 | - | let | |
20 | - | let | |
21 | - | let | |
22 | - | if (( | |
24 | + | func k () = { | |
25 | + | let l = lastBlock.timestamp | |
26 | + | let m = toString(l) | |
27 | + | let n = takeRight(m, 2) | |
28 | + | let o = parseIntValue(n) | |
29 | + | if ((o == 0)) | |
23 | 30 | then "II-II-II-II" | |
24 | - | else if (if (( | |
25 | - | then (3 >= | |
31 | + | else if (if ((o > 0)) | |
32 | + | then (3 >= o) | |
26 | 33 | else false) | |
27 | 34 | then "BB-BB-BB-BB" | |
28 | - | else if (if (( | |
29 | - | then (8 >= | |
35 | + | else if (if ((o > 3)) | |
36 | + | then (8 >= o) | |
30 | 37 | else false) | |
31 | 38 | then "CC-CC-CC-CC" | |
32 | - | else if (if (( | |
33 | - | then (15 >= | |
39 | + | else if (if ((o > 8)) | |
40 | + | then (15 >= o) | |
34 | 41 | else false) | |
35 | 42 | then "DD-DD-DD-DD" | |
36 | - | else if (if (( | |
37 | - | then (24 >= | |
43 | + | else if (if ((o > 15)) | |
44 | + | then (24 >= o) | |
38 | 45 | else false) | |
39 | 46 | then "EE-EE-EE-EE" | |
40 | - | else if (if (( | |
41 | - | then (35 >= | |
47 | + | else if (if ((o > 24)) | |
48 | + | then (35 >= o) | |
42 | 49 | else false) | |
43 | 50 | then "FF-FF-FF-FF" | |
44 | - | else if (if (( | |
45 | - | then (48 >= | |
51 | + | else if (if ((o > 35)) | |
52 | + | then (48 >= o) | |
46 | 53 | else false) | |
47 | 54 | then "GG-GG-GG-GG" | |
48 | - | else if (if (( | |
49 | - | then (51 >= | |
55 | + | else if (if ((o > 48)) | |
56 | + | then (51 >= o) | |
50 | 57 | else false) | |
51 | 58 | then "AA-AA-AA-AA" | |
52 | 59 | else "HH-HH-HH-HH" | |
53 | 60 | } | |
54 | 61 | ||
55 | 62 | ||
56 | - | @Callable(i) | |
57 | - | func giveBirthKitten () = { | |
58 | - | let j = i.payments[0] | |
59 | - | let k = toBase58String(value(j.assetId)) | |
60 | - | if ((k != a)) | |
63 | + | func p (j) = { | |
64 | + | let l = lastBlock.timestamp | |
65 | + | let m = toString(l) | |
66 | + | let n = takeRight(m, 2) | |
67 | + | let o = parseIntValue(n) | |
68 | + | if ((o == 0)) | |
69 | + | then "II-II-II-II" | |
70 | + | else if (if ((o > 0)) | |
71 | + | then (3 >= o) | |
72 | + | else false) | |
73 | + | then "BB-BB-BB-BB" | |
74 | + | else if (if ((o > 3)) | |
75 | + | then (8 >= o) | |
76 | + | else false) | |
77 | + | then "CC-CC-CC-CC" | |
78 | + | else if (if ((o > 8)) | |
79 | + | then (15 >= o) | |
80 | + | else false) | |
81 | + | then "DD-DD-DD-DD" | |
82 | + | else if (if ((o > 15)) | |
83 | + | then (24 >= o) | |
84 | + | else false) | |
85 | + | then "EE-EE-EE-EE" | |
86 | + | else if (if ((o > 24)) | |
87 | + | then (35 >= o) | |
88 | + | else false) | |
89 | + | then "FF-FF-FF-FF" | |
90 | + | else if (if ((o > 35)) | |
91 | + | then (48 >= o) | |
92 | + | else false) | |
93 | + | then "GG-GG-GG-GG" | |
94 | + | else if (if ((o > 48)) | |
95 | + | then (51 >= o) | |
96 | + | else false) | |
97 | + | then "AA-AA-AA-AA" | |
98 | + | else "HH-HH-HH-HH" | |
99 | + | } | |
100 | + | ||
101 | + | ||
102 | + | @Callable(q) | |
103 | + | func testKitten (j) = { | |
104 | + | let r = q.payments[0] | |
105 | + | let s = toBase58String(value(r.assetId)) | |
106 | + | if ((s != a)) | |
61 | 107 | then throw("Please send Kitten token.") | |
62 | 108 | else { | |
63 | - | let l = j.amount | |
64 | - | let m = { | |
65 | - | let n = getInteger(this, "issueQuantity") | |
66 | - | if ($isInstanceOf(n, "Int")) | |
67 | - | then { | |
68 | - | let o = n | |
69 | - | o | |
70 | - | } | |
71 | - | else 0 | |
72 | - | } | |
73 | - | let p = (m + 1) | |
74 | - | let q = b(p) | |
75 | - | if ((l > 300)) | |
109 | + | let t = r.amount | |
110 | + | if ((t > 300)) | |
76 | 111 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
77 | - | else if ((300 > | |
112 | + | else if ((300 > t)) | |
78 | 113 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
79 | 114 | else { | |
80 | - | let r = Issue("Kitten(=^・^=)", ("generation:" + q), 1, 0, false) | |
81 | - | let s = calculateAssetId(r) | |
82 | - | let t = ScriptTransfer(i.caller, 1, s) | |
83 | - | let u = d() | |
84 | - | [r, t, StringEntry(toBase58String(value(s)), u), IntegerEntry("issueQuantity", p)] | |
115 | + | let u = { | |
116 | + | let v = getInteger(this, "issueQuantity") | |
117 | + | if ($isInstanceOf(v, "Int")) | |
118 | + | then { | |
119 | + | let w = v | |
120 | + | w | |
121 | + | } | |
122 | + | else 0 | |
123 | + | } | |
124 | + | let x = (u + 1) | |
125 | + | let y = i(x) | |
126 | + | let z = Issue("Kitten(=^・^=)", ("generation:" + y), 1, 0, false) | |
127 | + | let A = calculateAssetId(z) | |
128 | + | let B = lastBlock.height | |
129 | + | let C = b(2, A, B, 0) | |
130 | + | if ((j == 0)) | |
131 | + | then throw(((("blockHeight:" + toString(B)) + "/typeRandom:") + toString(C))) | |
132 | + | else { | |
133 | + | let D = p(C) | |
134 | + | [z, ScriptTransfer(q.caller, 1, A), StringEntry(toBase58String(value(A)), D), IntegerEntry("issueQuantity", x)] | |
135 | + | } | |
85 | 136 | } | |
86 | 137 | } | |
87 | 138 | } | |
88 | 139 | ||
89 | 140 | ||
90 | - | @Verifier(v) | |
91 | - | func w () = sigVerify(v.bodyBytes, v.proofs[0], v.senderPublicKey) | |
141 | + | ||
142 | + | @Callable(q) | |
143 | + | func giveBirthKitten () = { | |
144 | + | let r = q.payments[0] | |
145 | + | let s = toBase58String(value(r.assetId)) | |
146 | + | if ((s != a)) | |
147 | + | then throw("Please send Kitten token.") | |
148 | + | else { | |
149 | + | let t = r.amount | |
150 | + | let u = { | |
151 | + | let v = getInteger(this, "issueQuantity") | |
152 | + | if ($isInstanceOf(v, "Int")) | |
153 | + | then { | |
154 | + | let w = v | |
155 | + | w | |
156 | + | } | |
157 | + | else 0 | |
158 | + | } | |
159 | + | let x = (u + 1) | |
160 | + | let y = i(x) | |
161 | + | if ((t > 300)) | |
162 | + | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
163 | + | else if ((300 > t)) | |
164 | + | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
165 | + | else { | |
166 | + | let z = Issue("Kitten(=^・^=)", ("generation:" + y), 1, 0, false) | |
167 | + | let A = calculateAssetId(z) | |
168 | + | let E = ScriptTransfer(q.caller, 1, A) | |
169 | + | let D = k() | |
170 | + | [z, E, StringEntry(toBase58String(value(A)), D), IntegerEntry("issueQuantity", x)] | |
171 | + | } | |
172 | + | } | |
173 | + | } | |
174 | + | ||
175 | + | ||
176 | + | @Verifier(F) | |
177 | + | func G () = sigVerify(F.bodyBytes, F.proofs[0], F.senderPublicKey) | |
92 | 178 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "GuobcHvW9WqotnkGUj7JkpcbXtgVfB37TA4JkgSj9Qbb" | |
5 | 5 | ||
6 | - | func b (c) = if (if ((c > 0)) | |
6 | + | func b (c,d,e,f) = { | |
7 | + | let g = value(blockInfoByHeight((e - 1))) | |
8 | + | let h = sha256((d + value(g.vrf))) | |
9 | + | (toInt(h, (f * 8)) % c) | |
10 | + | } | |
11 | + | ||
12 | + | ||
13 | + | func i (j) = if (if ((j > 0)) | |
7 | 14 | then true | |
8 | - | else (300 >= | |
15 | + | else (300 >= j)) | |
9 | 16 | then "G1" | |
10 | - | else if (if (( | |
17 | + | else if (if ((j > 300)) | |
11 | 18 | then true | |
12 | - | else (1000 >= | |
19 | + | else (1000 >= j)) | |
13 | 20 | then "G2" | |
14 | 21 | else "G3" | |
15 | 22 | ||
16 | 23 | ||
17 | - | func | |
18 | - | let | |
19 | - | let | |
20 | - | let | |
21 | - | let | |
22 | - | if (( | |
24 | + | func k () = { | |
25 | + | let l = lastBlock.timestamp | |
26 | + | let m = toString(l) | |
27 | + | let n = takeRight(m, 2) | |
28 | + | let o = parseIntValue(n) | |
29 | + | if ((o == 0)) | |
23 | 30 | then "II-II-II-II" | |
24 | - | else if (if (( | |
25 | - | then (3 >= | |
31 | + | else if (if ((o > 0)) | |
32 | + | then (3 >= o) | |
26 | 33 | else false) | |
27 | 34 | then "BB-BB-BB-BB" | |
28 | - | else if (if (( | |
29 | - | then (8 >= | |
35 | + | else if (if ((o > 3)) | |
36 | + | then (8 >= o) | |
30 | 37 | else false) | |
31 | 38 | then "CC-CC-CC-CC" | |
32 | - | else if (if (( | |
33 | - | then (15 >= | |
39 | + | else if (if ((o > 8)) | |
40 | + | then (15 >= o) | |
34 | 41 | else false) | |
35 | 42 | then "DD-DD-DD-DD" | |
36 | - | else if (if (( | |
37 | - | then (24 >= | |
43 | + | else if (if ((o > 15)) | |
44 | + | then (24 >= o) | |
38 | 45 | else false) | |
39 | 46 | then "EE-EE-EE-EE" | |
40 | - | else if (if (( | |
41 | - | then (35 >= | |
47 | + | else if (if ((o > 24)) | |
48 | + | then (35 >= o) | |
42 | 49 | else false) | |
43 | 50 | then "FF-FF-FF-FF" | |
44 | - | else if (if (( | |
45 | - | then (48 >= | |
51 | + | else if (if ((o > 35)) | |
52 | + | then (48 >= o) | |
46 | 53 | else false) | |
47 | 54 | then "GG-GG-GG-GG" | |
48 | - | else if (if (( | |
49 | - | then (51 >= | |
55 | + | else if (if ((o > 48)) | |
56 | + | then (51 >= o) | |
50 | 57 | else false) | |
51 | 58 | then "AA-AA-AA-AA" | |
52 | 59 | else "HH-HH-HH-HH" | |
53 | 60 | } | |
54 | 61 | ||
55 | 62 | ||
56 | - | @Callable(i) | |
57 | - | func giveBirthKitten () = { | |
58 | - | let j = i.payments[0] | |
59 | - | let k = toBase58String(value(j.assetId)) | |
60 | - | if ((k != a)) | |
63 | + | func p (j) = { | |
64 | + | let l = lastBlock.timestamp | |
65 | + | let m = toString(l) | |
66 | + | let n = takeRight(m, 2) | |
67 | + | let o = parseIntValue(n) | |
68 | + | if ((o == 0)) | |
69 | + | then "II-II-II-II" | |
70 | + | else if (if ((o > 0)) | |
71 | + | then (3 >= o) | |
72 | + | else false) | |
73 | + | then "BB-BB-BB-BB" | |
74 | + | else if (if ((o > 3)) | |
75 | + | then (8 >= o) | |
76 | + | else false) | |
77 | + | then "CC-CC-CC-CC" | |
78 | + | else if (if ((o > 8)) | |
79 | + | then (15 >= o) | |
80 | + | else false) | |
81 | + | then "DD-DD-DD-DD" | |
82 | + | else if (if ((o > 15)) | |
83 | + | then (24 >= o) | |
84 | + | else false) | |
85 | + | then "EE-EE-EE-EE" | |
86 | + | else if (if ((o > 24)) | |
87 | + | then (35 >= o) | |
88 | + | else false) | |
89 | + | then "FF-FF-FF-FF" | |
90 | + | else if (if ((o > 35)) | |
91 | + | then (48 >= o) | |
92 | + | else false) | |
93 | + | then "GG-GG-GG-GG" | |
94 | + | else if (if ((o > 48)) | |
95 | + | then (51 >= o) | |
96 | + | else false) | |
97 | + | then "AA-AA-AA-AA" | |
98 | + | else "HH-HH-HH-HH" | |
99 | + | } | |
100 | + | ||
101 | + | ||
102 | + | @Callable(q) | |
103 | + | func testKitten (j) = { | |
104 | + | let r = q.payments[0] | |
105 | + | let s = toBase58String(value(r.assetId)) | |
106 | + | if ((s != a)) | |
61 | 107 | then throw("Please send Kitten token.") | |
62 | 108 | else { | |
63 | - | let l = j.amount | |
64 | - | let m = { | |
65 | - | let n = getInteger(this, "issueQuantity") | |
66 | - | if ($isInstanceOf(n, "Int")) | |
67 | - | then { | |
68 | - | let o = n | |
69 | - | o | |
70 | - | } | |
71 | - | else 0 | |
72 | - | } | |
73 | - | let p = (m + 1) | |
74 | - | let q = b(p) | |
75 | - | if ((l > 300)) | |
109 | + | let t = r.amount | |
110 | + | if ((t > 300)) | |
76 | 111 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
77 | - | else if ((300 > | |
112 | + | else if ((300 > t)) | |
78 | 113 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
79 | 114 | else { | |
80 | - | let r = Issue("Kitten(=^・^=)", ("generation:" + q), 1, 0, false) | |
81 | - | let s = calculateAssetId(r) | |
82 | - | let t = ScriptTransfer(i.caller, 1, s) | |
83 | - | let u = d() | |
84 | - | [r, t, StringEntry(toBase58String(value(s)), u), IntegerEntry("issueQuantity", p)] | |
115 | + | let u = { | |
116 | + | let v = getInteger(this, "issueQuantity") | |
117 | + | if ($isInstanceOf(v, "Int")) | |
118 | + | then { | |
119 | + | let w = v | |
120 | + | w | |
121 | + | } | |
122 | + | else 0 | |
123 | + | } | |
124 | + | let x = (u + 1) | |
125 | + | let y = i(x) | |
126 | + | let z = Issue("Kitten(=^・^=)", ("generation:" + y), 1, 0, false) | |
127 | + | let A = calculateAssetId(z) | |
128 | + | let B = lastBlock.height | |
129 | + | let C = b(2, A, B, 0) | |
130 | + | if ((j == 0)) | |
131 | + | then throw(((("blockHeight:" + toString(B)) + "/typeRandom:") + toString(C))) | |
132 | + | else { | |
133 | + | let D = p(C) | |
134 | + | [z, ScriptTransfer(q.caller, 1, A), StringEntry(toBase58String(value(A)), D), IntegerEntry("issueQuantity", x)] | |
135 | + | } | |
85 | 136 | } | |
86 | 137 | } | |
87 | 138 | } | |
88 | 139 | ||
89 | 140 | ||
90 | - | @Verifier(v) | |
91 | - | func w () = sigVerify(v.bodyBytes, v.proofs[0], v.senderPublicKey) | |
141 | + | ||
142 | + | @Callable(q) | |
143 | + | func giveBirthKitten () = { | |
144 | + | let r = q.payments[0] | |
145 | + | let s = toBase58String(value(r.assetId)) | |
146 | + | if ((s != a)) | |
147 | + | then throw("Please send Kitten token.") | |
148 | + | else { | |
149 | + | let t = r.amount | |
150 | + | let u = { | |
151 | + | let v = getInteger(this, "issueQuantity") | |
152 | + | if ($isInstanceOf(v, "Int")) | |
153 | + | then { | |
154 | + | let w = v | |
155 | + | w | |
156 | + | } | |
157 | + | else 0 | |
158 | + | } | |
159 | + | let x = (u + 1) | |
160 | + | let y = i(x) | |
161 | + | if ((t > 300)) | |
162 | + | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
163 | + | else if ((300 > t)) | |
164 | + | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
165 | + | else { | |
166 | + | let z = Issue("Kitten(=^・^=)", ("generation:" + y), 1, 0, false) | |
167 | + | let A = calculateAssetId(z) | |
168 | + | let E = ScriptTransfer(q.caller, 1, A) | |
169 | + | let D = k() | |
170 | + | [z, E, StringEntry(toBase58String(value(A)), D), IntegerEntry("issueQuantity", x)] | |
171 | + | } | |
172 | + | } | |
173 | + | } | |
174 | + | ||
175 | + | ||
176 | + | @Verifier(F) | |
177 | + | func G () = sigVerify(F.bodyBytes, F.proofs[0], F.senderPublicKey) | |
92 | 178 |
github/deemru/w8io/026f985 69.11 ms ◑