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+0AAAABCQAAZQAAAAIFAAAAFGhhdGNoaW5nRmluaXNoSGVpZ2h0AAAAAAAAAAABBAAAAApyYW5kb21IYXNoCQAB9wAAAAEJAADLAAAAAgUAAAAEdHhJZAkBAAAABXZhbHVlAAAAAQgFAAAAD3JhbmRvbVNlZWRCbG9jawAAAAN2cmYJAABqAAAAAgkABLIAAAACBQAAAApyYW5kb21IYXNoCQAAaAAAAAIFAAAABm9mZnNldAAAAAAAAAAACAUAAAAIdmFyaWFudHMBAAAACmdlbmVyYXRpb24AAAABAAAAA251bQMDCQAAZgAAAAIFAAAAA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lzc3VlTmZ0CQAETAAAAAIFAAAAC25mdFRyYW5zZmVyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQUAAAAKaXNzdWVOZnRJZAUAAAAIZ2VuZUNvZGUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADWlzc3VlUXVhbnRpdHkFAAAAC25ld1F1YW50aXR5BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQ4lJMI=", "height": 1550596, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ABaqmFA2AAKDZZqyrEXPrCCjxNRnsriyvGxnVYYRspr Next: H9wVYAkyxVazSsacyfk1L7MpNAyDkmUDUttX2kDAwuua Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kittenId = "GuobcHvW9WqotnkGUj7JkpcbXtgVfB37TA4JkgSj9Qbb"
5+
6+func getRandomNumber (variants,txId,hatchingFinishHeight,offset) = {
7+ let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1)))
8+ let randomHash = sha256((txId + value(randomSeedBlock.vrf)))
9+ (toInt(randomHash, (offset * 8)) % variants)
10+ }
11+
512
613 func generation (num) = if (if ((num > 0))
714 then true
5360 }
5461
5562
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)
72+ else false)
73+ then "BB-BB-BB-BB"
74+ else if (if ((percent > 3))
75+ then (8 >= percent)
76+ else false)
77+ then "CC-CC-CC-CC"
78+ else if (if ((percent > 8))
79+ then (15 >= percent)
80+ else false)
81+ then "DD-DD-DD-DD"
82+ else if (if ((percent > 15))
83+ then (24 >= percent)
84+ else false)
85+ then "EE-EE-EE-EE"
86+ else if (if ((percent > 24))
87+ then (35 >= percent)
88+ else false)
89+ then "FF-FF-FF-FF"
90+ else if (if ((percent > 35))
91+ then (48 >= percent)
92+ 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+ }
100+
101+
102+@Callable(i)
103+func testKitten (num) = {
104+ let pmt = i.payments[0]
105+ let pmtId = toBase58String(value(pmt.assetId))
106+ if ((pmtId != kittenId))
107+ then throw("Please send Kitten token.")
108+ else {
109+ let kittenAmount = pmt.amount
110+ if ((kittenAmount > 300))
111+ then throw("Amount of Kitten tokens sent is 3 tokens.")
112+ else if ((300 > kittenAmount))
113+ then throw("Amount of Kitten tokens sent is 3 tokens.")
114+ else {
115+ let issueQuantity = match getInteger(this, "issueQuantity") {
116+ case a: Int =>
117+ a
118+ case _ =>
119+ 0
120+ }
121+ let newQuantity = (issueQuantity + 1)
122+ let generationType = generation(newQuantity)
123+ let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
124+ let issueNftId = calculateAssetId(issueNft)
125+ let blockHeight = lastBlock.height
126+ let typeRandom = getRandomNumber(2, issueNftId, blockHeight, 0)
127+ 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+ }
133+ }
134+ }
135+ }
136+
137+
138+
56139 @Callable(i)
57140 func giveBirthKitten () = {
58141 let pmt = i.payments[0]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kittenId = "GuobcHvW9WqotnkGUj7JkpcbXtgVfB37TA4JkgSj9Qbb"
5+
6+func getRandomNumber (variants,txId,hatchingFinishHeight,offset) = {
7+ let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1)))
8+ let randomHash = sha256((txId + value(randomSeedBlock.vrf)))
9+ (toInt(randomHash, (offset * 8)) % variants)
10+ }
11+
512
613 func generation (num) = if (if ((num > 0))
714 then true
815 else (300 >= num))
916 then "G1"
1017 else if (if ((num > 300))
1118 then true
1219 else (1000 >= num))
1320 then "G2"
1421 else "G3"
1522
1623
1724 func issueGeneCode () = {
1825 let timestamp = lastBlock.timestamp
1926 let timestampStr = toString(timestamp)
2027 let timestamp2 = takeRight(timestampStr, 2)
2128 let percent = parseIntValue(timestamp2)
2229 if ((percent == 0))
2330 then "II-II-II-II"
2431 else if (if ((percent > 0))
2532 then (3 >= percent)
2633 else false)
2734 then "BB-BB-BB-BB"
2835 else if (if ((percent > 3))
2936 then (8 >= percent)
3037 else false)
3138 then "CC-CC-CC-CC"
3239 else if (if ((percent > 8))
3340 then (15 >= percent)
3441 else false)
3542 then "DD-DD-DD-DD"
3643 else if (if ((percent > 15))
3744 then (24 >= percent)
3845 else false)
3946 then "EE-EE-EE-EE"
4047 else if (if ((percent > 24))
4148 then (35 >= percent)
4249 else false)
4350 then "FF-FF-FF-FF"
4451 else if (if ((percent > 35))
4552 then (48 >= percent)
4653 else false)
4754 then "GG-GG-GG-GG"
4855 else if (if ((percent > 48))
4956 then (51 >= percent)
5057 else false)
5158 then "AA-AA-AA-AA"
5259 else "HH-HH-HH-HH"
5360 }
5461
5562
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)
72+ else false)
73+ then "BB-BB-BB-BB"
74+ else if (if ((percent > 3))
75+ then (8 >= percent)
76+ else false)
77+ then "CC-CC-CC-CC"
78+ else if (if ((percent > 8))
79+ then (15 >= percent)
80+ else false)
81+ then "DD-DD-DD-DD"
82+ else if (if ((percent > 15))
83+ then (24 >= percent)
84+ else false)
85+ then "EE-EE-EE-EE"
86+ else if (if ((percent > 24))
87+ then (35 >= percent)
88+ else false)
89+ then "FF-FF-FF-FF"
90+ else if (if ((percent > 35))
91+ then (48 >= percent)
92+ 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+ }
100+
101+
102+@Callable(i)
103+func testKitten (num) = {
104+ let pmt = i.payments[0]
105+ let pmtId = toBase58String(value(pmt.assetId))
106+ if ((pmtId != kittenId))
107+ then throw("Please send Kitten token.")
108+ else {
109+ let kittenAmount = pmt.amount
110+ if ((kittenAmount > 300))
111+ then throw("Amount of Kitten tokens sent is 3 tokens.")
112+ else if ((300 > kittenAmount))
113+ then throw("Amount of Kitten tokens sent is 3 tokens.")
114+ else {
115+ let issueQuantity = match getInteger(this, "issueQuantity") {
116+ case a: Int =>
117+ a
118+ case _ =>
119+ 0
120+ }
121+ let newQuantity = (issueQuantity + 1)
122+ let generationType = generation(newQuantity)
123+ let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
124+ let issueNftId = calculateAssetId(issueNft)
125+ let blockHeight = lastBlock.height
126+ let typeRandom = getRandomNumber(2, issueNftId, blockHeight, 0)
127+ 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+ }
133+ }
134+ }
135+ }
136+
137+
138+
56139 @Callable(i)
57140 func giveBirthKitten () = {
58141 let pmt = i.payments[0]
59142 let pmtId = toBase58String(value(pmt.assetId))
60143 if ((pmtId != kittenId))
61144 then throw("Please send Kitten token.")
62145 else {
63146 let kittenAmount = pmt.amount
64147 let issueQuantity = match getInteger(this, "issueQuantity") {
65148 case a: Int =>
66149 a
67150 case _ =>
68151 0
69152 }
70153 let newQuantity = (issueQuantity + 1)
71154 let generationType = generation(newQuantity)
72155 if ((kittenAmount > 300))
73156 then throw("Amount of Kitten tokens sent is 3 tokens.")
74157 else if ((300 > kittenAmount))
75158 then throw("Amount of Kitten tokens sent is 3 tokens.")
76159 else {
77160 let issueNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
78161 let issueNftId = calculateAssetId(issueNft)
79162 let nftTransfer = ScriptTransfer(i.caller, 1, issueNftId)
80163 let geneCode = issueGeneCode()
81164 [issueNft, nftTransfer, StringEntry(toBase58String(value(issueNftId)), geneCode), IntegerEntry("issueQuantity", newQuantity)]
82165 }
83166 }
84167 }
85168
86169
87170 @Verifier(tx)
88171 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
89172

github/deemru/w8io/026f985 
249.88 ms