tx · BH1pWCc5hg1NBDet9oVvecCVWT2NFmDc9w4BHnJf1N6C 3N1PPoNT4epUSgdGwx1eNePsZjeYp5RUAcj: -0.01400000 Waves 2019.06.22 21:30 [553618] smart account 3N1PPoNT4epUSgdGwx1eNePsZjeYp5RUAcj > SELF 0.00000000 Waves
{ "type": 13, "id": "BH1pWCc5hg1NBDet9oVvecCVWT2NFmDc9w4BHnJf1N6C", "fee": 1400000, "feeAssetId": null, "timestamp": 1561228296383, "version": 1, "sender": "3N1PPoNT4epUSgdGwx1eNePsZjeYp5RUAcj", "senderPublicKey": "AomFdZHmK72gCbitdy7X2sUvNueScd3LhY9g2m7DJdo4", "proofs": [ "291rb8H1NnoxGFwT1BDL7spvRAt3snv1MXqwmENFCh5YTYg3NfC7JxGMf6ZWFXm1JoM9j2ufit4bmmBFdeRqKtZC" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAABJtYXhBdWN0aW9uRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAAHgAAAAMAAAABaQEAAAAMc3RhcnRBdWN0aW9uAAAAAwAAAAhkdXJhdGlvbgAAAApzdGFydFByaWNlAAAADHByaWNlQXNzZXRJZAQAAAAJYXVjdGlvbklkCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQEAAAAEGF1Y3Rpb25FbmRIZWlnaHQJAABkAAAAAggFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQFAAAACGR1cmF0aW9uBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAABmAAAAAgUAAAAIZHVyYXRpb24FAAAAEm1heEF1Y3Rpb25EdXJhdGlvbgkAAAIAAAABCQABLAAAAAICAAAAKER1cmF0aW9uIGlzIHRvbyBsb25nLiBNdXN0IGJlIGxlc3MgdGhhbiAJAAGkAAAAAQUAAAASbWF4QXVjdGlvbkR1cmF0aW9uCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAA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aQAAAAZjYWxsZXIJAQAAAAV2YWx1ZQAAAAEFAAAACWJldEFtb3VudAUAAAARYXVjdGlvblByaWNlQXNzZXQFAAAAA25pbAAAAAAWljL3", "chainId": 84, "height": 553618, "spentComplexity": 0 } View: original | compacted Prev: A3Q56WArTCQ5ySw86X9oFBwetu6TzVFrg8su9vrhHFzR Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = (1440 * 30) | |
5 | 5 | ||
6 | 6 | @Callable(b) | |
7 | 7 | func startAuction (c,d,e) = { | |
8 | 8 | let f = toBase58String(b.transactionId) | |
9 | 9 | let g = (lastBlock.height + c) | |
10 | 10 | let h = extract(b.payment) | |
11 | 11 | if ((c > a)) | |
12 | 12 | then throw(("Duration is too long. Must be less than " + toString(a))) | |
13 | 13 | else WriteSet([DataEntry(f, g), DataEntry((f + "_organizer"), toBase58String(b.caller.bytes)), DataEntry((f + "_lot_assetId"), if (isDefined(h.assetId)) | |
14 | 14 | then toBase58String(value(h.assetId)) | |
15 | 15 | else "WAVES"), DataEntry((f + "_lot_amount"), h.amount), DataEntry((f + "_startPrice"), d), DataEntry((f + "_priceAssetId"), e)]) | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | 20 | @Callable(b) | |
21 | 21 | func bid (f) = { | |
22 | 22 | let h = extract(b.payment) | |
23 | 23 | let i = if (isDefined(h.assetId)) | |
24 | 24 | then toBase58String(value(h.assetId)) | |
25 | 25 | else "WAVES" | |
26 | 26 | let j = toBase58String(b.caller.bytes) | |
27 | 27 | let g = getIntegerValue(this, f) | |
28 | 28 | let k = getStringValue(this, (f + "_priceAssetId")) | |
29 | 29 | let l = getInteger(this, (f + "_winAmount")) | |
30 | 30 | if ((lastBlock.height >= g)) | |
31 | 31 | then throw("Auction already finished") | |
32 | 32 | else if ((k != i)) | |
33 | 33 | then throw((("Bid must be in asset '" + k) + "'")) | |
34 | 34 | else if (if (isDefined(l)) | |
35 | 35 | then (value(l) >= h.amount) | |
36 | 36 | else false) | |
37 | 37 | then throw(("Bid must be more then " + toString(h.amount))) | |
38 | 38 | else WriteSet([DataEntry(((f + "_bidder_") + j), h.amount), DataEntry((f + "_winner"), j), DataEntry((f + "_winAmount"), h.amount)]) | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(b) | |
44 | 44 | func withdraw (f) = { | |
45 | 45 | let h = extract(b.payment) | |
46 | 46 | let i = if (isDefined(h.assetId)) | |
47 | 47 | then toBase58String(value(h.assetId)) | |
48 | 48 | else "WAVES" | |
49 | 49 | let j = toBase58String(b.caller.bytes) | |
50 | 50 | let g = getIntegerValue(this, f) | |
51 | 51 | let m = getStringValue(this, (f + "_organizer")) | |
52 | 52 | let n = getString(this, (f + "_winner")) | |
53 | 53 | let o = getStringValue(this, (f + "_lot_assetId")) | |
54 | 54 | let p = getIntegerValue(this, (f + "_lot_amount")) | |
55 | 55 | let k = getStringValue(this, (f + "_priceAssetId")) | |
56 | 56 | let l = getIntegerValue(this, (f + "_winAmount")) | |
57 | 57 | let q = if ((o == "WAVES")) | |
58 | 58 | then unit | |
59 | 59 | else fromBase58String(o) | |
60 | 60 | let r = if (if ((k == "WAVES")) | |
61 | 61 | then true | |
62 | 62 | else (k == "")) | |
63 | 63 | then unit | |
64 | 64 | else fromBase58String(k) | |
65 | 65 | let s = addressFromStringValue(value(n)) | |
66 | 66 | let t = addressFromStringValue(value(m)) | |
67 | 67 | let u = getInteger(this, ((f + "_bidder_") + j)) | |
68 | 68 | if ((g > lastBlock.height)) | |
69 | 69 | then throw("Auction is not finished yet") | |
70 | 70 | else if (!(isDefined(n))) | |
71 | 71 | then if ((j == m)) | |
72 | 72 | then if (!(isDefined(getBoolean(this, (f + "_lot_passed"))))) | |
73 | 73 | then throw("You have already got your lot back") | |
74 | 74 | else ScriptResult(WriteSet([DataEntry((f + "_lot_passed"), true)]), TransferSet([ScriptTransfer(b.caller, p, q)])) | |
75 | 75 | else throw("You haven't participate in this auction") | |
76 | 76 | else if (if ((j == m)) | |
77 | 77 | then true | |
78 | 78 | else (j == n)) | |
79 | 79 | then if (isDefined(getBoolean(this, (f + "_lot_passed")))) | |
80 | 80 | then throw("Lot is already passed to the winner, and organizer got his reward") | |
81 | 81 | else ScriptResult(WriteSet([DataEntry((f + "_lot_passed"), true)]), TransferSet([ScriptTransfer(s, p, q), ScriptTransfer(t, l, r)])) | |
82 | 82 | else if (!(isDefined(u))) | |
83 | 83 | then throw("You didn't bid anything") | |
84 | 84 | else if (isDefined(getBoolean(this, (((f + "_bidder_") + j) + "_return")))) | |
85 | 85 | then throw("You have already got your bid back") | |
86 | 86 | else ScriptResult(WriteSet([DataEntry((((f + "_bidder_") + j) + "_return"), true)]), TransferSet([ScriptTransfer(b.caller, value(u), r)])) | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 |
github/deemru/w8io/03bedc9 30.14 ms ◑![]()