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:BgIKCAISBAoCAQESAAACAWkBDHN0YXJ0QXVjdGlvbgIIZHVyYXRpb24Kc3RhcnRQcmljZQQJYXVjdGlvbklkCQDYBAEIBQFpDXRyYW5zYWN0aW9uSWQEA3BtdAkBBXZhbHVlAQkAkQMCCAUBaQhwYXltZW50cwAACQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUJYXVjdGlvbklkAgpfb3JnYW5pemVyCQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUJYXVjdGlvbklkAgdfYW1vdW50CAUDcG10BmFtb3VudAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQlhdWN0aW9uSWQCC19zdGFydFByaWNlBQpzdGFydFByaWNlBQNuaWwBaQEDYmlkAAQJYXVjdGlvbklkCQDYBAEIBQFpDXRyYW5zYWN0aW9uSWQEA3BtdAkBBXZhbHVlAQkAkQMCCAUBaQhwYXltZW50cwAABA1wbXRBc3NldElkU3RyCQDYBAEJAQV2YWx1ZQEIBQNwbXQHYXNzZXRJZAQQY2FsbGVyQWRkcmV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nRyeQIJAKwCAgUJYXVjdGlvbklkAgdfd2lubmVyBRBjYWxsZXJBZGRyZXNzU3RyCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCWF1Y3Rpb25JZAIKX3dpbkFtb3VudAUOdG90YWxCaWRBbW91bnQFA25pbAQScHJldmlvdXNCaWRkZXJBZGRyCQERQGV4dHJOYXRpdmUoMTA2MikBCQEFdmFsdWUBBQZ3aW5uZXIECnByaWNlQXNzZXQDAwkAAAIFDHByaWNlQXNzZXRJZAIFV0FWRVMGCQAAAgUMcHJpY2VBc3NldElkAgAFBHVuaXQJANkEAQUMcHJpY2VBc3NldElkCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUJYXVjdGlvbklkAgdfd2lubmVyBRBjYWxsZXJBZGRyZXNzU3RyCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCWF1Y3Rpb25JZAIKX3dpbkFtb3VudAUOdG90YWxCaWRBbW91bnQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUScHJldmlvdXNCaWRkZXJBZGRyCQEFdmFsdWUBBQl3aW5BbW91bnQFCnByaWNlQXNzZXQFA25pbAB7Wpti", "height": 2342708, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3jZCjrdiD3B2M5AY7H6p8CXLTWPgR7fz5npy5akyrsUM Next: 2nkzLJDqh3ymhpCfHhJ9iP9GFCa9oVPuAyPgjNiUqRqd Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | func bid () = { | |
17 | 17 | let auctionId = toBase58String(i.transactionId) | |
18 | 18 | 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)) | |
22 | 20 | let callerAddressStr = toBase58String(i.caller.bytes) | |
23 | 21 | let startPrice = getIntegerValue(this, (auctionId + "_startPrice")) | |
24 | 22 | let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId")) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func startAuction (duration,startPrice) = { | |
8 | 8 | let auctionId = toBase58String(i.transactionId) | |
9 | 9 | let pmt = value(i.payments[0]) | |
10 | 10 | [StringEntry((auctionId + "_organizer"), toBase58String(i.caller.bytes)), IntegerEntry((auctionId + "_amount"), pmt.amount), IntegerEntry((auctionId + "_startPrice"), startPrice)] | |
11 | 11 | } | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | 15 | @Callable(i) | |
16 | 16 | func bid () = { | |
17 | 17 | let auctionId = toBase58String(i.transactionId) | |
18 | 18 | 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)) | |
22 | 20 | let callerAddressStr = toBase58String(i.caller.bytes) | |
23 | 21 | let startPrice = getIntegerValue(this, (auctionId + "_startPrice")) | |
24 | 22 | let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId")) | |
25 | 23 | let winAmount = getInteger(this, (auctionId + "_winAmount")) | |
26 | 24 | let winner = getString(this, (auctionId + "_winner")) | |
27 | 25 | let bidFromTheSameUser = if (isDefined(winner)) | |
28 | 26 | then (value(winner) == callerAddressStr) | |
29 | 27 | else false | |
30 | 28 | let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser) | |
31 | 29 | then value(winAmount) | |
32 | 30 | else 0)) | |
33 | 31 | if ((priceAssetId != pmtAssetIdStr)) | |
34 | 32 | then throw((("Bid must be in asset '" + priceAssetId) + "'")) | |
35 | 33 | else if (if (if (isDefined(winAmount)) | |
36 | 34 | then (value(winAmount) >= totalBidAmount) | |
37 | 35 | else false) | |
38 | 36 | then true | |
39 | 37 | else if (!(isDefined(winAmount))) | |
40 | 38 | then (startPrice >= totalBidAmount) | |
41 | 39 | else false) | |
42 | 40 | then throw(("Bid must be more then " + toString(if (isDefined(winAmount)) | |
43 | 41 | then value(winAmount) | |
44 | 42 | else startPrice))) | |
45 | 43 | else if (if (bidFromTheSameUser) | |
46 | 44 | then true | |
47 | 45 | else !(isDefined(winner))) | |
48 | 46 | then [StringEntry((auctionId + "_winner"), callerAddressStr), IntegerEntry((auctionId + "_winAmount"), totalBidAmount)] | |
49 | 47 | else { | |
50 | 48 | let previousBidderAddr = addressFromStringValue(value(winner)) | |
51 | 49 | let priceAsset = if (if ((priceAssetId == "WAVES")) | |
52 | 50 | then true | |
53 | 51 | else (priceAssetId == "")) | |
54 | 52 | then unit | |
55 | 53 | else fromBase58String(priceAssetId) | |
56 | 54 | [StringEntry((auctionId + "_winner"), callerAddressStr), IntegerEntry((auctionId + "_winAmount"), totalBidAmount), ScriptTransfer(previousBidderAddr, value(winAmount), priceAsset)] | |
57 | 55 | } | |
58 | 56 | } | |
59 | 57 | ||
60 | 58 |
github/deemru/w8io/026f985 23.98 ms ◑