tx · FCV8jNouP2vzJST2wBHZK4yJN4xETN5ftGQbMpLLqqrc 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw: -0.01000000 Waves 2022.06.08 22:15 [2087796] smart account 3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw > SELF 0.00000000 Waves
{ "type": 13, "id": "FCV8jNouP2vzJST2wBHZK4yJN4xETN5ftGQbMpLLqqrc", "fee": 1000000, "feeAssetId": null, "timestamp": 1654715764514, "version": 2, "chainId": 84, "sender": "3N7nJwbFGppbebBtXy6bWVcQCGu7m3kXFaw", "senderPublicKey": "GTKqLSK6nuFkRdebB5SmTwTU2DnTeLMvhymCFfT2CxX2", "proofs": [ "3CNhZw8jH1yaGCL48yHWTr5WaFTkCRmDAm2X93YeyzGaEzrSNaHBJs8MBmZqJwDEf91fKTEZdzAcDJLT5yputDF" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgMKAQgSAAAAAA0AAAAABEhBU0gBAAAAIJklwE3i+u/bc48vf4d/BnVXhMLmuX4eB+81QVXPc36rAAAAAAhLcm9zc0NhcgEAAAAgNewIuJ8fl0L3aDIXfe5KYUI4pQbPPcpdLtTikAZosrsAAAAABlRvd2luZwEAAAAgLzVn9FxXOELHRV9NM7WHnRz83AP0i2FsXYU/kxb44koAAAAACGRBcHBGZWVzAQAAABoBV5prAZfpnthmNq2ZMbws44Htl6ZEmG28iwAAAAAJQWRtaW5kQXBwAQAAABoBV9BDQuIchL6bmoa833jKal/OBiGoZGoQDgAAAAAJTWluQW1vdW50AAAAAAAAAAK8AAAAAA5Lcm9zc0NhclJld2FyZAAAAAAAAAAAAQAAAAAMVG93aW5nUmV3YXJkAAAAAAAAAAABAAAAAApSZWZlcnJlVGlwAAAAAAAAAAABAAAAAAxtaW5Kb2luV2Vla3MAAAAAAAAAAAgAAAAAClRpbWVUb3dpbmcAAAAAAAAAAB4AAAAABFdlZWsAAAAAAAAAAAoAAAAAA0RheQAAAAAAAAAABQAAAAMAAAABaQEAA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YQAAAAAAAAAAAAQAAAAUTGFzdFRvd2luZ0Jsb2NrVmFsdWUEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAPTGFzdFRvd2luZ0Jsb2NrAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADAwMJAABmAAAAAgkAAGgAAAACBQAAAAlNaW5BbW91bnQAAAAAAAX14QAJAABpAAAAAgkAAGgAAAACBQAAAAZhbW91bnQJAABlAAAAAgUAAAAGaGVpZ2h0BQAAABFVc2VyTWF0dXJpdHlWYWx1ZQUAAAAEV2VlawYJAABmAAAAAgkAAGgAAAACBQAAAAxtaW5Kb2luV2Vla3MFAAAABFdlZWsJAABlAAAAAgUAAAAGaGVpZ2h0BQAAABFVc2VyTWF0dXJpdHlWYWx1ZQYJAABmAAAAAgkAAGgAAAACBQAAAApUaW1lVG93aW5nBQAAAANEYXkFAAAAFExhc3RUb3dpbmdCbG9ja1ZhbHVlCQAAAgAAAAECAAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAAEF9MYXN0VG93aW5nQmxvY2sFAAAABmhlaWdodAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIJAABoAAAAAgUAAAAMVG93aW5nUmV3YXJkAAAAAAAF9eEABQAAAAZUb3dpbmcFAAAAA25pbAAAAAA+X0sM", "height": 2087796, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4TKUWPBoMW8BGMBYAYHawuoGfx2F6aun89AZ34CnmKmP Next: Bu5R81Vep5Rh3FejUPWNxKLm8THHjGGfkMAj1wSgWq3 Diff:
Old | New | Differences | |
---|---|---|---|
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(i) | |
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) { | |
59 | - | case a: Int => | |
60 | - | a | |
61 | - | case _ => | |
62 | - | 0 | |
63 | - | } | |
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 | - | } | |
55 | + | func RewardReferrer (UserWalletAddressStr) = if ((UserWalletAddressStr == "")) | |
56 | + | then throw("Referrer Wallet Address cannot be empty !") | |
57 | + | else { | |
58 | + | let UserWalletAddress = addressFromStringValue(UserWalletAddressStr) | |
59 | + | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
60 | + | let TippedStatus = (toBase58String(i.caller.bytes) + "_TippedStatus") | |
61 | + | let amount = match getInteger(this, UserDeposit) { | |
62 | + | case a: Int => | |
63 | + | a | |
64 | + | case _ => | |
65 | + | 0 | |
66 | + | } | |
67 | + | let TippedStatusValue = getStringValue(this, TippedStatus) | |
68 | + | if ((TippedStatusValue == "YES")) | |
69 | + | then throw("You already tipped a User, you only can tip once a user") | |
70 | + | else if (((MinAmount * 100000000) > amount)) | |
71 | + | then throw((("To tip your referrer you must have at least deposited: " + toString(MinAmount)) + " HASH")) | |
72 | + | else [StringEntry((toBase58String(i.caller.bytes) + "_TippedStatus"), "YES"), ScriptTransfer(UserWalletAddress, (ReferreTip * 100000000), KrossCar)] | |
73 | + | } | |
71 | 74 | ||
72 | 75 | ||
73 | 76 |
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 | 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 | - | 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) { | |
59 | - | case a: Int => | |
60 | - | a | |
61 | - | case _ => | |
62 | - | 0 | |
63 | - | } | |
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 | - | } | |
55 | + | func RewardReferrer (UserWalletAddressStr) = if ((UserWalletAddressStr == "")) | |
56 | + | then throw("Referrer Wallet Address cannot be empty !") | |
57 | + | else { | |
58 | + | let UserWalletAddress = addressFromStringValue(UserWalletAddressStr) | |
59 | + | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
60 | + | let TippedStatus = (toBase58String(i.caller.bytes) + "_TippedStatus") | |
61 | + | let amount = match getInteger(this, UserDeposit) { | |
62 | + | case a: Int => | |
63 | + | a | |
64 | + | case _ => | |
65 | + | 0 | |
66 | + | } | |
67 | + | let TippedStatusValue = getStringValue(this, TippedStatus) | |
68 | + | if ((TippedStatusValue == "YES")) | |
69 | + | then throw("You already tipped a User, you only can tip once a user") | |
70 | + | else if (((MinAmount * 100000000) > amount)) | |
71 | + | then throw((("To tip your referrer you must have at least deposited: " + toString(MinAmount)) + " HASH")) | |
72 | + | else [StringEntry((toBase58String(i.caller.bytes) + "_TippedStatus"), "YES"), ScriptTransfer(UserWalletAddress, (ReferreTip * 100000000), KrossCar)] | |
73 | + | } | |
71 | 74 | ||
72 | 75 | ||
73 | 76 | ||
74 | 77 | @Callable(i) | |
75 | 78 | func RequestTowing () = { | |
76 | 79 | let UserDeposit = (toBase58String(i.caller.bytes) + "_Deposit") | |
77 | 80 | let UserMaturity = (toBase58String(i.caller.bytes) + "_DepositBlock") | |
78 | 81 | let LastTowingBlock = (toBase58String(i.caller.bytes) + "_LastTowingBlock") | |
79 | 82 | let amount = match getInteger(this, UserDeposit) { | |
80 | 83 | case a: Int => | |
81 | 84 | a | |
82 | 85 | case _ => | |
83 | 86 | 0 | |
84 | 87 | } | |
85 | 88 | let UserMaturityValue = match getInteger(this, UserMaturity) { | |
86 | 89 | case a: Int => | |
87 | 90 | a | |
88 | 91 | case _ => | |
89 | 92 | 0 | |
90 | 93 | } | |
91 | 94 | let LastTowingBlockValue = match getInteger(this, LastTowingBlock) { | |
92 | 95 | case a: Int => | |
93 | 96 | a | |
94 | 97 | case _ => | |
95 | 98 | 0 | |
96 | 99 | } | |
97 | 100 | if (if (if (((MinAmount * 100000000) > ((amount * (height - UserMaturityValue)) / Week))) | |
98 | 101 | then true | |
99 | 102 | else ((minJoinWeeks * Week) > (height - UserMaturityValue))) | |
100 | 103 | then true | |
101 | 104 | else ((TimeTowing * Day) > LastTowingBlockValue)) | |
102 | 105 | then throw("") | |
103 | 106 | else [IntegerEntry((toBase58String(i.caller.bytes) + "_LastTowingBlock"), height), ScriptTransfer(i.caller, (TowingReward * 100000000), Towing)] | |
104 | 107 | } | |
105 | 108 | ||
106 | 109 |
github/deemru/w8io/169f3d6 29.78 ms ◑