tx · J7KZs43MScEnSHLptzWoHV99BoyYVXHiwRsQFPm6JLZJ
3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx: -0.01000000 Waves
2023.03.23 12:01 [2502454] smart account 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx > SELF 0.00000000 Waves
{
"type": 13,
"id": "J7KZs43MScEnSHLptzWoHV99BoyYVXHiwRsQFPm6JLZJ",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1679562180023,
"version": 2,
"chainId": 84,
"sender": "3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx",
"senderPublicKey": "DyeDJ3fgwVVux2WRkxpLU9BbVjTM96AyV58b7bRFzCBx",
"proofs": [
"2Pcac4eRNWjbrLUG2BmUzvXJjHuk2UPYLRnmk4gnj5ce3WKF2m9DMxqjxtpsSGwxmXAMQZPW6XfPAGZfZsBT1eip"
],
"script": "base64:BgIJCAISBQoDGBgRAAEBaQEGYnV5TmZ0AwZzZWxsZXIEbmZ0cwVwcmljZQQFYnV5ZXIIBQFpBmNhbGxlcgQMYnV5ZXJCYWxhbmNlCQDwBwIFBWJ1eWVyASCFY5Wj84iOsN4MF44ITr+aP5K7Jts66HaOFtwUIipIfgQGYW1vdW50CQEFdmFsdWUBCAkAkQMCCAUBaQhwYXltZW50cwAABmFtb3VudAQGbGVuZ3RoCQCxAgECBW5mdElkAwMJAQIhPQIJAJADAQUEbmZ0cwkAkAMBBQZzZWxsZXIGCQECIT0CCQCQAwEFBnNlbGxlcgkAkAMBBQVwcmljZQkAAgECTEludmFsaWQgaW5wdXQ6IE51bWJlciBvZiBORlRzLCBzZWxsZXIgYWRkcmVzc2VzLCBhbmQgY29zdHMgbXVzdCBiZSB0aGUgc2FtZS4DCQBmAgUGYW1vdW50BQxidXllckJhbGFuY2UJAAIBAjpCdXllciBkb2VzIG5vdCBoYXZlIGVub3VnaCBmdW5kcyB0byBjb21wbGV0ZSB0aGUgcHVyY2hhc2UuCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKUIAQgFAWkGY2FsbGVyCQCkAwEFBmFtb3VudAUDbmlsAIpn0sQ=",
"height": 2502454,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: Eg4U5FNoZirPVxUoGzWrB5qBJTEnsmbMNVKpE5nYYTg
Next: BCvKXonzm7qpH38oEoDcbJZ7HZt8LYzY5Gzso4HTLWKU
Diff:
Old | New | | Differences |
---|
7 | 7 | | func buyNft (seller,nfts,price) = { |
---|
8 | 8 | | let buyer = i.caller |
---|
9 | 9 | | let buyerBalance = assetBalance(buyer, base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq') |
---|
10 | | - | let totalcost = value(i.payments[0].amount) |
---|
| 10 | + | let amount = value(i.payments[0].amount) |
---|
11 | 11 | | let length = size("nftId") |
---|
12 | 12 | | if (if ((size(nfts) != size(seller))) |
---|
13 | 13 | | then true |
---|
14 | 14 | | else (size(seller) != size(price))) |
---|
15 | 15 | | then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.") |
---|
16 | | - | else if ((totalcost > buyerBalance)) |
---|
| 16 | + | else if ((amount > buyerBalance)) |
---|
17 | 17 | | then throw("Buyer does not have enough funds to complete the purchase.") |
---|
18 | | - | else nil |
---|
| 18 | + | else [StringEntry(toString(i.caller), toString(amount))] |
---|
19 | 19 | | } |
---|
20 | 20 | | |
---|
21 | 21 | | |
---|
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 | 7 | | func buyNft (seller,nfts,price) = { |
---|
8 | 8 | | let buyer = i.caller |
---|
9 | 9 | | let buyerBalance = assetBalance(buyer, base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq') |
---|
10 | | - | let totalcost = value(i.payments[0].amount) |
---|
| 10 | + | let amount = value(i.payments[0].amount) |
---|
11 | 11 | | let length = size("nftId") |
---|
12 | 12 | | if (if ((size(nfts) != size(seller))) |
---|
13 | 13 | | then true |
---|
14 | 14 | | else (size(seller) != size(price))) |
---|
15 | 15 | | then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.") |
---|
16 | | - | else if ((totalcost > buyerBalance)) |
---|
| 16 | + | else if ((amount > buyerBalance)) |
---|
17 | 17 | | then throw("Buyer does not have enough funds to complete the purchase.") |
---|
18 | | - | else nil |
---|
| 18 | + | else [StringEntry(toString(i.caller), toString(amount))] |
---|
19 | 19 | | } |
---|
20 | 20 | | |
---|
21 | 21 | | |
---|