tx · 6QSHtqxxB8NjQn8BJeNa35D7g9HTNMUbcK2TxdPkcWDM 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx: -0.01000000 Waves 2023.03.24 13:09 [2503949] smart account 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx > SELF 0.00000000 Waves
{ "type": 13, "id": "6QSHtqxxB8NjQn8BJeNa35D7g9HTNMUbcK2TxdPkcWDM", "fee": 1000000, "feeAssetId": null, "timestamp": 1679652796574, "version": 2, "chainId": 84, "sender": "3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx", "senderPublicKey": "DyeDJ3fgwVVux2WRkxpLU9BbVjTM96AyV58b7bRFzCBx", "proofs": [ "4Wz4jiCnt1nKNmLVBidSce4Ze6X73prpjkvndTpvPXmAEZT7rRHTW5Jmwc8V9jiUa2bmF8jS94CPVinErC5SRF9m" ], "script": "base64:BgIJCAISBQoDGBgRAAEBaQEGYnV5TmZ0AwZzZWxsZXIEbmZ0cwVwcmljZQQFYnV5ZXIIBQFpBmNhbGxlcgQDbmZ0CQCQAwEFBG5mdHMEDGJ1eWVyQmFsYW5jZQkA8AcCBQVidXllcgEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4EBmFtb3VudAkBBXZhbHVlAQgJAJEDAggFAWkIcGF5bWVudHMAAAZhbW91bnQEBmxlbmd0aAkAsQIBAgVuZnRJZAoBA3N1bQIFYWNjdW0EbmV4dAkAZAIFBWFjY3VtBQRuZXh0BANhcnIFBXByaWNlBAl0b3RhbENvc3QKAAIkbAUDYXJyCgACJHMJAJADAQUCJGwKAAUkYWNjMAAACgEFJGYwXzECAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAQNzdW0CBQIkYQkAkQMCBQIkbAUCJGkKAQUkZjBfMgICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkAAgECE0xpc3Qgc2l6ZSBleGNlZWRzIDUJAQUkZjBfMgIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFBAZvbmVQcm8JANkEAQkAkQMCBQRuZnRzAAAEBnR3b1BybwkA2QQBCQCRAwIFBG5mdHMAAQkAzAgCCQELU3RyaW5nRW50cnkCCQClCAEIBQFpBmNhbGxlcgkApAMBBQZhbW91bnQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUFYnV5ZXIAAQUGb25lUHJvCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFBWJ1eWVyAAEFBnR3b1BybwUDbmlsAN5W8ew=", "height": 2503949, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FsX2Xb3eLrgVj4zcXk9RhdiugM7QUs737F5LhgsSvcc4 Next: 9xq2xjAA334ar5YWN7fjLfXWW1UNorZnK8n8XM6eRe8s Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | } | |
30 | 30 | let onePro = fromBase58String(nfts[0]) | |
31 | 31 | let twoPro = fromBase58String(nfts[1]) | |
32 | - | if ((totalCost > amount)) | |
33 | - | then throw("your paying ammount is wrong ") | |
34 | - | else if (if ((size(nfts) != size(seller))) | |
35 | - | then true | |
36 | - | else (size(seller) != size(price))) | |
37 | - | then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.") | |
38 | - | else if ((amount > buyerBalance)) | |
39 | - | then throw("Buyer does not have enough funds to complete the purchase.") | |
40 | - | else [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, onePro), ScriptTransfer(buyer, 1, twoPro)] | |
32 | + | [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, onePro), ScriptTransfer(buyer, 1, twoPro)] | |
41 | 33 | } | |
42 | 34 | ||
43 | 35 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func buyNft (seller,nfts,price) = { | |
8 | 8 | let buyer = i.caller | |
9 | 9 | let nft = size(nfts) | |
10 | 10 | let buyerBalance = assetBalance(buyer, base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq') | |
11 | 11 | let amount = value(i.payments[0].amount) | |
12 | 12 | let length = size("nftId") | |
13 | 13 | func sum (accum,next) = (accum + next) | |
14 | 14 | ||
15 | 15 | let arr = price | |
16 | 16 | let totalCost = { | |
17 | 17 | let $l = arr | |
18 | 18 | let $s = size($l) | |
19 | 19 | let $acc0 = 0 | |
20 | 20 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
21 | 21 | then $a | |
22 | 22 | else sum($a, $l[$i]) | |
23 | 23 | ||
24 | 24 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
25 | 25 | then $a | |
26 | 26 | else throw("List size exceeds 5") | |
27 | 27 | ||
28 | 28 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
29 | 29 | } | |
30 | 30 | let onePro = fromBase58String(nfts[0]) | |
31 | 31 | let twoPro = fromBase58String(nfts[1]) | |
32 | - | if ((totalCost > amount)) | |
33 | - | then throw("your paying ammount is wrong ") | |
34 | - | else if (if ((size(nfts) != size(seller))) | |
35 | - | then true | |
36 | - | else (size(seller) != size(price))) | |
37 | - | then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.") | |
38 | - | else if ((amount > buyerBalance)) | |
39 | - | then throw("Buyer does not have enough funds to complete the purchase.") | |
40 | - | else [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, onePro), ScriptTransfer(buyer, 1, twoPro)] | |
32 | + | [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, onePro), ScriptTransfer(buyer, 1, twoPro)] | |
41 | 33 | } | |
42 | 34 | ||
43 | 35 |
github/deemru/w8io/169f3d6 45.31 ms ◑