tx · 9DEqBQNy6gF24dGzCp6vACoGxFcSS5fvbWYV5xSTb9S

3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw:  -0.01000000 Waves

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

{ "type": 13, "id": "9DEqBQNy6gF24dGzCp6vACoGxFcSS5fvbWYV5xSTb9S", "fee": 1000000, "feeAssetId": null, "timestamp": 1654356283711, "version": 2, "chainId": 84, "sender": "3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw", "senderPublicKey": "GTKqLSK6nuFkRdebB5SmTwTU2DnTeLMvhymCFfT2CxX2", "proofs": [ "5nsYRUjNPKsRK8Z6Yq3RjtwrWhMBsrpjYPeQ6DsSyD8YBmbost2cFmjg6MY6k4NsBCZfMbDavNpPk4CS5ZFoXAeR" ], "script": "base64:AAIFAAAAAAAAAAgIAhIAEgASAAAAAAIAAAAABEJVc2QBAAAAIAu+yPsU61UT6w/UBobJ3Bln9DA/EA0rHMeXciw6ixXjAAAAAAhkQXBwRmVlcwEAAAAaAVSnJAa+rdQxXJacpl/yZdtSATGRaLbaMxIAAAADAAAAAWkBAAAABVJlc2V0AAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAABF9MaXEAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAxfTGFzdFVuc3Rha2UAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAtfdHJ4VW5zdGFrZQAAAAAAAAAAAAUAAAADbmlsAAAAAWkBAAAADERlc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ABmFtb3VudAkAAGgAAAACBQAAAAdGZWVQYWlkAAAAAAAF9eEAAAAAAAAAAABkBAAAAA5XaXRoZHJhd0Ftb3VudAkAAGkAAAACCQAAaAAAAAIAAAAAAAAAABkFAAAABmFtb3VudAAAAAAAAAAAZAkABRQAAAACCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAALX3RyeFVuc3Rha2UFAAAADFBhaWR0cnhWYWx1ZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAABF9MaXEFAAAAC1VzZXJBY2NvdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAMX0xhc3RVbnN0YWtlBQAAAAZoZWlnaHQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA5XaXRoZHJhd0Ftb3VudAUAAAAEQlVzZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAlkQXBwRnJlZXMJAABoAAAAAgUAAAAHRmVlUGFpZAAAAAAABfXhAAUAAAAEQlVzZAUAAAADbmlsBQAAAARCVXNkAAAAAHpBVGg=", "height": 2081777, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DBmJ2rBnCuidPkxuRaHXTMvavz2NNi5bA15F5H2QhGME Next: BVW23vCXtEKVhQiNT7mAVE5iEMqFdvu5uguUFuenT7Bx Diff:
OldNewDifferences
6868 let WaitTime = if ((trxUnstakeValue == 0))
6969 then 2
7070 else 10
71- if (if ((trxUnstakeValue == 2))
72- then ((LastUnstakeBlockValue + WaitTime) > height)
73- else false)
71+ if (((LastUnstakeBlockValue + WaitTime) > height))
7472 then throw((("Second withdraw cannot be done before " + toString(((height - LastUnstakeBlockValue) - WaitTime))) + " min"))
7573 else {
7674 let PaidtrxValue = if ((trxUnstakeValue == 3))
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 LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake")
1717 let UserBalance = match getInteger(this, UserLiquidity) {
1818 case a: Int =>
1919 a
2020 case _ =>
2121 0
2222 }
2323 let pmt = if ((size(i.payments) == 1))
2424 then i.payments[0]
2525 else throw("Attached payment is required")
2626 if ((UserBalance != 0))
2727 then throw("You already have funds supplied, cannot supply more than once")
2828 else if (if (((50 * 100000000) > pmt.amount))
2929 then true
3030 else (pmt.assetId != BUsd))
3131 then throw("Can only deposit BUsd tokens, and amount should be at least 50 BUsd")
3232 else {
3333 let NewBalance = (UserBalance + pmt.amount)
3434 [IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), NewBalance), IntegerEntry((toBase58String(i.caller.bytes) + "_LastUnstake"), height)]
3535 }
3636 }
3737
3838
3939
4040 @Callable(i)
4141 func WithdrawLiq () = {
4242 let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq")
4343 let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake")
4444 let trxUnstakeNum = (toBase58String(i.caller.bytes) + "_trxUnstake")
4545 let dAppFrees = Address(dAppFees)
4646 let FeePaid = 1
4747 let amount = match getInteger(this, UserLiquidity) {
4848 case a: Int =>
4949 a
5050 case _ =>
5151 0
5252 }
5353 let trxUnstakeValue = match getInteger(this, trxUnstakeNum) {
5454 case a: Int =>
5555 a
5656 case _ =>
5757 0
5858 }
5959 let LastUnstakeBlockValue = match getInteger(this, LastUnstakeBlock) {
6060 case a: Int =>
6161 a
6262 case _ =>
6363 0
6464 }
6565 if ((amount == 0))
6666 then throw(("You do not have enough funds to withdraw, your available funds are: " + toString((amount / 100000000))))
6767 else {
6868 let WaitTime = if ((trxUnstakeValue == 0))
6969 then 2
7070 else 10
71- if (if ((trxUnstakeValue == 2))
72- then ((LastUnstakeBlockValue + WaitTime) > height)
73- else false)
71+ if (((LastUnstakeBlockValue + WaitTime) > height))
7472 then throw((("Second withdraw cannot be done before " + toString(((height - LastUnstakeBlockValue) - WaitTime))) + " min"))
7573 else {
7674 let PaidtrxValue = if ((trxUnstakeValue == 3))
7775 then 0
7876 else (trxUnstakeValue + 1)
7977 let UserAccount = if ((trxUnstakeValue == 3))
8078 then 0
8179 else ((amount - (FeePaid * 100000000)) - (((PaidtrxValue * 25) * (amount - (FeePaid * 100000000))) / 100))
8280 let WithdrawAmount = ((25 * amount) / 100)
8381 $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)
8482 }
8583 }
8684 }
8785
8886

github/deemru/w8io/169f3d6 
41.97 ms