tx · DBmJ2rBnCuidPkxuRaHXTMvavz2NNi5bA15F5H2QhGME

3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw:  -0.01000000 Waves

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

{ "type": 13, "id": "DBmJ2rBnCuidPkxuRaHXTMvavz2NNi5bA15F5H2QhGME", "fee": 1000000, "feeAssetId": null, "timestamp": 1654355899242, "version": 2, "chainId": 84, "sender": "3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw", "senderPublicKey": "GTKqLSK6nuFkRdebB5SmTwTU2DnTeLMvhymCFfT2CxX2", "proofs": [ "63JsnnVJfJDMqgJkquuyEeZN9WT7DU3Nk2GX2ewhciCQQktmEG8EkwabGgC6fbVpyTowEsT6j35edzwudEYHAuCo" ], "script": "base64:AAIFAAAAAAAAAAgIAhIAEgASAAAAAAIAAAAABEJVc2QBAAAAIAu+yPsU61UT6w/UBobJ3Bln9DA/EA0rHMeXciw6ixXjAAAAAAhkQXBwRmVlcwEAAAAaAVSnJAa+rdQxXJacpl/yZdtSATGRaLbaMxIAAAADAAAAAWkBAAAABVJlc2V0AAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAABF9MaXEAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAxfTGFzdFVuc3Rha2UAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAtfdHJ4VW5zdGFrZQAAAAAAAAAAAAUAAAADbmlsAAAAAWkBAAAADERlcG9zaXRGdW5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yeFZhbHVlAAAAAAAAAAAZCQAAZQAAAAIFAAAABmFtb3VudAkAAGgAAAACBQAAAAdGZWVQYWlkAAAAAAAF9eEAAAAAAAAAAABkBAAAAA5XaXRoZHJhd0Ftb3VudAkAAGkAAAACCQAAaAAAAAIAAAAAAAAAABkFAAAABmFtb3VudAAAAAAAAAAAZAkABRQAAAACCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAALX3RyeFVuc3Rha2UFAAAADFBhaWR0cnhWYWx1ZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAABF9MaXEFAAAAC1VzZXJBY2NvdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAMX0xhc3RVbnN0YWtlBQAAAAZoZWlnaHQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA5XaXRoZHJhd0Ftb3VudAUAAAAEQlVzZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAlkQXBwRnJlZXMJAABoAAAAAgUAAAAHRmVlUGFpZAAAAAAABfXhAAUAAAAEQlVzZAUAAAADbmlsBQAAAARCVXNkAAAAAGK+OAE=", "height": 2081772, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DfsqqyYPWde1Er46gYZdjXSw4p6uy8HGMLxcvKftvMP6 Next: 9DEqBQNy6gF24dGzCp6vACoGxFcSS5fvbWYV5xSTb9S Diff:
OldNewDifferences
1313 @Callable(i)
1414 func DepositFunds () = {
1515 let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq")
16+ let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake")
1617 let UserBalance = match getInteger(this, UserLiquidity) {
1718 case a: Int =>
1819 a
3031 then throw("Can only deposit BUsd tokens, and amount should be at least 50 BUsd")
3132 else {
3233 let NewBalance = (UserBalance + pmt.amount)
33-[IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), NewBalance)]
34+[IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), NewBalance), IntegerEntry((toBase58String(i.caller.bytes) + "_LastUnstake"), height)]
3435 }
3536 }
3637
6465 if ((amount == 0))
6566 then throw(("You do not have enough funds to withdraw, your available funds are: " + toString((amount / 100000000))))
6667 else {
67- let WaitTime = if ((trxUnstakeValue == 1))
68+ let WaitTime = if ((trxUnstakeValue == 0))
6869 then 2
6970 else 10
7071 if (if ((trxUnstakeValue == 2))
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")
16+ let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake")
1617 let UserBalance = match getInteger(this, UserLiquidity) {
1718 case a: Int =>
1819 a
1920 case _ =>
2021 0
2122 }
2223 let pmt = if ((size(i.payments) == 1))
2324 then i.payments[0]
2425 else throw("Attached payment is required")
2526 if ((UserBalance != 0))
2627 then throw("You already have funds supplied, cannot supply more than once")
2728 else if (if (((50 * 100000000) > pmt.amount))
2829 then true
2930 else (pmt.assetId != BUsd))
3031 then throw("Can only deposit BUsd tokens, and amount should be at least 50 BUsd")
3132 else {
3233 let NewBalance = (UserBalance + pmt.amount)
33-[IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), NewBalance)]
34+[IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), NewBalance), IntegerEntry((toBase58String(i.caller.bytes) + "_LastUnstake"), height)]
3435 }
3536 }
3637
3738
3839
3940 @Callable(i)
4041 func WithdrawLiq () = {
4142 let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq")
4243 let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake")
4344 let trxUnstakeNum = (toBase58String(i.caller.bytes) + "_trxUnstake")
4445 let dAppFrees = Address(dAppFees)
4546 let FeePaid = 1
4647 let amount = match getInteger(this, UserLiquidity) {
4748 case a: Int =>
4849 a
4950 case _ =>
5051 0
5152 }
5253 let trxUnstakeValue = match getInteger(this, trxUnstakeNum) {
5354 case a: Int =>
5455 a
5556 case _ =>
5657 0
5758 }
5859 let LastUnstakeBlockValue = match getInteger(this, LastUnstakeBlock) {
5960 case a: Int =>
6061 a
6162 case _ =>
6263 0
6364 }
6465 if ((amount == 0))
6566 then throw(("You do not have enough funds to withdraw, your available funds are: " + toString((amount / 100000000))))
6667 else {
67- let WaitTime = if ((trxUnstakeValue == 1))
68+ let WaitTime = if ((trxUnstakeValue == 0))
6869 then 2
6970 else 10
7071 if (if ((trxUnstakeValue == 2))
7172 then ((LastUnstakeBlockValue + WaitTime) > height)
7273 else false)
7374 then throw((("Second withdraw cannot be done before " + toString(((height - LastUnstakeBlockValue) - WaitTime))) + " min"))
7475 else {
7576 let PaidtrxValue = if ((trxUnstakeValue == 3))
7677 then 0
7778 else (trxUnstakeValue + 1)
7879 let UserAccount = if ((trxUnstakeValue == 3))
7980 then 0
8081 else ((amount - (FeePaid * 100000000)) - (((PaidtrxValue * 25) * (amount - (FeePaid * 100000000))) / 100))
8182 let WithdrawAmount = ((25 * amount) / 100)
8283 $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)
8384 }
8485 }
8586 }
8687
8788

github/deemru/w8io/169f3d6 
29.89 ms