tx · AGNVGwVtDXZqie5MyPjARiiDG2qgkEnEtyivQ87VFcS6 3MpcyLdYAQ6Z14cs1Fy3o7XK1cAHajK5g5N: -0.01000000 Waves 2022.04.27 14:48 [2026850] smart account 3MpcyLdYAQ6Z14cs1Fy3o7XK1cAHajK5g5N > SELF 0.00000000 Waves
{ "type": 13, "id": "AGNVGwVtDXZqie5MyPjARiiDG2qgkEnEtyivQ87VFcS6", "fee": 1000000, "feeAssetId": null, "timestamp": 1651060156459, "version": 2, "chainId": 84, "sender": "3MpcyLdYAQ6Z14cs1Fy3o7XK1cAHajK5g5N", "senderPublicKey": "CpN2UR96CYA49vvxNChb3NFpAE9TK2nyuCptRU4VkHzS", "proofs": [ "54UEEYSHunkyMWCv4RMNgaGMvZcUYtDUKQo17428KKgjNqQpQJXozNKxW5fF9CVSBwkibCDveYsH7KW3pFdsfTnP" ], "script": "base64:AAIFAAAAAAAAACYIAhIECgIBARIDCgEIEgMKAQgSBwoFAQEBAQgSAwoBARIAEgASAAAAABsAAAAAA3ZlcgIAAAADMS4wAAAAAAR5ZWFyAAAAAAAACAUgAAAAAAlzZXBhcmF0b3ICAAAAAl9fAAAAAApXQVZFU0lEU1RSAgAAAAVXQVZFUwAAAAAHV0FWRVNJRAkAAlkAAAABBQAAAApXQVZFU0lEU1RSAAAAAAxtYXhJbnZlc3RLZXkCAAAADSVzX19tYXhJbnZlc3QAAAAADnRvdGFsSW52ZXN0S2V5AgAAAA8lc19fdG90YWxJbnZlc3QAAAAADmludmVzdEFzc2V0S2V5AgAAABElc19faW52ZXN0QXNzZXRJZAAAAAAKYXB5RnJvbUtleQIAAAALJXNfX2FweUZyb20AAAAACGFweVRvS2V5AgAAAAklc19fYXB5VG8AAAAAFGludmVzdEludGVydmFsTWluS2V5AgAAAA8lc19faW50ZXJ2YWxNaW4AAAAADm1heEludGVydmFsS2V5AgAAAA4lX19tYXhJbnRlcnZhbAEAAAAQZ2V0VXNlckludmVzdEtleQAAAAEAAAAEdXNlcgkABLk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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAA25pbAAAAAFpAQAAAAxkZWxldGVBbW91bnQAAAAAAwkBAAAAAiE9AAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAAR0aGlzCQAAAgAAAAECAAAACU5vdCBvd25lcgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAOdG90YWxJbnZlc3RLZXkAAAAAAAAAAAAFAAAAA25pbAAAAACoPsnI", "height": 2026850, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: vRkEPpDxqRXJLtKKStEmhHBw9NbH6GzJHymKQaKdivC Next: 7ToLhrUZefvWhNQjNw8Zq98EhR7Mf61EaHptAYMBMMmp Diff:
Old | New | Differences | |
---|---|---|---|
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | + | func calculateForfeit (heightStart,heightEnd,claimHeight,amount,toClaim,claimed,apy) = { | |
112 | + | let fromClaimHeight = heightStart | |
113 | + | let toEndHeight = getMinVal(heightEnd, height) | |
114 | + | let delta = (toEndHeight - fromClaimHeight) | |
115 | + | let koeficient = fraction(apy, delta, year) | |
116 | + | let accumulate = fraction(koeficient, amount, 100000000) | |
117 | + | let fdelta = (heightEnd - toEndHeight) | |
118 | + | let fkoeficient = fraction((apy * 2), delta, year) | |
119 | + | let faccumulate = fraction(fkoeficient, amount, 100000000) | |
120 | + | (accumulate + faccumulate) | |
121 | + | } | |
122 | + | ||
123 | + | ||
111 | 124 | @Callable(i) | |
112 | 125 | func getApyReaOnly (interval,maxInterval) = { | |
113 | 126 | let currentApy = getApy(interval, maxInterval) | |
121 | 134 | let data = readUserData(user) | |
122 | 135 | let toClaim = calculateToClaim(data[0], data[1], data[2], data[3], data[4], data[5], data[6]) | |
123 | 136 | $Tuple2(nil, toClaim) | |
137 | + | } | |
138 | + | ||
139 | + | ||
140 | + | ||
141 | + | @Callable(i) | |
142 | + | func forfaitReadonly (user) = { | |
143 | + | let data = readUserData(user) | |
144 | + | let forfeit = calculateForfeit(data[0], data[1], data[2], data[3], data[4], data[5], data[6]) | |
145 | + | $Tuple2(nil, forfeit) | |
124 | 146 | } | |
125 | 147 | ||
126 | 148 | ||
191 | 213 | ||
192 | 214 | ||
193 | 215 | @Callable(i) | |
216 | + | func cancelInvest () = { | |
217 | + | let investAsset = getStringOrFail(investAssetKey) | |
218 | + | let userData = readUserData(toString(i.caller)) | |
219 | + | if ((7 > size(userData))) | |
220 | + | then throw("User has't invest") | |
221 | + | else { | |
222 | + | let toClaim = calculateToClaim(userData[0], userData[1], userData[2], userData[3], userData[4], userData[5], userData[6]) | |
223 | + | let forfeiht = calculateForfeit(userData[0], userData[1], userData[2], userData[3], userData[4], userData[5], userData[6]) | |
224 | + | let amount = userData[3] | |
225 | + | let totalAmount = ((toClaim + amount) - forfeiht) | |
226 | + | [ScriptTransfer(i.caller, toClaim, fromBase58String(investAsset)), setUserData(toString(i.caller), 0, 0, 0, 0, 0, 0, 0)] | |
227 | + | } | |
228 | + | } | |
229 | + | ||
230 | + | ||
231 | + | ||
232 | + | @Callable(i) | |
194 | 233 | func deleteAmount () = if ((i.caller != this)) | |
195 | 234 | then throw("Not owner") | |
196 | 235 | else [IntegerEntry(totalInvestKey, 0)] |
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 | + | func calculateForfeit (heightStart,heightEnd,claimHeight,amount,toClaim,claimed,apy) = { | |
112 | + | let fromClaimHeight = heightStart | |
113 | + | let toEndHeight = getMinVal(heightEnd, height) | |
114 | + | let delta = (toEndHeight - fromClaimHeight) | |
115 | + | let koeficient = fraction(apy, delta, year) | |
116 | + | let accumulate = fraction(koeficient, amount, 100000000) | |
117 | + | let fdelta = (heightEnd - toEndHeight) | |
118 | + | let fkoeficient = fraction((apy * 2), delta, year) | |
119 | + | let faccumulate = fraction(fkoeficient, amount, 100000000) | |
120 | + | (accumulate + faccumulate) | |
121 | + | } | |
122 | + | ||
123 | + | ||
111 | 124 | @Callable(i) | |
112 | 125 | func getApyReaOnly (interval,maxInterval) = { | |
113 | 126 | let currentApy = getApy(interval, maxInterval) | |
114 | 127 | $Tuple2(nil, currentApy) | |
115 | 128 | } | |
116 | 129 | ||
117 | 130 | ||
118 | 131 | ||
119 | 132 | @Callable(i) | |
120 | 133 | func claimReadonly (user) = { | |
121 | 134 | let data = readUserData(user) | |
122 | 135 | let toClaim = calculateToClaim(data[0], data[1], data[2], data[3], data[4], data[5], data[6]) | |
123 | 136 | $Tuple2(nil, toClaim) | |
137 | + | } | |
138 | + | ||
139 | + | ||
140 | + | ||
141 | + | @Callable(i) | |
142 | + | func forfaitReadonly (user) = { | |
143 | + | let data = readUserData(user) | |
144 | + | let forfeit = calculateForfeit(data[0], data[1], data[2], data[3], data[4], data[5], data[6]) | |
145 | + | $Tuple2(nil, forfeit) | |
124 | 146 | } | |
125 | 147 | ||
126 | 148 | ||
127 | 149 | ||
128 | 150 | @Callable(i) | |
129 | 151 | func setParams (apyFrom,apyTo,maxIntervalMonths,maxInvest,investAsset) = if ((i.caller != this)) | |
130 | 152 | then throw("Not owner") | |
131 | 153 | else [StringEntry(investAssetKey, investAsset), IntegerEntry(apyToKey, apyTo), IntegerEntry(apyFromKey, apyFrom), IntegerEntry(maxIntervalKey, maxIntervalMonths), IntegerEntry(maxInvestKey, maxInvest)] | |
132 | 154 | ||
133 | 155 | ||
134 | 156 | ||
135 | 157 | @Callable(i) | |
136 | 158 | func deposit (interval) = { | |
137 | 159 | let minInterval = getIntOrElse(investIntervalMinKey, 43200) | |
138 | 160 | let maxInvest = getIntOrZero(maxInvestKey) | |
139 | 161 | let totalInvested = getIntOrZero(totalInvestKey) | |
140 | 162 | let investAsset = getStringOrFail(investAssetKey) | |
141 | 163 | let userAddress = i.caller | |
142 | 164 | let userAddressString = toString(userAddress) | |
143 | 165 | let maxInterval = getIntOrZero(maxIntervalKey) | |
144 | 166 | let investStart = height | |
145 | 167 | let investEnd = (investStart + (minInterval * interval)) | |
146 | 168 | let invalidAssetMessage = (("Invalid asset. " + investAsset) + " is expected") | |
147 | 169 | if (if ((1 > interval)) | |
148 | 170 | then true | |
149 | 171 | else (interval > maxInterval)) | |
150 | 172 | then throw("Wrong interval") | |
151 | 173 | else if ((size(i.payments) != 1)) | |
152 | 174 | then throw("Invalid payments size") | |
153 | 175 | else { | |
154 | 176 | let payment = i.payments[0] | |
155 | 177 | let amount = payment.amount | |
156 | 178 | let assetId = valueOrErrorMessage(payment.assetId, invalidAssetMessage) | |
157 | 179 | if ((toBase58String(assetId) != investAsset)) | |
158 | 180 | then throw(invalidAssetMessage) | |
159 | 181 | else if (((amount + totalInvested) > maxInvest)) | |
160 | 182 | then throw("The max invest limit has been reached") | |
161 | 183 | else { | |
162 | 184 | let currentApy = getApy(interval, maxInterval) | |
163 | 185 | let userData = readUserData(userAddressString) | |
164 | 186 | let noClaimed = calculateToClaim(userData[0], userData[1], userData[2], userData[3], userData[4], userData[5], userData[6]) | |
165 | 187 | let allAmount = (amount + userData[3]) | |
166 | 188 | let claimed = userData[4] | |
167 | 189 | let toClaim = userData[5] | |
168 | 190 | [setUserData(userAddressString, investStart, investEnd, investStart, allAmount, noClaimed, claimed, currentApy), IntegerEntry(totalInvestKey, (amount + totalInvested))] | |
169 | 191 | } | |
170 | 192 | } | |
171 | 193 | } | |
172 | 194 | ||
173 | 195 | ||
174 | 196 | ||
175 | 197 | @Callable(i) | |
176 | 198 | func claim () = { | |
177 | 199 | let investAsset = getStringOrFail(investAssetKey) | |
178 | 200 | let data = readUserData(toString(i.caller)) | |
179 | 201 | if ((7 > size(data))) | |
180 | 202 | then throw("User has't invest") | |
181 | 203 | else { | |
182 | 204 | let toClaim = calculateToClaim(data[0], data[1], data[2], data[3], data[4], data[5], data[6]) | |
183 | 205 | let claimed = (data[4] + toClaim) | |
184 | 206 | let claimHeight = height | |
185 | 207 | if ((toClaim == 0)) | |
186 | 208 | then throw("Nothing to claim") | |
187 | 209 | else [ScriptTransfer(i.caller, toClaim, fromBase58String(investAsset)), setUserData(toString(i.caller), data[0], data[1], claimHeight, data[3], 0, claimed, data[6])] | |
188 | 210 | } | |
189 | 211 | } | |
190 | 212 | ||
191 | 213 | ||
192 | 214 | ||
193 | 215 | @Callable(i) | |
216 | + | func cancelInvest () = { | |
217 | + | let investAsset = getStringOrFail(investAssetKey) | |
218 | + | let userData = readUserData(toString(i.caller)) | |
219 | + | if ((7 > size(userData))) | |
220 | + | then throw("User has't invest") | |
221 | + | else { | |
222 | + | let toClaim = calculateToClaim(userData[0], userData[1], userData[2], userData[3], userData[4], userData[5], userData[6]) | |
223 | + | let forfeiht = calculateForfeit(userData[0], userData[1], userData[2], userData[3], userData[4], userData[5], userData[6]) | |
224 | + | let amount = userData[3] | |
225 | + | let totalAmount = ((toClaim + amount) - forfeiht) | |
226 | + | [ScriptTransfer(i.caller, toClaim, fromBase58String(investAsset)), setUserData(toString(i.caller), 0, 0, 0, 0, 0, 0, 0)] | |
227 | + | } | |
228 | + | } | |
229 | + | ||
230 | + | ||
231 | + | ||
232 | + | @Callable(i) | |
194 | 233 | func deleteAmount () = if ((i.caller != this)) | |
195 | 234 | then throw("Not owner") | |
196 | 235 | else [IntegerEntry(totalInvestKey, 0)] | |
197 | 236 | ||
198 | 237 |
github/deemru/w8io/026f985 41.73 ms ◑