tx · CQUjTXGdGLE3Q5CoX5saT2BnohQ8pDPLjEr6dPS3C1JP

3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw:  -0.01000000 Waves

2022.05.05 19:26 [2038634] smart account 3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw > SELF 0.00000000 Waves

{ "type": 13, "id": "CQUjTXGdGLE3Q5CoX5saT2BnohQ8pDPLjEr6dPS3C1JP", "fee": 1000000, "feeAssetId": null, "timestamp": 1651768028737, "version": 2, "chainId": 84, "sender": "3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw", "senderPublicKey": "88pVWRX5DjU6wHFa5a8qeFQ3fuykBy1BXq7Z8pjdxhsc", "proofs": [ "5eCUwUaY8zdERX3B5g1i4HJEe6soESAucb1Ex4kGv4eAifa57Xj2abDx6wjQ2VDQnHU3533BhepffqYeNvQnYikz" ], "script": "base64:AAIDAAAAAAAAAW0IARIAEgMKAQEaBgoBYRIBaRoQCgFiEgtTdGFrZWRUb2tlbhoICgFjEgNwbXQaFwoBZBISVXNlclN0YWtlZFRva2VuS2V5GhcKAWUSElVzZXJHb3Zlcm5Ub2tlbktleRoXCgFmEhJVc2VyTGFzdFN0YWtlQmxvY2saHQoBZxIYY3VycmVudEFtb3VudFN0YWtlZFRva2VuGgwKAWgSByRtYXRjaDAaBgoBaRIBYRoZCgFqEhRuZXdBbW91bnRTdGFrZWRUb2tlbhofCgFrEhpDb250cmFjdFdhbGxldFN0YWtlQmFsYW5jZRoLCgFsEgZhbW91bnQaEAoBbRILR292ZXJuVG9rZW4aEAoBbhILQWN0dWFsRGVsYXkaHAoBbxIXVXNlckxhc3RTdGFrZUJsb2NrVmFsdWUaDwoBcBIKY3VycmVudEtleRoSCgFxEg1jdXJyZW50QW1vdW50Gg4KAXISCW5ld0Ftb3VudAAAAAAAAAACAAAAAWEBAAAABVN0YWtlAAAAAAQAAAABYgEAAAAgyfO3KK1nQRdNMgY1dCxkhGzviOKkmyfHFOqpH9CNn1QEAAAAAW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KkNhbm5vdCB1bnN0YWtlIGJlZm9yZSB0aGUgbWluaW11bSBwZXJpb2Q6IAkAAaQAAAABBQAAAAFuAAAAAAuE/M0=", "height": 2038634, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HqT9QEtSzMynCex3KKRjUCjRbvkXzWdk7oVzNHZRhLB Next: AqxJ4u6KLXSx265bKFU6AJBpH8Ab8ZiEFZpxQeRL86UL Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
7-func StoreMydAppData (b,c) = [StringEntry("MyStrData", b), IntegerEntry("MyIntData", c)]
7+func Stake () = {
8+ let b = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5'
9+ let c = extract(a.payment)
10+ if (if ((c.amount > 0))
11+ then (c.assetId == b)
12+ else false)
13+ then {
14+ let d = (toBase58String(a.caller.bytes) + "_Stake")
15+ let e = (toBase58String(a.caller.bytes) + "_Earnings")
16+ let f = (toBase58String(a.caller.bytes) + "_UserLastStakeBlock")
17+ let g = {
18+ let h = getInteger(this, d)
19+ if ($isInstanceOf(h, "Int"))
20+ then {
21+ let i = h
22+ i
23+ }
24+ else 0
25+ }
26+ let j = (g + c.amount)
27+ let k = assetBalance(this, b)
28+ WriteSet([DataEntry(d, j), DataEntry(f, height)])
29+ }
30+ else throw("Can deposit only StakeToken")
31+ }
32+
33+
34+
35+@Callable(a)
36+func WithdrawStakedFunds (l) = {
37+ let b = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5'
38+ let m = base58'DHZVHe6JzD61zTwH4ZnHnmo3w7oKGABXwgBt4S8KkzUP'
39+ let f = (toBase58String(a.caller.bytes) + "_UserLastStakeBlock")
40+ let d = (toBase58String(a.caller.bytes) + "_Staking")
41+ let n = (1440 * 7)
42+ let o = {
43+ let h = getInteger(this, f)
44+ if ($isInstanceOf(h, "Int"))
45+ then {
46+ let i = h
47+ i
48+ }
49+ else 0
50+ }
51+ let p = toBase58String(a.caller.bytes)
52+ let q = {
53+ let h = getInteger(this, d)
54+ if ($isInstanceOf(h, "Int"))
55+ then {
56+ let i = h
57+ i
58+ }
59+ else 0
60+ }
61+ let r = (q - l)
62+ if ((0 > l))
63+ 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)))
69+ }
870
971

github/deemru/w8io/026f985 
28.08 ms