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