tx · ERkX8r2aTS7NE6zwkaoGay88rHLQQqmu7zvxyq7QQnFe

3MsU936briqQ2XZMpkhWdrV8EsNwm5iCuRY:  -0.01700000 Waves

2023.02.27 10:00 [2467783] smart account 3MsU936briqQ2XZMpkhWdrV8EsNwm5iCuRY > SELF 0.00000000 Waves

{ "type": 13, "id": "ERkX8r2aTS7NE6zwkaoGay88rHLQQqmu7zvxyq7QQnFe", "fee": 1700000, "feeAssetId": null, "timestamp": 1677481323639, "version": 2, "chainId": 84, "sender": "3MsU936briqQ2XZMpkhWdrV8EsNwm5iCuRY", "senderPublicKey": "F471QhzucRgQCSkZK5opBNc55AoNgiibCabvTp6GZ9nq", "proofs": [ "5L6qM4Zt9mgyWwgdwBFFNavbNeRXDuk3Y4nKDbLvkeUSq8DBwgCbJfseJpLACJCfVEgZxmYx6zvJMCTMMjbVN9vP" ], "script": "base64:BgIrCAISBwoFAQgIAQESBQoDCAgIEgASAwoBCBIDCgEIEgYKBAgIAQESAwoBCEEAA1NFUAICX18ABU1VTFQ2AMCEPQAFTVVMVDgAgMLXLwAKV0FWRVNJRFNUUgIFV0FWRVMAB1dBVkVTSUQJANkEAQUKV0FWRVNJRFNUUgEMZ2V0SW50T3JGYWlsAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAmggCBQR0aGlzBQNrZXkJAKwCAgkArAICAg9NYW5kYXRvcnkgdGhpcy4FA2tleQIPIGlzIG5vdCBkZWZpbmVkAQxnZXRTdHJPckVsc2UDB2FkZHJlc3MDa2V5CmRlZmF1bHRWYWwJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUHYWRkcmVzcwUDa2V5BQpkZWZhdWx0VmFsAQ9nZXRTdHJpbmdPckZhaWwCB2FkZHJlc3MDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUHYWRkcmVzcwUDa2V5CQCsAgIJAKwCAgIPTWFuZGF0b3J5IHRoaXMuBQNrZXkCDyBpcyBub3QgZGVmaW5lZAEQZ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GnLvKHKNFyCzbZBTugxTPiuCrh8K Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let MULT6 = 1000000
77
88 let MULT8 = 100000000
99
1010 let WAVESIDSTR = "WAVES"
1111
1212 let WAVESID = fromBase58String(WAVESIDSTR)
1313
1414 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined"))
1515
1616
1717 func getStrOrElse (address,key,defaultVal) = valueOrElse(getString(address, key), defaultVal)
1818
1919
2020 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("Mandatory this." + key) + " is not defined"))
2121
2222
2323 func getAddressOrFail (key) = valueOrErrorMessage(addressFromString(getStringOrFail(this, key)), (("Fail to convert this." + key) + " value into Address"))
2424
2525
2626 func asAnyList (val) = match val {
2727 case valAnyList: List[Any] =>
2828 valAnyList
2929 case _ =>
3030 throw("fail to cast into List[Any]")
3131 }
3232
3333
3434 func asInt (v) = match v {
3535 case i: Int =>
3636 i
3737 case _ =>
3838 throw("fail to cast into Int")
3939 }
4040
4141
4242 func asByteVecot (v) = match v {
4343 case i: ByteVector =>
4444 i
4545 case _ =>
4646 throw("fail to cast into ByteVector")
4747 }
4848
4949
5050 func validateAddressOrFail (addressStr) = {
5151 let address = valueOrErrorMessage(addressFromString(addressStr), ("fail to convert into address " + addressStr))
5252 if ((0 > wavesBalance(address).available))
5353 then throw()
5454 else addressStr
5555 }
5656
5757
5858 func keyNodeRegistry (address) = ("%s__" + address)
5959
6060
6161 func keyNodeRewardsTotals (address) = ("%s%s__totals__" + address)
6262
6363
6464 func keyApprovedNodeList () = "%s__approvedNodeList"
6565
6666
6767 func keyDepositAmount () = "%s%s__cfg__depositAmount"
6868
6969
7070 func keyNeutrinoAddressStr () = "%s%s__cfg__neutrinoAddress"
7171
7272
7373 func keyMasterNodeAddressStr () = "%s%s__cfg__mainNeutrinoNodeAddress"
7474
7575
7676 func keyProtocolPartX6 () = "%s%s__cfg__protocolPartX6"
7777
7878
7979 func keyBenificaryPartX6 () = "%s%s__cfg__benificaryPartX6"
8080
8181
8282 func keyMinDistributeAmount () = "%s%s__cfg__minDistributeAmount"
8383
8484
8585 func keySwopfiUsdtUsdnPoolAddress () = "%s%s__cfg__swopfiUsdtUsdnPoolAddress"
8686
8787
8888 func keySavingsAddress () = "%s%s__cfg__savingsAddress"
8989
9090
9191 func keyBeneficiaryAddress () = "%s%s__cfg__beneficiaryAddress"
9292
9393
9494 let IdxControlCfgNeutrinoDapp = 1
9595
9696 let IdxControlCfgAuctionDapp = 2
9797
9898 let IdxControlCfgRpdDapp = 3
9999
100100 let IdxControlCfgMathDapp = 4
101101
102102 let IdxControlCfgLiquidationDapp = 5
103103
104104 let IdxControlCfgRestDapp = 6
105105
106106 let IdxControlCfgNodeRegistryDapp = 7
107107
108108 let IdxControlCfgNsbtStakingDapp = 8
109109
110110 let IdxControlCfgMediatorDapp = 9
111111
112112 let IdxControlCfgSurfStakingDapp = 10
113113
114114 let IdxControlCfgGnsbtControllerDapp = 11
115115
116116 let IdxControlCfgRestV2Dapp = 12
117117
118118 let IdxControlCfgGovernanceDapp = 13
119119
120120 func keyControlAddress () = "%s%s__config__controlAddress"
121121
122122
123123 func keyControlCfg () = "%s__controlConfig"
124124
125125
126126 func keyUsdnAssetId () = "neutrino_asset_id"
127127
128128
129129 func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP)
130130
131131
132132 func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx)))
133133
134134
135135 let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx"))
136136
137137 let controlCfg = readControlCfgOrFail(controlContract)
138138
139139 let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp)
140140
141141 let usdnAssetIdStr = getStrOrElse(neutrinoContract, keyUsdnAssetId(), "HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ")
142142
143143 let usdnAssetId = fromBase58String(usdnAssetIdStr)
144144
145145 let nRegIdxTxAdd = 1
146146
147147 let nRegIdxHeightAdd = 2
148148
149149 let nRegIdxTimeAdd = 3
150150
151151 let nRegIdxDepoAmt = 4
152152
153153 let nRegIdxDepoAmtLeft = 5
154154
155155 let nRegIdxStatus = 6
156156
157157 let nRegIdxStatusChangeHeight = 7
158158
159159 let nRegIdxStatusChangeTime = 8
160160
161161 func formatDepositAdd (txIdStr,depositAmount,remainingDepositAmount,status) = makeString(["%s%d%d%d%d%s%d%d", txIdStr, toString(lastBlock.height), toString(lastBlock.timestamp), toString(depositAmount), toString(remainingDepositAmount), status, "0", "0"], SEP)
162162
163163
164164 func formatDepositChangeStatus (origS,newStatus) = {
165165 let orig = split(origS, SEP)
166166 makeString(["%s%d%d%d%d%s%d%d", orig[nRegIdxTxAdd], orig[nRegIdxHeightAdd], orig[nRegIdxTimeAdd], orig[nRegIdxDepoAmt], orig[nRegIdxDepoAmtLeft], newStatus, toString(lastBlock.height), toString(lastBlock.timestamp)], SEP)
167167 }
168168
169169
170170 func keyRewardHistory (nodeAddress,txId) = makeString(["%s%s%s", "history", toString(nodeAddress), toBase58String(txId)], SEP)
171171
172172
173173 func dataRewardHistory (wavesAmountTotal,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(wavesAmountTotal), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP)
174174
175175
176176 func RewardHistoryEntry (nodeAddress,txId,minedAmt,beneficiaryAmt,protocolAmt,protocolAmt1,protocolAmt2) = StringEntry(keyRewardHistory(nodeAddress, txId), dataRewardHistory(minedAmt, beneficiaryAmt, protocolAmt, protocolAmt1, protocolAmt2))
177177
178178
179179 func dataRewardTotals (minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d", toString(minedAmt), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP)
180180
181181
182182 func RewardTotalsEntry (miner,minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = {
183183 let nodeRewardsTotalsKEY = keyNodeRewardsTotals(toString(miner))
184184 let nodeRewardsArray = split(getStrOrElse(this, nodeRewardsTotalsKEY, dataRewardTotals(0, 0, 0, 0, 0)), SEP)
185185 let newMinedAmt = (parseIntValue(nodeRewardsArray[1]) + minedAmt)
186186 let newBeneficiaryAmt = (parseIntValue(nodeRewardsArray[2]) + beneficiaryAmt)
187187 let newProtocolAmt = (parseIntValue(nodeRewardsArray[3]) + protocolAmt)
188188 let newProtocolAmtPart1 = (parseIntValue(nodeRewardsArray[4]) + protocolAmtPart1)
189189 let newProtocolAmtPart2 = (parseIntValue(nodeRewardsArray[5]) + protocolAmtPart2)
190190 StringEntry(nodeRewardsTotalsKEY, dataRewardTotals(newMinedAmt, newBeneficiaryAmt, newProtocolAmt, newProtocolAmtPart1, newProtocolAmtPart2))
191191 }
192192
193193
194194 func resolveBeneficiaries (minerAddress,beneficiaryFromParam) = {
195195 let beneficiaryFromMinerState = addressFromStringValue(getStringOrFail(minerAddress, keyBeneficiaryAddress()))
196196 if ((scriptHash(minerAddress) == unit))
197197 then beneficiaryFromParam
198198 else beneficiaryFromMinerState
199199 }
200200
201201
202202 func readNodeDataAndValidateStatus (nodeAddr,expectedStatus) = {
203203 let nodeDataOpt = getString(keyNodeRegistry(nodeAddr))
204204 if (!(isDefined(nodeDataOpt)))
205205 then throw(("Unknown Node " + nodeAddr))
206206 else {
207207 let nodeDataStr = value(nodeDataOpt)
208208 let nodeData = split(nodeDataStr, SEP)
209209 let nodeStatus = if ((size(nodeData) >= 9))
210210 then nodeData[nRegIdxStatus]
211211 else "PENDING"
212212 if ((nodeStatus != expectedStatus))
213213 then throw(((((("Node " + nodeAddr) + " status should be ") + expectedStatus) + ", but actually ") + nodeStatus))
214214 else nodeDataStr
215215 }
216216 }
217217
218218
219219 @Callable(i)
220220 func constructorV1 (depositAmount,neutrinoAddressStr,masterNodeAddressStr,protocolPartX6,benificaryPartX6) = if ((i.caller != this))
221221 then throw("permissions denied")
222222 else if ((0 > depositAmount))
223223 then throw("depositAmount less then zero")
224224 else if ((0 > protocolPartX6))
225225 then throw("protocolPartX6 less then zero")
226226 else if ((0 > benificaryPartX6))
227227 then throw("benificaryPartX6 less then zero")
228228 else if (((protocolPartX6 + benificaryPartX6) != MULT6))
229229 then throw("parts sum must be 1")
230230 else [IntegerEntry(keyDepositAmount(), depositAmount), StringEntry(keyNeutrinoAddressStr(), validateAddressOrFail(neutrinoAddressStr)), StringEntry(keyMasterNodeAddressStr(), validateAddressOrFail(masterNodeAddressStr)), IntegerEntry(keyProtocolPartX6(), protocolPartX6), IntegerEntry(keyBenificaryPartX6(), benificaryPartX6)]
231231
232232
233233
234234 @Callable(i)
235235 func constructorV2 (swopfiAddressStr,controlAddressStr,savingsAddressStr) = if ((i.caller != this))
236236 then throw("permissions denied")
237237 else [StringEntry(keySwopfiUsdtUsdnPoolAddress(), validateAddressOrFail(swopfiAddressStr)), StringEntry(keyControlAddress(), validateAddressOrFail(controlAddressStr)), StringEntry(keySavingsAddress(), validateAddressOrFail(savingsAddressStr))]
238238
239239
240240
241241 @Callable(i)
242242 func sumbitApplication () = if ((size(i.payments) != 1))
243243 then throw("exact 1 payment must be attached")
244244 else if ((i.caller != i.originCaller))
245245 then throw("dapp to dapp calls are not allowed")
246246 else {
247247 let pmt = i.payments[0]
248248 let deposit = pmt.amount
249249 let pmtAssetId = valueOrElse(pmt.assetId, WAVESID)
250250 let expectedDepositAmount = getIntOrFail(keyDepositAmount())
251251 let txId = toBase58String(i.transactionId)
252252 let nodeAddress = toString(i.caller)
253253 let nodeRegistryKEY = keyNodeRegistry(nodeAddress)
254254 if ((pmtAssetId != WAVESID))
255255 then throw("only Waves can be used for deposit")
256256 else if ((deposit != expectedDepositAmount))
257257 then throw((("exactly " + toString(expectedDepositAmount)) + " Wavelets are expected"))
258258 else if ((getStrOrElse(this, nodeRegistryKEY, "") != ""))
259259 then throw("your node already registered")
260260 else [StringEntry(nodeRegistryKEY, formatDepositAdd(txId, deposit, deposit, "PENDING"))]
261261 }
262262
263263
264264
265265 @Callable(i)
266266 func distributeMinerReward (beneficiaryAddressStr) = {
267267 let minDistributeAmount = valueOrElse(getInteger(this, keyMinDistributeAmount()), (24 * MULT8))
268268 if ((size(i.payments) != 1))
269269 then throw("exact 1 payment must be attached")
270270 else if ((i.caller != i.originCaller))
271271 then throw("dapp to dapp calls are not allowed")
272272 else {
273273 let pmt = i.payments[0]
274274 let pmtAssetId = valueOrElse(pmt.assetId, WAVESID)
275275 let feeAmt = i.fee
276276 let feeAssetId = valueOrElse(i.feeAssetId, WAVESID)
277277 let callReward = (feeAmt * 3)
278278 let minedAmt = (pmt.amount - callReward)
279279 if ((pmt.amount != minDistributeAmount))
280280 then throw((("attached payment must be exact " + toString(minDistributeAmount)) + " Wavelets"))
281281 else if ((pmtAssetId != WAVESID))
282282 then throw("only Waves can be used in payment")
283283 else if ((feeAssetId != WAVESID))
284284 then throw("only Waves can be used in fees")
285285 else if ((feeAmt != ((5 * MULT8) / 1000)))
286286 then throw("fee amount couldn't exceed 0.005")
287287 else {
288288 let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr())
289289 let masterNodeAddress = getAddressOrFail(keyMasterNodeAddressStr())
290290 let minerAddress = i.caller
291291 let beneficiaryFromParam = addressFromStringValue(beneficiaryAddressStr)
292292 let beneficiaryAddress = resolveBeneficiaries(minerAddress, beneficiaryFromParam)
293293 let txRewardReceiver = beneficiaryFromParam
294294 let protocolPart = getIntOrFail(keyProtocolPartX6())
295295 let beneficiaryPart = getIntOrFail(keyBenificaryPartX6())
296296 let beneficiaryAmt = fraction(minedAmt, beneficiaryPart, MULT6)
297297 let protocolAmt = (minedAmt - beneficiaryAmt)
298298 [ScriptTransfer(beneficiaryAddress, beneficiaryAmt, unit), ScriptTransfer(neutrinoContract, protocolAmt, unit), ScriptTransfer(txRewardReceiver, callReward, unit), RewardHistoryEntry(minerAddress, i.transactionId, minedAmt, beneficiaryAmt, protocolAmt, protocolAmt, 0), RewardTotalsEntry(minerAddress, minedAmt, beneficiaryAmt, protocolAmt, protocolAmt, 0)]
299299 }
300300 }
301301 }
302302
303303
304304
305305 @Callable(i)
306306 func validateAndApproveLeasings (nListS) = {
307307 let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7]
308308 let nList = split(nListS, SEP)
309309 let expectedCount = size(nIdxs)
310310 let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr())
311311 if ((i.caller != neutrinoAddress))
312312 then throw("validateAndApproveLeasings not authorized")
313313 else if (((size(nList) % 2) != 0))
314314 then throw("Only even number of nodes is allowed")
315315 else if ((size(nList) != expectedCount))
316316 then throw((("Only " + toString(expectedCount)) + " of nodes' addresses can be passed"))
317317 else {
318318 func forEachNodeChangeStatus (acc,i) = {
319319 let nodeAddr = nList[i]
320320 let nodeDataStr = readNodeDataAndValidateStatus(nodeAddr, "PENDING")
321321 (acc :+ StringEntry(keyNodeRegistry(nodeAddr), formatDepositChangeStatus(nodeDataStr, "APPROVED")))
322322 }
323323
324324 let approvedNodesData = {
325325 let $l = nIdxs
326326 let $s = size($l)
327327 let $acc0 = nil
328328 func $f0_1 ($a,$i) = if (($i >= $s))
329329 then $a
330330 else forEachNodeChangeStatus($a, $l[$i])
331331
332332 func $f0_2 ($a,$i) = if (($i >= $s))
333333 then $a
334334 else throw("List size exceeds 8")
335335
336336 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8)
337337 }
338338 $Tuple2(approvedNodesData, nil)
339339 }
340340 }
341341
342342
343343
344344 @Callable(i)
345345 func replaceApprovedNode (oldNodeAddrStr,newNodeAddrStr,groupNum,penaltyAmount) = if ((i.caller != neutrinoContract))
346346 then throw("permissions denied")
347347 else {
348348 let oldDataStr = readNodeDataAndValidateStatus(oldNodeAddrStr, "APPROVED")
349349 let newDataStr = readNodeDataAndValidateStatus(newNodeAddrStr, "PENDING")
350350 let approvedNodeListS = getStringOrFail(this, keyApprovedNodeList())
351351 if (!(contains(approvedNodeListS, oldNodeAddrStr)))
352352 then throw(("approvedNodeList does not contain " + oldNodeAddrStr))
353353 else {
354354 let updatedNodeListS = makeString_2C(split_4C(approvedNodeListS, oldNodeAddrStr), newNodeAddrStr)
355355 let oldNodeAddr = addressFromStringValue(oldNodeAddrStr)
356356 let beneficiaryAddress = resolveBeneficiaries(oldNodeAddr, oldNodeAddr)
357357 let depoAmount = parseIntValue(split(oldDataStr, SEP)[nRegIdxDepoAmt])
358358 let actions = [StringEntry(keyApprovedNodeList(), updatedNodeListS), DeleteEntry(keyNodeRegistry(oldNodeAddrStr)), StringEntry(keyNodeRegistry(newNodeAddrStr), formatDepositChangeStatus(newDataStr, "APPROVED"))]
359359 $Tuple2(if ((depoAmount > penaltyAmount))
360360 then (actions :+ ScriptTransfer(beneficiaryAddress, (depoAmount - penaltyAmount), unit))
361361 else actions, unit)
362362 }
363363 }
364364
365365
366366
367367 @Callable(i)
368368 func returnDeposit (nodeAddressStr) = if ((size(i.payments) != 0))
369369 then throw("No payments allowed")
370370 else {
371371 let callerAddress = i.caller
372372 let nodeRegistryKEY = keyNodeRegistry(nodeAddressStr)
373373 let nodeDataOpt = getString(this, nodeRegistryKEY)
374374 if (!(isDefined(nodeDataOpt)))
375375 then throw(("Address is not applied as neutrino node: " + nodeAddressStr))
376376 else {
377377 let approvedNodeList = getStringOrFail(this, keyApprovedNodeList())
378378 if (contains(approvedNodeList, nodeAddressStr))
379379 then throw("Impossible to return deposit from approved Node, please contact support team")
380380 else {
381381 let nodeData = split(value(nodeDataOpt), SEP)
382382 let status = if ((size(nodeData) >= 9))
383383 then nodeData[nRegIdxStatus]
384384 else "PENDING"
385385 if ((status != "PENDING"))
386386 then throw("Application status is not PENDING!")
387387 else {
388388 let depoAmount = parseIntValue(nodeData[nRegIdxDepoAmt])
389389 let nodeAddress = addressFromStringValue(nodeAddressStr)
390390 let beneficiaryAddress = resolveBeneficiaries(nodeAddress, nodeAddress)
391391 if (!(if (if ((callerAddress == this))
392392 then true
393393 else if ((beneficiaryAddress != nodeAddress))
394394 then (callerAddress == beneficiaryAddress)
395395 else false)
396396 then true
397397 else if ((beneficiaryAddress == nodeAddress))
398398 then (callerAddress == nodeAddress)
399399 else false))
400400 then throw("returnDeposit permissions denied")
401401 else [DeleteEntry(nodeRegistryKEY), ScriptTransfer(beneficiaryAddress, depoAmount, unit)]
402402 }
403403 }
404404 }
405405 }
406406
407407

github/deemru/w8io/026f985 
49.16 ms