tx · H9wVYAkyxVazSsacyfk1L7MpNAyDkmUDUttX2kDAwuua 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB: -0.01400000 Waves 2021.06.01 04:06 [1550609] smart account 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB > SELF 0.00000000 Waves
{ "type": 13, "id": "H9wVYAkyxVazSsacyfk1L7MpNAyDkmUDUttX2kDAwuua", "fee": 1400000, "feeAssetId": null, "timestamp": 1622509650057, "version": 2, "chainId": 84, "sender": "3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB", "senderPublicKey": "CQ7vntBAYh2QZcKcqiiyEnQWWXsr98ysDptD23Wgxmvb", "proofs": [ "3N63gX3jbwQgnoDd6q2Zrb1S5X6FCDpmpGHCiL17sgcH53ksjLrNxgFZQf3s9s8uJAP5JKMvXvSbC2HYTSguVNg4" ], "script": "base64:AAIEAAAAAAAAAAkIAhIDCgEBEgAAAAAFAAAAAAhraXR0ZW5JZAIAAAAsR3VvYmNIdlc5V3FvdG5rR1VqN0prcGNiWHRnVmZCMzdUQTRKa2dTajlRYmIBAAAAD2dldFJhbmRvbU51bWJlcgAAAAQAAAAIdmFyaWFudHMAAAAEdHhJZAAAABRoYXRjaGluZ0ZpbmlzaEhlaWdodAAAAAZvZmZzZXQEAAAAD3JhbmRvbVNlZWRCbG9jawkBAAAABXZhbHVlAAAAAQkAA+0AAAABCQAAZQAAAAIFAAAAFGhhdGNoaW5nRmluaXNoSGVpZ2h0AAAAAAAAAAABBAAAAApyYW5kb21IYXNoCQAB9wAAAAEJAADLAAAAAgUAAAAEdHhJZAkBAAAABXZhbHVlAAAAAQgFAAAAD3JhbmRvbVNlZWRCbG9jawAAAAN2cmYJAABqAAAAAgkABLIAAAACBQAAAApyYW5kb21IYXNoCQAAaAAAAAIFAAAABm9mZnNldAAAAAAAAAAACAUAAAAIdmFyaWFudHMBAAAACmdlbmVyYXRpb24AAAABAAAAA251bQMDCQAAZgAAAAIFAAAAA251bQAAA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TmZ0CQAETAAAAAIFAAAAC25mdFRyYW5zZmVyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQUAAAAKaXNzdWVOZnRJZAUAAAAIZ2VuZUNvZGUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADWlzc3VlUXVhbnRpdHkFAAAAC25ld1F1YW50aXR5BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleRu+Up8=", "height": 1550609, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 45ZZNqrw9UT9PdNW6d36kFL8WQmotksgYCw4TSW8LfHo Next: 31Li9KkucfFGWok6WYQ8cSQz8dtqEgFVrF9YqpivZn61 Diff:
Old | New | Differences | |
---|---|---|---|
123 | 123 | let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false) | |
124 | 124 | let issueNftId = calculateAssetId(issueNft) | |
125 | 125 | let blockHeight = lastBlock.height | |
126 | - | let typeRandom = getRandomNumber( | |
126 | + | let typeRandom = getRandomNumber(100, issueNftId, blockHeight, 0) | |
127 | 127 | if ((num == 0)) | |
128 | 128 | then throw(((("blockHeight:" + toString(blockHeight)) + "/typeRandom:") + toString(typeRandom))) | |
129 | 129 | else { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kittenId = "GuobcHvW9WqotnkGUj7JkpcbXtgVfB37TA4JkgSj9Qbb" | |
5 | 5 | ||
6 | 6 | func getRandomNumber (variants,txId,hatchingFinishHeight,offset) = { | |
7 | 7 | let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1))) | |
8 | 8 | let randomHash = sha256((txId + value(randomSeedBlock.vrf))) | |
9 | 9 | (toInt(randomHash, (offset * 8)) % variants) | |
10 | 10 | } | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func generation (num) = if (if ((num > 0)) | |
14 | 14 | then true | |
15 | 15 | else (300 >= num)) | |
16 | 16 | then "G1" | |
17 | 17 | else if (if ((num > 300)) | |
18 | 18 | then true | |
19 | 19 | else (1000 >= num)) | |
20 | 20 | then "G2" | |
21 | 21 | else "G3" | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func issueGeneCode () = { | |
25 | 25 | let timestamp = lastBlock.timestamp | |
26 | 26 | let timestampStr = toString(timestamp) | |
27 | 27 | let timestamp2 = takeRight(timestampStr, 2) | |
28 | 28 | let percent = parseIntValue(timestamp2) | |
29 | 29 | if ((percent == 0)) | |
30 | 30 | then "II-II-II-II" | |
31 | 31 | else if (if ((percent > 0)) | |
32 | 32 | then (3 >= percent) | |
33 | 33 | else false) | |
34 | 34 | then "BB-BB-BB-BB" | |
35 | 35 | else if (if ((percent > 3)) | |
36 | 36 | then (8 >= percent) | |
37 | 37 | else false) | |
38 | 38 | then "CC-CC-CC-CC" | |
39 | 39 | else if (if ((percent > 8)) | |
40 | 40 | then (15 >= percent) | |
41 | 41 | else false) | |
42 | 42 | then "DD-DD-DD-DD" | |
43 | 43 | else if (if ((percent > 15)) | |
44 | 44 | then (24 >= percent) | |
45 | 45 | else false) | |
46 | 46 | then "EE-EE-EE-EE" | |
47 | 47 | else if (if ((percent > 24)) | |
48 | 48 | then (35 >= percent) | |
49 | 49 | else false) | |
50 | 50 | then "FF-FF-FF-FF" | |
51 | 51 | else if (if ((percent > 35)) | |
52 | 52 | then (48 >= percent) | |
53 | 53 | else false) | |
54 | 54 | then "GG-GG-GG-GG" | |
55 | 55 | else if (if ((percent > 48)) | |
56 | 56 | then (51 >= percent) | |
57 | 57 | else false) | |
58 | 58 | then "AA-AA-AA-AA" | |
59 | 59 | else "HH-HH-HH-HH" | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func testIssueGeneCode (num) = { | |
64 | 64 | let timestamp = lastBlock.timestamp | |
65 | 65 | let timestampStr = toString(timestamp) | |
66 | 66 | let timestamp2 = takeRight(timestampStr, 2) | |
67 | 67 | let percent = parseIntValue(timestamp2) | |
68 | 68 | if ((percent == 0)) | |
69 | 69 | then "II-II-II-II" | |
70 | 70 | else if (if ((percent > 0)) | |
71 | 71 | then (3 >= percent) | |
72 | 72 | else false) | |
73 | 73 | then "BB-BB-BB-BB" | |
74 | 74 | else if (if ((percent > 3)) | |
75 | 75 | then (8 >= percent) | |
76 | 76 | else false) | |
77 | 77 | then "CC-CC-CC-CC" | |
78 | 78 | else if (if ((percent > 8)) | |
79 | 79 | then (15 >= percent) | |
80 | 80 | else false) | |
81 | 81 | then "DD-DD-DD-DD" | |
82 | 82 | else if (if ((percent > 15)) | |
83 | 83 | then (24 >= percent) | |
84 | 84 | else false) | |
85 | 85 | then "EE-EE-EE-EE" | |
86 | 86 | else if (if ((percent > 24)) | |
87 | 87 | then (35 >= percent) | |
88 | 88 | else false) | |
89 | 89 | then "FF-FF-FF-FF" | |
90 | 90 | else if (if ((percent > 35)) | |
91 | 91 | then (48 >= percent) | |
92 | 92 | else false) | |
93 | 93 | then "GG-GG-GG-GG" | |
94 | 94 | else if (if ((percent > 48)) | |
95 | 95 | then (51 >= percent) | |
96 | 96 | else false) | |
97 | 97 | then "AA-AA-AA-AA" | |
98 | 98 | else "HH-HH-HH-HH" | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(i) | |
103 | 103 | func testKitten (num) = { | |
104 | 104 | let pmt = i.payments[0] | |
105 | 105 | let pmtId = toBase58String(value(pmt.assetId)) | |
106 | 106 | if ((pmtId != kittenId)) | |
107 | 107 | then throw("Please send Kitten token.") | |
108 | 108 | else { | |
109 | 109 | let kittenAmount = pmt.amount | |
110 | 110 | if ((kittenAmount > 300)) | |
111 | 111 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
112 | 112 | else if ((300 > kittenAmount)) | |
113 | 113 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
114 | 114 | else { | |
115 | 115 | let issueQuantity = match getInteger(this, "issueQuantity") { | |
116 | 116 | case a: Int => | |
117 | 117 | a | |
118 | 118 | case _ => | |
119 | 119 | 0 | |
120 | 120 | } | |
121 | 121 | let newQuantity = (issueQuantity + 1) | |
122 | 122 | let generationType = generation(newQuantity) | |
123 | 123 | let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false) | |
124 | 124 | let issueNftId = calculateAssetId(issueNft) | |
125 | 125 | let blockHeight = lastBlock.height | |
126 | - | let typeRandom = getRandomNumber( | |
126 | + | let typeRandom = getRandomNumber(100, issueNftId, blockHeight, 0) | |
127 | 127 | if ((num == 0)) | |
128 | 128 | then throw(((("blockHeight:" + toString(blockHeight)) + "/typeRandom:") + toString(typeRandom))) | |
129 | 129 | else { | |
130 | 130 | let geneCode = testIssueGeneCode(typeRandom) | |
131 | 131 | [issueNft, ScriptTransfer(i.caller, 1, issueNftId), StringEntry(toBase58String(value(issueNftId)), geneCode), IntegerEntry("issueQuantity", newQuantity)] | |
132 | 132 | } | |
133 | 133 | } | |
134 | 134 | } | |
135 | 135 | } | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | ||
139 | 139 | @Callable(i) | |
140 | 140 | func giveBirthKitten () = { | |
141 | 141 | let pmt = i.payments[0] | |
142 | 142 | let pmtId = toBase58String(value(pmt.assetId)) | |
143 | 143 | if ((pmtId != kittenId)) | |
144 | 144 | then throw("Please send Kitten token.") | |
145 | 145 | else { | |
146 | 146 | let kittenAmount = pmt.amount | |
147 | 147 | let issueQuantity = match getInteger(this, "issueQuantity") { | |
148 | 148 | case a: Int => | |
149 | 149 | a | |
150 | 150 | case _ => | |
151 | 151 | 0 | |
152 | 152 | } | |
153 | 153 | let newQuantity = (issueQuantity + 1) | |
154 | 154 | let generationType = generation(newQuantity) | |
155 | 155 | if ((kittenAmount > 300)) | |
156 | 156 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
157 | 157 | else if ((300 > kittenAmount)) | |
158 | 158 | then throw("Amount of Kitten tokens sent is 3 tokens.") | |
159 | 159 | else { | |
160 | 160 | let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false) | |
161 | 161 | let issueNftId = calculateAssetId(issueNft) | |
162 | 162 | let nftTransfer = ScriptTransfer(i.caller, 1, issueNftId) | |
163 | 163 | let geneCode = issueGeneCode() | |
164 | 164 | [issueNft, nftTransfer, StringEntry(toBase58String(value(issueNftId)), geneCode), IntegerEntry("issueQuantity", newQuantity)] | |
165 | 165 | } | |
166 | 166 | } | |
167 | 167 | } | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | @Verifier(tx) | |
171 | 171 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
172 | 172 |
github/deemru/w8io/026f985 25.98 ms ◑