tx · 9xq2xjAA334ar5YWN7fjLfXWW1UNorZnK8n8XM6eRe8s
3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx: -0.01000000 Waves
2023.03.24 13:11 [2503951] smart account 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx > SELF 0.00000000 Waves
{
"type": 13,
"id": "9xq2xjAA334ar5YWN7fjLfXWW1UNorZnK8n8XM6eRe8s",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1679652856420,
"version": 2,
"chainId": 84,
"sender": "3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx",
"senderPublicKey": "DyeDJ3fgwVVux2WRkxpLU9BbVjTM96AyV58b7bRFzCBx",
"proofs": [
"xaAGrY8ApVH39ow6YsWWYdAzthTi1mpa7HkRXAVPT5VtUtWLFJTZCX5DK1BnmLcZjCWrMYMMKHtYbA6pGMZh6LD"
],
"script": "base64:BgIHCAISAwoBGAABAWkBBmJ1eU5mdAEEbmZ0cwQFYnV5ZXIIBQFpBmNhbGxlcgQDbmZ0CQCQAwEFBG5mdHMEDGJ1eWVyQmFsYW5jZQkA8AcCBQVidXllcgEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4EBmFtb3VudAkBBXZhbHVlAQgJAJEDAggFAWkIcGF5bWVudHMAAAZhbW91bnQEBmxlbmd0aAkAsQIBAgVuZnRJZAQGb25lUHJvCQDZBAEJAJEDAgUEbmZ0cwAABAZ0d29Qcm8JANkEAQkAkQMCBQRuZnRzAAEJAMwIAgkBC1N0cmluZ0VudHJ5AgkApQgBCAUBaQZjYWxsZXIJAKQDAQUGYW1vdW50CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFBWJ1eWVyAAEFBm9uZVBybwkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQVidXllcgABBQZ0d29Qcm8FA25pbAAgDAir",
"height": 2503951,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 6QSHtqxxB8NjQn8BJeNa35D7g9HTNMUbcK2TxdPkcWDM
Next: AtMDE5CQiq6cuhzQt31J6LrsY97hwXkQXZD8ysYSUxUh
Diff:
Old | New | | Differences |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | | - | func buyNft (seller,nfts,price) = { |
---|
| 7 | + | func buyNft (nfts) = { |
---|
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 | | - | func sum (accum,next) = (accum + next) |
---|
14 | | - | |
---|
15 | | - | let arr = price |
---|
16 | | - | let totalCost = { |
---|
17 | | - | let $l = arr |
---|
18 | | - | let $s = size($l) |
---|
19 | | - | let $acc0 = 0 |
---|
20 | | - | func $f0_1 ($a,$i) = if (($i >= $s)) |
---|
21 | | - | then $a |
---|
22 | | - | else sum($a, $l[$i]) |
---|
23 | | - | |
---|
24 | | - | func $f0_2 ($a,$i) = if (($i >= $s)) |
---|
25 | | - | then $a |
---|
26 | | - | else throw("List size exceeds 5") |
---|
27 | | - | |
---|
28 | | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) |
---|
29 | | - | } |
---|
30 | 13 | | let onePro = fromBase58String(nfts[0]) |
---|
31 | 14 | | let twoPro = fromBase58String(nfts[1]) |
---|
32 | 15 | | [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, onePro), ScriptTransfer(buyer, 1, twoPro)] |
---|
Full:
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 | | - | func buyNft (seller,nfts,price) = { |
---|
| 7 | + | func buyNft (nfts) = { |
---|
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 | | - | func sum (accum,next) = (accum + next) |
---|
14 | | - | |
---|
15 | | - | let arr = price |
---|
16 | | - | let totalCost = { |
---|
17 | | - | let $l = arr |
---|
18 | | - | let $s = size($l) |
---|
19 | | - | let $acc0 = 0 |
---|
20 | | - | func $f0_1 ($a,$i) = if (($i >= $s)) |
---|
21 | | - | then $a |
---|
22 | | - | else sum($a, $l[$i]) |
---|
23 | | - | |
---|
24 | | - | func $f0_2 ($a,$i) = if (($i >= $s)) |
---|
25 | | - | then $a |
---|
26 | | - | else throw("List size exceeds 5") |
---|
27 | | - | |
---|
28 | | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) |
---|
29 | | - | } |
---|
30 | 13 | | let onePro = fromBase58String(nfts[0]) |
---|
31 | 14 | | let twoPro = fromBase58String(nfts[1]) |
---|
32 | 15 | | [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, onePro), ScriptTransfer(buyer, 1, twoPro)] |
---|
33 | 16 | | } |
---|
34 | 17 | | |
---|
35 | 18 | | |
---|