tx · 8kcReFwfsRJrzi6D6hVpGw48Q1gUeegTiGRjbGPWEZTs

3N6ALE8YyAYnRk9f38mdWRTvW77rFkg5hN1:  -0.02300000 Waves

2024.02.05 12:14 [2962774] smart account 3N6ALE8YyAYnRk9f38mdWRTvW77rFkg5hN1 > SELF 0.00000000 Waves

{ "type": 13, "id": "8kcReFwfsRJrzi6D6hVpGw48Q1gUeegTiGRjbGPWEZTs", "fee": 2300000, "feeAssetId": null, "timestamp": 1707124403656, "version": 2, "chainId": 84, "sender": "3N6ALE8YyAYnRk9f38mdWRTvW77rFkg5hN1", "senderPublicKey": "HMMF9zUpZPBGLAhpc1yDdcJNJychSarGHS79P2mGvq7J", "proofs": [ "VmgV7MMTEP6EPZScoZCorNwg59aBmZouasWRJ2MtMo6PbkrhuiCm5DdihM6MCqDmuHjz92oy3EaePWgZokjr2w2" ], "script": "base64:BgJACAISBgoECAgICBIHCgUICAgICBIGCgQICAgIEgASAwoBARIECgIBARIDCgEIEgMKAQgSABIAEgMKAQgSAwoBCF0ACVNFUEFSQVRPUgICX18ABVdBVkVTAgVXQVZFUwAMS0VZX01VTFRJU0lHAghNVUxUSVNJRwAKS0VZX1NUQVRVUwIGU1RBVFVTAAhLRVlfSU5JVAIESU5JVAAKS0VZX1BBVVNFRAIGUEFVU0VEAApLRVlfUEFVU0VSAgZQQVVTRVIADEtFWV9FWEVDVVRPUgIIRVhFQ1VUT1IACktFWV9PUkFDTEUCBk9SQUNMRQATS0VZX0NBTExFUl9DT05UUkFDVAIPQ0FMTEVSX0NPTlRSQUNUAAlLRVlfUFJJQ0UCBVBSSUNFABFLRVlfVVNFUl9QT1NJVElPTgINVVNFUl9QT1NJVElPTgAUS0VZX1VTRVJfVVNEX0JBTEFOQ0UCEFVTRVJfVVNEX0JBTEFOQ0UAJ0tFWV9VU0VSX1VOSVRTX1BFUl9VU0RfQkFMQU5DRV9JTlRFR1JBTAIjVVNFUl9VTklUU19QRVJfVVNEX0JBTEFOQ0VfSU5URUdSQU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78U4f4CW2aVuTYT8RwtVwUhVKDNTGwy3BNy Diff:
OldNewDifferences
4747
4848 let KEY_UNITS_BALANCE = "UNITS_BALANCE"
4949
50+let KEY_TOKEN_BALANCE = "TOKEN_BALANCE"
51+
52+let KEY_SWAVES_CONTRACT = "SWAVES_CONTRACT"
53+
54+let KEY_SWAVES_ASSET = "ASSET"
55+
56+let FUNC_DEPOSIT = "deposit"
57+
58+let FUNC_GET_RATE = "getRate"
59+
60+let FUNC_WITHDRAW = "withdraw"
61+
5062 let MAX_INT = 9223372036854775807
5163
5264 let PERCENT_FACTOR = toBigInt(1000000000000)
5365
5466 let ZERO_BIGINT = toBigInt(0)
67+
68+let SWAVES_RATE_FACTOR = toBigInt(1000000000000)
5569
5670 func _validateAddress (address_,err_) = match addressFromString(address_) {
5771 case a: Address =>
167181
168182 func _loadUserPosition (token_,user_) = match getString(makeString([KEY_USER_POSITION, token_, user_], SEPARATOR)) {
169183 case a: String =>
170- let struct = split(a, SEPARATOR)
184+ let struct = split_51C(a, SEPARATOR)
171185 $Tuple2(parseBigIntValue(struct[0]), parseBigIntValue(struct[1]))
172186 case _ =>
173187 $Tuple2(ZERO_BIGINT, ZERO_BIGINT)
174188 }
175189
176190
177-func _saveUserPosition (token_,user_,position_) = [StringEntry(makeString([KEY_USER_POSITION, token_, user_], SEPARATOR), makeString([toString(position_._1), toString(position_._2)], SEPARATOR))]
191+func _saveUserPosition (token_,user_,position_) = [StringEntry(makeString([KEY_USER_POSITION, token_, user_], SEPARATOR), makeString_11C([toString(position_._1), toString(position_._2)], SEPARATOR))]
178192
179193
180194 func _loadUserUSDBalance (user_) = match getString(makeString([KEY_USER_USD_BALANCE, user_], SEPARATOR)) {
185199 }
186200
187201
188-func _saveUserUSDBalance (user_,value_) = [StringEntry(KEY_USER_USD_BALANCE, toString(value_))]
202+func _saveUserUSDBalance (user_,value_) = [StringEntry(makeString([KEY_USER_USD_BALANCE, user_], SEPARATOR), toString(value_))]
189203
190204
191205 func _loadUnitsPerUSDBalanceIntegral () = match getString(KEY_UNITS_PER_USD_BALANCE_INTEGRAL) {
298312 func _saveTotalUSDBalance (value_) = [StringEntry(KEY_TOTAL_USD_BALANCE, toString(value_))]
299313
300314
315+func _loadSWavesContract () = match getString(KEY_SWAVES_CONTRACT) {
316+ case a: String =>
317+ addressFromStringValue(a)
318+ case _ =>
319+ Address(base58'')
320+}
321+
322+
323+func _saveSWavesContract (contract_) = [StringEntry(KEY_SWAVES_CONTRACT, toString(contract_))]
324+
325+
326+func _loadSWavesAsset (contract_) = match getString(contract_, KEY_SWAVES_ASSET) {
327+ case a: String =>
328+ fromBase58String(a)
329+ case _ =>
330+ throw("_loadSWavesAsset: revert")
331+}
332+
333+
334+func _loadTokenBalance (token_) = match getString(makeString([KEY_TOKEN_BALANCE, token_], SEPARATOR)) {
335+ case a: String =>
336+ parseBigIntValue(a)
337+ case _ =>
338+ ZERO_BIGINT
339+}
340+
341+
342+func _saveTokenBalance (token_,value_) = [StringEntry(makeString([KEY_TOKEN_BALANCE, token_], SEPARATOR), toString(value_))]
343+
344+
301345 func _onlyThisContract (caller_) = if ((caller_ != this))
302346 then throw("_onlyThisContract: revert")
303347 else true
367411
368412
369413 func _userCheckpoint (user_,userUSDBalance_) = {
370- let $t01360113668 = _checkpoint()
371- let checkpointActions = $t01360113668._1
372- let unitsPerUSDBalanceIntegral = $t01360113668._2
414+ let $t01275212819 = _checkpoint()
415+ let checkpointActions = $t01275212819._1
416+ let unitsPerUSDBalanceIntegral = $t01275212819._2
373417 let prevUserUnitsPerUSDBalanceIntegral = _loadUserUnitsPerUSDBalanceIntegral(user_)
374418 let prevUserCheckpointAt = max([_loadStartBlock(), _loadUserCheckpointAt(user_)])
375419 let prevUserUnitsBalance = _loadUserUnitsBalance(user_)
384428
385429
386430 @Callable(i)
387-func init (executor_,oracle_,pauser_) = {
388- let err = if (if (if (if (if (_onlyThisContract(i.caller))
431+func init (executor_,oracle_,pauser_,sWavesContract_) = {
432+ let err = if (if (if (if (if (if (_onlyThisContract(i.caller))
389433 then _whenNotInitialized()
390434 else false)
391435 then _whenMultisigSet()
395439 then _validateAddress(oracle_, "init: invalid oracle")
396440 else false)
397441 then _validateAddress(pauser_, "init: invalid pauser")
442+ else false)
443+ then _validateAddress(sWavesContract_, "init: invalid sWavesContract")
398444 else false
399445 if ((err == err))
400- then $Tuple2((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _saveOracle(addressFromStringValue(oracle_))) ++ _savePauser(addressFromStringValue(pauser_))), unit)
446+ then $Tuple2(((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _saveOracle(addressFromStringValue(oracle_))) ++ _savePauser(addressFromStringValue(pauser_))) ++ _saveSWavesContract(addressFromStringValue(sWavesContract_))), unit)
401447 else throw("Strict value is not equal to itself.")
402448 }
403449
418464 if ((err == err))
419465 then {
420466 let rate = _getTokenRate(token_)
421- let $t01578615868 = _loadUserPosition(sender_, token_)
422- let userTokenBalance = $t01578615868._1
423- let userTokenBalanceInUSD = $t01578615868._2
467+ let $t01511215194 = _loadUserPosition(token_, sender_)
468+ let userTokenBalance = $t01511215194._1
469+ let userTokenBalanceInUSD = $t01511215194._2
424470 let userUSDBalance = _loadUserUSDBalance(sender_)
425- let $t01592716011 = _userCheckpoint(sender_, userUSDBalance)
426- let checkpointActions = $t01592716011._1
427- let userUnitsBalance = $t01592716011._2
471+ let $t01525315337 = _userCheckpoint(sender_, userUSDBalance)
472+ let checkpointActions = $t01525315337._1
473+ let userUnitsBalance = $t01525315337._2
428474 let newUserTokenBalance = (userTokenBalance + toBigInt(amount))
429475 let newUserTokenBalanceInUSD = fraction(newUserTokenBalance, rate, PERCENT_FACTOR, DOWN)
430476 let newUserUSDBalance = ((userUSDBalance - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
431477 let totalBalanceUpdated = ((_loadTotalUSDBalance() - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
432- $Tuple2((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveUserUSDBalance(sender_, newUserUSDBalance)) ++ _saveUserPosition(token_, sender_, $Tuple2(newUserTokenBalance, newUserUSDBalance))), userUnitsBalance)
478+ $Tuple2(((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveTokenBalance(token_, (_loadTokenBalance(token_) + toBigInt(amount)))) ++ _saveUserUSDBalance(sender_, newUserUSDBalance)) ++ _saveUserPosition(token_, sender_, $Tuple2(newUserTokenBalance, newUserTokenBalanceInUSD))), userUnitsBalance)
433479 }
434480 else throw("Strict value is not equal to itself.")
435481 }
451497 if ((err == err))
452498 then {
453499 let rate = _getTokenRate(token_)
454- let $t01717817260 = _loadUserPosition(sender_, token_)
455- let userTokenBalance = $t01717817260._1
456- let userTokenBalanceInUSD = $t01717817260._2
500+ let $t01659516677 = _loadUserPosition(token_, sender_)
501+ let userTokenBalance = $t01659516677._1
502+ let userTokenBalanceInUSD = $t01659516677._2
457503 let userUSDBalance = _loadUserUSDBalance(sender_)
458- let $t01731917403 = _userCheckpoint(sender_, userUSDBalance)
459- let checkpointActions = $t01731917403._1
460- let userUnitsBalance = $t01731917403._2
504+ let $t01673616820 = _userCheckpoint(sender_, userUSDBalance)
505+ let checkpointActions = $t01673616820._1
506+ let userUnitsBalance = $t01673616820._2
461507 let newUserTokenBalance = (userTokenBalance - toBigInt(amount))
462508 let err1 = _validateInt(toInt(newUserTokenBalance), 0, MAX_INT, "withdraw: insufficient token amount")
463509 if ((err1 == err1))
465511 let newUserTokenBalanceInUSD = fraction(newUserTokenBalance, rate, PERCENT_FACTOR, DOWN)
466512 let newUserUSDBalance = ((userUSDBalance - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
467513 let totalBalanceUpdated = ((_loadTotalUSDBalance() - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
468- $Tuple2((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveUserUSDBalance(sender_, newUserUSDBalance)) ++ _saveUserPosition(token_, sender_, $Tuple2(newUserTokenBalance, newUserUSDBalance))), unit)
514+ $Tuple2(((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveTokenBalance(token_, (_loadTokenBalance(token_) - toBigInt(amount)))) ++ _saveUserUSDBalance(sender_, newUserUSDBalance)) ++ _saveUserPosition(token_, sender_, $Tuple2(newUserTokenBalance, newUserTokenBalanceInUSD))), unit)
469515 }
470516 else throw("Strict value is not equal to itself.")
471517 }
491537 let sender = toString(i.caller)
492538 let token = WAVES
493539 let rate = _getTokenRate(token)
494- let $t01862418704 = _loadUserPosition(sender, token)
495- let userTokenBalance = $t01862418704._1
496- let userTokenBalanceInUSD = $t01862418704._2
540+ let $t01813218212 = _loadUserPosition(token, sender)
541+ let userTokenBalance = $t01813218212._1
542+ let userTokenBalanceInUSD = $t01813218212._2
497543 let userUSDBalance = _loadUserUSDBalance(sender)
498- let $t01876218845 = _userCheckpoint(sender, userUSDBalance)
499- let checkpointActions = $t01876218845._1
500- let userUnitsBalance = $t01876218845._2
544+ let $t01827018353 = _userCheckpoint(sender, userUSDBalance)
545+ let checkpointActions = $t01827018353._1
546+ let userUnitsBalance = $t01827018353._2
501547 let newUserTokenBalance = (userTokenBalance + toBigInt(amount))
502548 let newUserTokenBalanceInUSD = fraction(newUserTokenBalance, rate, PERCENT_FACTOR, DOWN)
503549 let newUserUSDBalance = ((userUSDBalance - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
504550 let totalBalanceUpdated = ((_loadTotalUSDBalance() - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
505- $Tuple2(((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveUserPosition(token, sender, $Tuple2(newUserTokenBalance, newUserUSDBalance))), userUnitsBalance)
551+ let invocation = invoke(_loadSWavesContract(), FUNC_DEPOSIT, nil, [AttachedPayment(unit, amount)])
552+ if ((invocation == invocation))
553+ then $Tuple2(((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveTokenBalance(WAVES, (_loadTokenBalance(WAVES) + toBigInt(amount)))) ++ _saveUserUSDBalance(sender, newUserUSDBalance)) ++ _saveUserPosition(token, sender, $Tuple2(newUserTokenBalance, newUserTokenBalanceInUSD))), userUnitsBalance)
554+ else throw("Strict value is not equal to itself.")
506555 }
507556 else throw("Strict value is not equal to itself.")
508557 }
521570 let sender = toString(i.caller)
522571 let token = WAVES
523572 let rate = _getTokenRate(token)
524- let $t01971319793 = _loadUserPosition(sender, token)
525- let userTokenBalance = $t01971319793._1
526- let userTokenBalanceInUSD = $t01971319793._2
573+ let $t01948819568 = _loadUserPosition(token, sender)
574+ let userTokenBalance = $t01948819568._1
575+ let userTokenBalanceInUSD = $t01948819568._2
527576 let userUSDBalance = _loadUserUSDBalance(sender)
528- let $t01985119934 = _userCheckpoint(sender, userUSDBalance)
529- let checkpointActions = $t01985119934._1
530- let userUnitsBalance = $t01985119934._2
577+ let $t01962619709 = _userCheckpoint(sender, userUSDBalance)
578+ let checkpointActions = $t01962619709._1
579+ let userUnitsBalance = $t01962619709._2
531580 let newUserTokenBalance = (userTokenBalance - toBigInt(amount_))
532581 let err1 = _validateInt(toInt(newUserTokenBalance), 0, MAX_INT, "withdrawWaves: insufficient token amount")
533582 if ((err1 == err1))
535584 let newUserTokenBalanceInUSD = fraction(newUserTokenBalance, rate, PERCENT_FACTOR, DOWN)
536585 let newUserUSDBalance = ((userUSDBalance - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
537586 let totalBalanceUpdated = ((_loadTotalUSDBalance() - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
538- $Tuple2((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveUserUSDBalance(sender, newUserUSDBalance)) ++ _saveUserPosition(token, sender, $Tuple2(newUserTokenBalance, newUserUSDBalance))), unit)
587+ let sWavesContract = _loadSWavesContract()
588+ let sWavesAsset = _loadSWavesAsset(sWavesContract)
589+ let invocation = invoke(sWavesContract, FUNC_GET_RATE, nil, nil)
590+ let swavesRate = match invocation {
591+ case a: String =>
592+ parseBigIntValue(a)
593+ case _ =>
594+ throw("withdrawWaves: sWaves getRate() revert")
595+ }
596+ let sWavesToWithdraw = toInt(fraction(toBigInt(amount_), SWAVES_RATE_FACTOR, swavesRate, CEILING))
597+ let invocation1 = invoke(sWavesContract, FUNC_WITHDRAW, nil, [AttachedPayment(sWavesAsset, sWavesToWithdraw)])
598+ if ((invocation1 == invocation1))
599+ then $Tuple2(((((([ScriptTransfer(i.caller, amount_, unit)] ++ checkpointActions) ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveTokenBalance(WAVES, (_loadTokenBalance(WAVES) - toBigInt(amount_)))) ++ _saveUserUSDBalance(sender, newUserUSDBalance)) ++ _saveUserPosition(token, sender, $Tuple2(newUserTokenBalance, newUserTokenBalanceInUSD))), unit)
600+ else throw("Strict value is not equal to itself.")
539601 }
540602 else throw("Strict value is not equal to itself.")
541603 }
571633
572634 @Callable(i)
573635 func getUnits (user_) = {
574- let userUSDBalance = _loadUserUSDBalance(user_)
575- let $t02154721619 = _userCheckpoint(user_, userUSDBalance)
576- let actions = $t02154721619._1
577- let userUnitsBalance = $t02154721619._2
636+ let $t02197822062 = _userCheckpoint(user_, _loadUserUSDBalance(user_))
637+ let actions = $t02197822062._1
638+ let userUnitsBalance = $t02197822062._2
578639 $Tuple2(nil, userUnitsBalance)
579640 }
580641
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEPARATOR = "__"
55
66 let WAVES = "WAVES"
77
88 let KEY_MULTISIG = "MULTISIG"
99
1010 let KEY_STATUS = "STATUS"
1111
1212 let KEY_INIT = "INIT"
1313
1414 let KEY_PAUSED = "PAUSED"
1515
1616 let KEY_PAUSER = "PAUSER"
1717
1818 let KEY_EXECUTOR = "EXECUTOR"
1919
2020 let KEY_ORACLE = "ORACLE"
2121
2222 let KEY_CALLER_CONTRACT = "CALLER_CONTRACT"
2323
2424 let KEY_PRICE = "PRICE"
2525
2626 let KEY_USER_POSITION = "USER_POSITION"
2727
2828 let KEY_USER_USD_BALANCE = "USER_USD_BALANCE"
2929
3030 let KEY_USER_UNITS_PER_USD_BALANCE_INTEGRAL = "USER_UNITS_PER_USD_BALANCE_INTEGRAL"
3131
3232 let KEY_USER_CHECKPOINT_AT = "USER_CHECKPOINT_AT"
3333
3434 let KEY_USER_UNITS_BALANCE = "USER_UNITS_BALANCE"
3535
3636 let KEY_START_BLOCK = "START_BLOCK"
3737
3838 let KEY_FINISH_BLOCK = "FINISH_BLOCK"
3939
4040 let KEY_UNITS_PER_BLOCK = "UNITS_PER_BLOCK"
4141
4242 let KEY_TOTAL_USD_BALANCE = "TOTAL_USD_BALANCE"
4343
4444 let KEY_UNITS_PER_USD_BALANCE_INTEGRAL = "UNITS_PER_USD_BALANCE_INTEGRAL"
4545
4646 let KEY_CHECKPOINT_AT = "CHECKPOINT_AT"
4747
4848 let KEY_UNITS_BALANCE = "UNITS_BALANCE"
4949
50+let KEY_TOKEN_BALANCE = "TOKEN_BALANCE"
51+
52+let KEY_SWAVES_CONTRACT = "SWAVES_CONTRACT"
53+
54+let KEY_SWAVES_ASSET = "ASSET"
55+
56+let FUNC_DEPOSIT = "deposit"
57+
58+let FUNC_GET_RATE = "getRate"
59+
60+let FUNC_WITHDRAW = "withdraw"
61+
5062 let MAX_INT = 9223372036854775807
5163
5264 let PERCENT_FACTOR = toBigInt(1000000000000)
5365
5466 let ZERO_BIGINT = toBigInt(0)
67+
68+let SWAVES_RATE_FACTOR = toBigInt(1000000000000)
5569
5670 func _validateAddress (address_,err_) = match addressFromString(address_) {
5771 case a: Address =>
5872 true
5973 case _ =>
6074 throw(err_)
6175 }
6276
6377
6478 func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_))
6579 then true
6680 else (val_ > upperBoundary_))
6781 then throw(err_)
6882 else true
6983
7084
7185 func _validatePaymentsSize (payments_,target_,err_) = if ((size(payments_) != target_))
7286 then throw(err_)
7387 else true
7488
7589
7690 func _validateWavesPayment (payment_,err_) = match payment_.assetId {
7791 case a: ByteVector =>
7892 throw(err_)
7993 case _: Unit =>
8094 true
8195 case _ =>
8296 throw("Match error")
8397 }
8498
8599
86100 func _validateEqBigInt (val1_,val2_,err_) = if ((val1_ != val2_))
87101 then throw(err_)
88102 else true
89103
90104
91105 func _loadInit () = match getBoolean(KEY_INIT) {
92106 case a: Boolean =>
93107 a
94108 case _ =>
95109 false
96110 }
97111
98112
99113 func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)]
100114
101115
102116 func _loadPause () = match getBoolean(KEY_PAUSED) {
103117 case a: Boolean =>
104118 a
105119 case _ =>
106120 false
107121 }
108122
109123
110124 func _savePause (isPaused_) = [BooleanEntry(KEY_PAUSED, isPaused_)]
111125
112126
113127 func _loadPauser () = match getString(KEY_PAUSER) {
114128 case a: String =>
115129 addressFromStringValue(a)
116130 case _ =>
117131 Address(base58'')
118132 }
119133
120134
121135 func _savePauser (pauser_) = [StringEntry(KEY_PAUSER, toString(pauser_))]
122136
123137
124138 func _loadMultisig () = match getString(KEY_MULTISIG) {
125139 case a: String =>
126140 addressFromStringValue(a)
127141 case _ =>
128142 Address(base58'')
129143 }
130144
131145
132146 func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))]
133147
134148
135149 func _loadExecutor () = match getString(KEY_EXECUTOR) {
136150 case a: String =>
137151 addressFromStringValue(a)
138152 case _ =>
139153 Address(base58'')
140154 }
141155
142156
143157 func _saveExecutor (executor_) = [StringEntry(KEY_EXECUTOR, toString(executor_))]
144158
145159
146160 func _loadOracle () = match getString(KEY_ORACLE) {
147161 case a: String =>
148162 addressFromStringValue(a)
149163 case _ =>
150164 Address(base58'')
151165 }
152166
153167
154168 func _saveOracle (oracle_) = [StringEntry(KEY_ORACLE, toString(oracle_))]
155169
156170
157171 func _loadCallerContract () = match getString(KEY_CALLER_CONTRACT) {
158172 case a: String =>
159173 a
160174 case _ =>
161175 ""
162176 }
163177
164178
165179 func _saveCallerContract (caller_) = [StringEntry(KEY_CALLER_CONTRACT, caller_)]
166180
167181
168182 func _loadUserPosition (token_,user_) = match getString(makeString([KEY_USER_POSITION, token_, user_], SEPARATOR)) {
169183 case a: String =>
170- let struct = split(a, SEPARATOR)
184+ let struct = split_51C(a, SEPARATOR)
171185 $Tuple2(parseBigIntValue(struct[0]), parseBigIntValue(struct[1]))
172186 case _ =>
173187 $Tuple2(ZERO_BIGINT, ZERO_BIGINT)
174188 }
175189
176190
177-func _saveUserPosition (token_,user_,position_) = [StringEntry(makeString([KEY_USER_POSITION, token_, user_], SEPARATOR), makeString([toString(position_._1), toString(position_._2)], SEPARATOR))]
191+func _saveUserPosition (token_,user_,position_) = [StringEntry(makeString([KEY_USER_POSITION, token_, user_], SEPARATOR), makeString_11C([toString(position_._1), toString(position_._2)], SEPARATOR))]
178192
179193
180194 func _loadUserUSDBalance (user_) = match getString(makeString([KEY_USER_USD_BALANCE, user_], SEPARATOR)) {
181195 case a: String =>
182196 parseBigIntValue(a)
183197 case _ =>
184198 ZERO_BIGINT
185199 }
186200
187201
188-func _saveUserUSDBalance (user_,value_) = [StringEntry(KEY_USER_USD_BALANCE, toString(value_))]
202+func _saveUserUSDBalance (user_,value_) = [StringEntry(makeString([KEY_USER_USD_BALANCE, user_], SEPARATOR), toString(value_))]
189203
190204
191205 func _loadUnitsPerUSDBalanceIntegral () = match getString(KEY_UNITS_PER_USD_BALANCE_INTEGRAL) {
192206 case a: String =>
193207 parseBigIntValue(a)
194208 case _ =>
195209 ZERO_BIGINT
196210 }
197211
198212
199213 func _saveUnitsPerUSDBalanceIntegral (value_) = [StringEntry(KEY_UNITS_PER_USD_BALANCE_INTEGRAL, toString(value_))]
200214
201215
202216 func _loadUserUnitsPerUSDBalanceIntegral (user_) = match getString(makeString([KEY_USER_UNITS_PER_USD_BALANCE_INTEGRAL, user_], SEPARATOR)) {
203217 case a: String =>
204218 parseBigIntValue(a)
205219 case _ =>
206220 ZERO_BIGINT
207221 }
208222
209223
210224 func _saveUserUnitsPerUSDBalanceIntegral (user_,value_) = [StringEntry(makeString([KEY_USER_UNITS_PER_USD_BALANCE_INTEGRAL, user_], SEPARATOR), toString(value_))]
211225
212226
213227 func _loadCheckpointAt () = match getString(KEY_CHECKPOINT_AT) {
214228 case a: String =>
215229 parseBigIntValue(a)
216230 case _ =>
217231 ZERO_BIGINT
218232 }
219233
220234
221235 func _saveCheckpointAt (value_) = [StringEntry(KEY_CHECKPOINT_AT, toString(value_))]
222236
223237
224238 func _loadUserCheckpointAt (user_) = match getString(makeString([KEY_USER_CHECKPOINT_AT, user_], SEPARATOR)) {
225239 case a: String =>
226240 parseBigIntValue(a)
227241 case _ =>
228242 ZERO_BIGINT
229243 }
230244
231245
232246 func _saveUserCheckpointAt (user_,value_) = [StringEntry(makeString([KEY_USER_CHECKPOINT_AT, user_], SEPARATOR), toString(value_))]
233247
234248
235249 func _loadStartBlock () = match getString(KEY_START_BLOCK) {
236250 case a: String =>
237251 parseBigIntValue(a)
238252 case _ =>
239253 ZERO_BIGINT
240254 }
241255
242256
243257 func _saveStartBlock (value_) = [StringEntry(KEY_START_BLOCK, toString(value_))]
244258
245259
246260 func _loadFinishBlock () = match getString(KEY_FINISH_BLOCK) {
247261 case a: String =>
248262 parseBigIntValue(a)
249263 case _ =>
250264 ZERO_BIGINT
251265 }
252266
253267
254268 func _saveFinishBlock (value_) = [StringEntry(KEY_FINISH_BLOCK, toString(value_))]
255269
256270
257271 func _loadUnitsPerBlock () = match getString(KEY_UNITS_PER_BLOCK) {
258272 case a: String =>
259273 parseBigIntValue(a)
260274 case _ =>
261275 ZERO_BIGINT
262276 }
263277
264278
265279 func _saveUnitsPerBlock (value_) = [StringEntry(KEY_UNITS_PER_BLOCK, toString(value_))]
266280
267281
268282 func _loadUnitsBalance () = match getString(KEY_UNITS_BALANCE) {
269283 case a: String =>
270284 parseBigIntValue(a)
271285 case _ =>
272286 ZERO_BIGINT
273287 }
274288
275289
276290 func _saveUnitsBalance (value_) = [StringEntry(KEY_UNITS_BALANCE, toString(value_))]
277291
278292
279293 func _loadUserUnitsBalance (user_) = match getString(makeString([KEY_USER_UNITS_BALANCE, user_], SEPARATOR)) {
280294 case a: String =>
281295 parseBigIntValue(a)
282296 case _ =>
283297 ZERO_BIGINT
284298 }
285299
286300
287301 func _saveUserUnitsBalance (user_,value_) = [StringEntry(makeString([KEY_USER_UNITS_BALANCE, user_], SEPARATOR), toString(value_))]
288302
289303
290304 func _loadTotalUSDBalance () = match getString(KEY_TOTAL_USD_BALANCE) {
291305 case a: String =>
292306 parseBigIntValue(a)
293307 case _ =>
294308 ZERO_BIGINT
295309 }
296310
297311
298312 func _saveTotalUSDBalance (value_) = [StringEntry(KEY_TOTAL_USD_BALANCE, toString(value_))]
299313
300314
315+func _loadSWavesContract () = match getString(KEY_SWAVES_CONTRACT) {
316+ case a: String =>
317+ addressFromStringValue(a)
318+ case _ =>
319+ Address(base58'')
320+}
321+
322+
323+func _saveSWavesContract (contract_) = [StringEntry(KEY_SWAVES_CONTRACT, toString(contract_))]
324+
325+
326+func _loadSWavesAsset (contract_) = match getString(contract_, KEY_SWAVES_ASSET) {
327+ case a: String =>
328+ fromBase58String(a)
329+ case _ =>
330+ throw("_loadSWavesAsset: revert")
331+}
332+
333+
334+func _loadTokenBalance (token_) = match getString(makeString([KEY_TOKEN_BALANCE, token_], SEPARATOR)) {
335+ case a: String =>
336+ parseBigIntValue(a)
337+ case _ =>
338+ ZERO_BIGINT
339+}
340+
341+
342+func _saveTokenBalance (token_,value_) = [StringEntry(makeString([KEY_TOKEN_BALANCE, token_], SEPARATOR), toString(value_))]
343+
344+
301345 func _onlyThisContract (caller_) = if ((caller_ != this))
302346 then throw("_onlyThisContract: revert")
303347 else true
304348
305349
306350 func _whenMultisigSet () = if ((_loadMultisig() == Address(base58'')))
307351 then throw("_whenMultisigSet: revert")
308352 else true
309353
310354
311355 func _whenNotInitialized () = if (_loadInit())
312356 then throw("_whenNotInitialized: revert")
313357 else true
314358
315359
316360 func _whenInitialized () = if (!(_loadInit()))
317361 then throw("_whenInitialized: revert")
318362 else true
319363
320364
321365 func _whenNotPaused () = if (_loadPause())
322366 then throw("_whenNotPaused: revert")
323367 else true
324368
325369
326370 func _whenPaused () = if (!(_loadPause()))
327371 then throw("_whenPaused: revert")
328372 else true
329373
330374
331375 func _onlyPauser (caller_) = if ((caller_ != _loadPauser()))
332376 then throw("_onlyPauser: revert")
333377 else true
334378
335379
336380 func _validateExecutor (val_,err_) = if ((val_ != _loadExecutor()))
337381 then throw(err_)
338382 else true
339383
340384
341385 func _validateCaller (val_,err_) = if ((val_ != _loadCallerContract()))
342386 then throw(err_)
343387 else true
344388
345389
346390 func _getTokenRate (token_) = match getString(_loadOracle(), makeString([KEY_PRICE, token_], SEPARATOR)) {
347391 case a: String =>
348392 parseBigIntValue(a)
349393 case _ =>
350394 throw(("_getTokenRate: no rate for token=" + token_))
351395 }
352396
353397
354398 func _checkpoint () = {
355399 let prevUnitsPerUSDBalanceIntegral = _loadUnitsPerUSDBalanceIntegral()
356400 let prevCheckpointAt = max([_loadStartBlock(), _loadCheckpointAt()])
357401 let prevUnitsBalance = _loadUnitsBalance()
358402 let currentBlock = min([toBigInt(height), _loadFinishBlock()])
359403 if ((prevCheckpointAt >= currentBlock))
360404 then $Tuple2(nil, prevUnitsPerUSDBalanceIntegral)
361405 else {
362406 let unitsBalance = (_loadUnitsPerBlock() * (currentBlock - _loadStartBlock()))
363407 let unitsPerUSDBalanceIntegral = ((((PERCENT_FACTOR * (currentBlock - prevCheckpointAt)) * (unitsBalance - prevUnitsBalance)) / _loadTotalUSDBalance()) + prevUnitsPerUSDBalanceIntegral)
364408 $Tuple2(((_saveUnitsPerUSDBalanceIntegral(unitsPerUSDBalanceIntegral) ++ _saveCheckpointAt(currentBlock)) ++ _saveUnitsBalance(unitsBalance)), unitsPerUSDBalanceIntegral)
365409 }
366410 }
367411
368412
369413 func _userCheckpoint (user_,userUSDBalance_) = {
370- let $t01360113668 = _checkpoint()
371- let checkpointActions = $t01360113668._1
372- let unitsPerUSDBalanceIntegral = $t01360113668._2
414+ let $t01275212819 = _checkpoint()
415+ let checkpointActions = $t01275212819._1
416+ let unitsPerUSDBalanceIntegral = $t01275212819._2
373417 let prevUserUnitsPerUSDBalanceIntegral = _loadUserUnitsPerUSDBalanceIntegral(user_)
374418 let prevUserCheckpointAt = max([_loadStartBlock(), _loadUserCheckpointAt(user_)])
375419 let prevUserUnitsBalance = _loadUserUnitsBalance(user_)
376420 let currentBlock = min([toBigInt(height), _loadFinishBlock()])
377421 if ((prevUserCheckpointAt >= currentBlock))
378422 then $Tuple2(checkpointActions, prevUserUnitsBalance)
379423 else {
380424 let userUnitsBalance = ((((userUSDBalance_ * (unitsPerUSDBalanceIntegral - prevUserUnitsPerUSDBalanceIntegral)) / (currentBlock - prevUserCheckpointAt)) / PERCENT_FACTOR) + prevUserUnitsBalance)
381425 $Tuple2((((checkpointActions ++ _saveUserUnitsPerUSDBalanceIntegral(user_, unitsPerUSDBalanceIntegral)) ++ _saveUserCheckpointAt(user_, currentBlock)) ++ _saveUserUnitsBalance(user_, userUnitsBalance)), userUnitsBalance)
382426 }
383427 }
384428
385429
386430 @Callable(i)
387-func init (executor_,oracle_,pauser_) = {
388- let err = if (if (if (if (if (_onlyThisContract(i.caller))
431+func init (executor_,oracle_,pauser_,sWavesContract_) = {
432+ let err = if (if (if (if (if (if (_onlyThisContract(i.caller))
389433 then _whenNotInitialized()
390434 else false)
391435 then _whenMultisigSet()
392436 else false)
393437 then _validateAddress(executor_, "init: invalid executor")
394438 else false)
395439 then _validateAddress(oracle_, "init: invalid oracle")
396440 else false)
397441 then _validateAddress(pauser_, "init: invalid pauser")
442+ else false)
443+ then _validateAddress(sWavesContract_, "init: invalid sWavesContract")
398444 else false
399445 if ((err == err))
400- then $Tuple2((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _saveOracle(addressFromStringValue(oracle_))) ++ _savePauser(addressFromStringValue(pauser_))), unit)
446+ then $Tuple2(((((_saveInit(true) ++ _saveExecutor(addressFromStringValue(executor_))) ++ _saveOracle(addressFromStringValue(oracle_))) ++ _savePauser(addressFromStringValue(pauser_))) ++ _saveSWavesContract(addressFromStringValue(sWavesContract_))), unit)
401447 else throw("Strict value is not equal to itself.")
402448 }
403449
404450
405451
406452 @Callable(i)
407453 func deposit (callerContract_,sender_,token_,amount_,referrer_) = {
408454 let amount = valueOrErrorMessage(parseInt(amount_), "deposit: amount is not Int")
409455 let err = if (if (if (if (_whenInitialized())
410456 then _whenNotPaused()
411457 else false)
412458 then _validateExecutor(i.caller, "deposit: invalid executor")
413459 else false)
414460 then _validateCaller(callerContract_, "deposit: invalid caller")
415461 else false)
416462 then _validateInt(amount, 0, MAX_INT, "deposit: invalid amount")
417463 else false
418464 if ((err == err))
419465 then {
420466 let rate = _getTokenRate(token_)
421- let $t01578615868 = _loadUserPosition(sender_, token_)
422- let userTokenBalance = $t01578615868._1
423- let userTokenBalanceInUSD = $t01578615868._2
467+ let $t01511215194 = _loadUserPosition(token_, sender_)
468+ let userTokenBalance = $t01511215194._1
469+ let userTokenBalanceInUSD = $t01511215194._2
424470 let userUSDBalance = _loadUserUSDBalance(sender_)
425- let $t01592716011 = _userCheckpoint(sender_, userUSDBalance)
426- let checkpointActions = $t01592716011._1
427- let userUnitsBalance = $t01592716011._2
471+ let $t01525315337 = _userCheckpoint(sender_, userUSDBalance)
472+ let checkpointActions = $t01525315337._1
473+ let userUnitsBalance = $t01525315337._2
428474 let newUserTokenBalance = (userTokenBalance + toBigInt(amount))
429475 let newUserTokenBalanceInUSD = fraction(newUserTokenBalance, rate, PERCENT_FACTOR, DOWN)
430476 let newUserUSDBalance = ((userUSDBalance - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
431477 let totalBalanceUpdated = ((_loadTotalUSDBalance() - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
432- $Tuple2((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveUserUSDBalance(sender_, newUserUSDBalance)) ++ _saveUserPosition(token_, sender_, $Tuple2(newUserTokenBalance, newUserUSDBalance))), userUnitsBalance)
478+ $Tuple2(((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveTokenBalance(token_, (_loadTokenBalance(token_) + toBigInt(amount)))) ++ _saveUserUSDBalance(sender_, newUserUSDBalance)) ++ _saveUserPosition(token_, sender_, $Tuple2(newUserTokenBalance, newUserTokenBalanceInUSD))), userUnitsBalance)
433479 }
434480 else throw("Strict value is not equal to itself.")
435481 }
436482
437483
438484
439485 @Callable(i)
440486 func withdraw (callerContract_,sender_,token_,amount_) = {
441487 let amount = valueOrErrorMessage(parseInt(amount_), "withdraw: amount is not Int")
442488 let err = if (if (if (if (_whenInitialized())
443489 then _whenNotPaused()
444490 else false)
445491 then _validateExecutor(i.caller, "withdraw: invalid executor")
446492 else false)
447493 then _validateCaller(callerContract_, "withdraw: invalid caller")
448494 else false)
449495 then _validateInt(amount, 0, MAX_INT, "withdraw: invalid amount")
450496 else false
451497 if ((err == err))
452498 then {
453499 let rate = _getTokenRate(token_)
454- let $t01717817260 = _loadUserPosition(sender_, token_)
455- let userTokenBalance = $t01717817260._1
456- let userTokenBalanceInUSD = $t01717817260._2
500+ let $t01659516677 = _loadUserPosition(token_, sender_)
501+ let userTokenBalance = $t01659516677._1
502+ let userTokenBalanceInUSD = $t01659516677._2
457503 let userUSDBalance = _loadUserUSDBalance(sender_)
458- let $t01731917403 = _userCheckpoint(sender_, userUSDBalance)
459- let checkpointActions = $t01731917403._1
460- let userUnitsBalance = $t01731917403._2
504+ let $t01673616820 = _userCheckpoint(sender_, userUSDBalance)
505+ let checkpointActions = $t01673616820._1
506+ let userUnitsBalance = $t01673616820._2
461507 let newUserTokenBalance = (userTokenBalance - toBigInt(amount))
462508 let err1 = _validateInt(toInt(newUserTokenBalance), 0, MAX_INT, "withdraw: insufficient token amount")
463509 if ((err1 == err1))
464510 then {
465511 let newUserTokenBalanceInUSD = fraction(newUserTokenBalance, rate, PERCENT_FACTOR, DOWN)
466512 let newUserUSDBalance = ((userUSDBalance - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
467513 let totalBalanceUpdated = ((_loadTotalUSDBalance() - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
468- $Tuple2((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveUserUSDBalance(sender_, newUserUSDBalance)) ++ _saveUserPosition(token_, sender_, $Tuple2(newUserTokenBalance, newUserUSDBalance))), unit)
514+ $Tuple2(((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveTokenBalance(token_, (_loadTokenBalance(token_) - toBigInt(amount)))) ++ _saveUserUSDBalance(sender_, newUserUSDBalance)) ++ _saveUserPosition(token_, sender_, $Tuple2(newUserTokenBalance, newUserTokenBalanceInUSD))), unit)
469515 }
470516 else throw("Strict value is not equal to itself.")
471517 }
472518 else throw("Strict value is not equal to itself.")
473519 }
474520
475521
476522
477523 @Callable(i)
478524 func depositWaves () = {
479525 let err = if (if (if (if (_whenInitialized())
480526 then _whenNotPaused()
481527 else false)
482528 then _validatePaymentsSize(i.payments, 1, "depositWaves: no payment")
483529 else false)
484530 then _validateWavesPayment(i.payments[0], "depositWaves: invalid asset")
485531 else false)
486532 then _validateInt(i.payments[0].amount, 0, MAX_INT, "depositWaves: invalid amount")
487533 else false
488534 if ((err == err))
489535 then {
490536 let amount = i.payments[0].amount
491537 let sender = toString(i.caller)
492538 let token = WAVES
493539 let rate = _getTokenRate(token)
494- let $t01862418704 = _loadUserPosition(sender, token)
495- let userTokenBalance = $t01862418704._1
496- let userTokenBalanceInUSD = $t01862418704._2
540+ let $t01813218212 = _loadUserPosition(token, sender)
541+ let userTokenBalance = $t01813218212._1
542+ let userTokenBalanceInUSD = $t01813218212._2
497543 let userUSDBalance = _loadUserUSDBalance(sender)
498- let $t01876218845 = _userCheckpoint(sender, userUSDBalance)
499- let checkpointActions = $t01876218845._1
500- let userUnitsBalance = $t01876218845._2
544+ let $t01827018353 = _userCheckpoint(sender, userUSDBalance)
545+ let checkpointActions = $t01827018353._1
546+ let userUnitsBalance = $t01827018353._2
501547 let newUserTokenBalance = (userTokenBalance + toBigInt(amount))
502548 let newUserTokenBalanceInUSD = fraction(newUserTokenBalance, rate, PERCENT_FACTOR, DOWN)
503549 let newUserUSDBalance = ((userUSDBalance - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
504550 let totalBalanceUpdated = ((_loadTotalUSDBalance() - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
505- $Tuple2(((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveUserPosition(token, sender, $Tuple2(newUserTokenBalance, newUserUSDBalance))), userUnitsBalance)
551+ let invocation = invoke(_loadSWavesContract(), FUNC_DEPOSIT, nil, [AttachedPayment(unit, amount)])
552+ if ((invocation == invocation))
553+ then $Tuple2(((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveTokenBalance(WAVES, (_loadTokenBalance(WAVES) + toBigInt(amount)))) ++ _saveUserUSDBalance(sender, newUserUSDBalance)) ++ _saveUserPosition(token, sender, $Tuple2(newUserTokenBalance, newUserTokenBalanceInUSD))), userUnitsBalance)
554+ else throw("Strict value is not equal to itself.")
506555 }
507556 else throw("Strict value is not equal to itself.")
508557 }
509558
510559
511560
512561 @Callable(i)
513562 func withdrawWaves (amount_) = {
514563 let err = if (if (_whenInitialized())
515564 then _whenNotPaused()
516565 else false)
517566 then _validateInt(amount_, 0, MAX_INT, "withdrawWaves: invalid amount")
518567 else false
519568 if ((err == err))
520569 then {
521570 let sender = toString(i.caller)
522571 let token = WAVES
523572 let rate = _getTokenRate(token)
524- let $t01971319793 = _loadUserPosition(sender, token)
525- let userTokenBalance = $t01971319793._1
526- let userTokenBalanceInUSD = $t01971319793._2
573+ let $t01948819568 = _loadUserPosition(token, sender)
574+ let userTokenBalance = $t01948819568._1
575+ let userTokenBalanceInUSD = $t01948819568._2
527576 let userUSDBalance = _loadUserUSDBalance(sender)
528- let $t01985119934 = _userCheckpoint(sender, userUSDBalance)
529- let checkpointActions = $t01985119934._1
530- let userUnitsBalance = $t01985119934._2
577+ let $t01962619709 = _userCheckpoint(sender, userUSDBalance)
578+ let checkpointActions = $t01962619709._1
579+ let userUnitsBalance = $t01962619709._2
531580 let newUserTokenBalance = (userTokenBalance - toBigInt(amount_))
532581 let err1 = _validateInt(toInt(newUserTokenBalance), 0, MAX_INT, "withdrawWaves: insufficient token amount")
533582 if ((err1 == err1))
534583 then {
535584 let newUserTokenBalanceInUSD = fraction(newUserTokenBalance, rate, PERCENT_FACTOR, DOWN)
536585 let newUserUSDBalance = ((userUSDBalance - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
537586 let totalBalanceUpdated = ((_loadTotalUSDBalance() - userTokenBalanceInUSD) + newUserTokenBalanceInUSD)
538- $Tuple2((((checkpointActions ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveUserUSDBalance(sender, newUserUSDBalance)) ++ _saveUserPosition(token, sender, $Tuple2(newUserTokenBalance, newUserUSDBalance))), unit)
587+ let sWavesContract = _loadSWavesContract()
588+ let sWavesAsset = _loadSWavesAsset(sWavesContract)
589+ let invocation = invoke(sWavesContract, FUNC_GET_RATE, nil, nil)
590+ let swavesRate = match invocation {
591+ case a: String =>
592+ parseBigIntValue(a)
593+ case _ =>
594+ throw("withdrawWaves: sWaves getRate() revert")
595+ }
596+ let sWavesToWithdraw = toInt(fraction(toBigInt(amount_), SWAVES_RATE_FACTOR, swavesRate, CEILING))
597+ let invocation1 = invoke(sWavesContract, FUNC_WITHDRAW, nil, [AttachedPayment(sWavesAsset, sWavesToWithdraw)])
598+ if ((invocation1 == invocation1))
599+ then $Tuple2(((((([ScriptTransfer(i.caller, amount_, unit)] ++ checkpointActions) ++ _saveTotalUSDBalance(totalBalanceUpdated)) ++ _saveTokenBalance(WAVES, (_loadTokenBalance(WAVES) - toBigInt(amount_)))) ++ _saveUserUSDBalance(sender, newUserUSDBalance)) ++ _saveUserPosition(token, sender, $Tuple2(newUserTokenBalance, newUserTokenBalanceInUSD))), unit)
600+ else throw("Strict value is not equal to itself.")
539601 }
540602 else throw("Strict value is not equal to itself.")
541603 }
542604 else throw("Strict value is not equal to itself.")
543605 }
544606
545607
546608
547609 @Callable(i)
548610 func startRetrodrop (amount_,blocksAt_) = {
549611 let err = if (if (if (if (if (_onlyThisContract(i.caller))
550612 then _whenInitialized()
551613 else false)
552614 then _whenNotPaused()
553615 else false)
554616 then _validateInt(amount_, 1, MAX_INT, "startRetrodrop: invalid amount")
555617 else false)
556618 then _validateInt(blocksAt_, 1, MAX_INT, "startRetrodrop: invalid blocksAt")
557619 else false)
558620 then _validateEqBigInt(_loadStartBlock(), ZERO_BIGINT, "startRetrodrop: already started")
559621 else false
560622 if ((err == err))
561623 then {
562624 let startHeight = toBigInt(height)
563625 let finishHeight = (startHeight + toBigInt(blocksAt_))
564626 let unitsPerBlock = fraction(toBigInt(amount_), PERCENT_FACTOR, toBigInt(blocksAt_))
565627 $Tuple2(((_saveStartBlock(startHeight) ++ _saveFinishBlock(finishHeight)) ++ _saveUnitsPerBlock(unitsPerBlock)), unit)
566628 }
567629 else throw("Strict value is not equal to itself.")
568630 }
569631
570632
571633
572634 @Callable(i)
573635 func getUnits (user_) = {
574- let userUSDBalance = _loadUserUSDBalance(user_)
575- let $t02154721619 = _userCheckpoint(user_, userUSDBalance)
576- let actions = $t02154721619._1
577- let userUnitsBalance = $t02154721619._2
636+ let $t02197822062 = _userCheckpoint(user_, _loadUserUSDBalance(user_))
637+ let actions = $t02197822062._1
638+ let userUnitsBalance = $t02197822062._2
578639 $Tuple2(nil, userUnitsBalance)
579640 }
580641
581642
582643
583644 @Callable(i)
584645 func updateCallerContract (callerContract_) = {
585646 let err = if (_onlyThisContract(i.caller))
586647 then _whenInitialized()
587648 else false
588649 if ((err == err))
589650 then $Tuple2(_saveCallerContract(callerContract_), unit)
590651 else throw("Strict value is not equal to itself.")
591652 }
592653
593654
594655
595656 @Callable(i)
596657 func pause () = {
597658 let err = if (if (_onlyPauser(i.caller))
598659 then _whenInitialized()
599660 else false)
600661 then _whenNotPaused()
601662 else false
602663 if ((err == err))
603664 then $Tuple2(_savePause(true), unit)
604665 else throw("Strict value is not equal to itself.")
605666 }
606667
607668
608669
609670 @Callable(i)
610671 func unpause () = {
611672 let err = if (if (_onlyPauser(i.caller))
612673 then _whenInitialized()
613674 else false)
614675 then _whenPaused()
615676 else false
616677 if ((err == err))
617678 then $Tuple2(_savePause(false), unit)
618679 else throw("Strict value is not equal to itself.")
619680 }
620681
621682
622683
623684 @Callable(i)
624685 func updatePauser (pauser_) = {
625686 let err = if (if (_onlyThisContract(i.caller))
626687 then _whenInitialized()
627688 else false)
628689 then _validateAddress(pauser_, "updatePauser: invalid pauser")
629690 else false
630691 if ((err == err))
631692 then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit)
632693 else throw("Strict value is not equal to itself.")
633694 }
634695
635696
636697
637698 @Callable(i)
638699 func setMultisig (multisig_) = {
639700 let err = if (_onlyThisContract(i.caller))
640701 then _validateAddress(multisig_, "setMultisig: invalid multisig")
641702 else false
642703 if ((err == err))
643704 then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit)
644705 else throw("Strict value is not equal to itself.")
645706 }
646707
647708
648709 @Verifier(tx)
649710 func verify () = match getString(KEY_MULTISIG) {
650711 case multisig: String =>
651712 valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false)
652713 case _ =>
653714 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
654715 }
655716

github/deemru/w8io/169f3d6 
104.52 ms