tx · AdysQvGg9eoyZnb6cQffiMisNBgJVDczND1uaywn4Bvg

3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB:  -0.01400000 Waves

2021.05.26 13:00 [1542483] smart account 3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB > SELF 0.00000000 Waves

{ "type": 13, "id": "AdysQvGg9eoyZnb6cQffiMisNBgJVDczND1uaywn4Bvg", "fee": 1400000, "feeAssetId": null, "timestamp": 1622023227141, "version": 2, "chainId": 84, "sender": "3Mr97MBt1TwRZHBK8R1EFDz8S8mxui5U4zB", "senderPublicKey": "CQ7vntBAYh2QZcKcqiiyEnQWWXsr98ysDptD23Wgxmvb", "proofs": [ "6BEkPD6xDb14JwGzkkwwv7pYJahNgMz3KMYXxXyH9z1qpdQahLmSMACJE5AEAnYybjKrdPtrZB41TmezkVPEJZv" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAAAgAAAAAIa2l0dGVuSWQCAAAALDhMTHBqNnlRTFV1MzdLVXQzclZvMVM2OWoyZ1dNYmdiTTZxcWd0MmFjMVZiAQAAAApnZW5lcmF0aW9uAAAAAQAAAANudW0DAwkAAGYAAAACBQAAAANudW0AAAAAAAAAAAAGCQAAZwAAAAIAAAAAAAAAAGQFAAAAA251bQIAAAACRzEDAwkAAGYAAAACBQAAAANudW0AAAAAAAAAAGQGCQAAZwAAAAIAAAAAAAAAA4QFAAAAA251bQIAAAACRzICAAAAAkczAAAAAQAAAAFpAQAAAA9naXZlQmlydGhLaXR0ZW4AAAAABAAAAANwbXQJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAABXBtdElkCQACWAAAAAEJAQAAAAV2YWx1ZQAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAMJAQAAAAIhPQAAAAIFAAAABXBtdElkBQAAAAhraXR0ZW5JZAkAAAIAAAABAgAAABlQbGVhc2Ugc2VuZCBLaXR0ZW4gdG9rZW4uBAAAAAxraXR0ZW5BbW91b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", "height": 1542483, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D4Q7dT7KW8UKaJPskYFrH6FRRjmJ7ANkRv3GuP9DLaXJ Next: DthZSH1gMzDMG9Yxhj6MTyBbre7KqTpniNoYcQSVeW5P Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let kittenId = "8LLpj6yQLUu37KUt3rVo1S69j2gWMbgbM6qqgt2ac1Vb"
5+
46 func generation (num) = if (if ((num > 0))
57 then true
68 else (100 >= num))
1517 @Callable(i)
1618 func giveBirthKitten () = {
1719 let pmt = i.payments[0]
18- let kittenAmount = pmt.amount
19- let kittenId = toBase58String(value(pmt.assetId))
20- let issueQuantity = match getInteger(this, "issueQuantity") {
21- case a: Int =>
22- a
23- case _ =>
24- 0
25- }
26- let newQuantity = (issueQuantity + 1)
27- let generationType = generation(newQuantity)
28- if ((kittenAmount > 3))
29- then throw("Amount of Kitten tokens sent is 3 tokens.")
30- else if ((3 > kittenAmount))
31- then throw("Amount of Kitten tokens sent is 3 tokens.")
32- else {
33- let kittenNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
34- let kittenNftId = calculateAssetId(kittenNft)
20+ let pmtId = toBase58String(value(pmt.assetId))
21+ if ((pmtId != kittenId))
22+ then throw("Please send Kitten token.")
23+ else {
24+ let kittenAmount = pmt.amount
25+ let issueQuantity = match getInteger(this, "issueQuantity") {
26+ case a: Int =>
27+ a
28+ case _ =>
29+ 0
30+ }
31+ let newQuantity = (issueQuantity + 1)
32+ let generationType = generation(newQuantity)
33+ if ((kittenAmount > 3))
34+ then throw("Amount of Kitten tokens sent is 3 tokens.")
35+ else if ((3 > kittenAmount))
36+ then throw("Amount of Kitten tokens sent is 3 tokens.")
37+ else {
38+ let kittenNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
39+ let kittenNftId = calculateAssetId(kittenNft)
3540 [kittenNft, ScriptTransfer(i.caller, 1, kittenNftId)]
36- }
41+ }
42+ }
3743 }
3844
3945
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let kittenId = "8LLpj6yQLUu37KUt3rVo1S69j2gWMbgbM6qqgt2ac1Vb"
5+
46 func generation (num) = if (if ((num > 0))
57 then true
68 else (100 >= num))
79 then "G1"
810 else if (if ((num > 100))
911 then true
1012 else (900 >= num))
1113 then "G2"
1214 else "G3"
1315
1416
1517 @Callable(i)
1618 func giveBirthKitten () = {
1719 let pmt = i.payments[0]
18- let kittenAmount = pmt.amount
19- let kittenId = toBase58String(value(pmt.assetId))
20- let issueQuantity = match getInteger(this, "issueQuantity") {
21- case a: Int =>
22- a
23- case _ =>
24- 0
25- }
26- let newQuantity = (issueQuantity + 1)
27- let generationType = generation(newQuantity)
28- if ((kittenAmount > 3))
29- then throw("Amount of Kitten tokens sent is 3 tokens.")
30- else if ((3 > kittenAmount))
31- then throw("Amount of Kitten tokens sent is 3 tokens.")
32- else {
33- let kittenNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
34- let kittenNftId = calculateAssetId(kittenNft)
20+ let pmtId = toBase58String(value(pmt.assetId))
21+ if ((pmtId != kittenId))
22+ then throw("Please send Kitten token.")
23+ else {
24+ let kittenAmount = pmt.amount
25+ let issueQuantity = match getInteger(this, "issueQuantity") {
26+ case a: Int =>
27+ a
28+ case _ =>
29+ 0
30+ }
31+ let newQuantity = (issueQuantity + 1)
32+ let generationType = generation(newQuantity)
33+ if ((kittenAmount > 3))
34+ then throw("Amount of Kitten tokens sent is 3 tokens.")
35+ else if ((3 > kittenAmount))
36+ then throw("Amount of Kitten tokens sent is 3 tokens.")
37+ else {
38+ let kittenNft = Issue("Kitten(=^・^=)", ("generation:" + generationType), 1, 0, false)
39+ let kittenNftId = calculateAssetId(kittenNft)
3540 [kittenNft, ScriptTransfer(i.caller, 1, kittenNftId)]
36- }
41+ }
42+ }
3743 }
3844
3945
4046 @Verifier(tx)
4147 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
4248

github/deemru/w8io/026f985 
45.75 ms