tx · BvbpfFcnw5YHicUvSX7ruBWMYT5vc3cPbGuSkKEJ8Ueh 3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw: -0.01000000 Waves 2022.05.05 19:39 [2038647] smart account 3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw > SELF 0.00000000 Waves
{ "type": 13, "id": "BvbpfFcnw5YHicUvSX7ruBWMYT5vc3cPbGuSkKEJ8Ueh", "fee": 1000000, "feeAssetId": null, "timestamp": 1651768782474, "version": 2, "chainId": 84, "sender": "3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw", "senderPublicKey": "88pVWRX5DjU6wHFa5a8qeFQ3fuykBy1BXq7Z8pjdxhsc", "proofs": [ "3sP6x4257hnfR5cWEDJV7ZauRCPgyQm3ByGWg7sedQDk2znoYavPXj9cifJKopKj8noGgEMSDQHoi4D4cnxc6Nsk" ], "script": "base64:AAIDAAAAAAAAATsIARIAEgAaBgoBYRIBaRoQCgFiEgtTdGFrZWRUb2tlbhoICgFjEgNwbXQaFwoBZBISVXNlclN0YWtlZFRva2VuS2V5GhcKAWUSElVzZXJHb3Zlcm5Ub2tlbktleRoXCgFmEhJVc2VyTGFzdFN0YWtlQmxvY2saHQoBZxIYY3VycmVudEFtb3VudFN0YWtlZFRva2VuGgwKAWgSByRtYXRjaDAaBgoBaRIBYRoZCgFqEhRuZXdBbW91bnRTdGFrZWRUb2tlbhofCgFrEhpDb250cmFjdFdhbGxldFN0YWtlQmFsYW5jZRoQCgFsEgtBY3R1YWxEZWxheRocCgFtEhdVc2VyTGFzdFN0YWtlQmxvY2tWYWx1ZRoPCgFuEgpjdXJyZW50S2V5GhIKAW8SDWN1cnJlbnRBbW91bnQAAAAAAAAAAgAAAAFhAQAAAAVTdGFrZQAAAAAEAAAAAWIBAAAAIDuWMw0Cl6r3boWUBaO2GhLrBr0cYVyuuqg+TPg3fGFFBAAAAAFjCQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFhAAAAB3BheW1lbnQDAwkAAG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AABbQQAAAABaAkABBoAAAACBQAAAAR0aGlzBQAAAAFmAwkAAAEAAAACBQAAAAFoAgAAAANJbnQEAAAAAWkFAAAAAWgFAAAAAWkAAAAAAAAAAAAEAAAAAW4JAAJYAAAAAQgIBQAAAAFhAAAABmNhbGxlcgAAAAVieXRlcwQAAAABbwQAAAABaAkABBoAAAACBQAAAAR0aGlzBQAAAAFkAwkAAAEAAAACBQAAAAFoAgAAAANJbnQEAAAAAWkFAAAAAWgFAAAAAWkAAAAAAAAAAAADCQAAZgAAAAIAAAAAAAAAAAAFAAAAAW8JAAACAAAAAQIAAAAeQ2FuJ3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAFvCQAAAgAAAAEJAAEsAAAAAgIAAABBVXNlciBjYW5ub3Qgd2l0aGRyYXcgbW9yZSB0aGFuIGRlcG9zaXRlZCBmdW5kcywgWW91ciBkZXBvc2l0IGlzOiAJAAGkAAAAAQkAAGkAAAACBQAAAAFvAAAAAAAF9eEAAwkAAGYAAAACCQAAZAAAAAIFAAAAAW0FAAAAAWwFAAAABmhlaWdodAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAAWQFAAAAAW8JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAAWYAAAAAAAAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABYQAAAAZjYWxsZXIFAAAAAW8FAAAAAWIFAAAAA25pbAkAAAIAAAABCQABLAAAAAICAAAAKkNhbm5vdCB1bnN0YWtlIGJlZm9yZSB0aGUgbWluaW11bSBwZXJpb2Q6IAkAAaQAAAABBQAAAAFsAAAAAKw9CGY=", "height": 2038647, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GzhR8NLsR8q5iyotfuQbrgSTYxzUSvSwWUMPVSvS1Dav Next: 2gXdP1dpBJrBLYWHv8eDX8Gtpi1nw6z3ByXb4Wz2tPzL Diff:
Old | New | Differences | |
---|---|---|---|
37 | 37 | let b = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS' | |
38 | 38 | let f = (toBase58String(a.caller.bytes) + "_UserLastStakeBlock") | |
39 | 39 | let d = (toBase58String(a.caller.bytes) + "_Stake") | |
40 | - | let l = (1440 * | |
40 | + | let l = (1440 * 1) | |
41 | 41 | let m = { | |
42 | 42 | let h = getInteger(this, f) | |
43 | 43 | if ($isInstanceOf(h, "Int")) |
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 Stake () = { | |
8 | 8 | let b = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS' | |
9 | 9 | let c = extract(a.payment) | |
10 | 10 | if (if ((c.amount > 0)) | |
11 | 11 | then (c.assetId == b) | |
12 | 12 | else false) | |
13 | 13 | then { | |
14 | 14 | let d = (toBase58String(a.caller.bytes) + "_Stake") | |
15 | 15 | let e = (toBase58String(a.caller.bytes) + "_Earnings") | |
16 | 16 | let f = (toBase58String(a.caller.bytes) + "_UserLastStakeBlock") | |
17 | 17 | let g = { | |
18 | 18 | let h = getInteger(this, d) | |
19 | 19 | if ($isInstanceOf(h, "Int")) | |
20 | 20 | then { | |
21 | 21 | let i = h | |
22 | 22 | i | |
23 | 23 | } | |
24 | 24 | else 0 | |
25 | 25 | } | |
26 | 26 | let j = (g + c.amount) | |
27 | 27 | let k = assetBalance(this, b) | |
28 | 28 | WriteSet([DataEntry(d, j), DataEntry(f, height)]) | |
29 | 29 | } | |
30 | 30 | else throw("Can deposit only StakeToken") | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(a) | |
36 | 36 | func WithdrawStakedFunds () = { | |
37 | 37 | let b = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS' | |
38 | 38 | let f = (toBase58String(a.caller.bytes) + "_UserLastStakeBlock") | |
39 | 39 | let d = (toBase58String(a.caller.bytes) + "_Stake") | |
40 | - | let l = (1440 * | |
40 | + | let l = (1440 * 1) | |
41 | 41 | let m = { | |
42 | 42 | let h = getInteger(this, f) | |
43 | 43 | if ($isInstanceOf(h, "Int")) | |
44 | 44 | then { | |
45 | 45 | let i = h | |
46 | 46 | i | |
47 | 47 | } | |
48 | 48 | else 0 | |
49 | 49 | } | |
50 | 50 | let n = toBase58String(a.caller.bytes) | |
51 | 51 | let o = { | |
52 | 52 | let h = getInteger(this, d) | |
53 | 53 | if ($isInstanceOf(h, "Int")) | |
54 | 54 | then { | |
55 | 55 | let i = h | |
56 | 56 | i | |
57 | 57 | } | |
58 | 58 | else 0 | |
59 | 59 | } | |
60 | 60 | if ((0 > o)) | |
61 | 61 | then throw("Can't withdraw negative amount") | |
62 | 62 | else if ((0 > o)) | |
63 | 63 | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString((o / 100000000)))) | |
64 | 64 | else if (((m + l) > height)) | |
65 | 65 | then ScriptResult(WriteSet([DataEntry(d, o), DataEntry(f, 0)]), TransferSet([ScriptTransfer(a.caller, o, b)])) | |
66 | 66 | else throw(("Cannot unstake before the minimum period: " + toString(l))) | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 |
github/deemru/w8io/169f3d6 33.76 ms ◑