tx · 8Mbb5mLaQp8129KHum5eqicKPBnk9GHXidKAAchfuj8u

3N66job2d8LT5VRVrR6sVrm5TetTVjHiBgK:  -0.01000000 Waves

2022.11.01 13:03 [2297901] smart account 3N66job2d8LT5VRVrR6sVrm5TetTVjHiBgK > SELF 0.00000000 Waves

{ "type": 13, "id": "8Mbb5mLaQp8129KHum5eqicKPBnk9GHXidKAAchfuj8u", "fee": 1000000, "feeAssetId": null, "timestamp": 1667296956538, "version": 2, "chainId": 84, "sender": "3N66job2d8LT5VRVrR6sVrm5TetTVjHiBgK", "senderPublicKey": "HtiQy2G7cXKiGN6z5x5aCuKqMKhLWN6RQCkkrstfEnpQ", "proofs": [ "3PKoVdfHtETs2NwUsBwwVVkjYvxV3ZUW39so72bxg3PTy3YWrno31EGwRgUizbSJ9QyNnwWfkD1WFkn3aWrsCFuD" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAEAAAAAAluZnRJc3N1ZWQCAAAACXdhc0luaXRlZAAAAAAKbmZ0QXNzZXRJZAIAAAALbmZ0X2Fzc2V0SWQAAAAAD1RvdGFsbmZ0U3dhcHBlZAIAAAAMdG90YWxTd2FwcGVkAAAAAA1vbGRuZnRBc3NldElkAQAAAAAAAAACAAAAAWkBAAAAC2lzc3VlTmV3bmZ0AAAAAAMJAQAAAAIhPQAAAAIJAAQgAAAAAQUAAAAJbmZ0SXNzdWVkBQAAAAR1bml0CQAAAgAAAAEJAAEsAAAAAgIAAAAvTmV3IG5mdCBpcyBhbHJlYWR5IGlzc3VlZCBhbmQgaXRzIGFzc2V0IGlkIGlzOiAJAQAAABFAZXh0ck5hdGl2ZSgxMDU4KQAAAAEFAAAACm5mdEFzc2V0SWQEAAAABm5ld05mdAkABEMAAAAHAgAAAAhEdWNrIEVnZwIAAABQVXRpbGl0eSBhbmQgUmV3YXJkIHRva2VuIEAgV2F2ZXNEdWNrcy5jb20gZ2FtZS4gVGhlIGR1Y2tpZXN0IHRva2VuIGluIHRoZSB3b3JsZC4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bmV3bmZ0QXNzZXRJZAUAAAANc3dhcHBlZEFtb3VudAYJAARMAAAAAgUAAAAHcmVpc3N1ZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAICAAAABXN3YXBfCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQCAAAAB19hbW91bnQFAAAADHRvU3dhcEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAPVG90YWxuZnRTd2FwcGVkCQAAZAAAAAIFAAAAD3RvdGFsU3dhcHBlZFZhbAUAAAAMdG9Td2FwQW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAANc3dhcHBlZEFtb3VudAUAAAANbmV3bmZ0QXNzZXRJZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXm96g5G", "height": 2297901, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6dbArGBxr88325yTEfRadVdVYkQP8mW1oGa4kwWQd49T Next: GohdFdQxN5zsenzkv4pHKmQPPnhe89stZXdabW5aqR4i Diff:
OldNewDifferences
2121
2222
2323 @Callable(i)
24-func swapEgg () = if ((size(i.payments) != 1))
25- then throw("You can attach only EGG tokens")
24+func swapnft () = if ((size(i.payments) != 1))
25+ then throw("You can attach only nft")
2626 else if ((value(i.payments[0]).assetId != oldnftAssetId))
27- then throw("You can attach only EGG tokens")
27+ then throw("You can attach only nft tokens")
2828 else {
2929 let totalSwappedVal = match getInteger(TotalnftSwapped) {
3030 case int: Int =>
3232 case _ =>
3333 0
3434 }
35- let newEggAssetId = fromBase58String(getStringValue(nftAssetId))
35+ let newnftAssetId = fromBase58String(getStringValue(nftAssetId))
3636 let toSwapAmount = value(i.payments[0]).amount
3737 let swappedAmount = (toSwapAmount * 1000000)
38- let reissue = Reissue(newEggAssetId, swappedAmount, true)
39-[reissue, IntegerEntry((("swap_" + toBase58String(i.transactionId)) + "_amount"), toSwapAmount), IntegerEntry(TotalnftSwapped, (totalSwappedVal + toSwapAmount)), ScriptTransfer(i.caller, swappedAmount, newEggAssetId)]
38+ let reissue = Reissue(newnftAssetId, swappedAmount, true)
39+[reissue, IntegerEntry((("swap_" + toBase58String(i.transactionId)) + "_amount"), toSwapAmount), IntegerEntry(TotalnftSwapped, (totalSwappedVal + toSwapAmount)), ScriptTransfer(i.caller, swappedAmount, newnftAssetId)]
4040 }
4141
4242
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let nftIssued = "wasInited"
55
66 let nftAssetId = "nft_assetId"
77
88 let TotalnftSwapped = "totalSwapped"
99
1010 let oldnftAssetId = base58''
1111
1212 @Callable(i)
1313 func issueNewnft () = if ((getBoolean(nftIssued) != unit))
1414 then throw(("New nft is already issued and its asset id is: " + getStringValue(nftAssetId)))
1515 else {
1616 let newNft = Issue("Duck Egg", "Utility and Reward token @ WavesDucks.com game. The duckiest token in the world.", 1, 8, true, unit, 0)
1717 let newNftId = calculateAssetId(newNft)
1818 [newNft, BooleanEntry(nftIssued, true), StringEntry(nftAssetId, toBase58String(newNftId))]
1919 }
2020
2121
2222
2323 @Callable(i)
24-func swapEgg () = if ((size(i.payments) != 1))
25- then throw("You can attach only EGG tokens")
24+func swapnft () = if ((size(i.payments) != 1))
25+ then throw("You can attach only nft")
2626 else if ((value(i.payments[0]).assetId != oldnftAssetId))
27- then throw("You can attach only EGG tokens")
27+ then throw("You can attach only nft tokens")
2828 else {
2929 let totalSwappedVal = match getInteger(TotalnftSwapped) {
3030 case int: Int =>
3131 int
3232 case _ =>
3333 0
3434 }
35- let newEggAssetId = fromBase58String(getStringValue(nftAssetId))
35+ let newnftAssetId = fromBase58String(getStringValue(nftAssetId))
3636 let toSwapAmount = value(i.payments[0]).amount
3737 let swappedAmount = (toSwapAmount * 1000000)
38- let reissue = Reissue(newEggAssetId, swappedAmount, true)
39-[reissue, IntegerEntry((("swap_" + toBase58String(i.transactionId)) + "_amount"), toSwapAmount), IntegerEntry(TotalnftSwapped, (totalSwappedVal + toSwapAmount)), ScriptTransfer(i.caller, swappedAmount, newEggAssetId)]
38+ let reissue = Reissue(newnftAssetId, swappedAmount, true)
39+[reissue, IntegerEntry((("swap_" + toBase58String(i.transactionId)) + "_amount"), toSwapAmount), IntegerEntry(TotalnftSwapped, (totalSwappedVal + toSwapAmount)), ScriptTransfer(i.caller, swappedAmount, newnftAssetId)]
4040 }
4141
4242
4343 @Verifier(tx)
4444 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
4545

github/deemru/w8io/026f985 
37.16 ms