tx · DfsqqyYPWde1Er46gYZdjXSw4p6uy8HGMLxcvKftvMP6

3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw:  -0.01000000 Waves

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

{ "type": 13, "id": "DfsqqyYPWde1Er46gYZdjXSw4p6uy8HGMLxcvKftvMP6", "fee": 1000000, "feeAssetId": null, "timestamp": 1654355515325, "version": 2, "chainId": 84, "sender": "3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw", "senderPublicKey": "GTKqLSK6nuFkRdebB5SmTwTU2DnTeLMvhymCFfT2CxX2", "proofs": [ "4dyfpQMSouWTidJZd2pehijwty6M1DWBzGsjVsZvQAZQh8Q85z94gTLRsm5nUHZPc8e3jJBfZRDDQ41XPefQ2dBZ" ], "script": "base64:AAIFAAAAAAAAAAgIAhIAEgASAAAAAAIAAAAABEJVc2QBAAAAIAu+yPsU61UT6w/UBobJ3Bln9DA/EA0rHMeXciw6ixXjAAAAAAhkQXBwRmVlcwEAAAAaAVSnJAa+rdQxXJacpl/yZdtSATGRaLbaMxIAAAADAAAAAWkBAAAABVJlc2V0AAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAABF9MaXEAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAxfTGFzdFVuc3Rha2UAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAtfdHJ4VW5zdGFrZQAAAAAAAAAAAAUAAAADbmlsAAAAAWkBAAAADERlcG9zaXRG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AAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAAC190cnhVbnN0YWtlBQAAAAxQYWlkdHJ4VmFsdWUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAARfTGlxBQAAAAtVc2VyQWNjb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAADF9MYXN0VW5zdGFrZQUAAAAGaGVpZ2h0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOV2l0aGRyYXdBbW91bnQFAAAABEJVc2QJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAJZEFwcEZyZWVzCQAAaAAAAAIFAAAAB0ZlZVBhaWQAAAAAAAX14QAFAAAABEJVc2QFAAAAA25pbAUAAAAEQlVzZAAAAACK/51h", "height": 2081766, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GxM4qFtDdinkoY1DQcQA2bp2Gb212wxVtwqKTnNBipyc Next: DBmJ2rBnCuidPkxuRaHXTMvavz2NNi5bA15F5H2QhGME Diff:
OldNewDifferences
2222 let pmt = if ((size(i.payments) == 1))
2323 then i.payments[0]
2424 else throw("Attached payment is required")
25- if (if (((50 * 100000000) > pmt.amount))
26- then true
27- else (pmt.assetId != BUsd))
28- then throw("Can only deposit BUsd tokens, and amount should be at least 50 BUsd")
29- else {
30- let NewBalance = (UserBalance + pmt.amount)
25+ if ((UserBalance != 0))
26+ then throw("You already have funds supplied, cannot supply more than once")
27+ else if (if (((50 * 100000000) > pmt.amount))
28+ then true
29+ else (pmt.assetId != BUsd))
30+ then throw("Can only deposit BUsd tokens, and amount should be at least 50 BUsd")
31+ else {
32+ let NewBalance = (UserBalance + pmt.amount)
3133 [IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), NewBalance)]
32- }
34+ }
3335 }
3436
3537
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")
25- if (if (((50 * 100000000) > pmt.amount))
26- then true
27- else (pmt.assetId != BUsd))
28- then throw("Can only deposit BUsd tokens, and amount should be at least 50 BUsd")
29- else {
30- let NewBalance = (UserBalance + pmt.amount)
25+ if ((UserBalance != 0))
26+ then throw("You already have funds supplied, cannot supply more than once")
27+ else if (if (((50 * 100000000) > pmt.amount))
28+ then true
29+ else (pmt.assetId != BUsd))
30+ then throw("Can only deposit BUsd tokens, and amount should be at least 50 BUsd")
31+ else {
32+ let NewBalance = (UserBalance + pmt.amount)
3133 [IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), NewBalance)]
32- }
34+ }
3335 }
3436
3537
3638
3739 @Callable(i)
3840 func WithdrawLiq () = {
3941 let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq")
4042 let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake")
4143 let trxUnstakeNum = (toBase58String(i.caller.bytes) + "_trxUnstake")
4244 let dAppFrees = Address(dAppFees)
4345 let FeePaid = 1
4446 let amount = match getInteger(this, UserLiquidity) {
4547 case a: Int =>
4648 a
4749 case _ =>
4850 0
4951 }
5052 let trxUnstakeValue = match getInteger(this, trxUnstakeNum) {
5153 case a: Int =>
5254 a
5355 case _ =>
5456 0
5557 }
5658 let LastUnstakeBlockValue = match getInteger(this, LastUnstakeBlock) {
5759 case a: Int =>
5860 a
5961 case _ =>
6062 0
6163 }
6264 if ((amount == 0))
6365 then throw(("You do not have enough funds to withdraw, your available funds are: " + toString((amount / 100000000))))
6466 else {
6567 let WaitTime = if ((trxUnstakeValue == 1))
6668 then 2
6769 else 10
6870 if (if ((trxUnstakeValue == 2))
6971 then ((LastUnstakeBlockValue + WaitTime) > height)
7072 else false)
7173 then throw((("Second withdraw cannot be done before " + toString(((height - LastUnstakeBlockValue) - WaitTime))) + " min"))
7274 else {
7375 let PaidtrxValue = if ((trxUnstakeValue == 3))
7476 then 0
7577 else (trxUnstakeValue + 1)
7678 let UserAccount = if ((trxUnstakeValue == 3))
7779 then 0
7880 else ((amount - (FeePaid * 100000000)) - (((PaidtrxValue * 25) * (amount - (FeePaid * 100000000))) / 100))
7981 let WithdrawAmount = ((25 * amount) / 100)
8082 $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)
8183 }
8284 }
8385 }
8486
8587

github/deemru/w8io/169f3d6 
46.62 ms