tx · 4E2K6Thw3YNavQiuE6qyEVWEwd8mtjFiqYcKHi56K8ef 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx: -0.01000000 Waves 2023.03.25 14:27 [2505460] smart account 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx > SELF 0.00000000 Waves
{ "type": 13, "id": "4E2K6Thw3YNavQiuE6qyEVWEwd8mtjFiqYcKHi56K8ef", "fee": 1000000, "feeAssetId": null, "timestamp": 1679743784842, "version": 2, "chainId": 84, "sender": "3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx", "senderPublicKey": "DyeDJ3fgwVVux2WRkxpLU9BbVjTM96AyV58b7bRFzCBx", "proofs": [ "2d1NyTiacdBzE9bcRhqCik3v13qvsx54S78eVsF43TN3mq6nMStVNnwuhHvqrwV6DQpznjhedsvguKAsjxVPDrtV" ], "script": "base64:BgIKCAISBgoEGBgRAQABAWkBBmJ1eU5mdAQGc2VsbGVyBG5mdHMFcHJpY2ULdG90YWxhbW91bnQEBWJ1eWVyCAUBaQZjYWxsZXIEA25mdAkAkAMBBQRuZnRzBAxidXllckJhbGFuY2UJAPAHAgUFYnV5ZXIBIIVjlaPziI6w3gwXjghOv5o/krsm2zrodo4W3BQiKkh+BAZhbW91bnQJAQV2YWx1ZQEICQCRAwIIBQFpCHBheW1lbnRzAAAGYW1vdW50BAV0ZWFtcwEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4KAQNzdW0CBWFjY3VtBG5leHQJAGQCBQVhY2N1bQUEbmV4dAQDYXJyBQVwcmljZQQJdG90YWxDb3N0CgACJGwFA2FycgoAAiRzCQCQAwEFAiRsCgAFJGFjYzAAAAoBBSRmMF8xAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQEDc3VtAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhNMaXN0IHNpemUgZXhjZWVkcyA1CQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQMDCQBmAgUJdG90YWxDb3N0BQZhbW91bnQGCQBmAgULdG90YWxhbW91bnQFBmFtb3VudAkAAgECHHlvdXIgcGF5aW5nIGFtbW91bnQgaXMgd3JvbmcDAwkBAiE9AgkAkAMBBQRuZnRzCQCQAwEFBnNlbGxlcgYJAQIhPQIJAJADAQUGc2VsbGVyCQCQAwEFBXByaWNlCQACAQJMSW52YWxpZCBpbnB1dDogTnVtYmVyIG9mIE5GVHMsIHNlbGxlciBhZGRyZXNzZXMsIGFuZCBjb3N0cyBtdXN0IGJlIHRoZSBzYW1lLgMJAGYCBQZhbW91bnQFDGJ1eWVyQmFsYW5jZQkAAgECOkJ1eWVyIGRvZXMgbm90IGhhdmUgZW5vdWdoIGZ1bmRzIHRvIGNvbXBsZXRlIHRoZSBwdXJjaGFzZS4JAMwIAgkBC1N0cmluZ0VudHJ5AgkApQgBCAUBaQZjYWxsZXIJAKQDAQUGYW1vdW50CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFBWJ1eWVyAAEJANkEAQkAkQMCBQRuZnRzAAAJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEJAJEDAgUGc2VsbGVyAAAJAJEDAgUFcHJpY2UAAAEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4FA25pbABgyhNe", "height": 2505460, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4i1EoEWTxjs75pN8rGZwyKKAciK3NcUevoajdeB9o248 Next: DNZnDZ4qMEztuQ4GcRnW58DsifTqoJZtWY69e4qspvbt Diff:
Old | New | Differences | |
---|---|---|---|
37 | 37 | then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.") | |
38 | 38 | else if ((amount > buyerBalance)) | |
39 | 39 | then throw("Buyer does not have enough funds to complete the purchase.") | |
40 | - | else [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(Address(fromBase58String(seller[0])), | |
40 | + | else [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')] | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 |
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,totalamount) = { | |
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 teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' | |
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 | if (if ((totalCost > amount)) | |
31 | 31 | then true | |
32 | 32 | else (totalamount > amount)) | |
33 | 33 | then throw("your paying ammount is wrong") | |
34 | 34 | else if (if ((size(nfts) != size(seller))) | |
35 | 35 | then true | |
36 | 36 | else (size(seller) != size(price))) | |
37 | 37 | then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.") | |
38 | 38 | else if ((amount > buyerBalance)) | |
39 | 39 | then throw("Buyer does not have enough funds to complete the purchase.") | |
40 | - | else [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(Address(fromBase58String(seller[0])), | |
40 | + | else [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')] | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 |
github/deemru/w8io/169f3d6 23.10 ms ◑