tx · BuLRmHEstJiEbYhei5tF5Aq93cE556sSqaNfuJfj612j

3Mp7YayxL6HjLfFJjzNYC8E3VTGjanV4bXw:  -0.01000000 Waves

2021.11.17 13:03 [1794890] smart account 3Mp7YayxL6HjLfFJjzNYC8E3VTGjanV4bXw > SELF 0.00000000 Waves

{ "type": 13, "id": "BuLRmHEstJiEbYhei5tF5Aq93cE556sSqaNfuJfj612j", "fee": 1000000, "feeAssetId": null, "timestamp": 1637143432443, "version": 1, "sender": "3Mp7YayxL6HjLfFJjzNYC8E3VTGjanV4bXw", "senderPublicKey": "EDfRSpmRQsE3teBhqfwCYfbjueikP1dLfdfj7kTpGP4P", "proofs": [ "5ob8MTQup9a3QHxTbFePi7fF2SKb3bf3YT5oGKPUVVH1pD8D6isvHxLBQRtWAXrwbJmA8sK3yoKWWSe57y1UvhNp" ], "script": "base64:AAIFAAAAAAAAABsIAhIICgYICAEBAQgSAwoBARIDCgEBEgMKAQgAAAA+AAAAAANTRVACAAAAAl9fAQAAAA9nZXRTdHJpbmdPckZhaWwAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgIAAAAPbWFuZGF0b3J5IHRoaXMuBQAAAANrZXkCAAAADyBpcyBub3QgZGVmaW5lZAEAAAAMZ2V0SW50T3JaZXJvAAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AAAAAAAAAAAAAQAAAAxnZXRJbnRPckZhaWwAAAABAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHwAAAAEFAAAAA2tleQkAASwAAAACCQABLAAAAAICAAAAD21hbmRhdG9yeSB0aGlzLgUAAAADa2V5AgAAAA8gaXMgbm90IGRlZmluZWQBAAAACWFzQW55TGlzdAAAAAEAAAAD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ldElkAAAAALVSSvs=", "chainId": 84, "height": 1794890, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: H5rQEVwko8EvNg8UW1nbsjKUvaC6WAgVNYKNCCzmCB3Z Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let SEP = "__"
5+
6+func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
7+
8+
9+func getIntOrZero (key) = valueOrElse(getInteger(this, key), 0)
10+
11+
12+func getIntOrFail (key) = valueOrErrorMessage(getInteger(key), (("mandatory this." + key) + " is not defined"))
13+
14+
15+func asAnyList (val) = match val {
16+ case valAnyLyst: List[Any] =>
17+ valAnyLyst
18+ case _ =>
19+ throw("fail to cast into List[Any]")
20+}
21+
22+
23+func asInt (val) = match val {
24+ case valInt: Int =>
25+ valInt
26+ case _ =>
27+ throw("fail to cast into Int")
28+}
29+
30+
31+func keyFactoryAddress () = "%s%s__config__factoryAddress"
32+
33+
34+let IdxFactoryCfgStakingDapp = 1
35+
36+let IdxFactoryCfgBoostingDapp = 2
37+
38+let IdxFactoryCfgIdoDapp = 3
39+
40+let IdxFactoryCfgTeamDapp = 4
41+
42+let IdxFactoryCfgEmissionDapp = 5
43+
44+let IdxFactoryCfgRestDapp = 6
45+
46+let IdxFactoryCfgSlippageDapp = 7
47+
48+func keyFactoryCfg () = "%s__factoryConfig"
49+
50+
51+func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
52+
53+
54+func keyFactoryLpList () = "%s__lpTokensList"
55+
56+
57+func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
58+
59+
60+func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
61+
62+
63+func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress()))
64+
65+
66+func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
67+
68+
69+func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP)
70+
71+
72+func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
73+
74+
75+func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
76+
77+
78+func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
79+
80+
81+let IdxCfgAssetId = 1
82+
83+let IdxCfgMinLockAmount = 2
84+
85+let IdxCfgMinLockDuration = 3
86+
87+let IdxCfgMaxLockDuration = 4
88+
89+let IdxCfgMathContract = 5
90+
91+func keyConfig () = "%s__config"
92+
93+
94+func readConfigArrayOrFail () = split(getStringOrFail(this, keyConfig()), SEP)
95+
96+
97+func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP)
98+
99+
100+func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract)
101+
102+
103+let IdxLockUserNum = 1
104+
105+let IdxLockAmount = 2
106+
107+let IdxLockStart = 3
108+
109+let IdxLockDuration = 4
110+
111+let IdxLockParamK = 5
112+
113+let IdxLockParamB = 6
114+
115+func keyLockParamsRecord (userAddress) = makeString(["%s%s__lock", userAddress], SEP)
116+
117+
118+func readLockParamsRecordOrFail (userAddress) = split(getStringOrFail(this, keyLockParamsRecord(userAddress)), SEP)
119+
120+
121+func formatLockParamsRecordS (userNum,amount,start,duration,paramK,paramB) = makeString(["%d%d%d%d%d%d", userNum, amount, start, duration, paramK, paramB], SEP)
122+
123+
124+func formatLockParamsRecord (userNum,amount,start,duration,paramK,paramB) = formatLockParamsRecordS(userNum, toString(amount), toString(start), toString(duration), toString(paramK), toString(paramB))
125+
126+
127+func keyNextUserNum () = "%s__nextUserNum"
128+
129+
130+func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
131+
132+
133+func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
134+
135+
136+func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP)
137+
138+
139+func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP)
140+
141+
142+func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP)
143+
144+
145+func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP)
146+
147+
148+func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP)
149+
150+
151+func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP)
152+
153+
154+func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP)
155+
156+
157+func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
158+
159+
160+func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
161+
162+
163+func keyStatsLocksCount () = "%s%s__stats__locksCount"
164+
165+
166+func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
167+
168+
169+func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = {
170+ let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
171+ let historyDATA = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount), toString(lockStart), toString(duration), toString(k), toString(b)], SEP)
172+ StringEntry(historyKEY, historyDATA)
173+ }
174+
175+
176+func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = {
177+ let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks()
178+ let locksCountKEY = keyStatsLocksCount()
179+ let usersCountKEY = keyStatsUsersCount()
180+ let totalAmountKEY = keyLockParamTotalAmount()
181+ let locksDurationSumInBlocks = getIntOrZero(locksCountKEY)
182+ let locksCount = getIntOrZero(locksCountKEY)
183+ let usersCount = getIntOrZero(usersCountKEY)
184+ let totalAmount = getIntOrZero(totalAmountKEY)
185+[IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))]
186+ }
187+
188+
189+func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = {
190+ let userAmountKEY = keyLockParamUserAmount(userNum)
191+ let startBlockKEY = keyLockParamStartBlock(userNum)
192+ let durationKEY = keyLockParamDuration(userNum)
193+ let kKEY = keyLockParamK(userNum)
194+ let bKEY = keyLockParamB(userNum)
195+ let kByPerioKEY = keyLockParamByPeriodK(userNum, period)
196+ let bByPeriodKEY = keyLockParamByPeriodB(userNum, period)
197+[IntegerEntry(userAmountKEY, amount), IntegerEntry(startBlockKEY, start), IntegerEntry(durationKEY, duration), IntegerEntry(kKEY, k), IntegerEntry(bKEY, b), IntegerEntry(kByPerioKEY, k), IntegerEntry(bByPeriodKEY, b), StringEntry(keyLockParamsRecord(userAddress), formatLockParamsRecord(userNum, amount, start, duration, k, b))]
198+ }
199+
200+
201+func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1))
202+ then throw("only one payment is allowed")
203+ else if ((size(i.payments) == 0))
204+ then 0
205+ else {
206+ let pmt = i.payments[0]
207+ if ((value(pmt.assetId) != expectedAssetId))
208+ then throw("invalid asset id in payment")
209+ else pmt.amount
210+ }
211+
212+
213+@Callable(i)
214+func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = if ((this != i.caller))
215+ then throw("not authorized")
216+ else ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0))
217+
218+
219+
220+@Callable(i)
221+func lock (duration) = {
222+ let cfgArray = readConfigArrayOrFail()
223+ let assetIdStr = cfgArray[IdxCfgAssetId]
224+ let assetId = fromBase58String(assetIdStr)
225+ let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount])
226+ let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
227+ let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
228+ let mathContract = addressFromStringValue(cfgArray[IdxCfgMathContract])
229+ if ((size(i.payments) != 1))
230+ then throw("invalid payment - exact one payment must be attached")
231+ else {
232+ let pmt = i.payments[0]
233+ let pmtAmount = pmt.amount
234+ if ((assetId != value(pmt.assetId)))
235+ then throw((("invalid asset is in payment - " + assetIdStr) + " is expected"))
236+ else {
237+ let nextUserNumKEY = keyNextUserNum()
238+ let userAddressStr = toString(i.caller)
239+ let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr)))
240+ let userNumStr = if (userIsExisting)
241+ then value(getString(keyUser2NumMapping(userAddressStr)))
242+ else toString(getIntOrFail(nextUserNumKEY))
243+ let userNum = parseIntValue(userNumStr)
244+ let lockStart = height
245+ let startBlockKEY = keyLockParamStartBlock(userNumStr)
246+ let durationKEY = keyLockParamDuration(userNumStr)
247+ let userAmountKEY = keyLockParamUserAmount(userNumStr)
248+ let userAmount = getIntOrZero(userAmountKEY)
249+ if ((minLockDuration > duration))
250+ then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration)))
251+ else if ((duration > maxLockDuration))
252+ then throw(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration)))
253+ else if (if (userIsExisting)
254+ then ((getIntOrFail(startBlockKEY) + getIntOrFail(durationKEY)) >= lockStart)
255+ else false)
256+ then throw("there is an active lock - consider to use increaseLock")
257+ else {
258+ let gWxParamsResultList = asAnyList(invoke(mathContract, "calcGwxParamsREADONLY", [pmtAmount, lockStart, duration], nil))
259+ let k = asInt(gWxParamsResultList[0])
260+ let b = asInt(gWxParamsResultList[1])
261+ let period = toString(asInt(gWxParamsResultList[2]))
262+ let arr = if (userIsExisting)
263+ then nil
264+ else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
265+ (((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting)
266+ then 0
267+ else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i))
268+ }
269+ }
270+ }
271+ }
272+
273+
274+
275+@Callable(i)
276+func increaseLock (deltaDuration) = {
277+ let cfgArray = readConfigArrayOrFail()
278+ let assetIdStr = cfgArray[IdxCfgAssetId]
279+ let assetId = fromBase58String(assetIdStr)
280+ let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
281+ let mathContract = addressFromStringValue("")
282+ let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId)
283+ let userAddressStr = toString(i.caller)
284+ let k = 0
285+ let b = 0
286+ let period = "0"
287+ let userRecordArray = readLockParamsRecordOrFail(userAddressStr)
288+ let userNumStr = userRecordArray[IdxLockUserNum]
289+ let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
290+ let lockStart = parseIntValue(userRecordArray[IdxLockStart])
291+ let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
292+ let lockEnd = (lockStart + lockDuration)
293+ let newAmount = (userAmount + pmtAmount)
294+ let newLockDuration = (lockDuration + deltaDuration)
295+ if ((0 > deltaDuration))
296+ then throw("duration is less then zero")
297+ else if ((newLockDuration > maxLockDuration))
298+ then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration)))
299+ else if (if ((height >= lockEnd))
300+ then (userAmount > 0)
301+ else false)
302+ then throw("there is an expired lock - need to unlock before new lock")
303+ else ((LockParamsEntry(userAddressStr, userNumStr, newAmount, lockStart, newLockDuration, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, newAmount, lockStart, newLockDuration, k, b, i))
304+ }
305+
306+
307+
308+@Callable(i)
309+func unlock (userAddress) = {
310+ let userRecordArray = readLockParamsRecordOrFail(userAddress)
311+ let userNumStr = userRecordArray[IdxLockUserNum]
312+ let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
313+ let lockStart = parseIntValue(userRecordArray[IdxLockStart])
314+ let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
315+ let lockEnd = (lockStart + lockDuration)
316+ let cfgArray = readConfigArrayOrFail()
317+ let assetId = fromBase58String(cfgArray[IdxCfgAssetId])
318+ if ((lockEnd >= height))
319+ then throw((("wait " + toString(lockEnd)) + " to unlock"))
320+ else if ((0 >= userAmount))
321+ then throw("nothing to unlock")
322+ else {
323+ let period = "0"
324+ (((LockParamsEntry(userAddress, userNumStr, 0, lockStart, lockDuration, 0, 0, period) ++ StatsEntry(-(userAmount), 0, 0, -1)) :+ HistoryEntry("unlock", userAddress, userAmount, lockStart, lockDuration, 0, 0, i)) :+ ScriptTransfer(addressFromStringValue(userAddress), userAmount, assetId))
325+ }
326+ }
327+
328+

github/deemru/w8io/026f985 
32.68 ms