tx · HqKtN1geP5FtbPy8EE2c13YjMEmg4hDTbeKsCnFfJkis

3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw:  -0.01000000 Waves

2022.06.03 22:37 [2080593] smart account 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw > SELF 0.00000000 Waves

{ "type": 13, "id": "HqKtN1geP5FtbPy8EE2c13YjMEmg4hDTbeKsCnFfJkis", "fee": 1000000, "feeAssetId": null, "timestamp": 1654285094464, "version": 2, "chainId": 84, "sender": "3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw", "senderPublicKey": "GTKqLSK6nuFkRdebB5SmTwTU2DnTeLMvhymCFfT2CxX2", "proofs": [ "3oVXb2TL7CXyhd5tWDCvvPp5VdLDUBtrFThxKpDry9k14dobzexpLMRwVNDSwN7ozVj9cNnsGNswaNujGYRBdXUj" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAACAAAAAARCVXNkAQAAACALvsj7FOtVE+sP1AaGydwZZ/QwPxANKxzHl3IsOosV4wAAAAAIZEFwcEZlZXMBAAAAGgFUpyQGvq3UMVyWnKZf8mXbUgExkWi22jMSAAAAAgAAAAFpAQAAAAxEZXBvc2l0RnVuZHMAAAAABAAAAA1Vc2VyTGlxdWlkaXR5CQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAEX0xpcQQAAAALVXNlckJhbGFuY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAANVXNlckxpcXVpZGl0eQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAANwbXQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAcQXR0YWNoZWQgcGF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dGFrZVZhbHVlAAAAAAAAAAADAAAAAAAAAAAACQAAZQAAAAIJAABlAAAAAgUAAAAGYW1vdW50CQAAaAAAAAIFAAAAB0ZlZVBhaWQAAAAAAAX14QAJAABpAAAAAgkAAGgAAAACCQAAaAAAAAIFAAAADFBhaWR0cnhWYWx1ZQAAAAAAAAAAGQkAAGUAAAACBQAAAAZhbW91bnQJAABoAAAAAgUAAAAHRmVlUGFpZAAAAAAABfXhAAAAAAAAAAAAZAQAAAAOV2l0aGRyYXdBbW91bnQJAABpAAAAAgkAAGgAAAACAAAAAAAAAAAZBQAAAAZhbW91bnQAAAAAAAAAAGQJAAUUAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAAC190cnhVbnN0YWtlBQAAAAxQYWlkdHJ4VmFsdWUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAARfTGlxBQAAAAtVc2VyQWNjb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAAC190cnhVbnN0YWtlBQAAAAZoZWlnaHQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA5XaXRoZHJhd0Ftb3VudAUAAAAEQlVzZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAlkQXBwRnJlZXMJAABoAAAAAgUAAAAHRmVlUGFpZAAAAAAABfXhAAUAAAAEQlVzZAUAAAADbmlsBQAAAARCVXNkAAAAAPRMRR8=", "height": 2080593, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9TzpGq4Ye3SCt2VNQ86FNLydPnotxpPcRCuKMosybJxH Next: 4a7B2T7fQN8BZWk85GStF69CrSyKjnasdxVYZeQsAUob Diff:
OldNewDifferences
3030
3131
3232 @Callable(i)
33-func WithdrawLiq (UnstakedAmount) = {
33+func WithdrawLiq () = {
3434 let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq")
3535 let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake")
3636 let trxUnstakeNum = (toBase58String(i.caller.bytes) + "_trxUnstake")
5555 case _ =>
5656 0
5757 }
58- let UserBalance = (amount - (UnstakedAmount * 10000000))
59- if ((0 >= UserBalance))
58+ if ((amount == 0))
6059 then throw(("You do not have enough funds to withdraw, your available funds are: " + toString((amount / 100000000))))
6160 else if (if ((trxUnstakeValue == 2))
6261 then (height > (trxUnstakeValue + WaitTime))
6362 else false)
6463 then throw((("Second withdraw cannot be done before " + toString(((height - WaitTime) - trxUnstakeValue))) + " min"))
6564 else {
66- let NewTrx = (trxUnstakeValue + 1)
67- $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), NewTrx), IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), UserBalance), IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), height), ScriptTransfer(i.caller, (UnstakedAmount * 10000000), BUsd), ScriptTransfer(dAppFrees, (FeePaid * 100000000), BUsd)], BUsd)
65+ let PaidtrxValue = if ((trxUnstakeValue == 3))
66+ then 0
67+ else (trxUnstakeValue + 1)
68+ let UserAccount = if ((trxUnstakeValue == 3))
69+ then 0
70+ else ((amount - (FeePaid * 100000000)) - (((PaidtrxValue * 25) * (amount - (FeePaid * 100000000))) / 100))
71+ let WithdrawAmount = ((25 * amount) / 100)
72+ $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), PaidtrxValue), IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), height), ScriptTransfer(i.caller, WithdrawAmount, BUsd), ScriptTransfer(dAppFrees, (FeePaid * 100000000), BUsd)], BUsd)
6873 }
6974 }
7075
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 DepositFunds () = {
1010 let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq")
1111 let UserBalance = match getInteger(this, UserLiquidity) {
1212 case a: Int =>
1313 a
1414 case _ =>
1515 0
1616 }
1717 let pmt = if ((size(i.payments) == 1))
1818 then i.payments[0]
1919 else throw("Attached payment is required")
2020 if (if ((0 >= pmt.amount))
2121 then true
2222 else (pmt.assetId != BUsd))
2323 then throw("Can only deposit BUsd tokens, and amount should be positive")
2424 else {
2525 let NewBalance = (UserBalance + pmt.amount)
2626 [IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), NewBalance)]
2727 }
2828 }
2929
3030
3131
3232 @Callable(i)
33-func WithdrawLiq (UnstakedAmount) = {
33+func WithdrawLiq () = {
3434 let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq")
3535 let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake")
3636 let trxUnstakeNum = (toBase58String(i.caller.bytes) + "_trxUnstake")
3737 let dAppFrees = Address(dAppFees)
3838 let WaitTime = 10
3939 let FeePaid = 1
4040 let amount = match getInteger(this, UserLiquidity) {
4141 case a: Int =>
4242 a
4343 case _ =>
4444 0
4545 }
4646 let trxUnstakeValue = match getInteger(this, trxUnstakeNum) {
4747 case a: Int =>
4848 a
4949 case _ =>
5050 0
5151 }
5252 let LastUnstakeBlockValue = match getInteger(this, LastUnstakeBlock) {
5353 case a: Int =>
5454 a
5555 case _ =>
5656 0
5757 }
58- let UserBalance = (amount - (UnstakedAmount * 10000000))
59- if ((0 >= UserBalance))
58+ if ((amount == 0))
6059 then throw(("You do not have enough funds to withdraw, your available funds are: " + toString((amount / 100000000))))
6160 else if (if ((trxUnstakeValue == 2))
6261 then (height > (trxUnstakeValue + WaitTime))
6362 else false)
6463 then throw((("Second withdraw cannot be done before " + toString(((height - WaitTime) - trxUnstakeValue))) + " min"))
6564 else {
66- let NewTrx = (trxUnstakeValue + 1)
67- $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), NewTrx), IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), UserBalance), IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), height), ScriptTransfer(i.caller, (UnstakedAmount * 10000000), BUsd), ScriptTransfer(dAppFrees, (FeePaid * 100000000), BUsd)], BUsd)
65+ let PaidtrxValue = if ((trxUnstakeValue == 3))
66+ then 0
67+ else (trxUnstakeValue + 1)
68+ let UserAccount = if ((trxUnstakeValue == 3))
69+ then 0
70+ else ((amount - (FeePaid * 100000000)) - (((PaidtrxValue * 25) * (amount - (FeePaid * 100000000))) / 100))
71+ let WithdrawAmount = ((25 * amount) / 100)
72+ $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), PaidtrxValue), IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), height), ScriptTransfer(i.caller, WithdrawAmount, BUsd), ScriptTransfer(dAppFrees, (FeePaid * 100000000), BUsd)], BUsd)
6873 }
6974 }
7075
7176

github/deemru/w8io/026f985 
32.69 ms