tx · 4yKh41bfZY9LEjr5AyUphWkyfr6aBDLq9vStNrCcqp2g

3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2:  -0.00200000 Waves

2022.08.02 16:31 [2166927] smart account 3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2 > SELF 0.00000000 Waves

{ "type": 13, "id": "4yKh41bfZY9LEjr5AyUphWkyfr6aBDLq9vStNrCcqp2g", "fee": 200000, "feeAssetId": null, "timestamp": 1659447121888, "version": 2, "chainId": 84, "sender": "3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2", "senderPublicKey": "3rvQsNbK5fc274oTJXxit5LUfVpNUHyPrKiaJZbmJ7zx", "proofs": [ "jLAYBirSDainPanX6vJ2o7HR7SzJkPvX26BQjodALCsJQ5M5gFLVXqii2eW4BSZnEqM9YBiWrB7wR2CVY83XHXK" ], "script": "base64:BgIRCAISBgoECAgICBIDCgEIEgALAAdrQ29tbW9uAgZjb21tb24ABWtSYXJlAgRyYXJlAAprTGVnZW5kYXJ5AglsZWdlbmRhcnkABmtQcmljZQIKcHJpY2VMZXZlcgAJc2VwYXJhdG9yAgF8AAljb3VudFJhcmUJAGQCAAEJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUFa1JhcmUAAAALY291bnRDb21tb24JAGQCAAEJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUHa0NvbW1vbgAAAA5jb3VudExlZ2VuZGFyeQkAZAIAAQkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQprTGVnZW5kYXJ5AAABCXJhbmRvbWl6ZQIFYnl0ZXMFcmFuZ2UEBGhhc2gJAPcDAQUFYnl0ZXMEBWluZGV4CQCxCQEFBGhhc2gJAGoCBQVpbmRleAUFcmFuZ2UBCmV4dHJhQ291bnQBBHJhcmUDCQAAAgUEcmFyZQUHa0NvbW1vbgkBDEludGVnZXJFbnRyeQIFB2tDb21tb24FC2NvdW50Q29tbW9uAwkAAAIFBHJhcm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prev: 4NvqBe7vFzRNwqz3w9Fwsc17AhS8bfdDutudKtaYHh8m Next: A7bCLTsaGz19v4jx9BLGonAUPP5cuSo53tFQHEz4SVje Diff:
OldNewDifferences
1111
1212 let separator = "|"
1313
14-let kActive = "active"
15-
16-let active = getBooleanValue(this, kActive)
17-
1814 let countRare = (1 + valueOrElse(getInteger(this, kRare), 0))
1915
2016 let countCommon = (1 + valueOrElse(getInteger(this, kCommon), 0))
2117
2218 let countLegendary = (1 + valueOrElse(getInteger(this, kLegendary), 0))
23-
24-func isActive () = if (active)
25- then unit
26- else throw("Store is active")
27-
2819
2920 func randomize (bytes,range) = {
3021 let hash = sha256(bytes)
7263 func pullTheLever () = {
7364 let rarity = calculationRarity(i.transactionId)
7465 let structRare = extraCount(rarity)
75-[structRare, ScriptTransfer(i.caller, 1, fromBase58String(getStringValue(this, ((rarity + separator) + toString(getIntegerValue(this, rarity))))))]
66+[structRare, ScriptTransfer(i.caller, 1, fromBase58String(getStringValue(this, ((rarity + separator) + toString(valueOrElse(getIntegerValue(this, rarity), 0))))))]
7667 }
7768
7869
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let kCommon = "common"
55
66 let kRare = "rare"
77
88 let kLegendary = "legendary"
99
1010 let kPrice = "priceLever"
1111
1212 let separator = "|"
1313
14-let kActive = "active"
15-
16-let active = getBooleanValue(this, kActive)
17-
1814 let countRare = (1 + valueOrElse(getInteger(this, kRare), 0))
1915
2016 let countCommon = (1 + valueOrElse(getInteger(this, kCommon), 0))
2117
2218 let countLegendary = (1 + valueOrElse(getInteger(this, kLegendary), 0))
23-
24-func isActive () = if (active)
25- then unit
26- else throw("Store is active")
27-
2819
2920 func randomize (bytes,range) = {
3021 let hash = sha256(bytes)
3122 let index = toInt(hash)
3223 (index % range)
3324 }
3425
3526
3627 func extraCount (rare) = if ((rare == kCommon))
3728 then IntegerEntry(kCommon, countCommon)
3829 else if ((rare == kRare))
3930 then IntegerEntry(kRare, countCommon)
4031 else IntegerEntry(kLegendary, countLegendary)
4132
4233
4334 func calculationRarity (transactionId) = {
4435 let tokenRare = randomize(transactionId, 100)
4536 if ((5 >= tokenRare))
4637 then kLegendary
4738 else if ((tokenRare >= 80))
4839 then kRare
4940 else kCommon
5041 }
5142
5243
5344 @Callable(i)
5445 func issueNft (name,desc,rarity,prefix) = if ((i.caller != this))
5546 then throw("Only owner")
5647 else {
5748 let newToken = Issue(name, desc, 1, 0, false)
5849 let issueId = calculateAssetId(newToken)
5950 [newToken]
6051 }
6152
6253
6354
6455 @Callable(i)
6556 func setPrice (price) = if ((i.caller != this))
6657 then throw("Only owner")
6758 else [StringEntry(kPrice, price)]
6859
6960
7061
7162 @Callable(i)
7263 func pullTheLever () = {
7364 let rarity = calculationRarity(i.transactionId)
7465 let structRare = extraCount(rarity)
75-[structRare, ScriptTransfer(i.caller, 1, fromBase58String(getStringValue(this, ((rarity + separator) + toString(getIntegerValue(this, rarity))))))]
66+[structRare, ScriptTransfer(i.caller, 1, fromBase58String(getStringValue(this, ((rarity + separator) + toString(valueOrElse(getIntegerValue(this, rarity), 0))))))]
7667 }
7768
7869

github/deemru/w8io/026f985 
25.65 ms