tx · 6W2C7G9daoitaLD8HwceYiDbNR5Buq5cLePCPAwoYHK6 3N5eaZXgSm4N46udxgJmXZVLwaqMvFrRgCy: -0.01500000 Waves 2019.12.14 07:50 [808088] smart account 3N5eaZXgSm4N46udxgJmXZVLwaqMvFrRgCy > SELF 0.00000000 Waves
{ "type": 13, "id": "6W2C7G9daoitaLD8HwceYiDbNR5Buq5cLePCPAwoYHK6", "fee": 1500000, "feeAssetId": null, "timestamp": 1576299013725, "version": 1, "sender": "3N5eaZXgSm4N46udxgJmXZVLwaqMvFrRgCy", "senderPublicKey": "AC4GJMwFZ7vNCSXZjLu7LxTo71o6UMCZyk9NqwQ9YU7T", "proofs": [ "5pmYDFuzx61vvTPQLDGkwGKKnoj4YPEh1S22ZNkaCM9mmti1L41tsXFjv4rhyE28tFFYy3pwiHYs4MGq3mdXvD6A" ], "script": "base64:AAIDAAAAAAAAABIIARIECgIBARIDCgEIEgMKAQgAAAABAAAAAA9hdWN0aW9uRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAAAQAAAAMAAAABaQEAAAAMYmVnaW5BdWN0aW9uAAAAAgAAAAhtaW5QcmljZQAAAAhkdXJhdGlvbgMJAABmAAAAAgUAAAAIZHVyYXRpb24FAAAAD2F1Y3Rpb25EdXJhdGlvbgkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAE1NwZWNpZmllZCBkdXJhdGlvbigJAAGkAAAAAQUAAAAIZHVyYXRpb24CAAAAHykgZXhjZWVkcyB0aGUgbWF4aW11bSBkdXJhdGlvbigJAAGkAAAAAQUAAAAPYXVjdGlvbkR1cmF0aW9uAgAAAAEpBAAAAAlhdWN0aW9uSWQJAAJYAAAAAQgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAQAAAAHZW5kVGltZQkAAGQAAAACCAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAUAAAAIZHVyYXRpb24EAAAAA3BtdAkBAAAAB2V4dHJhY3Q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QEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAACWF1Y3Rpb25JZAIAAAAHX3N0YXR1cwYFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABFoaWdoZXN0QmlkZGVyQWRkcgAAAAAAAAAAAQEAAAAGVB9aghjxCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAACW93bmVyQWRkcgUAAAANaGlnaGVzdEJpZEFtdAUAAAAEdW5pdAUAAAADbmlsAAAAANVLghk=", "chainId": 84, "height": 808088, "spentComplexity": 0 } View: original | compacted Prev: none Next: 8ADMhi57eTzJK7JZQe1f1npq8Fwt2mX6ei5rkLNP2dW2 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
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 | + | } | |
17 | + | ||
18 | + | ||
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) | |
30 | + | else false | |
31 | + | let l = (g.amount + (if (k) | |
32 | + | then value(i) | |
33 | + | else 0)) | |
34 | + | if (!(isDefined(getIntegerValue(this, e)))) | |
35 | + | then throw("Auction Id not found") | |
36 | + | else if ((lastBlock.height >= f)) | |
37 | + | then throw("Auction Completed") | |
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)])) | |
81 | + | } | |
82 | + | ||
83 | + |
github/deemru/w8io/169f3d6 29.28 ms ◑