tx · 4NrK9QpJGprjD3tTa73o5JKLsandschXZLo3PpTXwpKo 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep: -0.01400000 Waves 2019.07.12 14:00 [582423] smart account 3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep > SELF 0.00000000 Waves
{ "type": 13, "id": "4NrK9QpJGprjD3tTa73o5JKLsandschXZLo3PpTXwpKo", "fee": 1400000, "feeAssetId": null, "timestamp": 1562929181961, "version": 1, "sender": "3N2icgpJnXhcYab7KQrwqWsV4LwSF25C1Ep", "senderPublicKey": "BJAeTqNbDSA5FiYihZZaSWvD6XL5XjpqVXbTGerBJjRK", "proofs": [ "2qJAjxHgj2bHNNfcs3ZsEM58XUQ5oZMtyEXsTK4rXnNkymvLqoMhFNNj8YGK9JXhnamnqe7F5wJSxiz15cb9492p" ], "script": "base64:AAIDAAAAAAAAAAAAAAAEAAAAAAp0b2tlbklkRGVmAQAAACCU1B7l35UfeySUCJ5Oe8nTMKHr4huFqp+vPk8CQCqTZQEAAAASdXNlckhhc0FkbWluQWNjZXNzAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAABGFkZHIAAAACAAAAB3Rva2VuSWQAAAADcGFyCQABLAAAAAIJAAEsAAAAAgkAAlgAAAABBQAAAAd0b2tlbklkAgAAAAFfBQAAAANwYXIBAAAABXNhZGRyAAAAAgAAAAd0b2tlbklkAAAAA3BhcgkAASwAAAACCQABLAAAAAIFAAAAB3Rva2VuSWQCAAAAAV8FAAAAA3BhcgAAAAMAAAABaQEAAAADYmV0AAAAAQAAAA10b2tlbklkU3RyaW5nBAAAABZzdGFydFRyYW5zYWN0aW9uSGVpZ2h0CQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzCQEAAAAFc2FkZHIAAAACBQAAAA10b2tlbklkU3RyaW5nAgAAAAVzdGFydAQAAAAJdGltZURlbHRhCQAAZQAAAAIFAAAABmhlaWd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CZXRPd25lcgkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQkAAZsAAAABCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzCQEAAAAEYWRkcgAAAAIFAAAAB3Rva2VuSWQCAAAAC21heEJldE93bmVyCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAABGFkZHIAAAACBQAAAAd0b2tlbklkAgAAAAVzdGFydAAAAAAAAAAAAAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAC21heEJldE93bmVyAAAAAAAAAAABBQAAAAd0b2tlbklkBQAAAANuaWwAAAAAVwYhXg==", "chainId": 84, "height": 582423, "spentComplexity": 0 } View: original | compacted Prev: 9udV6wGvL4cd4xC9BoV1ALpkJE9e4Vg1h9xcVD9QRHKe Next: 7DaaARnnQ4CHY7Vb43qfYCRRcpxAR68zDU3nw4hidVfP Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | func bet (i) = { | |
17 | 17 | let j = getIntegerValue(this, g(i, "start")) | |
18 | 18 | let k = (height - j) | |
19 | - | let l = | |
19 | + | let l = getIntegerValue(this, g(i, "maxBet")) | |
20 | 20 | let m = addressFromPublicKey(toBytes(getStringValue(this, g(i, "maxBetOwner")))) | |
21 | 21 | let n = extract(h.payment) | |
22 | 22 | if ((k > 20000)) | |
23 | - | then throw("The betting was closed") | |
23 | + | then throw("The betting was closed.") | |
24 | 24 | else if (!(isDefined(n.assetId))) | |
25 | 25 | then { | |
26 | 26 | let o = n.amount | |
27 | - | if ((o > | |
27 | + | if ((o > l)) | |
28 | 28 | then throw(g(i, "start")) | |
29 | 29 | else throw("Your bet isn't the max bet") | |
30 | 30 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'B1xwWnBLB7z79VPr4sq1jBb5GDqs8TeT5jHojTdiwxfE' | |
5 | 5 | ||
6 | 6 | func b (c) = (c == this) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func d (e,f) = ((toBase58String(e) + "_") + f) | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func g (e,f) = ((e + "_") + f) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | @Callable(h) | |
16 | 16 | func bet (i) = { | |
17 | 17 | let j = getIntegerValue(this, g(i, "start")) | |
18 | 18 | let k = (height - j) | |
19 | - | let l = | |
19 | + | let l = getIntegerValue(this, g(i, "maxBet")) | |
20 | 20 | let m = addressFromPublicKey(toBytes(getStringValue(this, g(i, "maxBetOwner")))) | |
21 | 21 | let n = extract(h.payment) | |
22 | 22 | if ((k > 20000)) | |
23 | - | then throw("The betting was closed") | |
23 | + | then throw("The betting was closed.") | |
24 | 24 | else if (!(isDefined(n.assetId))) | |
25 | 25 | then { | |
26 | 26 | let o = n.amount | |
27 | - | if ((o > | |
27 | + | if ((o > l)) | |
28 | 28 | then throw(g(i, "start")) | |
29 | 29 | else throw("Your bet isn't the max bet") | |
30 | 30 | } | |
31 | 31 | else throw("You need to place a bet using waves currency") | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(h) | |
37 | 37 | func start (p,q) = { | |
38 | 38 | let n = extract(h.payment) | |
39 | 39 | let e = extract(n.assetId) | |
40 | 40 | if (isDefined(e)) | |
41 | 41 | then WriteSet([DataEntry(d(e, "start"), height), DataEntry(d(e, "startPrice"), p), DataEntry(d(e, "duration"), q), DataEntry(d(e, "maxBetOwner"), toBase58String(h.callerPublicKey))]) | |
42 | 42 | else throw("You can't sell waves using the auction") | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(h) | |
48 | 48 | func finish (e) = { | |
49 | 49 | let r = (getIntegerValue(this, d(e, "start")) - height) | |
50 | 50 | let s = (getIntegerValue(this, d(e, "duration")) - r) | |
51 | 51 | if ((s > 0)) | |
52 | 52 | then throw((("The auction cannot be finished yet! " + toString(s)) + " minutes remaining")) | |
53 | 53 | else { | |
54 | 54 | let m = addressFromPublicKey(toBytes(getStringValue(this, d(e, "maxBetOwner")))) | |
55 | 55 | ScriptResult(WriteSet([DataEntry(d(e, "start"), 0)]), TransferSet([ScriptTransfer(m, 1, e)])) | |
56 | 56 | } | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 |
github/deemru/w8io/169f3d6 30.13 ms ◑