tx · 8JAb4SAbpHjUFHZYdy8xwKcqiceVgpwcoATMtTT1HX1i 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw: -0.01000000 Waves 2022.06.08 21:52 [2087773] smart account 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw > SELF 0.00000000 Waves
{ "type": 13, "id": "8JAb4SAbpHjUFHZYdy8xwKcqiceVgpwcoATMtTT1HX1i", "fee": 1000000, "feeAssetId": null, "timestamp": 1654714401477, "version": 2, "chainId": 84, "sender": "3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw", "senderPublicKey": "GTKqLSK6nuFkRdebB5SmTwTU2DnTeLMvhymCFfT2CxX2", "proofs": [ "xG5AxLgrYHgaqcooAAymY6CEKqcH82Hiwce7VgawZzrVNBegHWcgLinAaCvExFFGZS2akvYuonaKLMVeKQk2TYc" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgMKAQgSAAAAAAsAAAAABEhBU0gBAAAAIF94jI3Tp6ELW8WMagcRgS1M3XAzJMFSz5i+N7gIQHlrAAAAAAhLcm9zc0NhcgEAAAAgX3iMjdOnoQtbxYxqBxGBLUzdcDMkwVLPmL43uAhAeWsAAAAABlRvd2luZwEAAAAgX3iMjdOnoQtbxYxqBxGBLUzdcDMkwVLPmL43uAhAeWsAAAAACGRBcHBGZWVzAQAAABoBV5prAZfpnthmNq2ZMbws44Htl6ZEmG28iwAAAAAJQWRtaW5kQXBwAQAAABoBV9BDQuIchL6bmoa833jKal/OBiGoZGoQDgAAAAAJTWluQW1vdW50AAAAAAAAAAK8AAAAAA5Lcm9zc0NhclJld2FyZAAAAAAAAAAAAQAAAAAMVG93aW5nUmV3YXJkAAAAAAAAAAABAAAAAApSZWZlcnJlVGlwAAAAAAAAAAABAAAAAAxtaW5Kb2luV2Vla3MAAAAAAAAAAAgAAAAAClRpbWVUb3dpbmcAAAAAAAAAAB4AAAADAAAAAWkBAAAAC0RlcG9zaXRIQVNIAAAAAAQAAAALVXNlckRlcG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vY2sDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAMDAwkAAGYAAAACCQAAaAAAAAIFAAAACU1pbkFtb3VudAAAAAAABfXhAAkAAGkAAAACCQAAaAAAAAIFAAAABmFtb3VudAkAAGUAAAACBQAAAAZoZWlnaHQFAAAAEVVzZXJNYXR1cml0eVZhbHVlCQAAaAAAAAIAAAAAAAAABaAAAAAAAAAAAAcGCQAAZgAAAAIJAABoAAAAAgkAAGgAAAACBQAAAAxtaW5Kb2luV2Vla3MAAAAAAAAABaAAAAAAAAAAAAcJAABlAAAAAgUAAAAGaGVpZ2h0BQAAABFVc2VyTWF0dXJpdHlWYWx1ZQYJAABmAAAAAgkAAGgAAAACAAAAAAAAAAAeAAAAAAAAAAWgBQAAABRMYXN0VG93aW5nQmxvY2tWYWx1ZQkAAAIAAAABAgAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAABBfTGFzdFRvd2luZ0Jsb2NrBQAAAAZoZWlnaHQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyCQAAaAAAAAIFAAAADFRvd2luZ1Jld2FyZAAAAAAABfXhAAUAAAAGVG93aW5nBQAAAANuaWwAAAAAXoHrIQ==", "height": 2087773, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2AtmaXvm8E1A6eWfFoToDkmEnf4weYG7c31JYsH5HJMc Next: 7pvMHoQzHgSyGkLLr47ezpYn5Ros1wvkbzhuPYnyzkCA Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let HASH = base58'7RgM3A5AVCUZFbL3EwBicv1eHFCVsaY8z71yda77zrAv' | |
5 | 5 | ||
6 | - | let dAppFees = base58'3N59qn7Ndw24WrGFkNFk7PGTBCzdMETyKqj' | |
6 | + | let KrossCar = base58'7RgM3A5AVCUZFbL3EwBicv1eHFCVsaY8z71yda77zrAv' | |
7 | + | ||
8 | + | let Towing = base58'7RgM3A5AVCUZFbL3EwBicv1eHFCVsaY8z71yda77zrAv' | |
9 | + | ||
10 | + | let dAppFees = base58'3PG1NyiC2rdgX46jb8c5zPGuEAzWXhr4L2W' | |
11 | + | ||
12 | + | let AdmindApp = base58'3PLv5rYMqR4gSiP5ZSjrX2FStLhHTRgFPbb' | |
13 | + | ||
14 | + | let MinAmount = 700 | |
15 | + | ||
16 | + | let KrossCarReward = 1 | |
17 | + | ||
18 | + | let TowingReward = 1 | |
19 | + | ||
20 | + | let ReferreTip = 1 | |
21 | + | ||
22 | + | let minJoinWeeks = 8 | |
23 | + | ||
24 | + | let TimeTowing = 30 | |
7 | 25 | ||
8 | 26 | @Callable(i) | |
9 | - | func Reset () = [IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), 0), IntegerEntry((toBase58String(i.caller.bytes) + "_LastUnstake"), 0), IntegerEntry((toBase58String(i.caller.bytes) + "_trxUnstake"), 0)] | |
10 | - | ||
11 | - | ||
12 | - | ||
13 | - | @Callable(i) | |
14 | - | func DepositFunds () = { | |
15 | - | let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq") | |
16 | - | let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake") | |
17 | - | let UserBalance = match getInteger(this, UserLiquidity) { | |
27 | + | func DepositHASH () = { | |
28 | + | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
29 | + | let amount = match getInteger(this, UserDeposit) { | |
18 | 30 | case a: Int => | |
19 | 31 | a | |
20 | 32 | case _ => | |
21 | 33 | 0 | |
22 | 34 | } | |
23 | - | let pmt = if ((size(i.payments) == 1)) | |
24 | - | then i.payments[0] | |
25 | - | else throw("Attached payment is required") | |
26 | - | if ((UserBalance != 0)) | |
27 | - | then throw("You already have funds supplied, cannot supply more than once") | |
28 | - | else if (if (((50 * 100000000) > pmt.amount)) | |
29 | - | then true | |
30 | - | else (pmt.assetId != BUsd)) | |
31 | - | then throw("Can only deposit BUsd tokens, and amount should be at least 50 BUsd") | |
32 | - | else { | |
33 | - | let NewBalance = (UserBalance + pmt.amount) | |
34 | - | [IntegerEntry((toBase58String(i.caller.bytes) + "_Liq"), NewBalance), IntegerEntry((toBase58String(i.caller.bytes) + "_Deposit"), NewBalance), IntegerEntry((toBase58String(i.caller.bytes) + "_LastUnstake"), height)] | |
35 | - | } | |
35 | + | if ((amount != 0)) | |
36 | + | then throw("You have already deposited funds, deposits can only be done once") | |
37 | + | else { | |
38 | + | let pmt = if ((size(i.payments) == 1)) | |
39 | + | then i.payments[0] | |
40 | + | else throw("Attached payment is required") | |
41 | + | if (if (((MinAmount * 100000000) >= pmt.amount)) | |
42 | + | then true | |
43 | + | else (pmt.assetId != HASH)) | |
44 | + | then throw("Can only deposit HASH tokens, and minimum amount is 700 HASH") | |
45 | + | else { | |
46 | + | let UserDepositValue = (amount + pmt.amount) | |
47 | + | [IntegerEntry((toBase58String(i.caller.bytes) + "_Deposit"), UserDepositValue), IntegerEntry((toBase58String(i.caller.bytes) + "_DepositBlock"), height), ScriptTransfer(i.caller, (KrossCarReward * 100000000), KrossCar)] | |
48 | + | } | |
49 | + | } | |
36 | 50 | } | |
37 | 51 | ||
38 | 52 | ||
39 | 53 | ||
40 | 54 | @Callable(i) | |
41 | - | func WithdrawLiq () = { | |
42 | - | let UserLiquidity = (toBase58String(i.caller.bytes) + "_Liq") | |
43 | - | let LastUnstakeBlock = (toBase58String(i.caller.bytes) + "_LastUnstake") | |
44 | - | let trxUnstakeNum = (toBase58String(i.caller.bytes) + "_trxUnstake") | |
45 | - | let User1stDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
46 | - | let dAppFrees = Address(dAppFees) | |
47 | - | let FeePaid = 1 | |
48 | - | let User1stDepositValue = match getInteger(this, User1stDeposit) { | |
55 | + | func RewardReferrer (UserWalletAddress) = { | |
56 | + | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
57 | + | let TippedStatus = (toBase58String(i.caller.bytes) + "_TippedStatus") | |
58 | + | let amount = match getInteger(this, UserDeposit) { | |
49 | 59 | case a: Int => | |
50 | 60 | a | |
51 | 61 | case _ => | |
52 | 62 | 0 | |
53 | 63 | } | |
54 | - | let amount = match getInteger(this, UserLiquidity) { | |
64 | + | let TippedStatusValue = getStringValue(this, TippedStatus) | |
65 | + | if ((TippedStatusValue == "YES")) | |
66 | + | then throw("You already tipped a User, you only can tip once a user") | |
67 | + | else if (((MinAmount * 100000000) > amount)) | |
68 | + | then throw((("To tip your referrer you must have at least deposited: " + toString(MinAmount)) + " HASH")) | |
69 | + | else [StringEntry((toBase58String(i.caller.bytes) + "_TippedStatus"), "YES"), ScriptTransfer(i.caller, (ReferreTip * 100000000), KrossCar)] | |
70 | + | } | |
71 | + | ||
72 | + | ||
73 | + | ||
74 | + | @Callable(i) | |
75 | + | func RequestTowing () = { | |
76 | + | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
77 | + | let UserMaturity = (toBase58String(i.caller.bytes) + "_DepositBlock") | |
78 | + | let LastTowingBlock = (toBase58String(i.caller.bytes) + "_LastTowingBlock") | |
79 | + | let amount = match getInteger(this, UserDeposit) { | |
55 | 80 | case a: Int => | |
56 | 81 | a | |
57 | 82 | case _ => | |
58 | 83 | 0 | |
59 | 84 | } | |
60 | - | let | |
85 | + | let UserMaturityValue = match getInteger(this, UserMaturity) { | |
61 | 86 | case a: Int => | |
62 | 87 | a | |
63 | 88 | case _ => | |
64 | 89 | 0 | |
65 | 90 | } | |
66 | - | let | |
91 | + | let LastTowingBlockValue = match getInteger(this, LastTowingBlock) { | |
67 | 92 | case a: Int => | |
68 | 93 | a | |
69 | 94 | case _ => | |
70 | 95 | 0 | |
71 | 96 | } | |
72 | - | if ((amount == 0)) | |
73 | - | then throw(("You do not have enough funds to withdraw, your available funds are: " + toString((amount / 100000000)))) | |
74 | - | else { | |
75 | - | let WaitTime = if ((trxUnstakeValue == 0)) | |
76 | - | then 2 | |
77 | - | else 10 | |
78 | - | if (((LastUnstakeBlockValue + WaitTime) > height)) | |
79 | - | then throw((("Second withdraw cannot be done before " + toString(((height - LastUnstakeBlockValue) - WaitTime))) + " min")) | |
80 | - | else { | |
81 | - | let PaidtrxValue = if ((trxUnstakeValue == 3)) | |
82 | - | then 0 | |
83 | - | else (trxUnstakeValue + 1) | |
84 | - | let WithdrawAmount = ((User1stDepositValue / 4) - (FeePaid * 100000000)) | |
85 | - | let UserAccount = if ((trxUnstakeValue == 3)) | |
86 | - | then 0 | |
87 | - | else (User1stDepositValue - (PaidtrxValue * (WithdrawAmount + (FeePaid * 100000000)))) | |
88 | - | $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) | |
89 | - | } | |
90 | - | } | |
97 | + | if (if (if (((MinAmount * 100000000) > ((amount * (height - UserMaturityValue)) / (1440 * 7)))) | |
98 | + | then true | |
99 | + | else (((minJoinWeeks * 1440) * 7) > (height - UserMaturityValue))) | |
100 | + | then true | |
101 | + | else ((30 * 1440) > LastTowingBlockValue)) | |
102 | + | then throw("") | |
103 | + | else [IntegerEntry((toBase58String(i.caller.bytes) + "_LastTowingBlock"), height), ScriptTransfer(i.caller, (TowingReward * 100000000), Towing)] | |
91 | 104 | } | |
92 | 105 | ||
93 | 106 |
github/deemru/w8io/169f3d6 33.88 ms ◑