tx · 5X52GTmaLN6mJyxK7KqepaWvoNLAmP5zmgkhHf7HQn2J 3MvU8vDCk4NkA1Ag4vE3mETA4U9ioFh6VEM: -0.01500000 Waves 2019.12.14 10:43 [808255] smart account 3MvU8vDCk4NkA1Ag4vE3mETA4U9ioFh6VEM > SELF 0.00000000 Waves
{ "type": 13, "id": "5X52GTmaLN6mJyxK7KqepaWvoNLAmP5zmgkhHf7HQn2J", "fee": 1500000, "feeAssetId": null, "timestamp": 1576309408212, "version": 1, "sender": "3MvU8vDCk4NkA1Ag4vE3mETA4U9ioFh6VEM", "senderPublicKey": "LknnJnwRo6xRdriHmjgVbRDgpexijZFTYBU3Lw4HBS1", "proofs": [ "4C5vTs3HeQhPKFmsJizgiQfee1SATsMS4ThwyskKrFoGXv8X4ERpq8wzpTssAsMv3Lh71rXeMARpYrEvxwDLbbpR" ], "script": "base64:AAIDAAAAAAAAABIIARIECgIBARIDCgEIEgMKAQgAAAABAAAAAA9hdWN0aW9uRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAAAQAAAAMAAAABaQEAAAAMYmVnaW5BdWN0aW9uAAAAAgAAAAhtaW5QcmljZQAAAAhkdXJhdGlvbgMJAABmAAAAAgUAAAAIZHVyYXRpb24FAAAAD2F1Y3Rpb25EdXJhdGlvbgkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAE1NwZWNpZmllZCBkdXJhdGlvbigJAAGkAAAAAQUAAAAIZHVyYXRpb24CAAAAHykgZXhjZWVkcyB0aGUgbWF4aW11bSBkdXJhdGlvbigJAAGkAAAAAQUAAAAPYXVjdGlvbkR1cmF0aW9uAgAAAAEpBAAAAAlhdWN0aW9uSWQJAAJYAAAAAQgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAQAAAAHZW5kVGltZQkAAGQAAAACCAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAUAAAAIZHVyYXRpb24EAAAAA3BtdAkBAAAAB2V4dHJh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bnRyeQAAAAIJAAEsAAAAAgUAAAAJYXVjdGlvbklkAgAAAAdfc3RhdHVzBgUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEWhpZ2hlc3RCaWRkZXJBZGRyAAAAAAAAAAABAQAAAAZUH1qCGPEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAJb3duZXJBZGRyBQAAAA1oaWdoZXN0QmlkQW10BQAAAAR1bml0BQAAAANuaWwAAAAA7xv6Gg==", "chainId": 84, "height": 808255, "spentComplexity": 0 } View: original | compacted Prev: BWU9gPhpQ9NqbK9FaZnUJKVwsj3jfrFdD3GWFfNDsS3q Next: 5f5eCzdCeHc4DmjmD5RQRoLpHBDZacEjwVzPABPiWxSe Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = (1440 * 1) | |
5 | + | ||
6 | + | @Callable(b) | |
7 | + | func beginAuction (c,d) = if ((d > a)) | |
8 | + | then throw((((("Specified duration(" + toString(d)) + ") exceeds the maximum duration(") + toString(a)) + ")")) | |
9 | + | else { | |
10 | + | let e = toBase58String(b.transactionId) | |
11 | + | let f = (lastBlock.height + d) | |
12 | + | let g = extract(b.payment) | |
13 | + | WriteSet([DataEntry(e, e), DataEntry((e + "_endTime"), f), DataEntry((e + "_owner"), toBase58String(b.caller.bytes)), DataEntry((e + "_itemId"), if (isDefined(g.assetId)) | |
14 | + | then toBase58String(value(g.assetId)) | |
15 | + | else throw("Item not atached")), DataEntry((e + "_minPrice"), c)]) | |
16 | + | } | |
4 | 17 | ||
5 | 18 | ||
6 | - | @Callable(a) | |
7 | - | func bid (b) = { | |
8 | - | let c = extract(a.payment) | |
9 | - | let d = toBase58String(a.caller.bytes) | |
10 | - | let e = getIntegerValue(this, (b + "_endTime")) | |
11 | - | let f = getIntegerValue(this, (b + "_minPrice")) | |
12 | - | let g = getInteger(this, (b + "_highestBidAmt")) | |
13 | - | let h = getString(this, (b + "_highestBidder")) | |
14 | - | let i = if (isDefined(h)) | |
15 | - | then (value(h) == d) | |
19 | + | ||
20 | + | @Callable(b) | |
21 | + | func bid (e) = { | |
22 | + | let g = extract(b.payment) | |
23 | + | let h = toBase58String(b.caller.bytes) | |
24 | + | let f = getIntegerValue(this, (e + "_endTime")) | |
25 | + | let c = getIntegerValue(this, (e + "_minPrice")) | |
26 | + | let i = getInteger(this, (e + "_highestBidAmt")) | |
27 | + | let j = getString(this, (e + "_highestBidder")) | |
28 | + | let k = if (isDefined(j)) | |
29 | + | then (value(j) == h) | |
16 | 30 | else false | |
17 | - | let | |
18 | - | then value( | |
31 | + | let l = (g.amount + (if (k) | |
32 | + | then value(i) | |
19 | 33 | else 0)) | |
20 | - | if (!(isDefined(getString(this, | |
34 | + | if (!(isDefined(getString(this, e)))) | |
21 | 35 | then throw("Auction Id not found") | |
22 | - | else if (( | |
36 | + | else if ((lastBlock.height >= f)) | |
23 | 37 | then throw("Auction Completed") | |
24 | - | else if ((100000 >= 1)) | |
25 | - | then throw("Bid must be more then ") | |
26 | - | else WriteSet([DataEntry("Content_Variable", "sss")]) | |
38 | + | else if (if (if (!(isDefined(i))) | |
39 | + | then (c >= l) | |
40 | + | else false) | |
41 | + | then true | |
42 | + | else if (isDefined(i)) | |
43 | + | then (value(i) >= l) | |
44 | + | else false) | |
45 | + | then throw(("Bid must be more then " + (if (!(isDefined(i))) | |
46 | + | then toString(c) | |
47 | + | else toString(value(i))))) | |
48 | + | else if (!(isDefined(j))) | |
49 | + | then WriteSet([DataEntry((e + "_highestBidder"), h), DataEntry((e + "_highestBidAmt"), l)]) | |
50 | + | else if (k) | |
51 | + | then WriteSet([DataEntry((e + "_highestBidAmt"), l)]) | |
52 | + | else { | |
53 | + | let m = addressFromStringValue(value(j)) | |
54 | + | ScriptResult(WriteSet([DataEntry((e + "_highestBidder"), h), DataEntry((e + "_highestBidAmt"), l)]), TransferSet([ScriptTransfer(m, value(i), unit)])) | |
55 | + | } | |
56 | + | } | |
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | @Callable(b) | |
61 | + | func withdraw (e) = { | |
62 | + | let g = extract(b.payment) | |
63 | + | let h = toBase58String(b.caller.bytes) | |
64 | + | let f = getIntegerValue(this, (e + "_endTime")) | |
65 | + | let n = getStringValue(this, (e + "_owner")) | |
66 | + | let j = getString(this, (e + "_highestBidder")) | |
67 | + | let o = getStringValue(this, (e + "_itemId")) | |
68 | + | let i = getIntegerValue(this, (e + "_highestBidAmt")) | |
69 | + | let p = addressFromStringValue(value(j)) | |
70 | + | let q = addressFromStringValue(value(n)) | |
71 | + | let r = addressFromStringValue(value(o)) | |
72 | + | if ((f > lastBlock.height)) | |
73 | + | then throw("Auction is not finished yet") | |
74 | + | else if (!(isDefined(j))) | |
75 | + | then if (!(isDefined(getBoolean(this, (e + "_status"))))) | |
76 | + | then throw("Owner already withdrawn the item") | |
77 | + | else ScriptResult(WriteSet([DataEntry((e + "_status"), true)]), TransferSet([ScriptTransfer(q, 1, base58'itemAddr')])) | |
78 | + | else if (isDefined(getBoolean(this, (e + "_status")))) | |
79 | + | then throw("The item is transfered to the highest bidder and the bid amount is transfered to the owner") | |
80 | + | else ScriptResult(WriteSet([DataEntry((e + "_status"), true)]), TransferSet([ScriptTransfer(p, 1, base58'itemAddr'), ScriptTransfer(q, i, unit)])) | |
27 | 81 | } | |
28 | 82 | ||
29 | 83 |
github/deemru/w8io/169f3d6 28.27 ms ◑