tx · AqxJ4u6KLXSx265bKFU6AJBpH8Ab8ZiEFZpxQeRL86UL
3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw: -0.01000000 Waves
2022.05.05 19:29 [2038636] smart account 3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw > SELF 0.00000000 Waves
{
"type": 13,
"id": "AqxJ4u6KLXSx265bKFU6AJBpH8Ab8ZiEFZpxQeRL86UL",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1651768176591,
"version": 2,
"chainId": 84,
"sender": "3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw",
"senderPublicKey": "88pVWRX5DjU6wHFa5a8qeFQ3fuykBy1BXq7Z8pjdxhsc",
"proofs": [
"5BeCKbBqLU9YAmPXTqbdS4hbQybxWsAbh7476hPk2T2huj5wSXkHKhHVjViw7zqmVdivxwJm4MzK9qjx7vsmhrEq"
],
"script": "base64:AAIDAAAAAAAAAVsIARIAEgMKAQEaBgoBYRIBaRoQCgFiEgtTdGFrZWRUb2tlbhoICgFjEgNwbXQaFwoBZBISVXNlclN0YWtlZFRva2VuS2V5GhcKAWUSElVzZXJHb3Zlcm5Ub2tlbktleRoXCgFmEhJVc2VyTGFzdFN0YWtlQmxvY2saHQoBZxIYY3VycmVudEFtb3VudFN0YWtlZFRva2VuGgwKAWgSByRtYXRjaDAaBgoBaRIBYRoZCgFqEhRuZXdBbW91bnRTdGFrZWRUb2tlbhofCgFrEhpDb250cmFjdFdhbGxldFN0YWtlQmFsYW5jZRoLCgFsEgZhbW91bnQaEAoBbRILQWN0dWFsRGVsYXkaHAoBbhIXVXNlckxhc3RTdGFrZUJsb2NrVmFsdWUaDwoBbxIKY3VycmVudEtleRoSCgFwEg1jdXJyZW50QW1vdW50Gg4KAXESCW5ld0Ftb3VudAAAAAAAAAACAAAAAWEBAAAABVN0YWtlAAAAAAQAAAABYgEAAAAgO5YzDQKXqvduhZQFo7YaEusGvRxhXK66qD5M+Dd8YUUEAAAAAWMJAQAAAAdleH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AEFAAAAAW0AAAAA0uIoGA==",
"height": 2038636,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: CQUjTXGdGLE3Q5CoX5saT2BnohQ8pDPLjEr6dPS3C1JP
Next: 2ZACk6Q92aY5sDKH3xZk6VAey3o1ch3FFb2kFU1DtSgt
Diff:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(a) |
---|
7 | 7 | | func Stake () = { |
---|
8 | | - | let b = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5' |
---|
| 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) |
---|
|
34 | 34 | | |
---|
35 | 35 | | @Callable(a) |
---|
36 | 36 | | func WithdrawStakedFunds (l) = { |
---|
37 | | - | let b = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5' |
---|
38 | | - | let m = base58'DHZVHe6JzD61zTwH4ZnHnmo3w7oKGABXwgBt4S8KkzUP' |
---|
| 37 | + | let b = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS' |
---|
39 | 38 | | let f = (toBase58String(a.caller.bytes) + "_UserLastStakeBlock") |
---|
40 | 39 | | let d = (toBase58String(a.caller.bytes) + "_Staking") |
---|
41 | | - | let n = (1440 * 7) |
---|
42 | | - | let o = { |
---|
| 40 | + | let m = (1440 * 7) |
---|
| 41 | + | let n = { |
---|
43 | 42 | | let h = getInteger(this, f) |
---|
44 | 43 | | if ($isInstanceOf(h, "Int")) |
---|
45 | 44 | | then { |
---|
|
48 | 47 | | } |
---|
49 | 48 | | else 0 |
---|
50 | 49 | | } |
---|
51 | | - | let p = toBase58String(a.caller.bytes) |
---|
52 | | - | let q = { |
---|
| 50 | + | let o = toBase58String(a.caller.bytes) |
---|
| 51 | + | let p = { |
---|
53 | 52 | | let h = getInteger(this, d) |
---|
54 | 53 | | if ($isInstanceOf(h, "Int")) |
---|
55 | 54 | | then { |
---|
|
58 | 57 | | } |
---|
59 | 58 | | else 0 |
---|
60 | 59 | | } |
---|
61 | | - | let r = (q - l) |
---|
| 60 | + | let q = (p - l) |
---|
62 | 61 | | if ((0 > l)) |
---|
63 | 62 | | then throw("Can't withdraw negative amount") |
---|
64 | | - | else if ((0 > r)) |
---|
65 | | - | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString((q / 100000000)))) |
---|
66 | | - | else if (((o + n) > height)) |
---|
67 | | - | then ScriptResult(WriteSet([DataEntry(d, r), DataEntry(f, 0)]), TransferSet([ScriptTransfer(a.caller, l, b)])) |
---|
68 | | - | else throw(("Cannot unstake before the minimum period: " + toString(n))) |
---|
| 63 | + | else if ((0 > q)) |
---|
| 64 | + | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString((p / 100000000)))) |
---|
| 65 | + | else if (((n + m) > height)) |
---|
| 66 | + | then ScriptResult(WriteSet([DataEntry(d, q), DataEntry(f, 0)]), TransferSet([ScriptTransfer(a.caller, l, b)])) |
---|
| 67 | + | else throw(("Cannot unstake before the minimum period: " + toString(m))) |
---|
69 | 68 | | } |
---|
70 | 69 | | |
---|
71 | 70 | | |
---|
Full:
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 | | - | let b = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5' |
---|
| 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 (l) = { |
---|
37 | | - | let b = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5' |
---|
38 | | - | let m = base58'DHZVHe6JzD61zTwH4ZnHnmo3w7oKGABXwgBt4S8KkzUP' |
---|
| 37 | + | let b = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS' |
---|
39 | 38 | | let f = (toBase58String(a.caller.bytes) + "_UserLastStakeBlock") |
---|
40 | 39 | | let d = (toBase58String(a.caller.bytes) + "_Staking") |
---|
41 | | - | let n = (1440 * 7) |
---|
42 | | - | let o = { |
---|
| 40 | + | let m = (1440 * 7) |
---|
| 41 | + | let n = { |
---|
43 | 42 | | let h = getInteger(this, f) |
---|
44 | 43 | | if ($isInstanceOf(h, "Int")) |
---|
45 | 44 | | then { |
---|
46 | 45 | | let i = h |
---|
47 | 46 | | i |
---|
48 | 47 | | } |
---|
49 | 48 | | else 0 |
---|
50 | 49 | | } |
---|
51 | | - | let p = toBase58String(a.caller.bytes) |
---|
52 | | - | let q = { |
---|
| 50 | + | let o = toBase58String(a.caller.bytes) |
---|
| 51 | + | let p = { |
---|
53 | 52 | | let h = getInteger(this, d) |
---|
54 | 53 | | if ($isInstanceOf(h, "Int")) |
---|
55 | 54 | | then { |
---|
56 | 55 | | let i = h |
---|
57 | 56 | | i |
---|
58 | 57 | | } |
---|
59 | 58 | | else 0 |
---|
60 | 59 | | } |
---|
61 | | - | let r = (q - l) |
---|
| 60 | + | let q = (p - l) |
---|
62 | 61 | | if ((0 > l)) |
---|
63 | 62 | | then throw("Can't withdraw negative amount") |
---|
64 | | - | else if ((0 > r)) |
---|
65 | | - | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString((q / 100000000)))) |
---|
66 | | - | else if (((o + n) > height)) |
---|
67 | | - | then ScriptResult(WriteSet([DataEntry(d, r), DataEntry(f, 0)]), TransferSet([ScriptTransfer(a.caller, l, b)])) |
---|
68 | | - | else throw(("Cannot unstake before the minimum period: " + toString(n))) |
---|
| 63 | + | else if ((0 > q)) |
---|
| 64 | + | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString((p / 100000000)))) |
---|
| 65 | + | else if (((n + m) > height)) |
---|
| 66 | + | then ScriptResult(WriteSet([DataEntry(d, q), DataEntry(f, 0)]), TransferSet([ScriptTransfer(a.caller, l, b)])) |
---|
| 67 | + | else throw(("Cannot unstake before the minimum period: " + toString(m))) |
---|
69 | 68 | | } |
---|
70 | 69 | | |
---|
71 | 70 | | |
---|