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+Dd8YUUEAAAAAWMJAQAAAAdleHRyYWN0AAA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0AAAAA0uIoGA==", "height": 2038636, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CQUjTXGdGLE3Q5CoX5saT2BnohQ8pDPLjEr6dPS3C1JP Next: 2ZACk6Q92aY5sDKH3xZk6VAey3o1ch3FFb2kFU1DtSgt Diff:
OldNewDifferences
55
66 @Callable(a)
77 func Stake () = {
8- let b = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5'
8+ let b = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS'
99 let c = extract(a.payment)
1010 if (if ((c.amount > 0))
1111 then (c.assetId == b)
3434
3535 @Callable(a)
3636 func WithdrawStakedFunds (l) = {
37- let b = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5'
38- let m = base58'DHZVHe6JzD61zTwH4ZnHnmo3w7oKGABXwgBt4S8KkzUP'
37+ let b = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS'
3938 let f = (toBase58String(a.caller.bytes) + "_UserLastStakeBlock")
4039 let d = (toBase58String(a.caller.bytes) + "_Staking")
41- let n = (1440 * 7)
42- let o = {
40+ let m = (1440 * 7)
41+ let n = {
4342 let h = getInteger(this, f)
4443 if ($isInstanceOf(h, "Int"))
4544 then {
4847 }
4948 else 0
5049 }
51- let p = toBase58String(a.caller.bytes)
52- let q = {
50+ let o = toBase58String(a.caller.bytes)
51+ let p = {
5352 let h = getInteger(this, d)
5453 if ($isInstanceOf(h, "Int"))
5554 then {
5857 }
5958 else 0
6059 }
61- let r = (q - l)
60+ let q = (p - l)
6261 if ((0 > l))
6362 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)))
6968 }
7069
7170
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
77 func Stake () = {
8- let b = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5'
8+ let b = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS'
99 let c = extract(a.payment)
1010 if (if ((c.amount > 0))
1111 then (c.assetId == b)
1212 else false)
1313 then {
1414 let d = (toBase58String(a.caller.bytes) + "_Stake")
1515 let e = (toBase58String(a.caller.bytes) + "_Earnings")
1616 let f = (toBase58String(a.caller.bytes) + "_UserLastStakeBlock")
1717 let g = {
1818 let h = getInteger(this, d)
1919 if ($isInstanceOf(h, "Int"))
2020 then {
2121 let i = h
2222 i
2323 }
2424 else 0
2525 }
2626 let j = (g + c.amount)
2727 let k = assetBalance(this, b)
2828 WriteSet([DataEntry(d, j), DataEntry(f, height)])
2929 }
3030 else throw("Can deposit only StakeToken")
3131 }
3232
3333
3434
3535 @Callable(a)
3636 func WithdrawStakedFunds (l) = {
37- let b = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5'
38- let m = base58'DHZVHe6JzD61zTwH4ZnHnmo3w7oKGABXwgBt4S8KkzUP'
37+ let b = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS'
3938 let f = (toBase58String(a.caller.bytes) + "_UserLastStakeBlock")
4039 let d = (toBase58String(a.caller.bytes) + "_Staking")
41- let n = (1440 * 7)
42- let o = {
40+ let m = (1440 * 7)
41+ let n = {
4342 let h = getInteger(this, f)
4443 if ($isInstanceOf(h, "Int"))
4544 then {
4645 let i = h
4746 i
4847 }
4948 else 0
5049 }
51- let p = toBase58String(a.caller.bytes)
52- let q = {
50+ let o = toBase58String(a.caller.bytes)
51+ let p = {
5352 let h = getInteger(this, d)
5453 if ($isInstanceOf(h, "Int"))
5554 then {
5655 let i = h
5756 i
5857 }
5958 else 0
6059 }
61- let r = (q - l)
60+ let q = (p - l)
6261 if ((0 > l))
6362 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)))
6968 }
7069
7170

github/deemru/w8io/026f985 
31.87 ms