tx · 6UaytaAqatP8mJLuMg1XZhDcTtryQAbZEiXbAANT5kBV

3N8rHcpcL8GstFYbE3Mrx8sSpB7XfZiae4X:  -0.01000000 Waves

2019.11.25 16:33 [780856] smart account 3N8rHcpcL8GstFYbE3Mrx8sSpB7XfZiae4X > SELF 0.00000000 Waves

{ "type": 13, "id": "6UaytaAqatP8mJLuMg1XZhDcTtryQAbZEiXbAANT5kBV", "fee": 1000000, "feeAssetId": null, "timestamp": 1574688909443, "version": 1, "sender": "3N8rHcpcL8GstFYbE3Mrx8sSpB7XfZiae4X", "senderPublicKey": "8oJVUSCNoYu2bBMgfucKMbp6zq3WVFckz8szCi5xrUgc", "proofs": [ "xkkUvKeyKdTjmDLDxNC5H57Wy2x2p5MRXXft4YgtoExhBrEUBzSNTw9Ephu6NaaiXhqz8rusMehQSKfKhJ8GVYj" ], "script": "base64:AAIDAAAAAAAAABAIARIDCgEIEgASAwoBCBIAAAAABAAAAAAQbG90dGVyeVRpY2tldEh1YgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVC+39ATLfj9WOsEULw1eayn3FgAYcG7bNQAAAAAMbG90dGVyeU93bmVyAgAAACMzTjhySGNwY0w4R3N0RlliRTNNcng4c1NwQjdYZlppYWU0WAAAAAALb3duZXJQdWJLZXkBAAAAIHPeTYB0wsJXl2G/5/wLNjtiWzCpL4zg9mGK36x3wucdAAAAABFkQXBwUmFuZG9tQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVFTgBTBlDW2NX5U+rtvuCzEEwtlJZ2tEoQAAAAQAAAAKY29udGV4dE9iagEAAAAXcmVnaXN0ZXJSYW5kb21SZXF1ZXN0VHgAAAABAAAAD3JhbmRvbVJlcXVlc3RUeAMJAQAAAAlpc0RlZmluZWQAAAABCQAEHQAAAAIFAAAABHRoaXMCAAAAD3JhbmRvbVJlcXVlc3RUeAkAAAIAAAABAgAAACdyYW5kb21SZXF1ZXN0VHggaXMgYWxyZWFkeSBpbiB0aGUgc3RhdGUD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AAABHRoaXMFAAAABHVuaXQFAAAABHVuaXQFAAAAA25pbAMDCQAAAAAAAAIIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAxsb3R0ZXJ5T3duZXIJAABmAAAAAgUAAAAGaGVpZ2h0CQAAZAAAAAIFAAAACXdpbkhlaWdodAUAAAAFbW9udGgHCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADG93bmVyQWRkcmVzcwkAA+sAAAACBQAAAAR0aGlzBQAAAAR1bml0BQAAAAR1bml0BQAAAANuaWwJAAACAAAAAQIAAAAceW91IGNhbid0IHdpdGhkcmF3IHRoZSBmdW5kcwAAAADAdZFi", "chainId": 84, "height": 780856, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let a = Address(base58'3MtGPuEE7F7KiERmknemXpaJNoFeYXAW2zG')
5+
6+let b = "3N8rHcpcL8GstFYbE3Mrx8sSpB7XfZiae4X"
7+
8+let c = base58'8oJVUSCNoYu2bBMgfucKMbp6zq3WVFckz8szCi5xrUgc'
9+
10+let d = Address(base58'3MweruEcWpkJfUFpshvfLRU1c87u4bXK5Qk')
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 loteryOwner 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+
63+@Callable(e)
64+func withdraw () = {
65+ let p = addressFromStringValue(getStringValue(this, "winnerAddress"))
66+ let q = getIntegerValue(this, "winHeight")
67+ let r = addressFromPublicKey(c)
68+ let s = 43200
69+ if (if ((e.caller == p))
70+ then ((q + s) >= height)
71+ else false)
72+ then TransferSet([ScriptTransfer(p, assetBalance(this, unit), unit)])
73+ else if (if ((e.caller == addressFromStringValue(b)))
74+ then (height > (q + s))
75+ else false)
76+ then TransferSet([ScriptTransfer(r, assetBalance(this, unit), unit)])
77+ else throw("you can't withdraw the funds")
78+ }
79+
80+

github/deemru/w8io/169f3d6 
21.53 ms