tx · GzhR8NLsR8q5iyotfuQbrgSTYxzUSvSwWUMPVSvS1Dav

3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw:  -0.01000000 Waves

2022.05.05 19:36 [2038644] smart account 3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw > SELF 0.00000000 Waves

{ "type": 13, "id": "GzhR8NLsR8q5iyotfuQbrgSTYxzUSvSwWUMPVSvS1Dav", "fee": 1000000, "feeAssetId": null, "timestamp": 1651768615325, "version": 2, "chainId": 84, "sender": "3Mt4pmCGGRuWGuNy3pyyRij45rySapd44Mw", "senderPublicKey": "88pVWRX5DjU6wHFa5a8qeFQ3fuykBy1BXq7Z8pjdxhsc", "proofs": [ "3b9cppJQZcvjfswNwaoRuhr2o8vtpNGtA4rK96eq3L2CZVUtrpvroZPhj9zqBekfdYDzLg7C8ZJ7QhGCFQZLK5hk" ], "script": "base64:AAIDAAAAAAAAATsIARIAEgAaBgoBYRIBaRoQCgFiEgtTdGFrZWRUb2tlbhoICgFjEgNwbXQaFwoBZBISVXNlclN0YWtlZFRva2VuS2V5GhcKAWUSElVzZXJHb3Zlcm5Ub2tlbktleRoXCgFmEhJVc2VyTGFzdFN0YWtlQmxvY2saHQoBZxIYY3VycmVudEFtb3VudFN0YWtlZFRva2VuGgwKAWgSByRtYXRjaDAaBgoBaRIBYRoZCgFqEhRuZXdBbW91bnRTdGFrZWRUb2tlbhofCgFrEhpDb250cmFjdFdhbGxldFN0YWtlQmFsYW5jZRoQCgFsEgtBY3R1YWxEZWxheRocCgFtEhdVc2VyTGFzdFN0YWtlQmxvY2tWYWx1ZRoPCgFuEgpjdXJyZW50S2V5GhIKAW8SDWN1cnJlbnRBbW91bnQAAAAAAAAAAgAAAAFhAQAAAAVTdGFrZQAAAAAEAAAAAWIBAAAAIDuWMw0Cl6r3boWUBaO2GhLrBr0cYVyuuqg+TPg3fGFFBAAAAAFjCQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFhAAAAB3BheW1lbnQDAwkAA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AABbQQAAAABaAkABBoAAAACBQAAAAR0aGlzBQAAAAFmAwkAAAEAAAACBQAAAAFoAgAAAANJbnQEAAAAAWkFAAAAAWgFAAAAAWkAAAAAAAAAAAAEAAAAAW4JAAJYAAAAAQgIBQAAAAFhAAAABmNhbGxlcgAAAAVieXRlcwQAAAABbwQAAAABaAkABBoAAAACBQAAAAR0aGlzBQAAAAFkAwkAAAEAAAACBQAAAAFoAgAAAANJbnQEAAAAAWkFAAAAAWgFAAAAAWkAAAAAAAAAAAADCQAAZgAAAAIAAAAAAAAAAAAFAAAAAW8JAAACAAAAAQIAAAAeQ2FuJ3Qgd2l0aGRyYXcgbmVnYXRpdmUgYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAFvCQAAAgAAAAEJAAEsAAAAAgIAAABBVXNlciBjYW5ub3Qgd2l0aGRyYXcgbW9yZSB0aGFuIGRlcG9zaXRlZCBmdW5kcywgWW91ciBkZXBvc2l0IGlzOiAJAAGkAAAAAQkAAGkAAAACBQAAAAFvAAAAAAAF9eEAAwkAAGYAAAACCQAAZAAAAAIFAAAAAW0FAAAAAWwFAAAABmhlaWdodAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAAWQFAAAAAW8JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAAWYAAAAAAAAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABYQAAAAZjYWxsZXIFAAAAAW8FAAAAAWIFAAAAA25pbAkAAAIAAAABCQABLAAAAAICAAAAKkNhbm5vdCB1bnN0YWtlIGJlZm9yZSB0aGUgbWluaW11bSBwZXJpb2Q6IAkAAaQAAAABBQAAAAFsAAAAAMpmQvs=", "height": 2038644, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2ZACk6Q92aY5sDKH3xZk6VAey3o1ch3FFb2kFU1DtSgt Next: BvbpfFcnw5YHicUvSX7ruBWMYT5vc3cPbGuSkKEJ8Ueh Diff:
OldNewDifferences
3333 func WithdrawStakedFunds () = {
3434 let StakedToken = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS'
3535 let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock")
36- let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Staking")
36+ let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Stake")
3737 let ActualDelay = (1440 * 7)
3838 let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) {
3939 case a: Int =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func Stake () = {
88 let StakedToken = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS'
99 let pmt = extract(i.payment)
1010 if (if ((pmt.amount > 0))
1111 then (pmt.assetId == StakedToken)
1212 else false)
1313 then {
1414 let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Stake")
1515 let UserGovernTokenKey = (toBase58String(i.caller.bytes) + "_Earnings")
1616 let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock")
1717 let currentAmountStakedToken = match getInteger(this, UserStakedTokenKey) {
1818 case a: Int =>
1919 a
2020 case _ =>
2121 0
2222 }
2323 let newAmountStakedToken = (currentAmountStakedToken + pmt.amount)
2424 let ContractWalletStakeBalance = assetBalance(this, StakedToken)
2525 WriteSet([DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserLastStakeBlock, height)])
2626 }
2727 else throw("Can deposit only StakeToken")
2828 }
2929
3030
3131
3232 @Callable(i)
3333 func WithdrawStakedFunds () = {
3434 let StakedToken = base58'51bthK9ab3y4G4gj88qeoQ4XuYM2ex2hape7yc6QzAyS'
3535 let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock")
36- let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Staking")
36+ let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Stake")
3737 let ActualDelay = (1440 * 7)
3838 let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) {
3939 case a: Int =>
4040 a
4141 case _ =>
4242 0
4343 }
4444 let currentKey = toBase58String(i.caller.bytes)
4545 let currentAmount = match getInteger(this, UserStakedTokenKey) {
4646 case a: Int =>
4747 a
4848 case _ =>
4949 0
5050 }
5151 if ((0 > currentAmount))
5252 then throw("Can't withdraw negative amount")
5353 else if ((0 > currentAmount))
5454 then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString((currentAmount / 100000000))))
5555 else if (((UserLastStakeBlockValue + ActualDelay) > height))
5656 then ScriptResult(WriteSet([DataEntry(UserStakedTokenKey, currentAmount), DataEntry(UserLastStakeBlock, 0)]), TransferSet([ScriptTransfer(i.caller, currentAmount, StakedToken)]))
5757 else throw(("Cannot unstake before the minimum period: " + toString(ActualDelay)))
5858 }
5959
6060

github/deemru/w8io/169f3d6 
40.97 ms