tx · Efr4ht9gZXz9zwiu7VpEEZWRR1phKwv3UtXifdSwPmQm 3MwAWzsrC9ArFFhHoArjM9Kpqkoo4u8RDe7: -0.01000000 Waves 2019.11.25 15:21 [780778] smart account 3MwAWzsrC9ArFFhHoArjM9Kpqkoo4u8RDe7 > SELF 0.00000000 Waves
{ "type": 13, "id": "Efr4ht9gZXz9zwiu7VpEEZWRR1phKwv3UtXifdSwPmQm", "fee": 1000000, "feeAssetId": null, "timestamp": 1574684469351, "version": 1, "sender": "3MwAWzsrC9ArFFhHoArjM9Kpqkoo4u8RDe7", "senderPublicKey": "1ZX9ie63Rz7X8FXA8GQRP8LbUCwGbjTua1oHfX6eD1o", "proofs": [ "4cSsTV88YQrqUqxB5koZLwB9AzQkFZjvqKXyDocme8CQj6CNiHMycQH4wRwiFL4J5qWmXfXpJVce8M6MjjXKCNqb" ], "script": "base64:AAIDAAAAAAAAAA4IARIDCgEIEgASAwoBCAAAAAQAAAAAEGxvdHRlcnlUaWNrZXRIdWIJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVS3c8KhZZqP/0Hgp2DgOzq/4eSqBnyXS3IAAAAADGxvdHRlcnlPd25lcgIAAAAjM013QVd6c3JDOUFyRkZoSG9BcmpNOUtwcWtvbzR1OFJEZTcAAAAAC293bmVyUHViS2V5AQAAACAAJMUx4FEFQZUQv4ZlV084IGd3q4aimkSoetUvcoXXNgAAAAARZEFwcFJhbmRvbUFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVR69Gble9L7ZAlkIRDez4s9orqMbsXhOU4AAAADAAAACmNvbnRleHRPYmoBAAAAF3JlZ2lzdGVyUmFuZG9tUmVxdWVzdFR4AAAAAQAAAA9yYW5kb21SZXF1ZXN0VHgDCQEAAAAJaXNEZWZpbmVkAAAAAQkABB0AAAACBQAAAAR0aGlzAgAAAA9yYW5kb21SZXF1ZXN0VHgJAAACAAAAAQIAAAAncmFuZG9tUmVxdWVzdFR4IGlzIGFscmVhZHkgaW4g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GNoMAMJAABmAAAAAgUAAAAGaGVpZ2h0BQAAAA5oZWlnaHRFbmRMZWFzZQkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAC293bmVyUHViS2V5BwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAMJAABmAAAAAgUAAAAGaGVpZ2h0BQAAAA5oZWlnaHRFbmRMZWFzZQkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAC293bmVyUHViS2V5BwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAC293bmVyUHViS2V5aSiaeg==", "chainId": 84, "height": 780778, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = Address(base58'3N6e67BztDWhitY4MicKwLRkjrmJ3U4or2M') | |
5 | + | ||
6 | + | let b = "3MwAWzsrC9ArFFhHoArjM9Kpqkoo4u8RDe7" | |
7 | + | ||
8 | + | let c = base58'1ZX9ie63Rz7X8FXA8GQRP8LbUCwGbjTua1oHfX6eD1o' | |
9 | + | ||
10 | + | let d = Address(base58'3N18CzfiNb2vhRRgVqMc3Y5kHezHWp9PowB') | |
11 | + | ||
12 | + | @Callable(e) | |
13 | + | func registerRandomRequestTx (f) = if (isDefined(getString(this, "randomRequestTx"))) | |
14 | + | then throw("randomRequestTx is already in the state") | |
15 | + | else if (isDefined(transactionHeightById(fromBase58String(f)))) | |
16 | + | then throw("You try register tx which is already in blockchain") | |
17 | + | else if ((e.caller == addressFromString(b))) | |
18 | + | then WriteSet([DataEntry("randomRequestTx", f)]) | |
19 | + | else throw("only owner can start the lottery") | |
20 | + | ||
21 | + | ||
22 | + | ||
23 | + | @Callable(e) | |
24 | + | func checkRandom () = { | |
25 | + | let g = getStringValue(this, "randomRequestTx") | |
26 | + | let h = getStringValue(d, g) | |
27 | + | let i = split(h, "_")[0] | |
28 | + | let j = split(h, "--")[1] | |
29 | + | if ((i == "FINISHED")) | |
30 | + | then WriteSet([DataEntry("randomResult", parseIntValue(j))]) | |
31 | + | else throw("Incorrect random result") | |
32 | + | } | |
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | @Callable(e) | |
37 | + | func defineTheWinner (k) = { | |
38 | + | let j = getIntegerValue(this, "randomResult") | |
39 | + | if (isDefined(getInteger(a, ("winningTicket" + toString(j))))) | |
40 | + | then { | |
41 | + | let l = getIntegerValue(a, "ticketAmount") | |
42 | + | let m = if ((j == l)) | |
43 | + | then 1 | |
44 | + | else (j + 1) | |
45 | + | WriteSet([DataEntry("randomResult", m)]) | |
46 | + | } | |
47 | + | else { | |
48 | + | let n = parseIntValue(split(split(k, "To")[0], "ticketsFrom")[1]) | |
49 | + | let o = parseIntValue(split(k, "To")[1]) | |
50 | + | if (if ((j >= n)) | |
51 | + | then (o >= j) | |
52 | + | else false) | |
53 | + | then { | |
54 | + | let p = getStringValue(a, k) | |
55 | + | WriteSet([DataEntry("winnerTicket", j), DataEntry("winnerAddress", p)]) | |
56 | + | } | |
57 | + | else throw("these tickets didn't win") | |
58 | + | } | |
59 | + | } | |
60 | + | ||
61 | + | ||
62 | + | @Verifier(q) | |
63 | + | func r () = { | |
64 | + | let s = 1 | |
65 | + | let t = 1000000000000 | |
66 | + | let u = q | |
67 | + | if ($isInstanceOf(u, "LeaseTransaction")) | |
68 | + | then { | |
69 | + | let v = u | |
70 | + | if (if (if ((height > s)) | |
71 | + | then (t > height) | |
72 | + | else false) | |
73 | + | then isDefined(getString(this, "winnerAddress")) | |
74 | + | else false) | |
75 | + | then (v.recipient == addressFromString(getStringValue(this, "winnerAddress"))) | |
76 | + | else false | |
77 | + | } | |
78 | + | else if ($isInstanceOf(u, "LeaseCancelTransaction")) | |
79 | + | then { | |
80 | + | let w = u | |
81 | + | if ((height > t)) | |
82 | + | then sigVerify(q.bodyBytes, q.proofs[0], c) | |
83 | + | else false | |
84 | + | } | |
85 | + | else if ($isInstanceOf(u, "TransferTransaction")) | |
86 | + | then { | |
87 | + | let x = u | |
88 | + | if ((height > t)) | |
89 | + | then sigVerify(q.bodyBytes, q.proofs[0], c) | |
90 | + | else false | |
91 | + | } | |
92 | + | else sigVerify(q.bodyBytes, q.proofs[0], c) | |
93 | + | } | |
94 | + |
github/deemru/w8io/169f3d6 18.84 ms ◑