tx · 91R6WV5PTyPjx6qWAWaLzZ8jk7Hip8HQjEfDapQpxKJp

3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo:  -0.01000000 Waves

2022.12.02 15:04 [2342708] smart account 3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo > SELF 0.00000000 Waves

{ "type": 13, "id": "91R6WV5PTyPjx6qWAWaLzZ8jk7Hip8HQjEfDapQpxKJp", "fee": 1000000, "feeAssetId": null, "timestamp": 1669982659207, "version": 2, "chainId": 84, "sender": "3N72SETEKtTuaA3YNVYWgVEmXKrRrZYXHGo", "senderPublicKey": "Kwu4LYBMntApXv8t7csxV23Kvc3tvak26wMKK56tA4V", "proofs": [ "2CM32qPEZrFiy9LAmUN61jhoHqUnoJnqvp2ZEYsQkS2dQoEoc3Be1nwQXyWyxez6fCGKi2Vtsac26rvEU33JW9xa" ], "script": "base64:BgIKCAISBAoCAQESAAACAWkBDHN0YXJ0QXVjdGlvbgIIZHVyYXRpb24Kc3RhcnRQcmljZQQJYXVjdGlvbklkCQDYBAEIBQFpDXRyYW5zYWN0aW9uSWQEA3BtdAkBBXZhbHVlAQkAkQMCCAUBaQhwYXltZW50cwAACQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUJYXVjdGlvbklkAgpfb3JnYW5pemVyCQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUJYXVjdGlvbklkAgdfYW1vdW50CAUDcG10BmFtb3VudAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQlhdWN0aW9uSWQCC19zdGFydFByaWNlBQpzdGFydFByaWNlBQNuaWwBaQEDYmlkAAQJYXVjdGlvbklkCQDYBAEIBQFpDXRyYW5zYWN0aW9uSWQEA3BtdAkBBXZhbHVlAQkAkQMCCAUBaQhwYXltZW50cwAABA1wbXRBc3NldElkU3RyCQDYBAEJAQV2YWx1ZQEIBQNwbXQHYXNzZXRJZAQQY2FsbGVyQWRkcm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bnRyeQIJAKwCAgUJYXVjdGlvbklkAgdfd2lubmVyBRBjYWxsZXJBZGRyZXNzU3RyCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCWF1Y3Rpb25JZAIKX3dpbkFtb3VudAUOdG90YWxCaWRBbW91bnQFA25pbAQScHJldmlvdXNCaWRkZXJBZGRyCQERQGV4dHJOYXRpdmUoMTA2MikBCQEFdmFsdWUBBQZ3aW5uZXIECnByaWNlQXNzZXQDAwkAAAIFDHByaWNlQXNzZXRJZAIFV0FWRVMGCQAAAgUMcHJpY2VBc3NldElkAgAFBHVuaXQJANkEAQUMcHJpY2VBc3NldElkCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUJYXVjdGlvbklkAgdfd2lubmVyBRBjYWxsZXJBZGRyZXNzU3RyCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCWF1Y3Rpb25JZAIKX3dpbkFtb3VudAUOdG90YWxCaWRBbW91bnQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUScHJldmlvdXNCaWRkZXJBZGRyCQEFdmFsdWUBBQl3aW5BbW91bnQFCnByaWNlQXNzZXQFA25pbAB7Wpti", "height": 2342708, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3jZCjrdiD3B2M5AY7H6p8CXLTWPgR7fz5npy5akyrsUM Next: 2nkzLJDqh3ymhpCfHhJ9iP9GFCa9oVPuAyPgjNiUqRqd Diff:
OldNewDifferences
1616 func bid () = {
1717 let auctionId = toBase58String(i.transactionId)
1818 let pmt = value(i.payments[0])
19- let pmtAssetIdStr = if (isDefined(pmt.assetId))
20- then toBase58String(value(pmt.assetId))
21- else "WAVES"
19+ let pmtAssetIdStr = toBase58String(value(pmt.assetId))
2220 let callerAddressStr = toBase58String(i.caller.bytes)
2321 let startPrice = getIntegerValue(this, (auctionId + "_startPrice"))
2422 let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func startAuction (duration,startPrice) = {
88 let auctionId = toBase58String(i.transactionId)
99 let pmt = value(i.payments[0])
1010 [StringEntry((auctionId + "_organizer"), toBase58String(i.caller.bytes)), IntegerEntry((auctionId + "_amount"), pmt.amount), IntegerEntry((auctionId + "_startPrice"), startPrice)]
1111 }
1212
1313
1414
1515 @Callable(i)
1616 func bid () = {
1717 let auctionId = toBase58String(i.transactionId)
1818 let pmt = value(i.payments[0])
19- let pmtAssetIdStr = if (isDefined(pmt.assetId))
20- then toBase58String(value(pmt.assetId))
21- else "WAVES"
19+ let pmtAssetIdStr = toBase58String(value(pmt.assetId))
2220 let callerAddressStr = toBase58String(i.caller.bytes)
2321 let startPrice = getIntegerValue(this, (auctionId + "_startPrice"))
2422 let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
2523 let winAmount = getInteger(this, (auctionId + "_winAmount"))
2624 let winner = getString(this, (auctionId + "_winner"))
2725 let bidFromTheSameUser = if (isDefined(winner))
2826 then (value(winner) == callerAddressStr)
2927 else false
3028 let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser)
3129 then value(winAmount)
3230 else 0))
3331 if ((priceAssetId != pmtAssetIdStr))
3432 then throw((("Bid must be in asset '" + priceAssetId) + "'"))
3533 else if (if (if (isDefined(winAmount))
3634 then (value(winAmount) >= totalBidAmount)
3735 else false)
3836 then true
3937 else if (!(isDefined(winAmount)))
4038 then (startPrice >= totalBidAmount)
4139 else false)
4240 then throw(("Bid must be more then " + toString(if (isDefined(winAmount))
4341 then value(winAmount)
4442 else startPrice)))
4543 else if (if (bidFromTheSameUser)
4644 then true
4745 else !(isDefined(winner)))
4846 then [StringEntry((auctionId + "_winner"), callerAddressStr), IntegerEntry((auctionId + "_winAmount"), totalBidAmount)]
4947 else {
5048 let previousBidderAddr = addressFromStringValue(value(winner))
5149 let priceAsset = if (if ((priceAssetId == "WAVES"))
5250 then true
5351 else (priceAssetId == ""))
5452 then unit
5553 else fromBase58String(priceAssetId)
5654 [StringEntry((auctionId + "_winner"), callerAddressStr), IntegerEntry((auctionId + "_winAmount"), totalBidAmount), ScriptTransfer(previousBidderAddr, value(winAmount), priceAsset)]
5755 }
5856 }
5957
6058

github/deemru/w8io/026f985 
23.98 ms