tx · DNZnDZ4qMEztuQ4GcRnW58DsifTqoJZtWY69e4qspvbt

3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx:  -0.01000000 Waves

2023.03.27 09:40 [2508032] smart account 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx > SELF 0.00000000 Waves

{ "type": 13, "id": "DNZnDZ4qMEztuQ4GcRnW58DsifTqoJZtWY69e4qspvbt", "fee": 1000000, "feeAssetId": null, "timestamp": 1679899338003, "version": 2, "chainId": 84, "sender": "3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx", "senderPublicKey": "DyeDJ3fgwVVux2WRkxpLU9BbVjTM96AyV58b7bRFzCBx", "proofs": [ "5DpMqYAd1tqY3Few2Fyg3hpKTaCzMV7ayTfToHLC4FCMv13pJttd6CvqEZ2vCg8a6H5HnXSs1FkEUGJriUVV8YmS" ], "script": "base64:BgIKCAISBgoEGBgRAQEABXRlYW1zASCFY5Wj84iOsN4MF44ITr+aP5K7Jts66HaOFtwUIipIfgEBaQEGYnV5TmZ0BAZzZWxsZXIEbmZ0cwVwcmljZQt0b3RhbGFtb3VudAQFYnV5ZXIIBQFpBmNhbGxlcgQDbmZ0CQCQAwEFBG5mdHMEDGJ1eWVyQmFsYW5jZQkA8AcCBQVidXllcgEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4EBmFtb3VudAkBBXZhbHVlAQgJAJEDAggFAWkIcGF5bWVudHMAAAZhbW91bnQKAQNzdW0CBWFjY3VtBG5leHQJAGQCBQVhY2N1bQUEbmV4dAQDYXJyBQVwcmljZQQJdG90YWxDb3N0CgACJGwFA2FycgoAAiRzCQCQAwEFAiRsCgAFJGFjYzAAAAoBBSRmMF8xAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQEDc3VtAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhNMaXN0IHNpemUgZXhjZWVkcyA1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AEJAJEDAgUGc2VsbGVyAAAJAJEDAgUFcHJpY2UAAAEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4JAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEJAJEDAgUGc2VsbGVyAAEJAJEDAgUFcHJpY2UAAQEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4JAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEJAJEDAgUGc2VsbGVyAAEJAJEDAgUFcHJpY2UAAgEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4FA25pbABNgkNd", "height": 2508032, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4E2K6Thw3YNavQiuE6qyEVWEwd8mtjFiqYcKHi56K8ef Next: 3vSppiy9vnnjPuLNXvv5YJBBdxAtQQZRHLm7HWMA6Fw9 Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-
4+let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
55
66 @Callable(i)
77 func buyNft (seller,nfts,price,totalamount) = {
99 let nft = size(nfts)
1010 let buyerBalance = assetBalance(buyer, base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')
1111 let amount = value(i.payments[0].amount)
12- let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
1312 func sum (accum,next) = (accum + next)
1413
1514 let arr = price
2726
2827 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
2928 }
29+ func foldFunc (acc,e) = e
30+
31+ let a = nfts
32+ let final = {
33+ let $l = a
34+ let $s = size($l)
35+ let $acc0 = 0
36+ func $f1_1 ($a,$i) = if (($i >= $s))
37+ then $a
38+ else foldFunc($a, $l[$i])
39+
40+ func $f1_2 ($a,$i) = if (($i >= $s))
41+ then $a
42+ else throw("List size exceeds 5")
43+
44+ $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5)
45+ }
3046 if (if ((totalCost > amount))
3147 then true
3248 else (totalamount > amount))
33- then throw("your paying ammount is wrong")
49+ then throw("your paying ammount is wrong ")
3450 else if (if ((size(nfts) != size(seller)))
3551 then true
3652 else (size(seller) != size(price)))
3753 then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.")
3854 else if ((amount > buyerBalance))
3955 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])), price[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')]
56+ else [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, toBytes(final)), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'), ScriptTransfer(Address(fromBase58String(seller[1])), price[1], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'), ScriptTransfer(Address(fromBase58String(seller[1])), price[2], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')]
4157 }
4258
4359
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-
4+let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
55
66 @Callable(i)
77 func buyNft (seller,nfts,price,totalamount) = {
88 let buyer = i.caller
99 let nft = size(nfts)
1010 let buyerBalance = assetBalance(buyer, base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')
1111 let amount = value(i.payments[0].amount)
12- let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
1312 func sum (accum,next) = (accum + next)
1413
1514 let arr = price
1615 let totalCost = {
1716 let $l = arr
1817 let $s = size($l)
1918 let $acc0 = 0
2019 func $f0_1 ($a,$i) = if (($i >= $s))
2120 then $a
2221 else sum($a, $l[$i])
2322
2423 func $f0_2 ($a,$i) = if (($i >= $s))
2524 then $a
2625 else throw("List size exceeds 5")
2726
2827 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
2928 }
29+ func foldFunc (acc,e) = e
30+
31+ let a = nfts
32+ let final = {
33+ let $l = a
34+ let $s = size($l)
35+ let $acc0 = 0
36+ func $f1_1 ($a,$i) = if (($i >= $s))
37+ then $a
38+ else foldFunc($a, $l[$i])
39+
40+ func $f1_2 ($a,$i) = if (($i >= $s))
41+ then $a
42+ else throw("List size exceeds 5")
43+
44+ $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5)
45+ }
3046 if (if ((totalCost > amount))
3147 then true
3248 else (totalamount > amount))
33- then throw("your paying ammount is wrong")
49+ then throw("your paying ammount is wrong ")
3450 else if (if ((size(nfts) != size(seller)))
3551 then true
3652 else (size(seller) != size(price)))
3753 then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.")
3854 else if ((amount > buyerBalance))
3955 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])), price[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')]
56+ else [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, toBytes(final)), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'), ScriptTransfer(Address(fromBase58String(seller[1])), price[1], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'), ScriptTransfer(Address(fromBase58String(seller[1])), price[2], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')]
4157 }
4258
4359

github/deemru/w8io/169f3d6 
28.50 ms