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:AAIFAAAAAAAAAAYIAhIAEgAAAAAEAAAAAAluZnRJc3N1ZWQCAAAACXdhc0luaXRlZAAAAAAKbmZ0QXNzZXRJZAIAAAALbmZ0X2Fzc2V0SWQAAAAAD1RvdGFsbmZ0U3dhcHBlZAIAAAAMdG90YWxTd2FwcGVkAAAAAA1vbGRuZnRBc3NldElkAQAAAAAAAAACAAAAAWkBAAAAC2lzc3VlTmV3bmZ0AAAAAAMJAQAAAAIhPQAAAAIJAAQgAAAAAQUAAAAJbmZ0SXNzdWVkBQAAAAR1bml0CQAAAgAAAAEJAAEsAAAAAgIAAAAvTmV3IG5mdCBpcyBhbHJlYWR5IGlzc3VlZCBhbmQgaXRzIGFzc2V0IGlkIGlzOiAJAQAAABFAZXh0ck5hdGl2ZSgxMDU4KQAAAAEFAAAACm5mdEFzc2V0SWQEAAAABm5ld05mdAkABEMAAAAHAgAAAAhEdWNrIEVnZwIAAABQVXRpbGl0eSBhbmQgUmV3YXJkIHRva2VuIEAgV2F2ZXNEdWNrcy5jb20gZ2FtZS4gVGhlIGR1Y2tpZXN0IHRva2VuIGluIHRoZSB3b3JsZC4A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mV3bmZ0QXNzZXRJZAUAAAANc3dhcHBlZEFtb3VudAYJAARMAAAAAgUAAAAHcmVpc3N1ZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAICAAAABXN3YXBfCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQCAAAAB19hbW91bnQFAAAADHRvU3dhcEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAPVG90YWxuZnRTd2FwcGVkCQAAZAAAAAIFAAAAD3RvdGFsU3dhcHBlZFZhbAUAAAAMdG9Td2FwQW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAANc3dhcHBlZEFtb3VudAUAAAANbmV3bmZ0QXNzZXRJZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXm96g5G", "height": 2297901, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6dbArGBxr88325yTEfRadVdVYkQP8mW1oGa4kwWQd49T Next: GohdFdQxN5zsenzkv4pHKmQPPnhe89stZXdabW5aqR4i Diff:
Old | New | Differences | |
---|---|---|---|
21 | 21 | ||
22 | 22 | ||
23 | 23 | @Callable(i) | |
24 | - | func | |
25 | - | then throw("You can attach only | |
24 | + | func swapnft () = if ((size(i.payments) != 1)) | |
25 | + | then throw("You can attach only nft") | |
26 | 26 | else if ((value(i.payments[0]).assetId != oldnftAssetId)) | |
27 | - | then throw("You can attach only | |
27 | + | then throw("You can attach only nft tokens") | |
28 | 28 | else { | |
29 | 29 | let totalSwappedVal = match getInteger(TotalnftSwapped) { | |
30 | 30 | case int: Int => | |
32 | 32 | case _ => | |
33 | 33 | 0 | |
34 | 34 | } | |
35 | - | let | |
35 | + | let newnftAssetId = fromBase58String(getStringValue(nftAssetId)) | |
36 | 36 | let toSwapAmount = value(i.payments[0]).amount | |
37 | 37 | let swappedAmount = (toSwapAmount * 1000000) | |
38 | - | let reissue = Reissue( | |
39 | - | [reissue, IntegerEntry((("swap_" + toBase58String(i.transactionId)) + "_amount"), toSwapAmount), IntegerEntry(TotalnftSwapped, (totalSwappedVal + toSwapAmount)), ScriptTransfer(i.caller, swappedAmount, | |
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)] | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let nftIssued = "wasInited" | |
5 | 5 | ||
6 | 6 | let nftAssetId = "nft_assetId" | |
7 | 7 | ||
8 | 8 | let TotalnftSwapped = "totalSwapped" | |
9 | 9 | ||
10 | 10 | let oldnftAssetId = base58'' | |
11 | 11 | ||
12 | 12 | @Callable(i) | |
13 | 13 | func issueNewnft () = if ((getBoolean(nftIssued) != unit)) | |
14 | 14 | then throw(("New nft is already issued and its asset id is: " + getStringValue(nftAssetId))) | |
15 | 15 | else { | |
16 | 16 | let newNft = Issue("Duck Egg", "Utility and Reward token @ WavesDucks.com game. The duckiest token in the world.", 1, 8, true, unit, 0) | |
17 | 17 | let newNftId = calculateAssetId(newNft) | |
18 | 18 | [newNft, BooleanEntry(nftIssued, true), StringEntry(nftAssetId, toBase58String(newNftId))] | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | ||
23 | 23 | @Callable(i) | |
24 | - | func | |
25 | - | then throw("You can attach only | |
24 | + | func swapnft () = if ((size(i.payments) != 1)) | |
25 | + | then throw("You can attach only nft") | |
26 | 26 | else if ((value(i.payments[0]).assetId != oldnftAssetId)) | |
27 | - | then throw("You can attach only | |
27 | + | then throw("You can attach only nft tokens") | |
28 | 28 | else { | |
29 | 29 | let totalSwappedVal = match getInteger(TotalnftSwapped) { | |
30 | 30 | case int: Int => | |
31 | 31 | int | |
32 | 32 | case _ => | |
33 | 33 | 0 | |
34 | 34 | } | |
35 | - | let | |
35 | + | let newnftAssetId = fromBase58String(getStringValue(nftAssetId)) | |
36 | 36 | let toSwapAmount = value(i.payments[0]).amount | |
37 | 37 | let swappedAmount = (toSwapAmount * 1000000) | |
38 | - | let reissue = Reissue( | |
39 | - | [reissue, IntegerEntry((("swap_" + toBase58String(i.transactionId)) + "_amount"), toSwapAmount), IntegerEntry(TotalnftSwapped, (totalSwappedVal + toSwapAmount)), ScriptTransfer(i.caller, swappedAmount, | |
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)] | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Verifier(tx) | |
44 | 44 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
45 | 45 |
github/deemru/w8io/026f985 37.16 ms ◑