tx · DTrAQzRixfH3fqu3zzQzAA3gPqVEjNMjgpiU7kNdh4MK 3ND3aHBYuXrc7nmdgTxT61G7PP96pCho4mZ: -0.01500000 Waves 2019.12.14 10:08 [808212] smart account 3ND3aHBYuXrc7nmdgTxT61G7PP96pCho4mZ > SELF 0.00000000 Waves
{ "type": 13, "id": "DTrAQzRixfH3fqu3zzQzAA3gPqVEjNMjgpiU7kNdh4MK", "fee": 1500000, "feeAssetId": null, "timestamp": 1576307278565, "version": 1, "sender": "3ND3aHBYuXrc7nmdgTxT61G7PP96pCho4mZ", "senderPublicKey": "CVC1vveEA1mZieuvei1mbM7Uwe9tXpo25xmqdZQnkwbE", "proofs": [ "5pcFvy2659vGR2NKhfyET9zGdHKYznYfbszvBHxu1oCZPBkx8QZdEehQYGazCdrZF6r2PAgq7F4CWx4aZ6c4uiBQ" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAAAAAAAEAAAABaQEAAAADYmlkAAAAAQAAAAlhdWN0aW9uSWQEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50BAAAAA1jYWxsZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAB2VuZFRpbWUJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAJYXVjdGlvbklkAgAAAAhfZW5kVGltZQQAAAAIbWluUHJpY2UJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAJYXVjdGlvbklkAgAAAAlfbWluUHJpY2UEAAAADWhpZ2hlc3RCaWRBbXQJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAlhdWN0aW9uSWQCAAAADl9oaWdoZXN0QmlkQW10BAAAAA1oaWdoZXN0QmlkZGVyCQAEHQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAJYXVjdGlv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WLpcD", "chainId": 84, "height": 808212, "spentComplexity": 0 } View: original | compacted Prev: none Next: 8sGw7rUzPAZxxo4XaC67p8tVgHaMEczDgE5TKNVdhFHr Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func bid (auctionId) = { | |
8 | + | let pmt = extract(i.payment) | |
9 | + | let callerAddress = toBase58String(i.caller.bytes) | |
10 | + | let endTime = getIntegerValue(this, (auctionId + "_endTime")) | |
11 | + | let minPrice = getIntegerValue(this, (auctionId + "_minPrice")) | |
12 | + | let highestBidAmt = getInteger(this, (auctionId + "_highestBidAmt")) | |
13 | + | let highestBidder = getString(this, (auctionId + "_highestBidder")) | |
14 | + | let bidFromTheSameUser = if (isDefined(highestBidder)) | |
15 | + | then (value(highestBidder) == callerAddress) | |
16 | + | else false | |
17 | + | let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser) | |
18 | + | then value(highestBidAmt) | |
19 | + | else 0)) | |
20 | + | if (!(isDefined(getIntegerValue(this, auctionId)))) | |
21 | + | then throw("Auction Id not found") | |
22 | + | else if ((lastBlock.height >= endTime)) | |
23 | + | then throw("Auction Completed") | |
24 | + | else if (if (if (!(isDefined(highestBidAmt))) | |
25 | + | then (minPrice >= totalBidAmount) | |
26 | + | else false) | |
27 | + | then true | |
28 | + | else if (isDefined(highestBidAmt)) | |
29 | + | then (value(highestBidAmt) >= totalBidAmount) | |
30 | + | else false) | |
31 | + | then throw(("Bid must be more then " + (if (!(isDefined(highestBidAmt))) | |
32 | + | then toString(minPrice) | |
33 | + | else toString(value(highestBidAmt))))) | |
34 | + | else if (!(isDefined(highestBidder))) | |
35 | + | then WriteSet([DataEntry((auctionId + "_highestBidder"), callerAddress), DataEntry((auctionId + "_highestBidAmt"), totalBidAmount)]) | |
36 | + | else if (bidFromTheSameUser) | |
37 | + | then WriteSet([DataEntry((auctionId + "_highestBidAmt"), totalBidAmount)]) | |
38 | + | else { | |
39 | + | let previousBidder = addressFromStringValue(value(highestBidder)) | |
40 | + | ScriptResult(WriteSet([DataEntry((auctionId + "_highestBidder"), callerAddress), DataEntry((auctionId + "_highestBidAmt"), totalBidAmount)]), TransferSet([ScriptTransfer(previousBidder, value(highestBidAmt), unit)])) | |
41 | + | } | |
42 | + | } | |
43 | + | ||
44 | + |
github/deemru/w8io/169f3d6 28.72 ms ◑