tx · 7MyNfWvTthGaMoHkBeyWkUzM4NSpAVGzu5HdCybpZRax 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw: -0.01000000 Waves 2022.06.09 17:32 [2088966] smart account 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw > SELF 0.00000000 Waves
{ "type": 13, "id": "7MyNfWvTthGaMoHkBeyWkUzM4NSpAVGzu5HdCybpZRax", "fee": 1000000, "feeAssetId": null, "timestamp": 1654785165121, "version": 2, "chainId": 84, "sender": "3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw", "senderPublicKey": "GTKqLSK6nuFkRdebB5SmTwTU2DnTeLMvhymCFfT2CxX2", "proofs": [ "4j8pnaQr46N8LgQa4A6TyJ2CwBHmVNeX8yZhQs9zUVwto4JcbAa5EjAZbm21g58E6V97w552ZF55QzQ4feJfZWCp" ], "script": "base64:AAIFAAAAAAAAAA0IAhIAEgASAwoBCBIAAAAADQAAAAAESEFTSAEAAAAgmSXATeL679tzjy9/h38GdVeEwua5fh4H7zVBVc9zfqsAAAAACEtyb3NzQ2FyAQAAACA17Ai4nx+XQvdoMhd97kphQjilBs89yl0u1OKQBmiyuwAAAAAGVG93aW5nAQAAACAvNWf0XFc4QsdFX00ztYedHPzcA/SLYWxdhT+TFvjiSgAAAAAIZEFwcEZlZXMBAAAAGgFXmmsBl+me2GY2rZkxvCzjge2XpkSYbbyLAAAAAAlBZG1pbmRBcHABAAAAGgFX0ENC4hyEvpuahrzfeMpqX84GIahkahAOAAAAAAlNaW5BbW91bnQAAAAAAAAAArwAAAAADktyb3NzQ2FyUmV3YXJkAAAAAAAAAAABAAAAAAxUb3dpbmdSZXdhcmQAAAAAAAAAAAEAAAAAClJlZmVycmVUaXAAAAAAAAAAAAEAAAAADG1pbkpvaW5XZWVrcwAAAAAAAAAACAAAAAAKVGltZVRvd2luZwAAAAAAAAAAAgAAAAAEV2VlawAAAAAAAAAACgAAAAADRGF5AAAAAAAAAAAFAAAABAAAAAFpAQA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2h0BQAAABRMYXN0VG93aW5nQmxvY2tWYWx1ZQUAAAADRGF5CQAAAgAAAAEJAAEsAAAAAgkAASwAAAACAgAAACRZb3UgY2Fubm90IGNsYWltIHRoZSByZXdhcmQgYmVmb3JlOiAJAAGkAAAAAQkAAGkAAAACCQAAZQAAAAIFAAAABmhlaWdodAUAAAAUTGFzdFRvd2luZ0Jsb2NrVmFsdWUFAAAAA0RheQIAAAAFIGRheXMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAABBfTGFzdFRvd2luZ0Jsb2NrBQAAAAZoZWlnaHQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyCQAAaAAAAAIFAAAADFRvd2luZ1Jld2FyZAAAAAAABfXhAAUAAAAGVG93aW5nBQAAAANuaWwAAAAAv+NkZQ==", "height": 2088966, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Bs3eFB1nEf5JHF9FbKZnqhRuAwfrbcHSB8aLtktFPn9d Next: BkcwhRGszZj1UQSZxT8maECjXwz4j5whpkaRS36Pfq2u Diff:
Old | New | Differences | |
---|---|---|---|
26 | 26 | let Week = 10 | |
27 | 27 | ||
28 | 28 | let Day = 5 | |
29 | + | ||
30 | + | @Callable(i) | |
31 | + | func ReceiveFakeHASHForTest () = [ScriptTransfer(i.caller, (10000 * 100000000), HASH)] | |
32 | + | ||
33 | + | ||
29 | 34 | ||
30 | 35 | @Callable(i) | |
31 | 36 | func DepositHASH () = { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let HASH = base58'BJpmNoB9MABJ1ytHhbLNxuUaeoYcYVeTM1r7kh39P24i' | |
5 | 5 | ||
6 | 6 | let KrossCar = base58'4dVMkKtzaWuHC21kmxBBUwKQ5LGayLZLV9snpkJxsGeW' | |
7 | 7 | ||
8 | 8 | let Towing = base58'4BHPskP7pBoXLD7U8nk54CstqbsqRvuWr3SDP8uMrz5w' | |
9 | 9 | ||
10 | 10 | let dAppFees = base58'3PG1NyiC2rdgX46jb8c5zPGuEAzWXhr4L2W' | |
11 | 11 | ||
12 | 12 | let AdmindApp = base58'3PLv5rYMqR4gSiP5ZSjrX2FStLhHTRgFPbb' | |
13 | 13 | ||
14 | 14 | let MinAmount = 700 | |
15 | 15 | ||
16 | 16 | let KrossCarReward = 1 | |
17 | 17 | ||
18 | 18 | let TowingReward = 1 | |
19 | 19 | ||
20 | 20 | let ReferreTip = 1 | |
21 | 21 | ||
22 | 22 | let minJoinWeeks = 8 | |
23 | 23 | ||
24 | 24 | let TimeTowing = 2 | |
25 | 25 | ||
26 | 26 | let Week = 10 | |
27 | 27 | ||
28 | 28 | let Day = 5 | |
29 | + | ||
30 | + | @Callable(i) | |
31 | + | func ReceiveFakeHASHForTest () = [ScriptTransfer(i.caller, (10000 * 100000000), HASH)] | |
32 | + | ||
33 | + | ||
29 | 34 | ||
30 | 35 | @Callable(i) | |
31 | 36 | func DepositHASH () = { | |
32 | 37 | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
33 | 38 | let amount = match getInteger(this, UserDeposit) { | |
34 | 39 | case a: Int => | |
35 | 40 | a | |
36 | 41 | case _ => | |
37 | 42 | 0 | |
38 | 43 | } | |
39 | 44 | let pmt = if ((size(i.payments) == 1)) | |
40 | 45 | then i.payments[0] | |
41 | 46 | else throw("Attached payment is required") | |
42 | 47 | if (if (((MinAmount * 100000000) > pmt.amount)) | |
43 | 48 | then true | |
44 | 49 | else (pmt.assetId != HASH)) | |
45 | 50 | then throw("Can only deposit HASH tokens, and minimum amount is 700 HASH") | |
46 | 51 | else { | |
47 | 52 | let UserDepositValue = (amount + pmt.amount) | |
48 | 53 | [IntegerEntry((toBase58String(i.caller.bytes) + "_Deposit"), UserDepositValue), IntegerEntry((toBase58String(i.caller.bytes) + "_DepositBlock"), height), ScriptTransfer(i.caller, (KrossCarReward * 100000000), KrossCar)] | |
49 | 54 | } | |
50 | 55 | } | |
51 | 56 | ||
52 | 57 | ||
53 | 58 | ||
54 | 59 | @Callable(i) | |
55 | 60 | func RewardReferrer (UserWalletAddressStr) = if ((UserWalletAddressStr == "")) | |
56 | 61 | then throw("Referrer Wallet Address cannot be empty !") | |
57 | 62 | else { | |
58 | 63 | let UserWalletAddress = addressFromStringValue(UserWalletAddressStr) | |
59 | 64 | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
60 | 65 | let TippedStatus = (toBase58String(i.caller.bytes) + "_TippedStatus") | |
61 | 66 | let amount = match getInteger(this, UserDeposit) { | |
62 | 67 | case a: Int => | |
63 | 68 | a | |
64 | 69 | case _ => | |
65 | 70 | 0 | |
66 | 71 | } | |
67 | 72 | let TippedStatusValue = match getString(this, TippedStatus) { | |
68 | 73 | case a: String => | |
69 | 74 | a | |
70 | 75 | case _ => | |
71 | 76 | "NO" | |
72 | 77 | } | |
73 | 78 | if ((TippedStatusValue == "YES")) | |
74 | 79 | then throw("You already tipped a User, you only can tip once a user") | |
75 | 80 | else if (((MinAmount * 100000000) > amount)) | |
76 | 81 | then throw((("To tip your referrer you must have at least deposited: " + toString(MinAmount)) + " HASH")) | |
77 | 82 | else [StringEntry((toBase58String(i.caller.bytes) + "_TippedStatus"), "YES"), ScriptTransfer(UserWalletAddress, (ReferreTip * 100000000), KrossCar)] | |
78 | 83 | } | |
79 | 84 | ||
80 | 85 | ||
81 | 86 | ||
82 | 87 | @Callable(i) | |
83 | 88 | func RequestTowing () = { | |
84 | 89 | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
85 | 90 | let UserMaturity = (toBase58String(i.caller.bytes) + "_DepositBlock") | |
86 | 91 | let LastTowingBlock = (toBase58String(i.caller.bytes) + "_LastTowingBlock") | |
87 | 92 | let amount = match getInteger(this, UserDeposit) { | |
88 | 93 | case a: Int => | |
89 | 94 | a | |
90 | 95 | case _ => | |
91 | 96 | 0 | |
92 | 97 | } | |
93 | 98 | let UserMaturityValue = match getInteger(this, UserMaturity) { | |
94 | 99 | case a: Int => | |
95 | 100 | a | |
96 | 101 | case _ => | |
97 | 102 | 0 | |
98 | 103 | } | |
99 | 104 | let LastTowingBlockValue = match getInteger(this, LastTowingBlock) { | |
100 | 105 | case a: Int => | |
101 | 106 | a | |
102 | 107 | case _ => | |
103 | 108 | 0 | |
104 | 109 | } | |
105 | 110 | if (((MinAmount * 100000000) > ((amount * (height - UserMaturityValue)) / Week))) | |
106 | 111 | then throw(("You should hav deposited at least: " + toString((MinAmount * 100000000)))) | |
107 | 112 | else if (((minJoinWeeks * Week) > (height - UserMaturityValue))) | |
108 | 113 | then throw((("You should at least be a member of " + toString(minJoinWeeks)) + " Weeks")) | |
109 | 114 | else if (((TimeTowing * Day) > ((height - LastTowingBlockValue) / Day))) | |
110 | 115 | then throw((("You cannot claim the reward before: " + toString(((height - LastTowingBlockValue) / Day))) + " days")) | |
111 | 116 | else [IntegerEntry((toBase58String(i.caller.bytes) + "_LastTowingBlock"), height), ScriptTransfer(i.caller, (TowingReward * 100000000), Towing)] | |
112 | 117 | } | |
113 | 118 | ||
114 | 119 |
github/deemru/w8io/169f3d6 29.06 ms ◑