tx · CwtUjnvrcWHXRxWa3w1C83WhL4oBAGD7XuENijiJDMPP 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx: -0.01000000 Waves 2023.03.27 10:18 [2508073] smart account 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx > SELF 0.00000000 Waves
{ "type": 13, "id": "CwtUjnvrcWHXRxWa3w1C83WhL4oBAGD7XuENijiJDMPP", "fee": 1000000, "feeAssetId": null, "timestamp": 1679901633182, "version": 2, "chainId": 84, "sender": "3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx", "senderPublicKey": "DyeDJ3fgwVVux2WRkxpLU9BbVjTM96AyV58b7bRFzCBx", "proofs": [ "4jMWrLCr34vQrzhqxxEjLcT3Dygw3SwNfJQCGpRLc9vqJzf3WGgH41kme8gTHnrrmaJb8abtT7ge6r7hunG9QbeY" ], "script": "base64:BgIKCAISBgoEGBgRAQEABXRlYW1zASCFY5Wj84iOsN4MF44ITr+aP5K7Jts66HaOFtwUIipIfgEBaQEGYnV5TmZ0BAZzZWxsZXIEbmZ0cwVwcmljZQt0b3RhbGFtb3VudAQFYnV5ZXIIBQFpBmNhbGxlcgQDbmZ0CQCQAwEFBG5mdHMEDGJ1eWVyQmFsYW5jZQkA8AcCBQVidXllcgEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4EBmFtb3VudAkBBXZhbHVlAQgJAJEDAggFAWkIcGF5bWVudHMAAAZhbW91bnQDCQBmAgULdG90YWxhbW91bnQFBmFtb3VudAkAAgECHXlvdXIgcGF5aW5nIGFtbW91bnQgaXMgd3JvbmcgAwMJAQIhPQIJAJADAQUEbmZ0cwkAkAMBBQZzZWxsZXIGCQECIT0CCQCQAwEFBnNlbGxlcgkAkAMBBQVwcmljZQkAAgECTEludmFsaWQgaW5wdXQ6IE51bWJlciBvZiBORlRzLCBzZWxsZXIgYWRkcmVzc2VzLCBhbmQgY29zdHMgbXVzdCBiZSB0aGUgc2FtZS4DCQBmAg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QCRAwIFBG5mdHMAAgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQkAkQMCBQZzZWxsZXIAAAkAkQMCBQVwcmljZQAABQR1bml0CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAQdBZGRyZXNzAQkA2QQBCQCRAwIFBnNlbGxlcgABCQCRAwIFBXByaWNlAAEFBHVuaXQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEJAJEDAgUGc2VsbGVyAAEJAJEDAgUFcHJpY2UAAgUEdW5pdAUDbmlsBQNuaWwAJHZlOg==", "height": 2508073, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JCkYpSGCuTKgEgc9LeGGXN3zJFB4kgg1g6jkj96e4S3G Next: DKsJs1WVyDqz5TFfLmFxhf8g5SZLNkgZm5efLPsjZyHu Diff:
Old | New | Differences | |
---|---|---|---|
17 | 17 | then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.") | |
18 | 18 | else if ((j > i)) | |
19 | 19 | then throw("Buyer does not have enough funds to complete the purchase.") | |
20 | - | else [StringEntry(toString(b.caller), toString(j)), ScriptTransfer(g, 1, fromBase58String(d[0])), ScriptTransfer(g, 1, fromBase58String(d[1])), ScriptTransfer(g, 1, fromBase58String(d[2])), ScriptTransfer(Address(fromBase58String(c[0])), e[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'), ScriptTransfer(Address(fromBase58String(c[1])), e[1], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'), ScriptTransfer(Address(fromBase58String(c[1])), e[2], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')] | |
20 | + | else if ((b.payments[0].assetId == a)) | |
21 | + | then [StringEntry(toString(b.caller), toString(j)), ScriptTransfer(g, 1, fromBase58String(d[0])), ScriptTransfer(g, 1, fromBase58String(d[1])), ScriptTransfer(g, 1, fromBase58String(d[2])), ScriptTransfer(Address(fromBase58String(c[0])), e[0], a), ScriptTransfer(Address(fromBase58String(c[1])), e[1], a), ScriptTransfer(Address(fromBase58String(c[1])), e[2], a)] | |
22 | + | else if ((b.payments[0].assetId == unit)) | |
23 | + | then [StringEntry(toString(b.caller), toString(j)), ScriptTransfer(g, 1, fromBase58String(d[0])), ScriptTransfer(g, 1, fromBase58String(d[1])), ScriptTransfer(g, 1, fromBase58String(d[2])), ScriptTransfer(Address(fromBase58String(c[0])), e[0], unit), ScriptTransfer(Address(fromBase58String(c[1])), e[1], unit), ScriptTransfer(Address(fromBase58String(c[1])), e[2], unit)] | |
24 | + | else nil | |
21 | 25 | } | |
22 | 26 | ||
23 | 27 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' | |
5 | 5 | ||
6 | 6 | @Callable(b) | |
7 | 7 | func buyNft (c,d,e,f) = { | |
8 | 8 | let g = b.caller | |
9 | 9 | let h = size(d) | |
10 | 10 | let i = assetBalance(g, base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq') | |
11 | 11 | let j = value(b.payments[0].amount) | |
12 | 12 | if ((f > j)) | |
13 | 13 | then throw("your paying ammount is wrong ") | |
14 | 14 | else if (if ((size(d) != size(c))) | |
15 | 15 | then true | |
16 | 16 | else (size(c) != size(e))) | |
17 | 17 | then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.") | |
18 | 18 | else if ((j > i)) | |
19 | 19 | then throw("Buyer does not have enough funds to complete the purchase.") | |
20 | - | else [StringEntry(toString(b.caller), toString(j)), ScriptTransfer(g, 1, fromBase58String(d[0])), ScriptTransfer(g, 1, fromBase58String(d[1])), ScriptTransfer(g, 1, fromBase58String(d[2])), ScriptTransfer(Address(fromBase58String(c[0])), e[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'), ScriptTransfer(Address(fromBase58String(c[1])), e[1], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'), ScriptTransfer(Address(fromBase58String(c[1])), e[2], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')] | |
20 | + | else if ((b.payments[0].assetId == a)) | |
21 | + | then [StringEntry(toString(b.caller), toString(j)), ScriptTransfer(g, 1, fromBase58String(d[0])), ScriptTransfer(g, 1, fromBase58String(d[1])), ScriptTransfer(g, 1, fromBase58String(d[2])), ScriptTransfer(Address(fromBase58String(c[0])), e[0], a), ScriptTransfer(Address(fromBase58String(c[1])), e[1], a), ScriptTransfer(Address(fromBase58String(c[1])), e[2], a)] | |
22 | + | else if ((b.payments[0].assetId == unit)) | |
23 | + | then [StringEntry(toString(b.caller), toString(j)), ScriptTransfer(g, 1, fromBase58String(d[0])), ScriptTransfer(g, 1, fromBase58String(d[1])), ScriptTransfer(g, 1, fromBase58String(d[2])), ScriptTransfer(Address(fromBase58String(c[0])), e[0], unit), ScriptTransfer(Address(fromBase58String(c[1])), e[1], unit), ScriptTransfer(Address(fromBase58String(c[1])), e[2], unit)] | |
24 | + | else nil | |
21 | 25 | } | |
22 | 26 | ||
23 | 27 |
github/deemru/w8io/169f3d6 27.06 ms ◑