tx · 4vsN49eCWi5K38rQpPTiLWDWjnKrT3EbxPs8zbQjL7dL

3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx:  -0.01000000 Waves

2023.03.27 11:50 [2508164] smart account 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx > SELF 0.00000000 Waves

{ "type": 13, "id": "4vsN49eCWi5K38rQpPTiLWDWjnKrT3EbxPs8zbQjL7dL", "fee": 1000000, "feeAssetId": null, "timestamp": 1679907130268, "version": 2, "chainId": 84, "sender": "3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx", "senderPublicKey": "DyeDJ3fgwVVux2WRkxpLU9BbVjTM96AyV58b7bRFzCBx", "proofs": [ "4cqdZaN62R9KuSLHdW5VVRU8Z7D7qC3h4nFs3WkJXocFudBmRBLcwdgQk2xDLwQzT9y5e5AxCa3xTa9SdyZpnGuq" ], "script": "base64:BgICCAIDAAFhCQDMCAICBWFwcGxlCQDMCAICBm1hYmRmZAUDbmlsAQhmb2xkRnVuYwIDYWNjAWUFAWUABWZpbmFsCgACJGwFAWEKAAIkcwkAkAMBBQIkbAoABSRhY2MwAAAKAQUkZjBfMQICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkBCGZvbGRGdW5jAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhNMaXN0IHNpemUgZXhjZWVkcyA1CQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQAAyiN+eQ==", "height": 2508164, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DKsJs1WVyDqz5TFfLmFxhf8g5SZLNkgZm5efLPsjZyHu Next: D3y2GGR67oNVCg2Se978p8pJYXBjBfAPdry3zCr3266V Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
4+let a = ["apple", "mabdfd"]
55
6-@Callable(i)
7-func buyNft (seller,nfts,price,totalamount) = {
8- let buyer = i.caller
9- let nft = size(nfts)
10- let buyerBalance = assetBalance(buyer, teams)
11- let amount = value(i.payments[0].amount)
12- if ((totalamount > amount))
13- then throw("your paying ammount is wrong ")
14- else if (if ((size(nfts) != size(seller)))
15- then true
16- else (size(seller) != size(price)))
17- then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.")
18- else if ((amount > buyerBalance))
19- then throw("Buyer does not have enough funds to complete the purchase.")
20- else if ((i.payments[0].assetId == teams))
21- then [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(buyer, 1, fromBase58String(nfts[1])), ScriptTransfer(buyer, 1, fromBase58String(nfts[2])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], teams), ScriptTransfer(Address(fromBase58String(seller[1])), price[1], teams), ScriptTransfer(Address(fromBase58String(seller[1])), price[2], teams)]
22- else if ((i.payments[0].assetId == unit))
23- then [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(buyer, 1, fromBase58String(nfts[1])), ScriptTransfer(buyer, 1, fromBase58String(nfts[2])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], unit), ScriptTransfer(Address(fromBase58String(seller[1])), price[1], unit), ScriptTransfer(Address(fromBase58String(seller[1])), price[2], unit)]
24- else nil
6+func foldFunc (acc,e) = e
7+
8+
9+let final = {
10+ let $l = a
11+ let $s = size($l)
12+ let $acc0 = 0
13+ func $f0_1 ($a,$i) = if (($i >= $s))
14+ then $a
15+ else foldFunc($a, $l[$i])
16+
17+ func $f0_2 ($a,$i) = if (($i >= $s))
18+ then $a
19+ else throw("List size exceeds 5")
20+
21+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
2522 }
2623
2724

github/deemru/w8io/169f3d6 
39.03 ms