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:AAIFAAAAAAAAACYIAhIECgIBARIDCgEIEgMKAQgSBwoFAQEBAQgSAwoBARIAEgASAAAAABsAAAAAA3ZlcgIAAAADMS4wAAAAAAR5ZWFyAAAAAAAACAUgAAAAAAlzZXBhcmF0b3ICAAAAAl9fAAAAAApXQVZFU0lEU1RSAgAAAAVXQVZFUwAAAAAHV0FWRVNJRAkAAlkAAAABBQAAAApXQVZFU0lEU1RSAAAAAAxtYXhJbnZlc3RLZXkCAAAADSVzX19tYXhJbnZlc3QAAAAADnRvdGFsSW52ZXN0S2V5AgAAAA8lc19fdG90YWxJbnZlc3QAAAAADmludmVzdEFzc2V0S2V5AgAAABElc19faW52ZXN0QXNzZXRJZAAAAAAKYXB5RnJvbUtleQIAAAALJXNfX2FweUZyb20AAAAACGFweVRvS2V5AgAAAAklc19fYXB5VG8AAAAAFGludmVzdEludGVydmFsTWluS2V5AgAAAA8lc19faW50ZXJ2YWxNaW4AAAAADm1heEludGVydmFsS2V5AgAAAA4lX19tYXhJbnRlcnZhbAEAAAAQZ2V0VXNlckludmVzdEtleQAAAAEAAAAEdXNlcgkABL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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAA25pbAAAAAFpAQAAAAxkZWxldGVBbW91bnQAAAAAAwkBAAAAAiE9AAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAAR0aGlzCQAAAgAAAAECAAAACU5vdCBvd25lcgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAOdG90YWxJbnZlc3RLZXkAAAAAAAAAAAAFAAAAA25pbAAAAACoPsnI", "height": 2026850, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: vRkEPpDxqRXJLtKKStEmhHBw9NbH6GzJHymKQaKdivC Next: 7ToLhrUZefvWhNQjNw8Zq98EhR7Mf61EaHptAYMBMMmp Diff:
OldNewDifferences
108108 }
109109
110110
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+
111124 @Callable(i)
112125 func getApyReaOnly (interval,maxInterval) = {
113126 let currentApy = getApy(interval, maxInterval)
121134 let data = readUserData(user)
122135 let toClaim = calculateToClaim(data[0], data[1], data[2], data[3], data[4], data[5], data[6])
123136 $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)
124146 }
125147
126148
191213
192214
193215 @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)
194233 func deleteAmount () = if ((i.caller != this))
195234 then throw("Not owner")
196235 else [IntegerEntry(totalInvestKey, 0)]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ver = "1.0"
55
66 let year = 525600
77
88 let separator = "__"
99
1010 let WAVESIDSTR = "WAVES"
1111
1212 let WAVESID = fromBase58String(WAVESIDSTR)
1313
1414 let maxInvestKey = "%s__maxInvest"
1515
1616 let totalInvestKey = "%s__totalInvest"
1717
1818 let investAssetKey = "%s__investAssetId"
1919
2020 let apyFromKey = "%s__apyFrom"
2121
2222 let apyToKey = "%s__apyTo"
2323
2424 let investIntervalMinKey = "%s__intervalMin"
2525
2626 let maxIntervalKey = "%__maxInterval"
2727
2828 func getUserInvestKey (user) = makeString(["%s%s$d", "clrcInvest", user], separator)
2929
3030
3131 func valueOrDefault (val,defaultVal) = if ((valueOrElse(val, 0) != 0))
3232 then val
3333 else defaultVal
3434
3535
3636 func getMinVal (val1,val2) = if ((val1 > val2))
3737 then val2
3838 else val1
3939
4040
4141 func getMaxVal (val1,val2) = if ((val2 > val1))
4242 then val2
4343 else val1
4444
4545
4646 func getIntOrZero (key) = valueOrElse(getInteger(this, key), 0)
4747
4848
4949 func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal)
5050
5151
5252 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined"))
5353
5454
5555 func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal)
5656
5757
5858 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("Mandatory this." + key) + " is not defined"))
5959
6060
6161 func toAssetVect (assetStr) = if ((assetStr == WAVESIDSTR))
6262 then unit
6363 else fromBase58String(assetStr)
6464
6565
6666 func getApy (interval,maxInterval) = {
6767 let apyTo = getIntOrZero(apyToKey)
6868 let apyFrom = getIntOrZero(apyFromKey)
6969 let deltaApy = ((apyTo - apyFrom) * 1000000)
7070 let kInterval = (maxInterval - 1)
7171 let apyNormalize = ((deltaApy * (interval - 1)) / kInterval)
7272 let finalApy = (apyNormalize + (apyFrom * 1000000))
7373 finalApy
7474 }
7575
7676
7777 func readUserData (user) = {
7878 let data = split(getStrOrElse(getUserInvestKey(user), ""), separator)
7979 if ((7 > size(data)))
8080 then [0, 0, 0, 0, 0, 0, 0]
8181 else {
8282 let heightStart = valueOrElse(parseInt(data[1]), 0)
8383 let heightEnd = valueOrElse(parseInt(data[2]), 0)
8484 let claimHeight = valueOrElse(parseInt(data[3]), 0)
8585 let amount = valueOrElse(parseInt(data[4]), 0)
8686 let toClaim = valueOrElse(parseInt(data[5]), 0)
8787 let claimed = valueOrElse(parseInt(data[6]), 0)
8888 let apy = valueOrElse(parseInt(data[7]), 0)
8989 [heightStart, heightEnd, claimHeight, amount, toClaim, claimed, apy]
9090 }
9191 }
9292
9393
9494 func setUserData (user,heightStart,heightEnd,claimHeight,amount,toClaim,claimed,apy) = {
9595 let key = getUserInvestKey(user)
9696 let data = makeString(["%d%d%d%d%d%d", toString(heightStart), toString(heightEnd), toString(claimHeight), toString(amount), toString(toClaim), toString(claimed), toString(apy)], separator)
9797 StringEntry(key, data)
9898 }
9999
100100
101101 func calculateToClaim (heightStart,heightEnd,claimHeight,amount,toClaim,claimed,apy) = {
102102 let fromClaimHeight = getMaxVal(claimHeight, heightStart)
103103 let toEndHeight = getMinVal(heightEnd, height)
104104 let delta = (toEndHeight - fromClaimHeight)
105105 let koeficient = fraction(apy, delta, year)
106106 let accumulate = fraction(koeficient, amount, 100000000)
107107 (accumulate + toClaim)
108108 }
109109
110110
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+
111124 @Callable(i)
112125 func getApyReaOnly (interval,maxInterval) = {
113126 let currentApy = getApy(interval, maxInterval)
114127 $Tuple2(nil, currentApy)
115128 }
116129
117130
118131
119132 @Callable(i)
120133 func claimReadonly (user) = {
121134 let data = readUserData(user)
122135 let toClaim = calculateToClaim(data[0], data[1], data[2], data[3], data[4], data[5], data[6])
123136 $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)
124146 }
125147
126148
127149
128150 @Callable(i)
129151 func setParams (apyFrom,apyTo,maxIntervalMonths,maxInvest,investAsset) = if ((i.caller != this))
130152 then throw("Not owner")
131153 else [StringEntry(investAssetKey, investAsset), IntegerEntry(apyToKey, apyTo), IntegerEntry(apyFromKey, apyFrom), IntegerEntry(maxIntervalKey, maxIntervalMonths), IntegerEntry(maxInvestKey, maxInvest)]
132154
133155
134156
135157 @Callable(i)
136158 func deposit (interval) = {
137159 let minInterval = getIntOrElse(investIntervalMinKey, 43200)
138160 let maxInvest = getIntOrZero(maxInvestKey)
139161 let totalInvested = getIntOrZero(totalInvestKey)
140162 let investAsset = getStringOrFail(investAssetKey)
141163 let userAddress = i.caller
142164 let userAddressString = toString(userAddress)
143165 let maxInterval = getIntOrZero(maxIntervalKey)
144166 let investStart = height
145167 let investEnd = (investStart + (minInterval * interval))
146168 let invalidAssetMessage = (("Invalid asset. " + investAsset) + " is expected")
147169 if (if ((1 > interval))
148170 then true
149171 else (interval > maxInterval))
150172 then throw("Wrong interval")
151173 else if ((size(i.payments) != 1))
152174 then throw("Invalid payments size")
153175 else {
154176 let payment = i.payments[0]
155177 let amount = payment.amount
156178 let assetId = valueOrErrorMessage(payment.assetId, invalidAssetMessage)
157179 if ((toBase58String(assetId) != investAsset))
158180 then throw(invalidAssetMessage)
159181 else if (((amount + totalInvested) > maxInvest))
160182 then throw("The max invest limit has been reached")
161183 else {
162184 let currentApy = getApy(interval, maxInterval)
163185 let userData = readUserData(userAddressString)
164186 let noClaimed = calculateToClaim(userData[0], userData[1], userData[2], userData[3], userData[4], userData[5], userData[6])
165187 let allAmount = (amount + userData[3])
166188 let claimed = userData[4]
167189 let toClaim = userData[5]
168190 [setUserData(userAddressString, investStart, investEnd, investStart, allAmount, noClaimed, claimed, currentApy), IntegerEntry(totalInvestKey, (amount + totalInvested))]
169191 }
170192 }
171193 }
172194
173195
174196
175197 @Callable(i)
176198 func claim () = {
177199 let investAsset = getStringOrFail(investAssetKey)
178200 let data = readUserData(toString(i.caller))
179201 if ((7 > size(data)))
180202 then throw("User has't invest")
181203 else {
182204 let toClaim = calculateToClaim(data[0], data[1], data[2], data[3], data[4], data[5], data[6])
183205 let claimed = (data[4] + toClaim)
184206 let claimHeight = height
185207 if ((toClaim == 0))
186208 then throw("Nothing to claim")
187209 else [ScriptTransfer(i.caller, toClaim, fromBase58String(investAsset)), setUserData(toString(i.caller), data[0], data[1], claimHeight, data[3], 0, claimed, data[6])]
188210 }
189211 }
190212
191213
192214
193215 @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)
194233 func deleteAmount () = if ((i.caller != this))
195234 then throw("Not owner")
196235 else [IntegerEntry(totalInvestKey, 0)]
197236
198237

github/deemru/w8io/026f985 
41.73 ms