tx · 4TKUWPBoMW8BGMBYAYHawuoGfx2F6aun89AZ34CnmKmP 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw: -0.01000000 Waves 2022.06.08 22:09 [2087788] smart account 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw > SELF 0.00000000 Waves
{ "type": 13, "id": "4TKUWPBoMW8BGMBYAYHawuoGfx2F6aun89AZ34CnmKmP", "fee": 1000000, "feeAssetId": null, "timestamp": 1654715383375, "version": 2, "chainId": 84, "sender": "3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw", "senderPublicKey": "GTKqLSK6nuFkRdebB5SmTwTU2DnTeLMvhymCFfT2CxX2", "proofs": [ "3czyJggy3cQxfeKJav2TBJiyUy43pPWDRf8xDdrbDdmQgCYsxhSYJ4E3GPQFHwEQa4XAzeU1iVmTBrbaQHieLmGJ" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgMKAQgSAAAAAA0AAAAABEhBU0gBAAAAIJklwE3i+u/bc48vf4d/BnVXhMLmuX4eB+81QVXPc36rAAAAAAhLcm9zc0NhcgEAAAAgNewIuJ8fl0L3aDIXfe5KYUI4pQbPPcpdLtTikAZosrsAAAAABlRvd2luZwEAAAAgLzVn9FxXOELHRV9NM7WHnRz83AP0i2FsXYU/kxb44koAAAAACGRBcHBGZWVzAQAAABoBV5prAZfpnthmNq2ZMbws44Htl6ZEmG28iwAAAAAJQWRtaW5kQXBwAQAAABoBV9BDQuIchL6bmoa833jKal/OBiGoZGoQDgAAAAAJTWluQW1vdW50AAAAAAAAAAK8AAAAAA5Lcm9zc0NhclJld2FyZAAAAAAAAAAAAQAAAAAMVG93aW5nUmV3YXJkAAAAAAAAAAABAAAAAApSZWZlcnJlVGlwAAAAAAAAAAABAAAAAAxtaW5Kb2luV2Vla3MAAAAAAAAAAAgAAAAAClRpbWVUb3dpbmcAAAAAAAAAAB4AAAAABFdlZWsAAAAAAAAAAAoAAAAAA0RheQAAAAAAAAAABQAAAAMAAAABa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FAAAACU1pbkFtb3VudAAAAAAABfXhAAkAAGkAAAACCQAAaAAAAAIFAAAABmFtb3VudAkAAGUAAAACBQAAAAZoZWlnaHQFAAAAEVVzZXJNYXR1cml0eVZhbHVlBQAAAARXZWVrBgkAAGYAAAACCQAAaAAAAAIFAAAADG1pbkpvaW5XZWVrcwUAAAAEV2VlawkAAGUAAAACBQAAAAZoZWlnaHQFAAAAEVVzZXJNYXR1cml0eVZhbHVlBgkAAGYAAAACCQAAaAAAAAIFAAAAClRpbWVUb3dpbmcFAAAAA0RheQUAAAAUTGFzdFRvd2luZ0Jsb2NrVmFsdWUJAAACAAAAAQIAAAAACQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAQX0xhc3RUb3dpbmdCbG9jawUAAAAGaGVpZ2h0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgkAAGgAAAACBQAAAAxUb3dpbmdSZXdhcmQAAAAAAAX14QAFAAAABlRvd2luZwUAAAADbmlsAAAAABpTTZE=", "height": 2087788, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8wn6b7KHg9Xxt7x4Frs34WsdRdZg2nSba621tRE6U7TJ Next: FCV8jNouP2vzJST2wBHZK4yJN4xETN5ftGQbMpLLqqrc Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | let pmt = if ((size(i.payments) == 1)) | |
40 | 40 | then i.payments[0] | |
41 | 41 | else throw("Attached payment is required") | |
42 | - | if (if (((MinAmount * 100000000) > | |
42 | + | if (if (((MinAmount * 100000000) > pmt.amount)) | |
43 | 43 | then true | |
44 | 44 | else (pmt.assetId != HASH)) | |
45 | 45 | then throw("Can only deposit HASH tokens, and minimum amount is 700 HASH") |
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 = 30 | |
25 | 25 | ||
26 | 26 | let Week = 10 | |
27 | 27 | ||
28 | 28 | let Day = 5 | |
29 | 29 | ||
30 | 30 | @Callable(i) | |
31 | 31 | func DepositHASH () = { | |
32 | 32 | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
33 | 33 | let amount = match getInteger(this, UserDeposit) { | |
34 | 34 | case a: Int => | |
35 | 35 | a | |
36 | 36 | case _ => | |
37 | 37 | 0 | |
38 | 38 | } | |
39 | 39 | let pmt = if ((size(i.payments) == 1)) | |
40 | 40 | then i.payments[0] | |
41 | 41 | else throw("Attached payment is required") | |
42 | - | if (if (((MinAmount * 100000000) > | |
42 | + | if (if (((MinAmount * 100000000) > pmt.amount)) | |
43 | 43 | then true | |
44 | 44 | else (pmt.assetId != HASH)) | |
45 | 45 | then throw("Can only deposit HASH tokens, and minimum amount is 700 HASH") | |
46 | 46 | else { | |
47 | 47 | let UserDepositValue = (amount + pmt.amount) | |
48 | 48 | [IntegerEntry((toBase58String(i.caller.bytes) + "_Deposit"), UserDepositValue), IntegerEntry((toBase58String(i.caller.bytes) + "_DepositBlock"), height), ScriptTransfer(i.caller, (KrossCarReward * 100000000), KrossCar)] | |
49 | 49 | } | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(i) | |
55 | 55 | func RewardReferrer (UserWalletAddress) = { | |
56 | 56 | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
57 | 57 | let TippedStatus = (toBase58String(i.caller.bytes) + "_TippedStatus") | |
58 | 58 | let amount = match getInteger(this, UserDeposit) { | |
59 | 59 | case a: Int => | |
60 | 60 | a | |
61 | 61 | case _ => | |
62 | 62 | 0 | |
63 | 63 | } | |
64 | 64 | let TippedStatusValue = getStringValue(this, TippedStatus) | |
65 | 65 | if ((TippedStatusValue == "YES")) | |
66 | 66 | then throw("You already tipped a User, you only can tip once a user") | |
67 | 67 | else if (((MinAmount * 100000000) > amount)) | |
68 | 68 | then throw((("To tip your referrer you must have at least deposited: " + toString(MinAmount)) + " HASH")) | |
69 | 69 | else [StringEntry((toBase58String(i.caller.bytes) + "_TippedStatus"), "YES"), ScriptTransfer(i.caller, (ReferreTip * 100000000), KrossCar)] | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | ||
74 | 74 | @Callable(i) | |
75 | 75 | func RequestTowing () = { | |
76 | 76 | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
77 | 77 | let UserMaturity = (toBase58String(i.caller.bytes) + "_DepositBlock") | |
78 | 78 | let LastTowingBlock = (toBase58String(i.caller.bytes) + "_LastTowingBlock") | |
79 | 79 | let amount = match getInteger(this, UserDeposit) { | |
80 | 80 | case a: Int => | |
81 | 81 | a | |
82 | 82 | case _ => | |
83 | 83 | 0 | |
84 | 84 | } | |
85 | 85 | let UserMaturityValue = match getInteger(this, UserMaturity) { | |
86 | 86 | case a: Int => | |
87 | 87 | a | |
88 | 88 | case _ => | |
89 | 89 | 0 | |
90 | 90 | } | |
91 | 91 | let LastTowingBlockValue = match getInteger(this, LastTowingBlock) { | |
92 | 92 | case a: Int => | |
93 | 93 | a | |
94 | 94 | case _ => | |
95 | 95 | 0 | |
96 | 96 | } | |
97 | 97 | if (if (if (((MinAmount * 100000000) > ((amount * (height - UserMaturityValue)) / Week))) | |
98 | 98 | then true | |
99 | 99 | else ((minJoinWeeks * Week) > (height - UserMaturityValue))) | |
100 | 100 | then true | |
101 | 101 | else ((TimeTowing * Day) > LastTowingBlockValue)) | |
102 | 102 | then throw("") | |
103 | 103 | else [IntegerEntry((toBase58String(i.caller.bytes) + "_LastTowingBlock"), height), ScriptTransfer(i.caller, (TowingReward * 100000000), Towing)] | |
104 | 104 | } | |
105 | 105 | ||
106 | 106 |
github/deemru/w8io/169f3d6 24.23 ms ◑