tx · CdmR5oiz4hYCEyux5WM6byAkSZGyy85d9kXxQ719LESF 3MuMCHDzoXq9BrPzNX4iojaMYsFQxmxrTMb: -0.01400000 Waves 2020.10.08 22:48 [1212031] smart account 3MuMCHDzoXq9BrPzNX4iojaMYsFQxmxrTMb > SELF 0.00000000 Waves
{ "type": 13, "id": "CdmR5oiz4hYCEyux5WM6byAkSZGyy85d9kXxQ719LESF", "fee": 1400000, "feeAssetId": null, "timestamp": 1602186540399, "version": 2, "chainId": 84, "sender": "3MuMCHDzoXq9BrPzNX4iojaMYsFQxmxrTMb", "senderPublicKey": "EbbyzjzjzBawBS9j3M4P7Gp4Dgn6PdqDHmYS1RQ6UbbU", "proofs": [ "27AfaDwP9TjW6QVmNHAXB7kk1UpvwmDWoFySYuj6FhmHsVvkZujibPuzSD1VAeA4GGQc8MLkZSQQpmbhEZeKzKX6" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAEAAAAAA9mcm9zdEJsb2NrQ291bnQAAAAAAAAAAGQAAAAAB3BlcmNlbnQAAAAAAAAAABQBAAAADGdldFN0YXRpc3RpYwAAAAAEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwIAAAAJc3RhdGlzdGljAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAADTBfMF8wXzBfMF8wXzABAAAAB2dldFVzZXIAAAABAAAABHVzZXIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAAEdXNlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAABcwXzBfMF8wXzBfMF8wXzBfMF8wXzBfMAAAAAIAAAABaQEAAAAHZGVwb3NpdAAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAA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AABmFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAEAAAAgHkxz8qzFYQy/gEmjfxlkGkg1N6RMNBT1/p4yXLb8QTIGIJw1Lw==", "height": 1212031, "applicationStatus": "succeeded", "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 = 100 | |
5 | + | ||
6 | + | let b = 20 | |
7 | + | ||
8 | + | func c () = { | |
9 | + | let d = getString(this, "statistic") | |
10 | + | if ($isInstanceOf(d, "String")) | |
11 | + | then { | |
12 | + | let e = d | |
13 | + | e | |
14 | + | } | |
15 | + | else "0_0_0_0_0_0_0" | |
16 | + | } | |
17 | + | ||
18 | + | ||
19 | + | func f (g) = { | |
20 | + | let d = getString(this, g) | |
21 | + | if ($isInstanceOf(d, "String")) | |
22 | + | then { | |
23 | + | let e = d | |
24 | + | e | |
25 | + | } | |
26 | + | else "0_0_0_0_0_0_0_0_0_0_0_0" | |
27 | + | } | |
28 | + | ||
29 | + | ||
30 | + | @Callable(h) | |
31 | + | func deposit () = { | |
32 | + | let i = extract(h.payment) | |
33 | + | if (isDefined(i.assetId)) | |
34 | + | then throw("can hodl waves only at the moment") | |
35 | + | else { | |
36 | + | let j = toBase58String(h.caller.bytes) | |
37 | + | if ((j == "3N2hHaqEEXjFHE5G8NTw6v7KNMwcHob2Ena")) | |
38 | + | then WriteSet([DataEntry("statistic", c())]) | |
39 | + | else { | |
40 | + | let k = split(c(), "_") | |
41 | + | let l = lastBlock.height | |
42 | + | let m = ((i.amount / 100) * (100 + b)) | |
43 | + | let g = split(f(j), "_") | |
44 | + | let n = parseIntValue(g[2]) | |
45 | + | WriteSet([DataEntry("statistic", ((((((((((((toString((parseIntValue(k[0]) + i.amount)) + "_") + toString((parseIntValue(k[1]) + 1))) + "_") + k[2]) + "_") + k[3]) + "_") + k[4]) + "_") + k[5]) + "_") + k[6])), DataEntry(j, ((((((((((((((((((((((toString((parseIntValue(g[0]) + i.amount)) + "_") + toString((parseIntValue(g[1]) + m))) + "_") + toString((n + m))) + "_") + toString(((n + m) / a))) + "_") + toString(l)) + "_") + g[5]) + "_") + g[6]) + "_") + g[7]) + "_") + g[8]) + "_") + g[9]) + "_") + g[10]) + "_") + g[11]))]) | |
46 | + | } | |
47 | + | } | |
48 | + | } | |
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | @Callable(h) | |
53 | + | func withdraw (o) = { | |
54 | + | let j = toBase58String(h.caller.bytes) | |
55 | + | let g = split(f(j), "_") | |
56 | + | let k = split(c(), "_") | |
57 | + | let p = parseIntValue(g[2]) | |
58 | + | let q = (p - o) | |
59 | + | let l = lastBlock.height | |
60 | + | let r = parseIntValue(g[1]) | |
61 | + | let s = (r + a) | |
62 | + | let t = (parseIntValue(g[2]) + o) | |
63 | + | let u = if ((l >= s)) | |
64 | + | then p | |
65 | + | else ((a - (s - l)) * (p / a)) | |
66 | + | if ((0 > o)) | |
67 | + | then throw("Can't withdraw negative amount") | |
68 | + | else if ((o > u)) | |
69 | + | then throw(("Max sum: " + toString(u))) | |
70 | + | else if ((0 > q)) | |
71 | + | then throw("Not enough balance") | |
72 | + | else ScriptResult(WriteSet([DataEntry("statistic", (((((((((k[0] + "_") + k[1]) + "_") + toString((parseIntValue(k[2]) + o))) + "_") + toString((parseIntValue(k[1]) + 1))) + "_") + k[4]) + k[5])), DataEntry(j, ((((((((((((((((((((((g[0] + "_") + g[1]) + "_") + toString(q)) + "_") + g[3]) + "_") + toString(l)) + "_") + toString((parseIntValue(g[5]) + o))) + "_") + toString((parseIntValue(g[6]) + o))) + "_") + g[7]) + "_") + g[8]) + "_") + g[9]) + "_") + g[10]) + "_") + g[11]))]), TransferSet([ScriptTransfer(h.caller, o, unit)])) | |
73 | + | } | |
74 | + | ||
75 | + | ||
76 | + | @Verifier(v) | |
77 | + | func w () = { | |
78 | + | let d = v | |
79 | + | if ($isInstanceOf(d, "SetScriptTransaction")) | |
80 | + | then { | |
81 | + | let x = d | |
82 | + | sigVerify(v.bodyBytes, v.proofs[0], base58'33Gr5uEJMDMKdRs25QUDvTeQ7q5EpGcAdPztrFvQWdv9') | |
83 | + | } | |
84 | + | else true | |
85 | + | } | |
86 | + |
github/deemru/w8io/169f3d6 19.24 ms ◑