tx · 2qhDo49dzg19cZ5LQnmZoACCCb5uKZSb9yKEorEK6B1z 3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY: -0.01400000 Waves 2020.10.06 19:00 [1208916] smart account 3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY > SELF 0.00000000 Waves
{ "type": 13, "id": "2qhDo49dzg19cZ5LQnmZoACCCb5uKZSb9yKEorEK6B1z", "fee": 1400000, "feeAssetId": null, "timestamp": 1602000112051, "version": 2, "chainId": 84, "sender": "3N8XBzcbxt5snTdkqVSobDjtDGbTns27DdY", "senderPublicKey": "HhWoKsFPjXVx9nYfPydpV9BwLmuUdJyJ8ydtyVJVxg9Z", "proofs": [ "kUoHtayTLtnanQ3QR7KAFym3VDphg82qFx84Q5cJPCcxzvwW3g1sfgzn9vAhYAyU1iSmZLRoZbEtQzB7aN4arww" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAAAAAAAAgAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQEAAAAC2Jsb2NrSGVpZ2h0CAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAhY2FuIGhvZGwgd2F2ZXMgb25seSBhdCB0aGUgbW9tZW50BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCQAEHQAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAGkAAAAAQkAAGgAAAACCQAAaQAAAAIIBQAAAANwbXQAAAAGYW1vdW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AX14QACAAAABiBXYXZlcwMJAABmAAAAAgAAAAAAAAAAAAUAAAAJbmV3QW1vdW50CQAAAgAAAAECAAAAEk5vdCBlbm91Z2ggYmFsYW5jZQkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAGkAAAAAQUAAAAJbmV3QW1vdW50AgAAAAFfCQABkQAAAAIFAAAAB29sZERhdGEAAAAAAAAAAAECAAAAAV8JAAGkAAAAAQUAAAALc3VtV2l0aGRyYXcCAAAAAV8JAAGkAAAAAQkAAGUAAAACBQAAAA9mcm9zdEJsb2NrQ291bnQJAABpAAAAAgUAAAAJb2xkQW1vdW50BQAAAA9mcm9zdEJsb2NrQ291bnQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABmFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAALHChZs=", "height": 1208916, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: vfpVJzSW6LTNcAjiV9e4dQqrqqbK1Wjihs2KJbreLDe Next: FxvC6nSm2dhvMcRt6EE7SJX1y5sxrhwi2aDW3EaXgxaK Diff:
Old | New | Differences | |
---|---|---|---|
54 | 54 | let o = (parseIntValue(e[2]) + j) | |
55 | 55 | let p = if ((c >= n)) | |
56 | 56 | then k | |
57 | - | else ((n - c) * (k / i)) | |
57 | + | else ((n - c) * (i - (k / i))) | |
58 | 58 | if ((0 > j)) | |
59 | 59 | then throw("Can't withdraw negative amount") | |
60 | 60 | else if ((j > p)) | |
61 | 61 | then throw((("Max sum: " + toString((p / 100000000))) + " Waves")) | |
62 | 62 | else if ((0 > l)) | |
63 | 63 | then throw("Not enough balance") | |
64 | - | else ScriptResult(WriteSet([DataEntry(d, ((((((toString(l) + "_") + e[1]) + "_") + toString(o)) + "_") + toString(( | |
64 | + | else ScriptResult(WriteSet([DataEntry(d, ((((((toString(l) + "_") + e[1]) + "_") + toString(o)) + "_") + toString((i - (k / i)))))]), TransferSet([ScriptTransfer(a.caller, j, unit)])) | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | 7 | func deposit () = { | |
8 | 8 | let b = extract(a.payment) | |
9 | 9 | let c = lastBlock.height | |
10 | 10 | if (isDefined(b.assetId)) | |
11 | 11 | then throw("can hodl waves only at the moment") | |
12 | 12 | else { | |
13 | 13 | let d = toBase58String(a.caller.bytes) | |
14 | 14 | if (!(isDefined(getString(this, d)))) | |
15 | 15 | then WriteSet([DataEntry(d, (((toString(((b.amount / 100) * 120)) + "_") + toString(c)) + "_0"))]) | |
16 | 16 | else { | |
17 | 17 | let e = split({ | |
18 | 18 | let f = getString(this, d) | |
19 | 19 | if ($isInstanceOf(f, "String")) | |
20 | 20 | then { | |
21 | 21 | let g = f | |
22 | 22 | g | |
23 | 23 | } | |
24 | 24 | else throw("error") | |
25 | 25 | }, "_") | |
26 | 26 | let h = parseIntValue(e[0]) | |
27 | 27 | WriteSet([DataEntry(d, ((((toString((h + ((b.amount / 100) * 120))) + "_") + toString(c)) + "_") + e[2]))]) | |
28 | 28 | } | |
29 | 29 | } | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(a) | |
35 | 35 | func withdraw () = { | |
36 | 36 | let i = 100 | |
37 | 37 | let b = extract(a.payment) | |
38 | 38 | let j = b.amount | |
39 | 39 | let d = toBase58String(a.caller.bytes) | |
40 | 40 | let e = split({ | |
41 | 41 | let f = getString(this, d) | |
42 | 42 | if ($isInstanceOf(f, "String")) | |
43 | 43 | then { | |
44 | 44 | let g = f | |
45 | 45 | g | |
46 | 46 | } | |
47 | 47 | else throw("error") | |
48 | 48 | }, "_") | |
49 | 49 | let k = parseIntValue(e[0]) | |
50 | 50 | let l = (k - j) | |
51 | 51 | let c = lastBlock.height | |
52 | 52 | let m = parseIntValue(e[1]) | |
53 | 53 | let n = (m + i) | |
54 | 54 | let o = (parseIntValue(e[2]) + j) | |
55 | 55 | let p = if ((c >= n)) | |
56 | 56 | then k | |
57 | - | else ((n - c) * (k / i)) | |
57 | + | else ((n - c) * (i - (k / i))) | |
58 | 58 | if ((0 > j)) | |
59 | 59 | then throw("Can't withdraw negative amount") | |
60 | 60 | else if ((j > p)) | |
61 | 61 | then throw((("Max sum: " + toString((p / 100000000))) + " Waves")) | |
62 | 62 | else if ((0 > l)) | |
63 | 63 | then throw("Not enough balance") | |
64 | - | else ScriptResult(WriteSet([DataEntry(d, ((((((toString(l) + "_") + e[1]) + "_") + toString(o)) + "_") + toString(( | |
64 | + | else ScriptResult(WriteSet([DataEntry(d, ((((((toString(l) + "_") + e[1]) + "_") + toString(o)) + "_") + toString((i - (k / i)))))]), TransferSet([ScriptTransfer(a.caller, j, unit)])) | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 |
github/deemru/w8io/169f3d6 36.48 ms ◑