tx · vRkEPpDxqRXJLtKKStEmhHBw9NbH6GzJHymKQaKdivC 3MpcyLdYAQ6Z14cs1Fy3o7XK1cAHajK5g5N: -0.01000000 Waves 2022.04.27 08:30 [2026477] smart account 3MpcyLdYAQ6Z14cs1Fy3o7XK1cAHajK5g5N > SELF 0.00000000 Waves
{ "type": 13, "id": "vRkEPpDxqRXJLtKKStEmhHBw9NbH6GzJHymKQaKdivC", "fee": 1000000, "feeAssetId": null, "timestamp": 1651037488391, "version": 2, "chainId": 84, "sender": "3MpcyLdYAQ6Z14cs1Fy3o7XK1cAHajK5g5N", "senderPublicKey": "CpN2UR96CYA49vvxNChb3NFpAE9TK2nyuCptRU4VkHzS", "proofs": [ "CL28bB85hgGpfKYXc5G9Cd95ib1tkjhLPRWUDe7e823fQCEgHa5EsrpTnMxmPja74D6pGiVFvsBLdZqGcidVJWG" ], "script": "base64:AAIFAAAAAAAAAB8IAhIECgIBARIDCgEIEgcKBQEBAQEIEgMKAQESABIAAAAAGgAAAAADdmVyAgAAAAMxLjAAAAAABHllYXIAAAAAAAAIBSAAAAAACXNlcGFyYXRvcgIAAAACX18AAAAACldBVkVTSURTVFICAAAABVdBVkVTAAAAAAdXQVZFU0lECQACWQAAAAEFAAAACldBVkVTSURTVFIAAAAADG1heEludmVzdEtleQIAAAANJXNfX21heEludmVzdAAAAAAOdG90YWxJbnZlc3RLZXkCAAAADyVzX190b3RhbEludmVzdAAAAAAOaW52ZXN0QXNzZXRLZXkCAAAAESVzX19pbnZlc3RBc3NldElkAAAAAAphcHlGcm9tS2V5AgAAAAslc19fYXB5RnJvbQAAAAAIYXB5VG9LZXkCAAAACSVzX19hcHlUbwAAAAAUaW52ZXN0SW50ZXJ2YWxNaW5LZXkCAAAADyVzX19pbnRlcnZhbE1pbgAAAAAObWF4SW50ZXJ2YWxLZXkCAAAADiVfX21heEludGVydmFsAQAAABBnZXRVc2VySW52ZXN0S2V5AAAAAQAAAAR1c2VyCQAEuQAAAAIJAARMAAAAAgIAAA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AAAAAgUAAAAEZGF0YQAAAAAAAAAAAwkAAZEAAAACBQAAAARkYXRhAAAAAAAAAAAECQABkQAAAAIFAAAABGRhdGEAAAAAAAAAAAUJAAGRAAAAAgUAAAAEZGF0YQAAAAAAAAAABgQAAAAHY2xhaW1lZAkAAGQAAAACCQABkQAAAAIFAAAABGRhdGEAAAAAAAAAAAQFAAAAB3RvQ2xhaW0EAAAAC2NsYWltSGVpZ2h0BQAAAAZoZWlnaHQDCQAAAAAAAAIFAAAAB3RvQ2xhaW0AAAAAAAAAAAAJAAACAAAAAQIAAAAQTm90aGluZyB0byBjbGFpbQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAB3RvQ2xhaW0JAAJZAAAAAQUAAAALaW52ZXN0QXNzZXQJAARMAAAAAgkBAAAAC3NldFVzZXJEYXRhAAAACAkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIJAAGRAAAAAgUAAAAEZGF0YQAAAAAAAAAAAAkAAZEAAAACBQAAAARkYXRhAAAAAAAAAAABBQAAAAtjbGFpbUhlaWdodAkAAZEAAAACBQAAAARkYXRhAAAAAAAAAAADAAAAAAAAAAAABQAAAAdjbGFpbWVkCQABkQAAAAIFAAAABGRhdGEAAAAAAAAAAAYFAAAAA25pbAAAAAFpAQAAAAxkZWxldGVBbW91bnQAAAAAAwkBAAAAAiE9AAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAAR0aGlzCQAAAgAAAAECAAAACU5vdCBvd25lcgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAOdG90YWxJbnZlc3RLZXkAAAAAAAAAAAAFAAAAA25pbAAAAACLZ6EJ", "height": 2026477, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HvPLFokiuzRezM6P8pAtW4Pcpg26sHHWQfuHzkGaZgmX Next: AGNVGwVtDXZqie5MyPjARiiDG2qgkEnEtyivQ87VFcS6 Diff:
Old | New | Differences | |
---|---|---|---|
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(i) | |
129 | - | func setParams (apyFrom,apyTo,maxIntervalMonths,maxInvest,investAsset) = [StringEntry(investAssetKey, investAsset), IntegerEntry(apyToKey, apyTo), IntegerEntry(apyFromKey, apyFrom), IntegerEntry(maxIntervalKey, maxIntervalMonths), IntegerEntry(maxInvestKey, maxInvest)] | |
129 | + | func setParams (apyFrom,apyTo,maxIntervalMonths,maxInvest,investAsset) = if ((i.caller != this)) | |
130 | + | then throw("Not owner") | |
131 | + | else [StringEntry(investAssetKey, investAsset), IntegerEntry(apyToKey, apyTo), IntegerEntry(apyFromKey, apyFrom), IntegerEntry(maxIntervalKey, maxIntervalMonths), IntegerEntry(maxInvestKey, maxInvest)] | |
130 | 132 | ||
131 | 133 | ||
132 | 134 | ||
189 | 191 | ||
190 | 192 | ||
191 | 193 | @Callable(i) | |
192 | - | func deleteAmount () = [IntegerEntry(totalInvestKey, 0)] | |
194 | + | func deleteAmount () = if ((i.caller != this)) | |
195 | + | then throw("Not owner") | |
196 | + | else [IntegerEntry(totalInvestKey, 0)] | |
193 | 197 | ||
194 | 198 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ver = "1.0" | |
5 | 5 | ||
6 | 6 | let year = 525600 | |
7 | 7 | ||
8 | 8 | let separator = "__" | |
9 | 9 | ||
10 | 10 | let WAVESIDSTR = "WAVES" | |
11 | 11 | ||
12 | 12 | let WAVESID = fromBase58String(WAVESIDSTR) | |
13 | 13 | ||
14 | 14 | let maxInvestKey = "%s__maxInvest" | |
15 | 15 | ||
16 | 16 | let totalInvestKey = "%s__totalInvest" | |
17 | 17 | ||
18 | 18 | let investAssetKey = "%s__investAssetId" | |
19 | 19 | ||
20 | 20 | let apyFromKey = "%s__apyFrom" | |
21 | 21 | ||
22 | 22 | let apyToKey = "%s__apyTo" | |
23 | 23 | ||
24 | 24 | let investIntervalMinKey = "%s__intervalMin" | |
25 | 25 | ||
26 | 26 | let maxIntervalKey = "%__maxInterval" | |
27 | 27 | ||
28 | 28 | func getUserInvestKey (user) = makeString(["%s%s$d", "clrcInvest", user], separator) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func valueOrDefault (val,defaultVal) = if ((valueOrElse(val, 0) != 0)) | |
32 | 32 | then val | |
33 | 33 | else defaultVal | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func getMinVal (val1,val2) = if ((val1 > val2)) | |
37 | 37 | then val2 | |
38 | 38 | else val1 | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getMaxVal (val1,val2) = if ((val2 > val1)) | |
42 | 42 | then val2 | |
43 | 43 | else val1 | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func getIntOrZero (key) = valueOrElse(getInteger(this, key), 0) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined")) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("Mandatory this." + key) + " is not defined")) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func toAssetVect (assetStr) = if ((assetStr == WAVESIDSTR)) | |
62 | 62 | then unit | |
63 | 63 | else fromBase58String(assetStr) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func getApy (interval,maxInterval) = { | |
67 | 67 | let apyTo = getIntOrZero(apyToKey) | |
68 | 68 | let apyFrom = getIntOrZero(apyFromKey) | |
69 | 69 | let deltaApy = ((apyTo - apyFrom) * 1000000) | |
70 | 70 | let kInterval = (maxInterval - 1) | |
71 | 71 | let apyNormalize = ((deltaApy * (interval - 1)) / kInterval) | |
72 | 72 | let finalApy = (apyNormalize + (apyFrom * 1000000)) | |
73 | 73 | finalApy | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func readUserData (user) = { | |
78 | 78 | let data = split(getStrOrElse(getUserInvestKey(user), ""), separator) | |
79 | 79 | if ((7 > size(data))) | |
80 | 80 | then [0, 0, 0, 0, 0, 0, 0] | |
81 | 81 | else { | |
82 | 82 | let heightStart = valueOrElse(parseInt(data[1]), 0) | |
83 | 83 | let heightEnd = valueOrElse(parseInt(data[2]), 0) | |
84 | 84 | let claimHeight = valueOrElse(parseInt(data[3]), 0) | |
85 | 85 | let amount = valueOrElse(parseInt(data[4]), 0) | |
86 | 86 | let toClaim = valueOrElse(parseInt(data[5]), 0) | |
87 | 87 | let claimed = valueOrElse(parseInt(data[6]), 0) | |
88 | 88 | let apy = valueOrElse(parseInt(data[7]), 0) | |
89 | 89 | [heightStart, heightEnd, claimHeight, amount, toClaim, claimed, apy] | |
90 | 90 | } | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func setUserData (user,heightStart,heightEnd,claimHeight,amount,toClaim,claimed,apy) = { | |
95 | 95 | let key = getUserInvestKey(user) | |
96 | 96 | let data = makeString(["%d%d%d%d%d%d", toString(heightStart), toString(heightEnd), toString(claimHeight), toString(amount), toString(toClaim), toString(claimed), toString(apy)], separator) | |
97 | 97 | StringEntry(key, data) | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func calculateToClaim (heightStart,heightEnd,claimHeight,amount,toClaim,claimed,apy) = { | |
102 | 102 | let fromClaimHeight = getMaxVal(claimHeight, heightStart) | |
103 | 103 | let toEndHeight = getMinVal(heightEnd, height) | |
104 | 104 | let delta = (toEndHeight - fromClaimHeight) | |
105 | 105 | let koeficient = fraction(apy, delta, year) | |
106 | 106 | let accumulate = fraction(koeficient, amount, 100000000) | |
107 | 107 | (accumulate + toClaim) | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | @Callable(i) | |
112 | 112 | func getApyReaOnly (interval,maxInterval) = { | |
113 | 113 | let currentApy = getApy(interval, maxInterval) | |
114 | 114 | $Tuple2(nil, currentApy) | |
115 | 115 | } | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | ||
119 | 119 | @Callable(i) | |
120 | 120 | func claimReadonly (user) = { | |
121 | 121 | let data = readUserData(user) | |
122 | 122 | let toClaim = calculateToClaim(data[0], data[1], data[2], data[3], data[4], data[5], data[6]) | |
123 | 123 | $Tuple2(nil, toClaim) | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(i) | |
129 | - | func setParams (apyFrom,apyTo,maxIntervalMonths,maxInvest,investAsset) = [StringEntry(investAssetKey, investAsset), IntegerEntry(apyToKey, apyTo), IntegerEntry(apyFromKey, apyFrom), IntegerEntry(maxIntervalKey, maxIntervalMonths), IntegerEntry(maxInvestKey, maxInvest)] | |
129 | + | func setParams (apyFrom,apyTo,maxIntervalMonths,maxInvest,investAsset) = if ((i.caller != this)) | |
130 | + | then throw("Not owner") | |
131 | + | else [StringEntry(investAssetKey, investAsset), IntegerEntry(apyToKey, apyTo), IntegerEntry(apyFromKey, apyFrom), IntegerEntry(maxIntervalKey, maxIntervalMonths), IntegerEntry(maxInvestKey, maxInvest)] | |
130 | 132 | ||
131 | 133 | ||
132 | 134 | ||
133 | 135 | @Callable(i) | |
134 | 136 | func deposit (interval) = { | |
135 | 137 | let minInterval = getIntOrElse(investIntervalMinKey, 43200) | |
136 | 138 | let maxInvest = getIntOrZero(maxInvestKey) | |
137 | 139 | let totalInvested = getIntOrZero(totalInvestKey) | |
138 | 140 | let investAsset = getStringOrFail(investAssetKey) | |
139 | 141 | let userAddress = i.caller | |
140 | 142 | let userAddressString = toString(userAddress) | |
141 | 143 | let maxInterval = getIntOrZero(maxIntervalKey) | |
142 | 144 | let investStart = height | |
143 | 145 | let investEnd = (investStart + (minInterval * interval)) | |
144 | 146 | let invalidAssetMessage = (("Invalid asset. " + investAsset) + " is expected") | |
145 | 147 | if (if ((1 > interval)) | |
146 | 148 | then true | |
147 | 149 | else (interval > maxInterval)) | |
148 | 150 | then throw("Wrong interval") | |
149 | 151 | else if ((size(i.payments) != 1)) | |
150 | 152 | then throw("Invalid payments size") | |
151 | 153 | else { | |
152 | 154 | let payment = i.payments[0] | |
153 | 155 | let amount = payment.amount | |
154 | 156 | let assetId = valueOrErrorMessage(payment.assetId, invalidAssetMessage) | |
155 | 157 | if ((toBase58String(assetId) != investAsset)) | |
156 | 158 | then throw(invalidAssetMessage) | |
157 | 159 | else if (((amount + totalInvested) > maxInvest)) | |
158 | 160 | then throw("The max invest limit has been reached") | |
159 | 161 | else { | |
160 | 162 | let currentApy = getApy(interval, maxInterval) | |
161 | 163 | let userData = readUserData(userAddressString) | |
162 | 164 | let noClaimed = calculateToClaim(userData[0], userData[1], userData[2], userData[3], userData[4], userData[5], userData[6]) | |
163 | 165 | let allAmount = (amount + userData[3]) | |
164 | 166 | let claimed = userData[4] | |
165 | 167 | let toClaim = userData[5] | |
166 | 168 | [setUserData(userAddressString, investStart, investEnd, investStart, allAmount, noClaimed, claimed, currentApy), IntegerEntry(totalInvestKey, (amount + totalInvested))] | |
167 | 169 | } | |
168 | 170 | } | |
169 | 171 | } | |
170 | 172 | ||
171 | 173 | ||
172 | 174 | ||
173 | 175 | @Callable(i) | |
174 | 176 | func claim () = { | |
175 | 177 | let investAsset = getStringOrFail(investAssetKey) | |
176 | 178 | let data = readUserData(toString(i.caller)) | |
177 | 179 | if ((7 > size(data))) | |
178 | 180 | then throw("User has't invest") | |
179 | 181 | else { | |
180 | 182 | let toClaim = calculateToClaim(data[0], data[1], data[2], data[3], data[4], data[5], data[6]) | |
181 | 183 | let claimed = (data[4] + toClaim) | |
182 | 184 | let claimHeight = height | |
183 | 185 | if ((toClaim == 0)) | |
184 | 186 | then throw("Nothing to claim") | |
185 | 187 | else [ScriptTransfer(i.caller, toClaim, fromBase58String(investAsset)), setUserData(toString(i.caller), data[0], data[1], claimHeight, data[3], 0, claimed, data[6])] | |
186 | 188 | } | |
187 | 189 | } | |
188 | 190 | ||
189 | 191 | ||
190 | 192 | ||
191 | 193 | @Callable(i) | |
192 | - | func deleteAmount () = [IntegerEntry(totalInvestKey, 0)] | |
194 | + | func deleteAmount () = if ((i.caller != this)) | |
195 | + | then throw("Not owner") | |
196 | + | else [IntegerEntry(totalInvestKey, 0)] | |
193 | 197 | ||
194 | 198 |
github/deemru/w8io/026f985 57.70 ms ◑