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