tx · HkrBMSFyxzoAeXXJgpo4Hx3yGb8RLMjzGsBtiXa7B7in

3MxL4UKxkpm6FSUnQkjtrVjbWNHvNViWWZ9:  -0.01400000 Waves

2019.08.02 10:40 [612934] smart account 3MxL4UKxkpm6FSUnQkjtrVjbWNHvNViWWZ9 > SELF 0.00000000 Waves

{ "type": 13, "id": "HkrBMSFyxzoAeXXJgpo4Hx3yGb8RLMjzGsBtiXa7B7in", "fee": 1400000, "feeAssetId": null, "timestamp": 1564731694717, "version": 1, "sender": "3MxL4UKxkpm6FSUnQkjtrVjbWNHvNViWWZ9", "senderPublicKey": "BqPySUvbKdRTRZ33nGTtrQRdus5qwhnQkqZ7G9iNcDto", "proofs": [ "4x3Qh5APrgKzyTymnREroRQqnG74vBurUy5oQTNBDdb1aZSa4qwNfQrQft2jd8JGQJswYCpDgs8RMH8BUaWpVKu6" ], "script": "base64:AAIDAAAAAAAAAAAAAAAKAAAAAA5hZG1pblB1YmxpY0tleQEAAAAgPH0OWoXiJ6xp9vlVyPXYZF0BaddziuTixRaOgt3JrF0AAAAABXdjdElkAQAAACC2krPtV7BZ501xydDc/m59JfhQiLCAw6wvux9SHsStvwAAAAAId3ZzUHJpY2UAAAAAAAX14QAAAAAACHdjdFByaWNlAAAAAAAAAABkAAAAAAhsYXN0Q2VsbAAAAAAAAAAAGAAAAAAIcm91bmRLZXkCAAAABXJvdW5kAAAAAAhjZWxsc0tleQIAAAAFY2VsbHMAAAAACmxhc3RXaW5LZXkCAAAAB2xhc3RXaW4AAAAADWxhc3RXaW5XY3RLZXkCAAAACmxhc3RXaW5XY3QAAAAADWxhc3RXaW5XdnNLZXkCAAAACmxhc3RXaW5XdnMAAAACAAAAAWkBAAAABmNyZWF0ZQAAAAEAAAALdGlja2V0QXNzZXQEAAAABWFJbmZvCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAPsAAAAAQUAAAALdGlja2V0QXNzZXQCAAAAI1RoZXJlIGlzIG5vIGFzc2V0IHdpdGgg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HJlc3MFAAAADXd2c0FkbWluU2hhcmUFAAAABHVuaXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAKd2luQWRkcmVzcwUAAAALd2N0V2luU2hhcmUFAAAABXdjdElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADGFkbWluQWRkcmVzcwUAAAANd2N0QWRtaW5TaGFyZQUAAAAFd2N0SWQFAAAAA25pbAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAAaQAAAABBQAAAARjZWxsCQABLAAAAAIJAAEsAAAAAgkABCUAAAABCAUAAAABaQAAAAZjYWxsZXICAAAAAV8JAAGkAAAAAQUAAAAFcm91bmQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACGNlbGxzS2V5CQAAZAAAAAIFAAAABWNlbGxzAAAAAAAAAAABBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABsZWslw=", "chainId": 84, "height": 612934, "spentComplexity": 0 } View: original | compacted Prev: none Next: 37oPufw9tKaTVnpZb6MSc1BbWF4CMFQvQ4HdXvnCx67W Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let a = base58'5584brtd1tLqMNJdCzvPFUEL1ujYRyi4Sy3zEZ5nTPsJ'
5+
6+let b = base58'DHgwrRvVyqJsepd32YbBqUeDH4GJ1N984X8QoekjgH8J'
7+
8+let c = 100000000
9+
10+let d = 100
11+
12+let e = 24
13+
14+let f = "round"
15+
16+let g = "cells"
17+
18+let h = "lastWin"
19+
20+let i = "lastWinWct"
21+
22+let j = "lastWinWvs"
23+
24+@Callable(k)
25+func create (l) = {
26+ let m = valueOrErrorMessage(assetInfo(l), "There is no asset with specified id")
27+ throw(toBase58String(m.id))
28+ }
29+
30+
31+
32+@Callable(k)
33+func buy (n) = {
34+ let o = extract(getInteger(this, f))
35+ let p = extract(getInteger(this, g))
36+ if (if ((0 > n))
37+ then true
38+ else (n > e))
39+ then throw("Invalid number")
40+ else {
41+ let q = valueOrErrorMessage(k.payment, "Where is payment?")
42+ let r = !(isDefined(q.assetId))
43+ let s = (q.assetId == b)
44+ if (if (if (if (!(s))
45+ then !(r)
46+ else false)
47+ then true
48+ else if (s)
49+ then (q.amount != d)
50+ else false)
51+ then true
52+ else if (r)
53+ then (q.amount != c)
54+ else false)
55+ then throw("Price is 1 WCT or 1 WAVES")
56+ else {
57+ let t = getString(this, toString(n))
58+ let u = if (isDefined(t))
59+ then {
60+ let v = split(extract(t), "_")[1]
61+ if ((v == toString(o)))
62+ then true
63+ else false
64+ }
65+ else false
66+ if (u)
67+ then throw("Already bought")
68+ else {
69+ let w = (p == e)
70+ if (w)
71+ then {
72+ let x = if (s)
73+ then 1
74+ else 0
75+ let y = if (r)
76+ then 1
77+ else 0
78+ let z = (assetBalance(this, b) + (q.amount * x))
79+ let A = (wavesBalance(this) + (q.amount * y))
80+ let B = (A / 100)
81+ let C = (A - B)
82+ let D = (z / 100)
83+ let E = (z - D)
84+ let F = addressFromPublicKey(a)
85+ let G = (toInt(lastBlock.generationSignature) % (e + 1))
86+ let H = extract(getString(this, toString(G)))
87+ let I = if ((G == n))
88+ then k.caller
89+ else extract(addressFromString(split(H, "_")[0]))
90+ ScriptResult(WriteSet([DataEntry(toString(n), ((toString(k.caller) + "_") + toString(o))), DataEntry(g, 0), DataEntry(f, (o + 1)), DataEntry(h, ((toString(G) + "_") + toString(I))), DataEntry(j, A), DataEntry(i, z)]), TransferSet([ScriptTransfer(I, C, unit), ScriptTransfer(F, B, unit), ScriptTransfer(I, E, b), ScriptTransfer(F, D, b)]))
91+ }
92+ else WriteSet([DataEntry(toString(n), ((toString(k.caller) + "_") + toString(o))), DataEntry(g, (p + 1))])
93+ }
94+ }
95+ }
96+ }
97+
98+
99+@Verifier(J)
100+func K () = true
101+

github/deemru/w8io/026f985 
18.08 ms