tx · 4NvqBe7vFzRNwqz3w9Fwsc17AhS8bfdDutudKtaYHh8m

3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2:  -0.00200000 Waves

2022.08.02 16:24 [2166922] smart account 3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2 > SELF 0.00000000 Waves

{ "type": 13, "id": "4NvqBe7vFzRNwqz3w9Fwsc17AhS8bfdDutudKtaYHh8m", "fee": 200000, "feeAssetId": null, "timestamp": 1659446702049, "version": 2, "chainId": 84, "sender": "3NCz3oCc3PNdauKDJEiPLzQwpBXXYEBc9p2", "senderPublicKey": "3rvQsNbK5fc274oTJXxit5LUfVpNUHyPrKiaJZbmJ7zx", "proofs": [ "5XwonyYMKJPMqTK4uWiRrh3dBgKehDXuV57ngBewFWUQFoJq84vKCoLoh42FtwYUkSjzuPcSVKBt8bUFds2g6SUK" ], "script": "base64:BgIRCAISBgoECAgICBIDCgEIEgAOAAdrQ29tbW9uAgZjb21tb24ABWtSYXJlAgRyYXJlAAprTGVnZW5kYXJ5AglsZWdlbmRhcnkABmtQcmljZQIKcHJpY2VMZXZlcgAJc2VwYXJhdG9yAgF8AAdrQWN0aXZlAgZhY3RpdmUABmFjdGl2ZQkBEUBleHRyTmF0aXZlKDEwNTEpAgUEdGhpcwUHa0FjdGl2ZQAJY291bnRSYXJlCQBkAgABCQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFBWtSYXJlAAAAC2NvdW50Q29tbW9uCQBkAgABCQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFB2tDb21tb24AAAAOY291bnRMZWdlbmRhcnkJAGQCAAEJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUKa0xlZ2VuZGFyeQAAAQhpc0FjdGl2ZQADBQZhY3RpdmUFBHVuaXQJAAIBAg9TdG9yZSBpcyBhY3RpdmUBCXJhbmRvbWl6ZQIFYnl0ZXMFcmFuZ2UEBGhhc2gJAPcDAQUFYnl0ZXMEBWluZGV4CQCx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2VwYXJhdG9yCQCkAwEJARFAZXh0ck5hdGl2ZSgxMDUwKQIFBHRoaXMFBnJhcml0eQUDbmlsAJcfXrg=", "height": 2166922, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4XQo9vUurvxsoaFXLMJE2bnnHDJCTf2J6Jago5N4M3wa Next: 4yKh41bfZY9LEjr5AyUphWkyfr6aBDLq9vStNrCcqp2g Diff:
OldNewDifferences
5656 else {
5757 let newToken = Issue(name, desc, 1, 0, false)
5858 let issueId = calculateAssetId(newToken)
59-[newToken, ScriptTransfer(i.caller, newToken.quantity, issueId)]
59+[newToken]
6060 }
6161
6262
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
1414 let kActive = "active"
1515
1616 let active = getBooleanValue(this, kActive)
1717
1818 let countRare = (1 + valueOrElse(getInteger(this, kRare), 0))
1919
2020 let countCommon = (1 + valueOrElse(getInteger(this, kCommon), 0))
2121
2222 let countLegendary = (1 + valueOrElse(getInteger(this, kLegendary), 0))
2323
2424 func isActive () = if (active)
2525 then unit
2626 else throw("Store is active")
2727
2828
2929 func randomize (bytes,range) = {
3030 let hash = sha256(bytes)
3131 let index = toInt(hash)
3232 (index % range)
3333 }
3434
3535
3636 func extraCount (rare) = if ((rare == kCommon))
3737 then IntegerEntry(kCommon, countCommon)
3838 else if ((rare == kRare))
3939 then IntegerEntry(kRare, countCommon)
4040 else IntegerEntry(kLegendary, countLegendary)
4141
4242
4343 func calculationRarity (transactionId) = {
4444 let tokenRare = randomize(transactionId, 100)
4545 if ((5 >= tokenRare))
4646 then kLegendary
4747 else if ((tokenRare >= 80))
4848 then kRare
4949 else kCommon
5050 }
5151
5252
5353 @Callable(i)
5454 func issueNft (name,desc,rarity,prefix) = if ((i.caller != this))
5555 then throw("Only owner")
5656 else {
5757 let newToken = Issue(name, desc, 1, 0, false)
5858 let issueId = calculateAssetId(newToken)
59-[newToken, ScriptTransfer(i.caller, newToken.quantity, issueId)]
59+[newToken]
6060 }
6161
6262
6363
6464 @Callable(i)
6565 func setPrice (price) = if ((i.caller != this))
6666 then throw("Only owner")
6767 else [StringEntry(kPrice, price)]
6868
6969
7070
7171 @Callable(i)
7272 func pullTheLever () = {
7373 let rarity = calculationRarity(i.transactionId)
7474 let structRare = extraCount(rarity)
7575 [structRare, ScriptTransfer(i.caller, 1, fromBase58String(getStringValue(this, ((rarity + separator) + toString(getIntegerValue(this, rarity))))))]
7676 }
7777
7878

github/deemru/w8io/026f985 
45.32 ms