tx · 79JCZFSyNtVnuyy4wQ5EzuactLCnnwNYgdAEs5MXpnr6

3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx:  -0.01000000 Waves

2023.03.27 15:44 [2508391] smart account 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx > SELF 0.00000000 Waves

{ "type": 13, "id": "79JCZFSyNtVnuyy4wQ5EzuactLCnnwNYgdAEs5MXpnr6", "fee": 1000000, "feeAssetId": null, "timestamp": 1679921180701, "version": 2, "chainId": 84, "sender": "3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx", "senderPublicKey": "DyeDJ3fgwVVux2WRkxpLU9BbVjTM96AyV58b7bRFzCBx", "proofs": [ "2vurrsiwSQ8TMWpahvFBZu78NSXd25FKJByZDpGTa5GcMxzZizw1g9Hh5ujLmDpWmPyxwz4VHGF7JPaRttkNPAuT" ], "script": "base64:BgIKCAISBgoEGBgRAQEABXRlYW1zASCFY5Wj84iOsN4MF44ITr+aP5K7Jts66HaOFtwUIipIfgEBaQEGYnV5TmZ0BAZzZWxsZXIEbmZ0cwVwcmljZQt0b3RhbGFtb3VudAQFYnV5ZXIIBQFpBmNhbGxlcgQDbmZ0CQCQAwEFBG5mdHMEDGJ1eWVyQmFsYW5jZQkA8AcCBQVidXllcgUFdGVhbXMEBmFtb3VudAkBBXZhbHVlAQgJAJEDAggFAWkIcGF5bWVudHMAAAZhbW91bnQDCQBmAgULdG90YWxhbW91bnQFBmFtb3VudAkAAgECHXlvdXIgcGF5aW5nIGFtbW91bnQgaXMgd3JvbmcgAwMJAQIhPQIJAJADAQUEbmZ0cwkAkAMBBQZzZWxsZXIGCQECIT0CCQCQAwEFBnNlbGxlcgkAkAMBBQVwcmljZQkAAgECTEludmFsaWQgaW5wdXQ6IE51bWJlciBvZiBORlRzLCBzZWxsZXIgYWRkcmVzc2VzLCBhbmQgY29zdHMgbXVzdCBiZSB0aGUgc2FtZS4DCQBmAgUGYW1vdW50BQxidXllckJhbGFuY2UJAAIB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QkA2QQBCQCRAwIFBnNlbGxlcgADCQCRAwIFBXByaWNlAAMFBXRlYW1zCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAQdBZGRyZXNzAQkA2QQBCQCRAwIFBnNlbGxlcgAECQCRAwIFBXByaWNlAAQFBXRlYW1zBQNuaWwFA25pbADJOesd", "height": 2508391, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2vitsdrcZh8gm5uZy6Foi8P1VxAD6UNKGq7NcfyfFPeS Next: 62Tg79ihRh7qyTPbXNMaMcwXmkzAYCSzgywzf2cusKdj Diff:
OldNewDifferences
1717 then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.")
1818 else if ((amount > buyerBalance))
1919 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[2])), 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[2])), price[2], unit)]
24- else nil
20+ else if (if (if ((size(nfts) == 1))
21+ then true
22+ else (size(seller) == 1))
23+ then true
24+ else (size(price) == 1))
25+ then [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], teams)]
26+ else if (if (if ((size(nfts) == 2))
27+ then true
28+ else (size(seller) == 2))
29+ then true
30+ else (size(price) == 2))
31+ then [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(buyer, 1, fromBase58String(nfts[1])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], teams), ScriptTransfer(Address(fromBase58String(seller[1])), price[1], teams)]
32+ else if (if (if ((size(nfts) == 3))
33+ then true
34+ else (size(seller) == 3))
35+ then true
36+ else (size(price) == 3))
37+ 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[2])), price[2], teams)]
38+ else if (if (if ((size(nfts) == 4))
39+ then true
40+ else (size(seller) == 4))
41+ then true
42+ else (size(price) == 4))
43+ 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(buyer, 1, fromBase58String(nfts[3])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], teams), ScriptTransfer(Address(fromBase58String(seller[1])), price[1], teams), ScriptTransfer(Address(fromBase58String(seller[2])), price[2], teams), ScriptTransfer(Address(fromBase58String(seller[3])), price[3], teams)]
44+ else if (if (if ((size(nfts) == 5))
45+ then true
46+ else (size(seller) == 5))
47+ then true
48+ else (size(price) == 5))
49+ 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(buyer, 1, fromBase58String(nfts[3])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], teams), ScriptTransfer(Address(fromBase58String(seller[1])), price[1], teams), ScriptTransfer(Address(fromBase58String(seller[2])), price[2], teams), ScriptTransfer(Address(fromBase58String(seller[3])), price[3], teams), ScriptTransfer(Address(fromBase58String(seller[4])), price[4], teams)]
50+ else nil
2551 }
2652
2753
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 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, teams)
1111 let amount = value(i.payments[0].amount)
1212 if ((totalamount > amount))
1313 then throw("your paying ammount is wrong ")
1414 else if (if ((size(nfts) != size(seller)))
1515 then true
1616 else (size(seller) != size(price)))
1717 then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.")
1818 else if ((amount > buyerBalance))
1919 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[2])), 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[2])), price[2], unit)]
24- else nil
20+ else if (if (if ((size(nfts) == 1))
21+ then true
22+ else (size(seller) == 1))
23+ then true
24+ else (size(price) == 1))
25+ then [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], teams)]
26+ else if (if (if ((size(nfts) == 2))
27+ then true
28+ else (size(seller) == 2))
29+ then true
30+ else (size(price) == 2))
31+ then [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(buyer, 1, fromBase58String(nfts[1])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], teams), ScriptTransfer(Address(fromBase58String(seller[1])), price[1], teams)]
32+ else if (if (if ((size(nfts) == 3))
33+ then true
34+ else (size(seller) == 3))
35+ then true
36+ else (size(price) == 3))
37+ 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[2])), price[2], teams)]
38+ else if (if (if ((size(nfts) == 4))
39+ then true
40+ else (size(seller) == 4))
41+ then true
42+ else (size(price) == 4))
43+ 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(buyer, 1, fromBase58String(nfts[3])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], teams), ScriptTransfer(Address(fromBase58String(seller[1])), price[1], teams), ScriptTransfer(Address(fromBase58String(seller[2])), price[2], teams), ScriptTransfer(Address(fromBase58String(seller[3])), price[3], teams)]
44+ else if (if (if ((size(nfts) == 5))
45+ then true
46+ else (size(seller) == 5))
47+ then true
48+ else (size(price) == 5))
49+ 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(buyer, 1, fromBase58String(nfts[3])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], teams), ScriptTransfer(Address(fromBase58String(seller[1])), price[1], teams), ScriptTransfer(Address(fromBase58String(seller[2])), price[2], teams), ScriptTransfer(Address(fromBase58String(seller[3])), price[3], teams), ScriptTransfer(Address(fromBase58String(seller[4])), price[4], teams)]
50+ else nil
2551 }
2652
2753

github/deemru/w8io/169f3d6 
32.73 ms