tx · DUrkjHgNWa6UYaGhDEQP5wqLqirXqB85yVpv4EPG8GWt

3N8M5hmS83tTxWiFc738YLtnFHtQmmpquSJ:  -0.09000000 Waves

2022.02.09 15:13 [1916076] smart account 3N8M5hmS83tTxWiFc738YLtnFHtQmmpquSJ > SELF 0.00000000 Waves

{ "type": 13, "id": "DUrkjHgNWa6UYaGhDEQP5wqLqirXqB85yVpv4EPG8GWt", "fee": 9000000, "feeAssetId": null, "timestamp": 1644408847650, "version": 2, "chainId": 84, "sender": "3N8M5hmS83tTxWiFc738YLtnFHtQmmpquSJ", "senderPublicKey": "6G5qWw1mAguK2uYzgz1Xk6W1TmhQwrnVqDAhb8r6fGsM", "proofs": [ "zLfGUfaoDcDQzAbGErm5AQhGHsMpmK6pj6sZGhkUooeukVNQ38QjZArk9QVbRLNAEVGucbTf13j2UPt2KgENKsy" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQgAAAALAAAAAAt1c2RuQXNzZXRJZAEAAAAgENHLOpYG/Rtp7e9E9sMPM++iNSbiC23RRFi4KglwgZAAAAAACHByaWNlTkZUAAAAAAAF9eEAAAAAAAxTaGFya1N0YXJ0ZWQCAAAADVNIQVJLX1NUQVJURUQAAAAADVNoYXJrRmluaXNoZWQCAAAADlNIQVJLX0ZJTklTSEVEAQAAAAhpc1N0b3BlZAAAAAAEAAAADGFkbWluQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVPi9jq6+5IZPfWLZhf8Y2fIoCokcxov7MwQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAxhZG1pbkFkZHJlc3MCAAAACmdhbWVzdG9wZWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAEAAAANdHJ5R2V0SW50ZWdlcgAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACB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cwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5rO0Oqw==", "height": 1916076, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9XNtXsgm53RfTJttXamTEarCQ4gSVwvib2a81JXPJNW9 Next: E9kEvSbw1aA1hpcxXnXWMz1TXntqBTTAJ8vL7AVVQDoq Diff:
OldNewDifferences
9090 if ((getPayment.assetId != usdnAssetId))
9191 then throw(("You can attach only USD-N tokens with the following asset id: " + toBase58String(usdnAssetId)))
9292 else if ((priceNFT > getPayment.amount))
93- then throw((("To buy a NFT you currently need the following amount of: " + toString(priceNFT)) + "USD-N."))
93+ then throw("To buy a NFT you currently need the following amount of 100 USD-N.")
9494 else {
9595 let totalSharksAmount = tryGetInteger("sharks_amount")
9696 [StringEntry(getHeightStatusKey(toString(i.originCaller), i.transactionId), SharkStarted), IntegerEntry(getFinishHeightKey(toString(i.originCaller), i.transactionId), (height + 5)), IntegerEntry("sharks_amount", (totalSharksAmount + 1))]
107107 let HSKeyStatus = getStringValue(this, getHSKey)
108108 let FHKeyNumber = getIntegerValue(this, getFHKey)
109109 if ((HSKeyStatus == SharkFinished))
110- then {
111- let sharkId = getStringValue(this, getSharkIdKey(toString(i.caller), txId))
112- throw(("The Shark was claimed already, here is nftid: " + sharkId))
113- }
110+ then throw("The Shark was claimed already, here is nftid: ")
114111 else if ((FHKeyNumber > height))
115112 then throw((((("Your Shark is not ready, wait " + toString((FHKeyNumber - height))) + " blocks, it will take around ") + toString((FHKeyNumber - height))) + " minutes"))
116113 else {
117- let sharkId = getStringValue(this, getSharkIdKey(toString(i.caller), txId))
118114 let sharkGen = getRandomName(txId, FHKeyNumber)
119115 let description = (("{\"genotype\": \"" + sharkGen) + "\", \"crossbreeding\": true}")
120116 let asset = Issue(sharkGen, description, 1, 0, false, unit, FHKeyNumber)
121117 let assetId = calculateAssetId(asset)
122118 let sharkCount = (tryGetInteger("sharks_amount") + 1)
123-[StringEntry(getHSKey, SharkFinished), StringEntry(sharkId, toBase58String(assetId)), StringEntry(toBase58String(assetId), sharkId), IntegerEntry(sharkId, sharkCount), asset, ScriptTransfer(i.caller, 1, assetId)]
119+[StringEntry(getHSKey, SharkFinished), asset, ScriptTransfer(i.caller, 1, assetId)]
124120 }
125121 }
126122
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let usdnAssetId = base58'28f4pkm3PbgXaxkyNyZcUcA1XNKPfZaw95JfRxDvEV9y'
55
66 let priceNFT = 100000000
77
88 let SharkStarted = "SHARK_STARTED"
99
1010 let SharkFinished = "SHARK_FINISHED"
1111
1212 func isStoped () = {
1313 let adminAddress = Address(base58'3NCbJSAqFdLNGCfw8tQmaTuKPdesTtEc1oY')
1414 match getInteger(adminAddress, "gamestoped") {
1515 case b: Int =>
1616 b
1717 case _ =>
1818 0
1919 }
2020 }
2121
2222
2323 func tryGetInteger (key) = {
2424 let val = match getInteger(this, key) {
2525 case b: Int =>
2626 b
2727 case _ =>
2828 0
2929 }
3030 val
3131 }
3232
3333
3434 func getSharkIdKey (address,txId) = (((address + "_") + toBase58String(txId)) + "_idk")
3535
3636
3737 func getRandomNumber (variants,txId,hatchingFinishHeight,offset) = {
3838 let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1)))
3939 let randomHash = sha256((txId + value(randomSeedBlock.vrf)))
4040 (toInt(randomHash, (offset * 8)) % variants)
4141 }
4242
4343
4444 func getFinishHeightKey (address,txId) = (((address + "_") + toBase58String(txId)) + "_fhk")
4545
4646
4747 func getHeightStatusKey (address,txId) = (((address + "_") + toBase58String(txId)) + "_status")
4848
4949
5050 func getRandomName (txId,FinishHeight) = {
5151 let nameRandom = getRandomNumber(600, txId, FinishHeight, 0)
5252 let colorRandom = getRandomNumber(6, txId, FinishHeight, 0)
5353 let typeRandom = toString(getRandomNumber(6, txId, FinishHeight, 0))
5454 let color = if ((colorRandom == 0))
5555 then "Y"
5656 else if ((colorRandom == 1))
5757 then "R"
5858 else if ((colorRandom == 2))
5959 then "B"
6060 else if ((colorRandom == 3))
6161 then "G"
6262 else if ((colorRandom == 4))
6363 then "W"
6464 else "B"
6565 if ((99 > nameRandom))
6666 then ((("SHARK-BILLY-" + typeRandom) + "-") + color)
6767 else if (if ((nameRandom >= 100))
6868 then (nameRandom >= 199)
6969 else false)
7070 then ((("SHARK-JIMMY-" + typeRandom) + "-") + color)
7171 else if (if ((nameRandom >= 200))
7272 then (nameRandom >= 299)
7373 else false)
7474 then ((("SHARK-ABOBO-" + typeRandom) + "-") + color)
7575 else if (if ((nameRandom >= 300))
7676 then (nameRandom >= 399)
7777 else false)
7878 then ((("SHARK-WILLY-" + typeRandom) + "-") + color)
7979 else if (if ((nameRandom >= 400))
8080 then (nameRandom >= 499)
8181 else false)
8282 then ((("SHARK-EDDIE-" + typeRandom) + "-") + color)
8383 else ((("SHARK-DUKIE-" + typeRandom) + "-") + color)
8484 }
8585
8686
8787 @Callable(i)
8888 func buyNft () = {
8989 let getPayment = value(i.payments[0])
9090 if ((getPayment.assetId != usdnAssetId))
9191 then throw(("You can attach only USD-N tokens with the following asset id: " + toBase58String(usdnAssetId)))
9292 else if ((priceNFT > getPayment.amount))
93- then throw((("To buy a NFT you currently need the following amount of: " + toString(priceNFT)) + "USD-N."))
93+ then throw("To buy a NFT you currently need the following amount of 100 USD-N.")
9494 else {
9595 let totalSharksAmount = tryGetInteger("sharks_amount")
9696 [StringEntry(getHeightStatusKey(toString(i.originCaller), i.transactionId), SharkStarted), IntegerEntry(getFinishHeightKey(toString(i.originCaller), i.transactionId), (height + 5)), IntegerEntry("sharks_amount", (totalSharksAmount + 1))]
9797 }
9898 }
9999
100100
101101
102102 @Callable(i)
103103 func claimNft (txIdStr) = {
104104 let txId = fromBase58String(txIdStr)
105105 let getHSKey = getHeightStatusKey(toString(i.caller), txId)
106106 let getFHKey = getFinishHeightKey(toString(i.caller), txId)
107107 let HSKeyStatus = getStringValue(this, getHSKey)
108108 let FHKeyNumber = getIntegerValue(this, getFHKey)
109109 if ((HSKeyStatus == SharkFinished))
110- then {
111- let sharkId = getStringValue(this, getSharkIdKey(toString(i.caller), txId))
112- throw(("The Shark was claimed already, here is nftid: " + sharkId))
113- }
110+ then throw("The Shark was claimed already, here is nftid: ")
114111 else if ((FHKeyNumber > height))
115112 then throw((((("Your Shark is not ready, wait " + toString((FHKeyNumber - height))) + " blocks, it will take around ") + toString((FHKeyNumber - height))) + " minutes"))
116113 else {
117- let sharkId = getStringValue(this, getSharkIdKey(toString(i.caller), txId))
118114 let sharkGen = getRandomName(txId, FHKeyNumber)
119115 let description = (("{\"genotype\": \"" + sharkGen) + "\", \"crossbreeding\": true}")
120116 let asset = Issue(sharkGen, description, 1, 0, false, unit, FHKeyNumber)
121117 let assetId = calculateAssetId(asset)
122118 let sharkCount = (tryGetInteger("sharks_amount") + 1)
123-[StringEntry(getHSKey, SharkFinished), StringEntry(sharkId, toBase58String(assetId)), StringEntry(toBase58String(assetId), sharkId), IntegerEntry(sharkId, sharkCount), asset, ScriptTransfer(i.caller, 1, assetId)]
119+[StringEntry(getHSKey, SharkFinished), asset, ScriptTransfer(i.caller, 1, assetId)]
124120 }
125121 }
126122
127123
128124 @Verifier(tx)
129125 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
130126

github/deemru/w8io/169f3d6 
40.77 ms