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+0AAAABCQAAZQAAAAIFAAAAFGhhdGNoaW5nRmluaXNoSGVpZ2h0AAAAAAAAAAABBAAAAApyYW5kb21IYXNoCQAB9wAAAAEJAADLAAAAAgUAAAAEdHhJZAkBAAAABXZhbHVlAAAAAQgFAAAAD3JhbmRvbVNlZWRCbG9jawAAAAN2cmYJAABqAAAAAgkABLIAAAACBQAAAApyYW5kb21IYXNoCQAAaAAAAAIFAAAABm9mZnNldAAAAAAAAAAACAUAAAAIdmFyaWFudHMBAAAACmdlbmVyYXRpb24AAAABAAAAA251bQMDCQAAZgAAAAIFAAAAA251bQAA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lTmZ0CQAETAAAAAIFAAAAC25mdFRyYW5zZmVyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQUAAAAKaXNzdWVOZnRJZAUAAAAIZ2VuZUNvZGUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADWlzc3VlUXVhbnRpdHkFAAAAC25ld1F1YW50aXR5BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleRu+Up8=", "height": 1550609, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 45ZZNqrw9UT9PdNW6d36kFL8WQmotksgYCw4TSW8LfHo Next: 31Li9KkucfFGWok6WYQ8cSQz8dtqEgFVrF9YqpivZn61 Diff:
OldNewDifferences
123123 let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
124124 let issueNftId = calculateAssetId(issueNft)
125125 let blockHeight = lastBlock.height
126- let typeRandom = getRandomNumber(2, issueNftId, blockHeight, 0)
126+ let typeRandom = getRandomNumber(100, issueNftId, blockHeight, 0)
127127 if ((num == 0))
128128 then throw(((("blockHeight:" + toString(blockHeight)) + "/typeRandom:") + toString(typeRandom)))
129129 else {
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
6363 func testIssueGeneCode (num) = {
6464 let timestamp = lastBlock.timestamp
6565 let timestampStr = toString(timestamp)
6666 let timestamp2 = takeRight(timestampStr, 2)
6767 let percent = parseIntValue(timestamp2)
6868 if ((percent == 0))
6969 then "II-II-II-II"
7070 else if (if ((percent > 0))
7171 then (3 >= percent)
7272 else false)
7373 then "BB-BB-BB-BB"
7474 else if (if ((percent > 3))
7575 then (8 >= percent)
7676 else false)
7777 then "CC-CC-CC-CC"
7878 else if (if ((percent > 8))
7979 then (15 >= percent)
8080 else false)
8181 then "DD-DD-DD-DD"
8282 else if (if ((percent > 15))
8383 then (24 >= percent)
8484 else false)
8585 then "EE-EE-EE-EE"
8686 else if (if ((percent > 24))
8787 then (35 >= percent)
8888 else false)
8989 then "FF-FF-FF-FF"
9090 else if (if ((percent > 35))
9191 then (48 >= percent)
9292 else false)
9393 then "GG-GG-GG-GG"
9494 else if (if ((percent > 48))
9595 then (51 >= percent)
9696 else false)
9797 then "AA-AA-AA-AA"
9898 else "HH-HH-HH-HH"
9999 }
100100
101101
102102 @Callable(i)
103103 func testKitten (num) = {
104104 let pmt = i.payments[0]
105105 let pmtId = toBase58String(value(pmt.assetId))
106106 if ((pmtId != kittenId))
107107 then throw("Please send Kitten token.")
108108 else {
109109 let kittenAmount = pmt.amount
110110 if ((kittenAmount > 300))
111111 then throw("Amount of Kitten tokens sent is 3 tokens.")
112112 else if ((300 > kittenAmount))
113113 then throw("Amount of Kitten tokens sent is 3 tokens.")
114114 else {
115115 let issueQuantity = match getInteger(this, "issueQuantity") {
116116 case a: Int =>
117117 a
118118 case _ =>
119119 0
120120 }
121121 let newQuantity = (issueQuantity + 1)
122122 let generationType = generation(newQuantity)
123123 let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
124124 let issueNftId = calculateAssetId(issueNft)
125125 let blockHeight = lastBlock.height
126- let typeRandom = getRandomNumber(2, issueNftId, blockHeight, 0)
126+ let typeRandom = getRandomNumber(100, issueNftId, blockHeight, 0)
127127 if ((num == 0))
128128 then throw(((("blockHeight:" + toString(blockHeight)) + "/typeRandom:") + toString(typeRandom)))
129129 else {
130130 let geneCode = testIssueGeneCode(typeRandom)
131131 [issueNft, ScriptTransfer(i.caller, 1, issueNftId), StringEntry(toBase58String(value(issueNftId)), geneCode), IntegerEntry("issueQuantity", newQuantity)]
132132 }
133133 }
134134 }
135135 }
136136
137137
138138
139139 @Callable(i)
140140 func giveBirthKitten () = {
141141 let pmt = i.payments[0]
142142 let pmtId = toBase58String(value(pmt.assetId))
143143 if ((pmtId != kittenId))
144144 then throw("Please send Kitten token.")
145145 else {
146146 let kittenAmount = pmt.amount
147147 let issueQuantity = match getInteger(this, "issueQuantity") {
148148 case a: Int =>
149149 a
150150 case _ =>
151151 0
152152 }
153153 let newQuantity = (issueQuantity + 1)
154154 let generationType = generation(newQuantity)
155155 if ((kittenAmount > 300))
156156 then throw("Amount of Kitten tokens sent is 3 tokens.")
157157 else if ((300 > kittenAmount))
158158 then throw("Amount of Kitten tokens sent is 3 tokens.")
159159 else {
160160 let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
161161 let issueNftId = calculateAssetId(issueNft)
162162 let nftTransfer = ScriptTransfer(i.caller, 1, issueNftId)
163163 let geneCode = issueGeneCode()
164164 [issueNft, nftTransfer, StringEntry(toBase58String(value(issueNftId)), geneCode), IntegerEntry("issueQuantity", newQuantity)]
165165 }
166166 }
167167 }
168168
169169
170170 @Verifier(tx)
171171 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
172172

github/deemru/w8io/026f985 
25.98 ms