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