tx · 4a7B2T7fQN8BZWk85GStF69CrSyKjnasdxVYZeQsAUob

3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw:  -0.01000000 Waves

2022.06.03 22:41 [2080597] smart account 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw > SELF 0.00000000 Waves

{ "type": 13, "id": "4a7B2T7fQN8BZWk85GStF69CrSyKjnasdxVYZeQsAUob", "fee": 1000000, "feeAssetId": null, "timestamp": 1654285358937, "version": 2, "chainId": 84, "sender": "3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw", "senderPublicKey": "GTKqLSK6nuFkRdebB5SmTwTU2DnTeLMvhymCFfT2CxX2", "proofs": [ "5eWn8VmsGRCWYUoi6gnXt2wTQM8NPcL7P8xBdVfF7uVZhLGJHFArfEbJgrYTQKpF9G9gHPBEuRD4qnfQAvHCaYvR" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAACAAAAAARCVXNkAQAAACALvsj7FOtVE+sP1AaGydwZZ/QwPxANKxzHl3IsOosV4wAAAAAIZEFwcEZlZXMBAAAAGgFUpyQGvq3UMVyWnKZf8mXbUgExkWi22jMSAAAAAgAAAAFpAQAAAAxEZXBvc2l0RnVuZHMAAAAABAAAAA1Vc2VyTGlxdWlkaXR5CQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAEX0xpcQQAAAALVXNlckJhbGFuY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAANVXNlckxpcXVpZGl0eQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAANwbXQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAcQXR0YWNoZWQg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AAABfXhAAkAAGkAAAACCQAAaAAAAAIJAABoAAAAAgUAAAAMUGFpZHRyeFZhbHVlAAAAAAAAAAAZCQAAZQAAAAIFAAAABmFtb3VudAkAAGgAAAACBQAAAAdGZWVQYWlkAAAAAAAF9eEAAAAAAAAAAABkBAAAAA5XaXRoZHJhd0Ftb3VudAkAAGkAAAACCQAAaAAAAAIAAAAAAAAAABkFAAAABmFtb3VudAAAAAAAAAAAZAkABRQAAAACCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAALX3RyeFVuc3Rha2UFAAAADFBhaWR0cnhWYWx1ZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAABF9MaXEFAAAAC1VzZXJBY2NvdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAALX3RyeFVuc3Rha2UFAAAABmhlaWdodAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADldpdGhkcmF3QW1vdW50BQAAAARCVXNkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAACWRBcHBGcmVlcwkAAGgAAAACBQAAAAdGZWVQYWlkAAAAAAAF9eEABQAAAARCVXNkBQAAAANuaWwFAAAABEJVc2QAAAAAjS4zmA==", "height": 2080597, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HqKtN1geP5FtbPy8EE2c13YjMEmg4hDTbeKsCnFfJkis Next: 8pz19ydTFtqwsveD5SQcL8TbR4B3fb4fbSiQDcQtdDVs Diff:
OldNewDifferences
6060 else if (if ((trxUnstakeValue == 2))
6161 then (height > (trxUnstakeValue + WaitTime))
6262 else false)
63- then throw((("Second withdraw cannot be done before " + toString(((height - WaitTime) - trxUnstakeValue))) + " min"))
63+ then throw(("Second withdraw cannot be done before " + " min"))
6464 else {
6565 let PaidtrxValue = if ((trxUnstakeValue == 3))
6666 then 0
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)
3333 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 }
5858 if ((amount == 0))
5959 then throw(("You do not have enough funds to withdraw, your available funds are: " + toString((amount / 100000000))))
6060 else if (if ((trxUnstakeValue == 2))
6161 then (height > (trxUnstakeValue + WaitTime))
6262 else false)
63- then throw((("Second withdraw cannot be done before " + toString(((height - WaitTime) - trxUnstakeValue))) + " min"))
63+ then throw(("Second withdraw cannot be done before " + " min"))
6464 else {
6565 let PaidtrxValue = if ((trxUnstakeValue == 3))
6666 then 0
6767 else (trxUnstakeValue + 1)
6868 let UserAccount = if ((trxUnstakeValue == 3))
6969 then 0
7070 else ((amount - (FeePaid * 100000000)) - (((PaidtrxValue * 25) * (amount - (FeePaid * 100000000))) / 100))
7171 let WithdrawAmount = ((25 * amount) / 100)
7272 $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)
7373 }
7474 }
7575
7676

github/deemru/w8io/169f3d6 
39.89 ms