tx · GxM4qFtDdinkoY1DQcQA2bp2Gb212wxVtwqKTnNBipyc

3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw:  -0.01000000 Waves

2022.06.04 18:09 [2081764] smart account 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw > SELF 0.00000000 Waves

{ "type": 13, "id": "GxM4qFtDdinkoY1DQcQA2bp2Gb212wxVtwqKTnNBipyc", "fee": 1000000, "feeAssetId": null, "timestamp": 1654355362227, "version": 2, "chainId": 84, "sender": "3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw", "senderPublicKey": "GTKqLSK6nuFkRdebB5SmTwTU2DnTeLMvhymCFfT2CxX2", "proofs": [ "aCqAj1eSLHtDcWFsR4iKdJubicdwzhaWU5TXAdFnbtzNXcGQnXcCdQoPLoe1kowbjSdWUYq8BeHVrSS4nhHd9oc" ], "script": "base64:AAIFAAAAAAAAAAgIAhIAEgASAAAAAAIAAAAABEJVc2QBAAAAIAu+yPsU61UT6w/UBobJ3Bln9DA/EA0rHMeXciw6ixXjAAAAAAhkQXBwRmVlcwEAAAAaAVSnJAa+rdQxXJacpl/yZdtSATGRaLbaMxIAAAADAAAAAWkBAAAABVJlc2V0AAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAABF9MaXEAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAxfTGFzdFVuc3Rha2UAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAtfdHJ4VW5zdGFrZQAAAAAAAAAAAAUAAAADbmlsAAAAAWkBAAAADERlcG9zaXR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AAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAABF9MaXEFAAAAC1VzZXJBY2NvdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAMX0xhc3RVbnN0YWtlBQAAAAZoZWlnaHQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA5XaXRoZHJhd0Ftb3VudAUAAAAEQlVzZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAlkQXBwRnJlZXMJAABoAAAAAgUAAAAHRmVlUGFpZAAAAAAABfXhAAUAAAAEQlVzZAUAAAADbmlsBQAAAARCVXNkAAAAAJOwBv4=", "height": 2081764, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4Z7mFoj75aoEXJUtJf5bc6M29zRCPeiofN17BWHPWyiA Next: DfsqqyYPWde1Er46gYZdjXSw4p6uy8HGMLxcvKftvMP6 Diff:
OldNewDifferences
4040 let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake")
4141 let trxUnstakeNum = (toBase58String(i.caller.bytes) + "_trxUnstake")
4242 let dAppFrees = Address(dAppFees)
43- let WaitTime = 10
4443 let FeePaid = 1
4544 let amount = match getInteger(this, UserLiquidity) {
4645 case a: Int =>
6261 }
6362 if ((amount == 0))
6463 then throw(("You do not have enough funds to withdraw, your available funds are: " + toString((amount / 100000000))))
65- else if (if ((trxUnstakeValue == 2))
66- then ((LastUnstakeBlockValue + WaitTime) > height)
67- else false)
68- then throw((("Second withdraw cannot be done before " + toString(((height - LastUnstakeBlockValue) - WaitTime))) + " min"))
69- else {
70- let PaidtrxValue = if ((trxUnstakeValue == 3))
71- then 0
72- else (trxUnstakeValue + 1)
73- let UserAccount = if ((trxUnstakeValue == 3))
74- then 0
75- else ((amount - (FeePaid * 100000000)) - (((PaidtrxValue * 25) * (amount - (FeePaid * 100000000))) / 100))
76- let WithdrawAmount = ((25 * amount) / 100)
77- $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), PaidtrxValue), IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_LastUnstake"), height), ScriptTransfer(i.caller, WithdrawAmount, BUsd), ScriptTransfer(dAppFrees, (FeePaid * 100000000), BUsd)], BUsd)
78- }
64+ else {
65+ let WaitTime = if ((trxUnstakeValue == 1))
66+ then 2
67+ else 10
68+ if (if ((trxUnstakeValue == 2))
69+ then ((LastUnstakeBlockValue + WaitTime) > height)
70+ else false)
71+ then throw((("Second withdraw cannot be done before " + toString(((height - LastUnstakeBlockValue) - WaitTime))) + " min"))
72+ else {
73+ let PaidtrxValue = if ((trxUnstakeValue == 3))
74+ then 0
75+ else (trxUnstakeValue + 1)
76+ let UserAccount = if ((trxUnstakeValue == 3))
77+ then 0
78+ else ((amount - (FeePaid * 100000000)) - (((PaidtrxValue * 25) * (amount - (FeePaid * 100000000))) / 100))
79+ let WithdrawAmount = ((25 * amount) / 100)
80+ $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), PaidtrxValue), IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_LastUnstake"), height), ScriptTransfer(i.caller, WithdrawAmount, BUsd), ScriptTransfer(dAppFrees, (FeePaid * 100000000), BUsd)], BUsd)
81+ }
82+ }
7983 }
8084
8185
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BUsd = base58'nrDXX1zHfGht7xExqNxDu7voCy9wzmc9vJxwcc2jLga'
55
66 let dAppFees = base58'3N59qn7Ndw24WrGFkNFk7PGTBCzdMETyKqj'
77
88 @Callable(i)
99 func Reset () = [IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), 0), IntegerEntry((toBase58String(i.caller.bytes) + "_LastUnstake"), 0), IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), 0)]
1010
1111
1212
1313 @Callable(i)
1414 func DepositFunds () = {
1515 let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq")
1616 let UserBalance = match getInteger(this, UserLiquidity) {
1717 case a: Int =>
1818 a
1919 case _ =>
2020 0
2121 }
2222 let pmt = if ((size(i.payments) == 1))
2323 then i.payments[0]
2424 else throw("Attached payment is required")
2525 if (if (((50 * 100000000) > pmt.amount))
2626 then true
2727 else (pmt.assetId != BUsd))
2828 then throw("Can only deposit BUsd tokens, and amount should be at least 50 BUsd")
2929 else {
3030 let NewBalance = (UserBalance + pmt.amount)
3131 [IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), NewBalance)]
3232 }
3333 }
3434
3535
3636
3737 @Callable(i)
3838 func WithdrawLiq () = {
3939 let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq")
4040 let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake")
4141 let trxUnstakeNum = (toBase58String(i.caller.bytes) + "_trxUnstake")
4242 let dAppFrees = Address(dAppFees)
43- let WaitTime = 10
4443 let FeePaid = 1
4544 let amount = match getInteger(this, UserLiquidity) {
4645 case a: Int =>
4746 a
4847 case _ =>
4948 0
5049 }
5150 let trxUnstakeValue = match getInteger(this, trxUnstakeNum) {
5251 case a: Int =>
5352 a
5453 case _ =>
5554 0
5655 }
5756 let LastUnstakeBlockValue = match getInteger(this, LastUnstakeBlock) {
5857 case a: Int =>
5958 a
6059 case _ =>
6160 0
6261 }
6362 if ((amount == 0))
6463 then throw(("You do not have enough funds to withdraw, your available funds are: " + toString((amount / 100000000))))
65- else if (if ((trxUnstakeValue == 2))
66- then ((LastUnstakeBlockValue + WaitTime) > height)
67- else false)
68- then throw((("Second withdraw cannot be done before " + toString(((height - LastUnstakeBlockValue) - WaitTime))) + " min"))
69- else {
70- let PaidtrxValue = if ((trxUnstakeValue == 3))
71- then 0
72- else (trxUnstakeValue + 1)
73- let UserAccount = if ((trxUnstakeValue == 3))
74- then 0
75- else ((amount - (FeePaid * 100000000)) - (((PaidtrxValue * 25) * (amount - (FeePaid * 100000000))) / 100))
76- let WithdrawAmount = ((25 * amount) / 100)
77- $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), PaidtrxValue), IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_LastUnstake"), height), ScriptTransfer(i.caller, WithdrawAmount, BUsd), ScriptTransfer(dAppFrees, (FeePaid * 100000000), BUsd)], BUsd)
78- }
64+ else {
65+ let WaitTime = if ((trxUnstakeValue == 1))
66+ then 2
67+ else 10
68+ if (if ((trxUnstakeValue == 2))
69+ then ((LastUnstakeBlockValue + WaitTime) > height)
70+ else false)
71+ then throw((("Second withdraw cannot be done before " + toString(((height - LastUnstakeBlockValue) - WaitTime))) + " min"))
72+ else {
73+ let PaidtrxValue = if ((trxUnstakeValue == 3))
74+ then 0
75+ else (trxUnstakeValue + 1)
76+ let UserAccount = if ((trxUnstakeValue == 3))
77+ then 0
78+ else ((amount - (FeePaid * 100000000)) - (((PaidtrxValue * 25) * (amount - (FeePaid * 100000000))) / 100))
79+ let WithdrawAmount = ((25 * amount) / 100)
80+ $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), PaidtrxValue), IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_LastUnstake"), height), ScriptTransfer(i.caller, WithdrawAmount, BUsd), ScriptTransfer(dAppFrees, (FeePaid * 100000000), BUsd)], BUsd)
81+ }
82+ }
7983 }
8084
8185

github/deemru/w8io/169f3d6 
48.27 ms