tx · 7W3jALbxrKJds6CkkYWvPqR1xXV2V6VfP7MWhnvk1jx
3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx: -0.01000000 Waves
2023.03.25 13:23 [2505397] smart account 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx > SELF 0.00000000 Waves
{
"type": 13,
"id": "7W3jALbxrKJds6CkkYWvPqR1xXV2V6VfP7MWhnvk1jx",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1679739998470,
"version": 2,
"chainId": 84,
"sender": "3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx",
"senderPublicKey": "DyeDJ3fgwVVux2WRkxpLU9BbVjTM96AyV58b7bRFzCBx",
"proofs": [
"35hKrvhmLh2nE8GhoogUguPNFSiTDyLp5qQZnhsbwAoFXtH471zeew94nuYcsGQVVS5bXV57VMdQtwcgKJfGqSEU"
],
"script": "base64:BgIKCAISBgoEGBgRAQABAWkBBmJ1eU5mdAQGc2VsbGVyBG5mdHMFcHJpY2ULdG90YWxhbW91bnQEBWJ1eWVyCAUBaQZjYWxsZXIEA25mdAkAkAMBBQRuZnRzBAxidXllckJhbGFuY2UJAPAHAgUFYnV5ZXIBIIVjlaPziI6w3gwXjghOv5o/krsm2zrodo4W3BQiKkh+BAZhbW91bnQJAQV2YWx1ZQEICQCRAwIIBQFpCHBheW1lbnRzAAAGYW1vdW50BAV0ZWFtcwEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4KAQNzdW0CBWFjY3VtBG5leHQJAGQCBQVhY2N1bQUEbmV4dAQDYXJyBQVwcmljZQQJdG90YWxDb3N0CgACJGwFA2FycgoAAiRzCQCQAwEFAiRsCgAFJGFjYzAAAAoBBSRmMF8xAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQEDc3VtAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhNMaXN0IHNpemUgZXhjZWVkcyA1CQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQMDCQBmAgUJdG90YWxDb3N0BQZhbW91bnQGCQBmAgULdG90YWxhbW91bnQFBmFtb3VudAkAAgECHXlvdXIgcGF5aW5nIGFtbW91bnQgaXMgd3JvbmcgAwMJAQIhPQIJAJADAQUEbmZ0cwkAkAMBBQZzZWxsZXIGCQECIT0CCQCQAwEFBnNlbGxlcgkAkAMBBQVwcmljZQkAAgECTEludmFsaWQgaW5wdXQ6IE51bWJlciBvZiBORlRzLCBzZWxsZXIgYWRkcmVzc2VzLCBhbmQgY29zdHMgbXVzdCBiZSB0aGUgc2FtZS4DCQBmAgUGYW1vdW50BQxidXllckJhbGFuY2UJAAIBAjpCdXllciBkb2VzIG5vdCBoYXZlIGVub3VnaCBmdW5kcyB0byBjb21wbGV0ZSB0aGUgcHVyY2hhc2UuAwkAAAIICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAUFdGVhbXMJAMwIAgkBC1N0cmluZ0VudHJ5AgkApQgBCAUBaQZjYWxsZXIJAKQDAQUGYW1vdW50CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFBWJ1eWVyAAEJANkEAQkAkQMCBQRuZnRzAAAJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEJAJEDAgUGc2VsbGVyAAAJAJEDAgUFcHJpY2UAAAEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4FA25pbAUDbmlsAP9INnU=",
"height": 2505397,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: GN1Qub6HPHtwUp7E2w7apMcZSJV6eXmJo6atczC2ZFYd
Next: 8CucBjeUEajATYc4v8BDJ61ehDhChfc46GBh5WGMgwSF
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let a = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' |
---|
5 | 4 | | |
---|
6 | | - | @Callable(b) |
---|
7 | | - | func buyNft (c,d,e,f) = { |
---|
8 | | - | let g = b.caller |
---|
9 | | - | let h = size(d) |
---|
10 | | - | let i = assetBalance(g, base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq') |
---|
11 | | - | let j = value(b.payments[0].amount) |
---|
| 5 | + | |
---|
| 6 | + | @Callable(a) |
---|
| 7 | + | func buyNft (b,c,d,e) = { |
---|
| 8 | + | let f = a.caller |
---|
| 9 | + | let g = size(c) |
---|
| 10 | + | let h = assetBalance(f, base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq') |
---|
| 11 | + | let i = value(a.payments[0].amount) |
---|
| 12 | + | let j = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' |
---|
12 | 13 | | func k (l,m) = (l + m) |
---|
13 | 14 | | |
---|
14 | | - | let n = e |
---|
| 15 | + | let n = d |
---|
15 | 16 | | let o = { |
---|
16 | 17 | | let p = n |
---|
17 | 18 | | let q = size(p) |
---|
|
26 | 27 | | |
---|
27 | 28 | | v(s(s(s(s(s(r, 0), 1), 2), 3), 4), 5) |
---|
28 | 29 | | } |
---|
29 | | - | if (if ((o > j)) |
---|
| 30 | + | if (if ((o > i)) |
---|
30 | 31 | | then true |
---|
31 | | - | else (f > j)) |
---|
| 32 | + | else (e > i)) |
---|
32 | 33 | | then throw("your paying ammount is wrong ") |
---|
33 | | - | else if (if ((size(d) != size(c))) |
---|
| 34 | + | else if (if ((size(c) != size(b))) |
---|
34 | 35 | | then true |
---|
35 | | - | else (size(c) != size(e))) |
---|
| 36 | + | else (size(b) != size(d))) |
---|
36 | 37 | | then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.") |
---|
37 | | - | else if ((j > i)) |
---|
| 38 | + | else if ((i > h)) |
---|
38 | 39 | | then throw("Buyer does not have enough funds to complete the purchase.") |
---|
39 | | - | else [StringEntry(toString(b.caller), toString(j)), ScriptTransfer(g, 1, fromBase58String(d[0])), ScriptTransfer(Address(fromBase58String(c[0])), e[0], unit)] |
---|
| 40 | + | else if ((a.payments[0].assetId == j)) |
---|
| 41 | + | then [StringEntry(toString(a.caller), toString(i)), ScriptTransfer(f, 1, fromBase58String(c[0])), ScriptTransfer(Address(fromBase58String(b[0])), d[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')] |
---|
| 42 | + | else nil |
---|
40 | 43 | | } |
---|
41 | 44 | | |
---|
42 | 45 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let a = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' |
---|
5 | 4 | | |
---|
6 | | - | @Callable(b) |
---|
7 | | - | func buyNft (c,d,e,f) = { |
---|
8 | | - | let g = b.caller |
---|
9 | | - | let h = size(d) |
---|
10 | | - | let i = assetBalance(g, base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq') |
---|
11 | | - | let j = value(b.payments[0].amount) |
---|
| 5 | + | |
---|
| 6 | + | @Callable(a) |
---|
| 7 | + | func buyNft (b,c,d,e) = { |
---|
| 8 | + | let f = a.caller |
---|
| 9 | + | let g = size(c) |
---|
| 10 | + | let h = assetBalance(f, base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq') |
---|
| 11 | + | let i = value(a.payments[0].amount) |
---|
| 12 | + | let j = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' |
---|
12 | 13 | | func k (l,m) = (l + m) |
---|
13 | 14 | | |
---|
14 | | - | let n = e |
---|
| 15 | + | let n = d |
---|
15 | 16 | | let o = { |
---|
16 | 17 | | let p = n |
---|
17 | 18 | | let q = size(p) |
---|
18 | 19 | | let r = 0 |
---|
19 | 20 | | func s (t,u) = if ((u >= q)) |
---|
20 | 21 | | then t |
---|
21 | 22 | | else k(t, p[u]) |
---|
22 | 23 | | |
---|
23 | 24 | | func v (t,u) = if ((u >= q)) |
---|
24 | 25 | | then t |
---|
25 | 26 | | else throw("List size exceeds 5") |
---|
26 | 27 | | |
---|
27 | 28 | | v(s(s(s(s(s(r, 0), 1), 2), 3), 4), 5) |
---|
28 | 29 | | } |
---|
29 | | - | if (if ((o > j)) |
---|
| 30 | + | if (if ((o > i)) |
---|
30 | 31 | | then true |
---|
31 | | - | else (f > j)) |
---|
| 32 | + | else (e > i)) |
---|
32 | 33 | | then throw("your paying ammount is wrong ") |
---|
33 | | - | else if (if ((size(d) != size(c))) |
---|
| 34 | + | else if (if ((size(c) != size(b))) |
---|
34 | 35 | | then true |
---|
35 | | - | else (size(c) != size(e))) |
---|
| 36 | + | else (size(b) != size(d))) |
---|
36 | 37 | | then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.") |
---|
37 | | - | else if ((j > i)) |
---|
| 38 | + | else if ((i > h)) |
---|
38 | 39 | | then throw("Buyer does not have enough funds to complete the purchase.") |
---|
39 | | - | else [StringEntry(toString(b.caller), toString(j)), ScriptTransfer(g, 1, fromBase58String(d[0])), ScriptTransfer(Address(fromBase58String(c[0])), e[0], unit)] |
---|
| 40 | + | else if ((a.payments[0].assetId == j)) |
---|
| 41 | + | then [StringEntry(toString(a.caller), toString(i)), ScriptTransfer(f, 1, fromBase58String(c[0])), ScriptTransfer(Address(fromBase58String(b[0])), d[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')] |
---|
| 42 | + | else nil |
---|
40 | 43 | | } |
---|
41 | 44 | | |
---|
42 | 45 | | |
---|