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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nLvKHKNFyCzbZBTugxTPiuCrh8K Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let MULT6 = 1000000 | |
7 | 7 | ||
8 | 8 | let MULT8 = 100000000 | |
9 | 9 | ||
10 | 10 | let WAVESIDSTR = "WAVES" | |
11 | 11 | ||
12 | 12 | let WAVESID = fromBase58String(WAVESIDSTR) | |
13 | 13 | ||
14 | 14 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined")) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func getStrOrElse (address,key,defaultVal) = valueOrElse(getString(address, key), defaultVal) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("Mandatory this." + key) + " is not defined")) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func getAddressOrFail (key) = valueOrErrorMessage(addressFromString(getStringOrFail(this, key)), (("Fail to convert this." + key) + " value into Address")) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func asAnyList (val) = match val { | |
27 | 27 | case valAnyList: List[Any] => | |
28 | 28 | valAnyList | |
29 | 29 | case _ => | |
30 | 30 | throw("fail to cast into List[Any]") | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func asInt (v) = match v { | |
35 | 35 | case i: Int => | |
36 | 36 | i | |
37 | 37 | case _ => | |
38 | 38 | throw("fail to cast into Int") | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func asByteVecot (v) = match v { | |
43 | 43 | case i: ByteVector => | |
44 | 44 | i | |
45 | 45 | case _ => | |
46 | 46 | throw("fail to cast into ByteVector") | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func validateAddressOrFail (addressStr) = { | |
51 | 51 | let address = valueOrErrorMessage(addressFromString(addressStr), ("fail to convert into address " + addressStr)) | |
52 | 52 | if ((0 > wavesBalance(address).available)) | |
53 | 53 | then throw() | |
54 | 54 | else addressStr | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func keyNodeRegistry (address) = ("%s__" + address) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keyNodeRewardsTotals (address) = ("%s%s__totals__" + address) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func keyApprovedNodeList () = "%s__approvedNodeList" | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func keyDepositAmount () = "%s%s__cfg__depositAmount" | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func keyNeutrinoAddressStr () = "%s%s__cfg__neutrinoAddress" | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func keyMasterNodeAddressStr () = "%s%s__cfg__mainNeutrinoNodeAddress" | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func keyProtocolPartX6 () = "%s%s__cfg__protocolPartX6" | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func keyBenificaryPartX6 () = "%s%s__cfg__benificaryPartX6" | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func keyMinDistributeAmount () = "%s%s__cfg__minDistributeAmount" | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func keySwopfiUsdtUsdnPoolAddress () = "%s%s__cfg__swopfiUsdtUsdnPoolAddress" | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func keySavingsAddress () = "%s%s__cfg__savingsAddress" | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func keyBeneficiaryAddress () = "%s%s__cfg__beneficiaryAddress" | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | let IdxControlCfgNeutrinoDapp = 1 | |
95 | 95 | ||
96 | 96 | let IdxControlCfgAuctionDapp = 2 | |
97 | 97 | ||
98 | 98 | let IdxControlCfgRpdDapp = 3 | |
99 | 99 | ||
100 | 100 | let IdxControlCfgMathDapp = 4 | |
101 | 101 | ||
102 | 102 | let IdxControlCfgLiquidationDapp = 5 | |
103 | 103 | ||
104 | 104 | let IdxControlCfgRestDapp = 6 | |
105 | 105 | ||
106 | 106 | let IdxControlCfgNodeRegistryDapp = 7 | |
107 | 107 | ||
108 | 108 | let IdxControlCfgNsbtStakingDapp = 8 | |
109 | 109 | ||
110 | 110 | let IdxControlCfgMediatorDapp = 9 | |
111 | 111 | ||
112 | 112 | let IdxControlCfgSurfStakingDapp = 10 | |
113 | 113 | ||
114 | 114 | let IdxControlCfgGnsbtControllerDapp = 11 | |
115 | 115 | ||
116 | 116 | let IdxControlCfgRestV2Dapp = 12 | |
117 | 117 | ||
118 | 118 | let IdxControlCfgGovernanceDapp = 13 | |
119 | 119 | ||
120 | 120 | func keyControlAddress () = "%s%s__config__controlAddress" | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyControlCfg () = "%s__controlConfig" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyUsdnAssetId () = "neutrino_asset_id" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
136 | 136 | ||
137 | 137 | let controlCfg = readControlCfgOrFail(controlContract) | |
138 | 138 | ||
139 | 139 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
140 | 140 | ||
141 | 141 | let usdnAssetIdStr = getStrOrElse(neutrinoContract, keyUsdnAssetId(), "HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ") | |
142 | 142 | ||
143 | 143 | let usdnAssetId = fromBase58String(usdnAssetIdStr) | |
144 | 144 | ||
145 | 145 | let nRegIdxTxAdd = 1 | |
146 | 146 | ||
147 | 147 | let nRegIdxHeightAdd = 2 | |
148 | 148 | ||
149 | 149 | let nRegIdxTimeAdd = 3 | |
150 | 150 | ||
151 | 151 | let nRegIdxDepoAmt = 4 | |
152 | 152 | ||
153 | 153 | let nRegIdxDepoAmtLeft = 5 | |
154 | 154 | ||
155 | 155 | let nRegIdxStatus = 6 | |
156 | 156 | ||
157 | 157 | let nRegIdxStatusChangeHeight = 7 | |
158 | 158 | ||
159 | 159 | let nRegIdxStatusChangeTime = 8 | |
160 | 160 | ||
161 | 161 | 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) | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | func formatDepositChangeStatus (origS,newStatus) = { | |
165 | 165 | let orig = split(origS, SEP) | |
166 | 166 | 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) | |
167 | 167 | } | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func keyRewardHistory (nodeAddress,txId) = makeString(["%s%s%s", "history", toString(nodeAddress), toBase58String(txId)], SEP) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | 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) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func RewardHistoryEntry (nodeAddress,txId,minedAmt,beneficiaryAmt,protocolAmt,protocolAmt1,protocolAmt2) = StringEntry(keyRewardHistory(nodeAddress, txId), dataRewardHistory(minedAmt, beneficiaryAmt, protocolAmt, protocolAmt1, protocolAmt2)) | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func dataRewardTotals (minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d", toString(minedAmt), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP) | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func RewardTotalsEntry (miner,minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = { | |
183 | 183 | let nodeRewardsTotalsKEY = keyNodeRewardsTotals(toString(miner)) | |
184 | 184 | let nodeRewardsArray = split(getStrOrElse(this, nodeRewardsTotalsKEY, dataRewardTotals(0, 0, 0, 0, 0)), SEP) | |
185 | 185 | let newMinedAmt = (parseIntValue(nodeRewardsArray[1]) + minedAmt) | |
186 | 186 | let newBeneficiaryAmt = (parseIntValue(nodeRewardsArray[2]) + beneficiaryAmt) | |
187 | 187 | let newProtocolAmt = (parseIntValue(nodeRewardsArray[3]) + protocolAmt) | |
188 | 188 | let newProtocolAmtPart1 = (parseIntValue(nodeRewardsArray[4]) + protocolAmtPart1) | |
189 | 189 | let newProtocolAmtPart2 = (parseIntValue(nodeRewardsArray[5]) + protocolAmtPart2) | |
190 | 190 | StringEntry(nodeRewardsTotalsKEY, dataRewardTotals(newMinedAmt, newBeneficiaryAmt, newProtocolAmt, newProtocolAmtPart1, newProtocolAmtPart2)) | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func resolveBeneficiaries (minerAddress,beneficiaryFromParam) = { | |
195 | 195 | let beneficiaryFromMinerState = addressFromStringValue(getStringOrFail(minerAddress, keyBeneficiaryAddress())) | |
196 | 196 | if ((scriptHash(minerAddress) == unit)) | |
197 | 197 | then beneficiaryFromParam | |
198 | 198 | else beneficiaryFromMinerState | |
199 | 199 | } | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func readNodeDataAndValidateStatus (nodeAddr,expectedStatus) = { | |
203 | 203 | let nodeDataOpt = getString(keyNodeRegistry(nodeAddr)) | |
204 | 204 | if (!(isDefined(nodeDataOpt))) | |
205 | 205 | then throw(("Unknown Node " + nodeAddr)) | |
206 | 206 | else { | |
207 | 207 | let nodeDataStr = value(nodeDataOpt) | |
208 | 208 | let nodeData = split(nodeDataStr, SEP) | |
209 | 209 | let nodeStatus = if ((size(nodeData) >= 9)) | |
210 | 210 | then nodeData[nRegIdxStatus] | |
211 | 211 | else "PENDING" | |
212 | 212 | if ((nodeStatus != expectedStatus)) | |
213 | 213 | then throw(((((("Node " + nodeAddr) + " status should be ") + expectedStatus) + ", but actually ") + nodeStatus)) | |
214 | 214 | else nodeDataStr | |
215 | 215 | } | |
216 | 216 | } | |
217 | 217 | ||
218 | 218 | ||
219 | 219 | @Callable(i) | |
220 | 220 | func constructorV1 (depositAmount,neutrinoAddressStr,masterNodeAddressStr,protocolPartX6,benificaryPartX6) = if ((i.caller != this)) | |
221 | 221 | then throw("permissions denied") | |
222 | 222 | else if ((0 > depositAmount)) | |
223 | 223 | then throw("depositAmount less then zero") | |
224 | 224 | else if ((0 > protocolPartX6)) | |
225 | 225 | then throw("protocolPartX6 less then zero") | |
226 | 226 | else if ((0 > benificaryPartX6)) | |
227 | 227 | then throw("benificaryPartX6 less then zero") | |
228 | 228 | else if (((protocolPartX6 + benificaryPartX6) != MULT6)) | |
229 | 229 | then throw("parts sum must be 1") | |
230 | 230 | else [IntegerEntry(keyDepositAmount(), depositAmount), StringEntry(keyNeutrinoAddressStr(), validateAddressOrFail(neutrinoAddressStr)), StringEntry(keyMasterNodeAddressStr(), validateAddressOrFail(masterNodeAddressStr)), IntegerEntry(keyProtocolPartX6(), protocolPartX6), IntegerEntry(keyBenificaryPartX6(), benificaryPartX6)] | |
231 | 231 | ||
232 | 232 | ||
233 | 233 | ||
234 | 234 | @Callable(i) | |
235 | 235 | func constructorV2 (swopfiAddressStr,controlAddressStr,savingsAddressStr) = if ((i.caller != this)) | |
236 | 236 | then throw("permissions denied") | |
237 | 237 | else [StringEntry(keySwopfiUsdtUsdnPoolAddress(), validateAddressOrFail(swopfiAddressStr)), StringEntry(keyControlAddress(), validateAddressOrFail(controlAddressStr)), StringEntry(keySavingsAddress(), validateAddressOrFail(savingsAddressStr))] | |
238 | 238 | ||
239 | 239 | ||
240 | 240 | ||
241 | 241 | @Callable(i) | |
242 | 242 | func sumbitApplication () = if ((size(i.payments) != 1)) | |
243 | 243 | then throw("exact 1 payment must be attached") | |
244 | 244 | else if ((i.caller != i.originCaller)) | |
245 | 245 | then throw("dapp to dapp calls are not allowed") | |
246 | 246 | else { | |
247 | 247 | let pmt = i.payments[0] | |
248 | 248 | let deposit = pmt.amount | |
249 | 249 | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
250 | 250 | let expectedDepositAmount = getIntOrFail(keyDepositAmount()) | |
251 | 251 | let txId = toBase58String(i.transactionId) | |
252 | 252 | let nodeAddress = toString(i.caller) | |
253 | 253 | let nodeRegistryKEY = keyNodeRegistry(nodeAddress) | |
254 | 254 | if ((pmtAssetId != WAVESID)) | |
255 | 255 | then throw("only Waves can be used for deposit") | |
256 | 256 | else if ((deposit != expectedDepositAmount)) | |
257 | 257 | then throw((("exactly " + toString(expectedDepositAmount)) + " Wavelets are expected")) | |
258 | 258 | else if ((getStrOrElse(this, nodeRegistryKEY, "") != "")) | |
259 | 259 | then throw("your node already registered") | |
260 | 260 | else [StringEntry(nodeRegistryKEY, formatDepositAdd(txId, deposit, deposit, "PENDING"))] | |
261 | 261 | } | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | ||
265 | 265 | @Callable(i) | |
266 | 266 | func distributeMinerReward (beneficiaryAddressStr) = { | |
267 | 267 | let minDistributeAmount = valueOrElse(getInteger(this, keyMinDistributeAmount()), (24 * MULT8)) | |
268 | 268 | if ((size(i.payments) != 1)) | |
269 | 269 | then throw("exact 1 payment must be attached") | |
270 | 270 | else if ((i.caller != i.originCaller)) | |
271 | 271 | then throw("dapp to dapp calls are not allowed") | |
272 | 272 | else { | |
273 | 273 | let pmt = i.payments[0] | |
274 | 274 | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
275 | 275 | let feeAmt = i.fee | |
276 | 276 | let feeAssetId = valueOrElse(i.feeAssetId, WAVESID) | |
277 | 277 | let callReward = (feeAmt * 3) | |
278 | 278 | let minedAmt = (pmt.amount - callReward) | |
279 | 279 | if ((pmt.amount != minDistributeAmount)) | |
280 | 280 | then throw((("attached payment must be exact " + toString(minDistributeAmount)) + " Wavelets")) | |
281 | 281 | else if ((pmtAssetId != WAVESID)) | |
282 | 282 | then throw("only Waves can be used in payment") | |
283 | 283 | else if ((feeAssetId != WAVESID)) | |
284 | 284 | then throw("only Waves can be used in fees") | |
285 | 285 | else if ((feeAmt != ((5 * MULT8) / 1000))) | |
286 | 286 | then throw("fee amount couldn't exceed 0.005") | |
287 | 287 | else { | |
288 | 288 | let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr()) | |
289 | 289 | let masterNodeAddress = getAddressOrFail(keyMasterNodeAddressStr()) | |
290 | 290 | let minerAddress = i.caller | |
291 | 291 | let beneficiaryFromParam = addressFromStringValue(beneficiaryAddressStr) | |
292 | 292 | let beneficiaryAddress = resolveBeneficiaries(minerAddress, beneficiaryFromParam) | |
293 | 293 | let txRewardReceiver = beneficiaryFromParam | |
294 | 294 | let protocolPart = getIntOrFail(keyProtocolPartX6()) | |
295 | 295 | let beneficiaryPart = getIntOrFail(keyBenificaryPartX6()) | |
296 | 296 | let beneficiaryAmt = fraction(minedAmt, beneficiaryPart, MULT6) | |
297 | 297 | let protocolAmt = (minedAmt - beneficiaryAmt) | |
298 | 298 | [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)] | |
299 | 299 | } | |
300 | 300 | } | |
301 | 301 | } | |
302 | 302 | ||
303 | 303 | ||
304 | 304 | ||
305 | 305 | @Callable(i) | |
306 | 306 | func validateAndApproveLeasings (nListS) = { | |
307 | 307 | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
308 | 308 | let nList = split(nListS, SEP) | |
309 | 309 | let expectedCount = size(nIdxs) | |
310 | 310 | let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr()) | |
311 | 311 | if ((i.caller != neutrinoAddress)) | |
312 | 312 | then throw("validateAndApproveLeasings not authorized") | |
313 | 313 | else if (((size(nList) % 2) != 0)) | |
314 | 314 | then throw("Only even number of nodes is allowed") | |
315 | 315 | else if ((size(nList) != expectedCount)) | |
316 | 316 | then throw((("Only " + toString(expectedCount)) + " of nodes' addresses can be passed")) | |
317 | 317 | else { | |
318 | 318 | func forEachNodeChangeStatus (acc,i) = { | |
319 | 319 | let nodeAddr = nList[i] | |
320 | 320 | let nodeDataStr = readNodeDataAndValidateStatus(nodeAddr, "PENDING") | |
321 | 321 | (acc :+ StringEntry(keyNodeRegistry(nodeAddr), formatDepositChangeStatus(nodeDataStr, "APPROVED"))) | |
322 | 322 | } | |
323 | 323 | ||
324 | 324 | let approvedNodesData = { | |
325 | 325 | let $l = nIdxs | |
326 | 326 | let $s = size($l) | |
327 | 327 | let $acc0 = nil | |
328 | 328 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
329 | 329 | then $a | |
330 | 330 | else forEachNodeChangeStatus($a, $l[$i]) | |
331 | 331 | ||
332 | 332 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
333 | 333 | then $a | |
334 | 334 | else throw("List size exceeds 8") | |
335 | 335 | ||
336 | 336 | $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) | |
337 | 337 | } | |
338 | 338 | $Tuple2(approvedNodesData, nil) | |
339 | 339 | } | |
340 | 340 | } | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | ||
344 | 344 | @Callable(i) | |
345 | 345 | func replaceApprovedNode (oldNodeAddrStr,newNodeAddrStr,groupNum,penaltyAmount) = if ((i.caller != neutrinoContract)) | |
346 | 346 | then throw("permissions denied") | |
347 | 347 | else { | |
348 | 348 | let oldDataStr = readNodeDataAndValidateStatus(oldNodeAddrStr, "APPROVED") | |
349 | 349 | let newDataStr = readNodeDataAndValidateStatus(newNodeAddrStr, "PENDING") | |
350 | 350 | let approvedNodeListS = getStringOrFail(this, keyApprovedNodeList()) | |
351 | 351 | if (!(contains(approvedNodeListS, oldNodeAddrStr))) | |
352 | 352 | then throw(("approvedNodeList does not contain " + oldNodeAddrStr)) | |
353 | 353 | else { | |
354 | 354 | let updatedNodeListS = makeString_2C(split_4C(approvedNodeListS, oldNodeAddrStr), newNodeAddrStr) | |
355 | 355 | let oldNodeAddr = addressFromStringValue(oldNodeAddrStr) | |
356 | 356 | let beneficiaryAddress = resolveBeneficiaries(oldNodeAddr, oldNodeAddr) | |
357 | 357 | let depoAmount = parseIntValue(split(oldDataStr, SEP)[nRegIdxDepoAmt]) | |
358 | 358 | let actions = [StringEntry(keyApprovedNodeList(), updatedNodeListS), DeleteEntry(keyNodeRegistry(oldNodeAddrStr)), StringEntry(keyNodeRegistry(newNodeAddrStr), formatDepositChangeStatus(newDataStr, "APPROVED"))] | |
359 | 359 | $Tuple2(if ((depoAmount > penaltyAmount)) | |
360 | 360 | then (actions :+ ScriptTransfer(beneficiaryAddress, (depoAmount - penaltyAmount), unit)) | |
361 | 361 | else actions, unit) | |
362 | 362 | } | |
363 | 363 | } | |
364 | 364 | ||
365 | 365 | ||
366 | 366 | ||
367 | 367 | @Callable(i) | |
368 | 368 | func returnDeposit (nodeAddressStr) = if ((size(i.payments) != 0)) | |
369 | 369 | then throw("No payments allowed") | |
370 | 370 | else { | |
371 | 371 | let callerAddress = i.caller | |
372 | 372 | let nodeRegistryKEY = keyNodeRegistry(nodeAddressStr) | |
373 | 373 | let nodeDataOpt = getString(this, nodeRegistryKEY) | |
374 | 374 | if (!(isDefined(nodeDataOpt))) | |
375 | 375 | then throw(("Address is not applied as neutrino node: " + nodeAddressStr)) | |
376 | 376 | else { | |
377 | 377 | let approvedNodeList = getStringOrFail(this, keyApprovedNodeList()) | |
378 | 378 | if (contains(approvedNodeList, nodeAddressStr)) | |
379 | 379 | then throw("Impossible to return deposit from approved Node, please contact support team") | |
380 | 380 | else { | |
381 | 381 | let nodeData = split(value(nodeDataOpt), SEP) | |
382 | 382 | let status = if ((size(nodeData) >= 9)) | |
383 | 383 | then nodeData[nRegIdxStatus] | |
384 | 384 | else "PENDING" | |
385 | 385 | if ((status != "PENDING")) | |
386 | 386 | then throw("Application status is not PENDING!") | |
387 | 387 | else { | |
388 | 388 | let depoAmount = parseIntValue(nodeData[nRegIdxDepoAmt]) | |
389 | 389 | let nodeAddress = addressFromStringValue(nodeAddressStr) | |
390 | 390 | let beneficiaryAddress = resolveBeneficiaries(nodeAddress, nodeAddress) | |
391 | 391 | if (!(if (if ((callerAddress == this)) | |
392 | 392 | then true | |
393 | 393 | else if ((beneficiaryAddress != nodeAddress)) | |
394 | 394 | then (callerAddress == beneficiaryAddress) | |
395 | 395 | else false) | |
396 | 396 | then true | |
397 | 397 | else if ((beneficiaryAddress == nodeAddress)) | |
398 | 398 | then (callerAddress == nodeAddress) | |
399 | 399 | else false)) | |
400 | 400 | then throw("returnDeposit permissions denied") | |
401 | 401 | else [DeleteEntry(nodeRegistryKEY), ScriptTransfer(beneficiaryAddress, depoAmount, unit)] | |
402 | 402 | } | |
403 | 403 | } | |
404 | 404 | } | |
405 | 405 | } | |
406 | 406 | ||
407 | 407 |
github/deemru/w8io/026f985 49.16 ms ◑