tx · 7W3jALbxrKJds6CkkYWvPqR1xXV2V6VfP7MWhnvk1jx

3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx:  -0.01000000 Waves

2023.03.25 13:23 [2505397] smart account 3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx > SELF 0.00000000 Waves

{ "type": 13, "id": "7W3jALbxrKJds6CkkYWvPqR1xXV2V6VfP7MWhnvk1jx", "fee": 1000000, "feeAssetId": null, "timestamp": 1679739998470, "version": 2, "chainId": 84, "sender": "3N5BTH4bjnXn7AAKoj4sswxytsPGmdXUuTx", "senderPublicKey": "DyeDJ3fgwVVux2WRkxpLU9BbVjTM96AyV58b7bRFzCBx", "proofs": [ "35hKrvhmLh2nE8GhoogUguPNFSiTDyLp5qQZnhsbwAoFXtH471zeew94nuYcsGQVVS5bXV57VMdQtwcgKJfGqSEU" ], "script": "base64:BgIKCAISBgoEGBgRAQABAWkBBmJ1eU5mdAQGc2VsbGVyBG5mdHMFcHJpY2ULdG90YWxhbW91bnQEBWJ1eWVyCAUBaQZjYWxsZXIEA25mdAkAkAMBBQRuZnRzBAxidXllckJhbGFuY2UJAPAHAgUFYnV5ZXIBIIVjlaPziI6w3gwXjghOv5o/krsm2zrodo4W3BQiKkh+BAZhbW91bnQJAQV2YWx1ZQEICQCRAwIIBQFpCHBheW1lbnRzAAAGYW1vdW50BAV0ZWFtcwEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4KAQNzdW0CBWFjY3VtBG5leHQJAGQCBQVhY2N1bQUEbmV4dAQDYXJyBQVwcmljZQQJdG90YWxDb3N0CgACJGwFA2FycgoAAiRzCQCQAwEFAiRsCgAFJGFjYzAAAAoBBSRmMF8xAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQEDc3VtAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhNMaXN0IHNpemUgZXhjZWVkcyA1CQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQMDCQBmAgUJdG90YWxDb3N0BQZhbW91bnQGCQBmAgULdG90YWxhbW91bnQFBmFtb3VudAkAAgECHXlvdXIgcGF5aW5nIGFtbW91bnQgaXMgd3JvbmcgAwMJAQIhPQIJAJADAQUEbmZ0cwkAkAMBBQZzZWxsZXIGCQECIT0CCQCQAwEFBnNlbGxlcgkAkAMBBQVwcmljZQkAAgECTEludmFsaWQgaW5wdXQ6IE51bWJlciBvZiBORlRzLCBzZWxsZXIgYWRkcmVzc2VzLCBhbmQgY29zdHMgbXVzdCBiZSB0aGUgc2FtZS4DCQBmAgUGYW1vdW50BQxidXllckJhbGFuY2UJAAIBAjpCdXllciBkb2VzIG5vdCBoYXZlIGVub3VnaCBmdW5kcyB0byBjb21wbGV0ZSB0aGUgcHVyY2hhc2UuAwkAAAIICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAUFdGVhbXMJAMwIAgkBC1N0cmluZ0VudHJ5AgkApQgBCAUBaQZjYWxsZXIJAKQDAQUGYW1vdW50CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFBWJ1eWVyAAEJANkEAQkAkQMCBQRuZnRzAAAJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEJAJEDAgUGc2VsbGVyAAAJAJEDAgUFcHJpY2UAAAEghWOVo/OIjrDeDBeOCE6/mj+SuybbOuh2jhbcFCIqSH4FA25pbAUDbmlsAP9INnU=", "height": 2505397, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GN1Qub6HPHtwUp7E2w7apMcZSJV6eXmJo6atczC2ZFYd Next: 8CucBjeUEajATYc4v8BDJ61ehDhChfc46GBh5WGMgwSF Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
4+
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'
1213 func sum (accum,next) = (accum + next)
1314
1415 let arr = price
3637 then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.")
3738 else if ((amount > buyerBalance))
3839 then throw("Buyer does not have enough funds to complete the purchase.")
39- else [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], unit)]
40+ else if ((i.payments[0].assetId == teams))
41+ then [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')]
42+ else nil
4043 }
4144
4245
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
4+
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'
1213 func sum (accum,next) = (accum + next)
1314
1415 let arr = price
1516 let totalCost = {
1617 let $l = arr
1718 let $s = size($l)
1819 let $acc0 = 0
1920 func $f0_1 ($a,$i) = if (($i >= $s))
2021 then $a
2122 else sum($a, $l[$i])
2223
2324 func $f0_2 ($a,$i) = if (($i >= $s))
2425 then $a
2526 else throw("List size exceeds 5")
2627
2728 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
2829 }
2930 if (if ((totalCost > amount))
3031 then true
3132 else (totalamount > amount))
3233 then throw("your paying ammount is wrong ")
3334 else if (if ((size(nfts) != size(seller)))
3435 then true
3536 else (size(seller) != size(price)))
3637 then throw("Invalid input: Number of NFTs, seller addresses, and costs must be the same.")
3738 else if ((amount > buyerBalance))
3839 then throw("Buyer does not have enough funds to complete the purchase.")
39- else [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], unit)]
40+ else if ((i.payments[0].assetId == teams))
41+ then [StringEntry(toString(i.caller), toString(amount)), ScriptTransfer(buyer, 1, fromBase58String(nfts[0])), ScriptTransfer(Address(fromBase58String(seller[0])), price[0], base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq')]
42+ else nil
4043 }
4144
4245

github/deemru/w8io/169f3d6 
32.92 ms