tx · 31Li9KkucfFGWok6WYQ8cSQz8dtqEgFVrF9YqpivZn61

3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB:  -0.01400000 Waves

2021.06.01 04:12 [1550615] smart account 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB > SELF 0.00000000 Waves

{ "type": 13, "id": "31Li9KkucfFGWok6WYQ8cSQz8dtqEgFVrF9YqpivZn61", "fee": 1400000, "feeAssetId": null, "timestamp": 1622509956339, "version": 2, "chainId": 84, "sender": "3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB", "senderPublicKey": "CQ7vntBAYh2QZcKcqiiyEnQWWXsr98ysDptD23Wgxmvb", "proofs": [ "2Tyfb7Xtp2W36VpzKBjyp4vYuU4prB3w15vbHXnvvod4W84UWDddfuPdWuoUbigGvsokCz3TWgbkhhNiWN97zhs8" ], "script": "base64:AAIEAAAAAAAAAAkIAhIDCgEBEgAAAAAFAAAAAAhraXR0ZW5JZAIAAAAsR3VvYmNIdlc5V3FvdG5rR1VqN0prcGNiWHRnVmZCMzdUQTRKa2dTajlRYmIBAAAAD2dldFJhbmRvbU51bWJlcgAAAAQAAAAIdmFyaWFudHMAAAAEdHhJZAAAABRoYXRjaGluZ0ZpbmlzaEhlaWdodAAAAAZvZmZzZXQEAAAAD3JhbmRvbVNlZWRCbG9jawkBAAAABXZhbHVlAAAAAQkAA+0AAAABCQAAZQAAAAIFAAAAFGhhdGNoaW5nRmluaXNoSGVpZ2h0AAAAAAAAAAABBAAAAApyYW5kb21IYXNoCQAB9wAAAAEJAADLAAAAAgUAAAAEdHhJZAkBAAAABXZhbHVlAAAAAQgFAAAAD3JhbmRvbVNlZWRCbG9jawAAAAN2cmYJAABqAAAAAgkABLIAAAACBQAAAApyYW5kb21IYXNoCQAAaAAAAAIFAAAABm9mZnNldAAAAAAAAAAACAUAAAAIdmFyaWFudHMBAAAACmdlbmVyYXRpb24AAAABAAAAA251bQMDCQAAZgAAAAIFAAAAA251bQAAAAA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MIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleao0YMM=", "height": 1550615, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H9wVYAkyxVazSsacyfk1L7MpNAyDkmUDUttX2kDAwuua Next: 5KVpEg1NmCPxeYhejDGVYdv5FZt5Gi97DNKkLE1GaLU5 Diff:
OldNewDifferences
6060 }
6161
6262
63-func testIssueGeneCode (num) = {
64- let timestamp = lastBlock.timestamp
65- let timestampStr = toString(timestamp)
66- let timestamp2 = takeRight(timestampStr, 2)
67- let percent = parseIntValue(timestamp2)
68- if ((percent == 0))
69- then "II-II-II-II"
70- else if (if ((percent > 0))
71- then (3 >= percent)
63+func testIssueGeneCode (num) = if ((num == 100))
64+ then "II-II-II-II"
65+ else if (if ((num >= 1))
66+ then (3 >= num)
67+ else false)
68+ then "BB-BB-BB-BB"
69+ else if (if ((num > 3))
70+ then (8 >= num)
7271 else false)
73- then "BB-BB-BB-BB"
74- else if (if ((percent > 3))
75- then (8 >= percent)
72+ then "CC-CC-CC-CC"
73+ else if (if ((num > 8))
74+ then (15 >= num)
7675 else false)
77- then "CC-CC-CC-CC"
78- else if (if ((percent > 8))
79- then (15 >= percent)
76+ then "DD-DD-DD-DD"
77+ else if (if ((num > 15))
78+ then (24 >= num)
8079 else false)
81- then "DD-DD-DD-DD"
82- else if (if ((percent > 15))
83- then (24 >= percent)
80+ then "EE-EE-EE-EE"
81+ else if (if ((num > 24))
82+ then (35 >= num)
8483 else false)
85- then "EE-EE-EE-EE"
86- else if (if ((percent > 24))
87- then (35 >= percent)
84+ then "FF-FF-FF-FF"
85+ else if (if ((num > 35))
86+ then (48 >= num)
8887 else false)
89- then "FF-FF-FF-FF"
90- else if (if ((percent > 35))
91- then (48 >= percent)
88+ then "GG-GG-GG-GG"
89+ else if (if ((num > 48))
90+ then (51 >= num)
9291 else false)
93- then "GG-GG-GG-GG"
94- else if (if ((percent > 48))
95- then (51 >= percent)
96- else false)
97- then "AA-AA-AA-AA"
98- else "HH-HH-HH-HH"
99- }
92+ then "AA-AA-AA-AA"
93+ else "HH-HH-HH-HH"
10094
10195
10296 @Callable(i)
124118 let issueNftId = calculateAssetId(issueNft)
125119 let blockHeight = lastBlock.height
126120 let typeRandom = getRandomNumber(100, issueNftId, blockHeight, 0)
121+ let geneCode = testIssueGeneCode(typeRandom)
127122 if ((num == 0))
128- then throw(((("blockHeight:" + toString(blockHeight)) + "/typeRandom:") + toString(typeRandom)))
129- else {
130- let geneCode = testIssueGeneCode(typeRandom)
131-[issueNft, ScriptTransfer(i.caller, 1, issueNftId), StringEntry(toBase58String(value(issueNftId)), geneCode), IntegerEntry("issueQuantity", newQuantity)]
132- }
123+ then throw(((((("blockHeight:" + toString(blockHeight)) + "/typeRandom:") + toString(typeRandom)) + "/geneCode:") + geneCode))
124+ else [issueNft, ScriptTransfer(i.caller, 1, issueNftId), StringEntry(toBase58String(value(issueNftId)), geneCode), IntegerEntry("issueQuantity", newQuantity)]
133125 }
134126 }
135127 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kittenId = "GuobcHvW9WqotnkGUj7JkpcbXtgVfB37TA4JkgSj9Qbb"
55
66 func getRandomNumber (variants,txId,hatchingFinishHeight,offset) = {
77 let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1)))
88 let randomHash = sha256((txId + value(randomSeedBlock.vrf)))
99 (toInt(randomHash, (offset * 8)) % variants)
1010 }
1111
1212
1313 func generation (num) = if (if ((num > 0))
1414 then true
1515 else (300 >= num))
1616 then "G1"
1717 else if (if ((num > 300))
1818 then true
1919 else (1000 >= num))
2020 then "G2"
2121 else "G3"
2222
2323
2424 func issueGeneCode () = {
2525 let timestamp = lastBlock.timestamp
2626 let timestampStr = toString(timestamp)
2727 let timestamp2 = takeRight(timestampStr, 2)
2828 let percent = parseIntValue(timestamp2)
2929 if ((percent == 0))
3030 then "II-II-II-II"
3131 else if (if ((percent > 0))
3232 then (3 >= percent)
3333 else false)
3434 then "BB-BB-BB-BB"
3535 else if (if ((percent > 3))
3636 then (8 >= percent)
3737 else false)
3838 then "CC-CC-CC-CC"
3939 else if (if ((percent > 8))
4040 then (15 >= percent)
4141 else false)
4242 then "DD-DD-DD-DD"
4343 else if (if ((percent > 15))
4444 then (24 >= percent)
4545 else false)
4646 then "EE-EE-EE-EE"
4747 else if (if ((percent > 24))
4848 then (35 >= percent)
4949 else false)
5050 then "FF-FF-FF-FF"
5151 else if (if ((percent > 35))
5252 then (48 >= percent)
5353 else false)
5454 then "GG-GG-GG-GG"
5555 else if (if ((percent > 48))
5656 then (51 >= percent)
5757 else false)
5858 then "AA-AA-AA-AA"
5959 else "HH-HH-HH-HH"
6060 }
6161
6262
63-func testIssueGeneCode (num) = {
64- let timestamp = lastBlock.timestamp
65- let timestampStr = toString(timestamp)
66- let timestamp2 = takeRight(timestampStr, 2)
67- let percent = parseIntValue(timestamp2)
68- if ((percent == 0))
69- then "II-II-II-II"
70- else if (if ((percent > 0))
71- then (3 >= percent)
63+func testIssueGeneCode (num) = if ((num == 100))
64+ then "II-II-II-II"
65+ else if (if ((num >= 1))
66+ then (3 >= num)
67+ else false)
68+ then "BB-BB-BB-BB"
69+ else if (if ((num > 3))
70+ then (8 >= num)
7271 else false)
73- then "BB-BB-BB-BB"
74- else if (if ((percent > 3))
75- then (8 >= percent)
72+ then "CC-CC-CC-CC"
73+ else if (if ((num > 8))
74+ then (15 >= num)
7675 else false)
77- then "CC-CC-CC-CC"
78- else if (if ((percent > 8))
79- then (15 >= percent)
76+ then "DD-DD-DD-DD"
77+ else if (if ((num > 15))
78+ then (24 >= num)
8079 else false)
81- then "DD-DD-DD-DD"
82- else if (if ((percent > 15))
83- then (24 >= percent)
80+ then "EE-EE-EE-EE"
81+ else if (if ((num > 24))
82+ then (35 >= num)
8483 else false)
85- then "EE-EE-EE-EE"
86- else if (if ((percent > 24))
87- then (35 >= percent)
84+ then "FF-FF-FF-FF"
85+ else if (if ((num > 35))
86+ then (48 >= num)
8887 else false)
89- then "FF-FF-FF-FF"
90- else if (if ((percent > 35))
91- then (48 >= percent)
88+ then "GG-GG-GG-GG"
89+ else if (if ((num > 48))
90+ then (51 >= num)
9291 else false)
93- then "GG-GG-GG-GG"
94- else if (if ((percent > 48))
95- then (51 >= percent)
96- else false)
97- then "AA-AA-AA-AA"
98- else "HH-HH-HH-HH"
99- }
92+ then "AA-AA-AA-AA"
93+ else "HH-HH-HH-HH"
10094
10195
10296 @Callable(i)
10397 func testKitten (num) = {
10498 let pmt = i.payments[0]
10599 let pmtId = toBase58String(value(pmt.assetId))
106100 if ((pmtId != kittenId))
107101 then throw("Please send Kitten token.")
108102 else {
109103 let kittenAmount = pmt.amount
110104 if ((kittenAmount > 300))
111105 then throw("Amount of Kitten tokens sent is 3 tokens.")
112106 else if ((300 > kittenAmount))
113107 then throw("Amount of Kitten tokens sent is 3 tokens.")
114108 else {
115109 let issueQuantity = match getInteger(this, "issueQuantity") {
116110 case a: Int =>
117111 a
118112 case _ =>
119113 0
120114 }
121115 let newQuantity = (issueQuantity + 1)
122116 let generationType = generation(newQuantity)
123117 let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
124118 let issueNftId = calculateAssetId(issueNft)
125119 let blockHeight = lastBlock.height
126120 let typeRandom = getRandomNumber(100, issueNftId, blockHeight, 0)
121+ let geneCode = testIssueGeneCode(typeRandom)
127122 if ((num == 0))
128- then throw(((("blockHeight:" + toString(blockHeight)) + "/typeRandom:") + toString(typeRandom)))
129- else {
130- let geneCode = testIssueGeneCode(typeRandom)
131-[issueNft, ScriptTransfer(i.caller, 1, issueNftId), StringEntry(toBase58String(value(issueNftId)), geneCode), IntegerEntry("issueQuantity", newQuantity)]
132- }
123+ then throw(((((("blockHeight:" + toString(blockHeight)) + "/typeRandom:") + toString(typeRandom)) + "/geneCode:") + geneCode))
124+ else [issueNft, ScriptTransfer(i.caller, 1, issueNftId), StringEntry(toBase58String(value(issueNftId)), geneCode), IntegerEntry("issueQuantity", newQuantity)]
133125 }
134126 }
135127 }
136128
137129
138130
139131 @Callable(i)
140132 func giveBirthKitten () = {
141133 let pmt = i.payments[0]
142134 let pmtId = toBase58String(value(pmt.assetId))
143135 if ((pmtId != kittenId))
144136 then throw("Please send Kitten token.")
145137 else {
146138 let kittenAmount = pmt.amount
147139 let issueQuantity = match getInteger(this, "issueQuantity") {
148140 case a: Int =>
149141 a
150142 case _ =>
151143 0
152144 }
153145 let newQuantity = (issueQuantity + 1)
154146 let generationType = generation(newQuantity)
155147 if ((kittenAmount > 300))
156148 then throw("Amount of Kitten tokens sent is 3 tokens.")
157149 else if ((300 > kittenAmount))
158150 then throw("Amount of Kitten tokens sent is 3 tokens.")
159151 else {
160152 let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
161153 let issueNftId = calculateAssetId(issueNft)
162154 let nftTransfer = ScriptTransfer(i.caller, 1, issueNftId)
163155 let geneCode = issueGeneCode()
164156 [issueNft, nftTransfer, StringEntry(toBase58String(value(issueNftId)), geneCode), IntegerEntry("issueQuantity", newQuantity)]
165157 }
166158 }
167159 }
168160
169161
170162 @Verifier(tx)
171163 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
172164

github/deemru/w8io/026f985 
53.25 ms