tx · 64P8Ctk9QtYDPcQc4hCiVLv29KjqEUXkkGTkBGcpbnr2 3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY: -0.01300000 Waves 2022.07.06 21:35 [2128192] smart account 3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY > SELF 0.00000000 Waves
{ "type": 13, "id": "64P8Ctk9QtYDPcQc4hCiVLv29KjqEUXkkGTkBGcpbnr2", "fee": 1300000, "feeAssetId": null, "timestamp": 1657132523432, "version": 2, "chainId": 84, "sender": "3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY", "senderPublicKey": "A8DvbFTEjyHFvpK57CmHu6QKczzymTB5sgqq8xxjNsXG", "proofs": [ "4ng5UZVcFXr6T5qhmxCStP8pYoxFrxhqZUgjNqRfgJrE2gj2V6FNKtZ8qtvtRKuswW4LqMdxejqBWE5UyZu4ZXEf" ], "script": "base64:AAIFAAAAAAAAABwIAhIHCgUBCAgBARIAEgMKAQgSAwoBCBIDCgEIAAAAGwAAAAADU0VQAgAAAAJfXwAAAAAFTVVMVDYAAAAAAAAPQkAAAAAABU1VTFQ4AAAAAAAF9eEAAAAAAApXQVZFU0lEU1RSAgAAAAVXQVZFUwAAAAAHV0FWRVNJRAkAAlkAAAABBQAAAApXQVZFU0lEU1RSAQAAAAxnZXRJbnRPckZhaWwAAAABAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQkAASwAAAACCQABLAAAAAICAAAAD01hbmRhdG9yeSB0aGlzLgUAAAADa2V5AgAAAA8gaXMgbm90IGRlZmluZWQBAAAADGdldFN0ck9yRWxzZQAAAAIAAAADa2V5AAAACmRlZmF1bHRWYWwJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5BQAAAApkZWZhdWx0VmFsAQAAAA9nZXRTdHJpbmdPckZhaWwAAAACAAAAB2FkZHJlc3MAAAAD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ded", "spentComplexity": 0 } View: original | compacted Prev: B4Yy3ovpSn5jGaBUonzhQcxt7eEaXSVXAqjbfBVqihWe Next: 8NgdJwRuBChSvtSB5KtuktQUr9ktezaxgYWYmkUFKQam Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let SEP = "__" | |
5 | + | ||
6 | + | let MULT6 = 1000000 | |
7 | + | ||
8 | + | let MULT8 = 100000000 | |
9 | + | ||
10 | + | let WAVESIDSTR = "WAVES" | |
11 | + | ||
12 | + | let WAVESID = fromBase58String(WAVESIDSTR) | |
13 | + | ||
14 | + | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined")) | |
15 | + | ||
16 | + | ||
17 | + | func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal) | |
18 | + | ||
19 | + | ||
20 | + | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("Mandatory this." + key) + " is not defined")) | |
21 | + | ||
22 | + | ||
23 | + | func getAddressOrFail (key) = valueOrErrorMessage(addressFromString(getStringOrFail(this, key)), (("Fail to convert this." + key) + " value into Address")) | |
24 | + | ||
25 | + | ||
26 | + | func validateAddressOrFail (addressStr) = { | |
27 | + | let address = valueOrErrorMessage(addressFromString(addressStr), ("fail to convert into address " + addressStr)) | |
28 | + | if ((0 > wavesBalance(address).available)) | |
29 | + | then throw() | |
30 | + | else addressStr | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | func keyNodeRegistry (address) = ("%s__" + address) | |
35 | + | ||
36 | + | ||
37 | + | func keyNodeRewardsTotals (address) = ("%s%s__totals__" + address) | |
38 | + | ||
39 | + | ||
40 | + | func keyDepositAmount () = "%s%s__cfg__depositAmount" | |
41 | + | ||
42 | + | ||
43 | + | func keyNeutrinoAddressStr () = "%s%s__cfg__neutrinoAddress" | |
44 | + | ||
45 | + | ||
46 | + | func keyMasterNodeAddressStr () = "%s%s__cfg__mainNeutrinoNodeAddress" | |
47 | + | ||
48 | + | ||
49 | + | func keyProtocolPartX6 () = "%s%s__cfg__protocolPartX6" | |
50 | + | ||
51 | + | ||
52 | + | func keyBenificaryPartX6 () = "%s%s__cfg__benificaryPartX6" | |
53 | + | ||
54 | + | ||
55 | + | func keyBeneficiaryAddress () = "%s%s__cfg__beneficiaryAddress" | |
56 | + | ||
57 | + | ||
58 | + | func keyLastUpdateHeight () = "%s__lastUpdatedHeight" | |
59 | + | ||
60 | + | ||
61 | + | func keyScriptUpdateHash () = "%s__scriptUpdateHash" | |
62 | + | ||
63 | + | ||
64 | + | 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) | |
65 | + | ||
66 | + | ||
67 | + | func formatDepositChangeStatus (origS,newStatus) = { | |
68 | + | let orig = split(origS, SEP) | |
69 | + | makeString(["%s%d%d%d%d%s%d%d", orig[1], orig[2], orig[3], orig[4], orig[5], newStatus, toString(lastBlock.height), toString(lastBlock.timestamp)], SEP) | |
70 | + | } | |
71 | + | ||
72 | + | ||
73 | + | func keyRewardHistory (nodeAddress,txId) = makeString(["%s%s%s", "history", toString(nodeAddress), toBase58String(txId)], SEP) | |
74 | + | ||
75 | + | ||
76 | + | 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) | |
77 | + | ||
78 | + | ||
79 | + | func RewardHistoryEntry (nodeAddress,txId,minedAmt,beneficiaryAmt,protocolAmt,protocolAmt1,protocolAmt2) = StringEntry(keyRewardHistory(nodeAddress, txId), dataRewardHistory(minedAmt, beneficiaryAmt, protocolAmt, protocolAmt1, protocolAmt2)) | |
80 | + | ||
81 | + | ||
82 | + | func dataRewardTotals (minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d", toString(minedAmt), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP) | |
83 | + | ||
84 | + | ||
85 | + | func RewardTotalsEntry (miner,minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = { | |
86 | + | let nodeRewardsTotalsKEY = keyNodeRewardsTotals(toString(miner)) | |
87 | + | let nodeRewardsArray = split(getStrOrElse(nodeRewardsTotalsKEY, dataRewardTotals(0, 0, 0, 0, 0)), SEP) | |
88 | + | let newMinedAmt = (parseIntValue(nodeRewardsArray[1]) + minedAmt) | |
89 | + | let newBeneficiaryAmt = (parseIntValue(nodeRewardsArray[2]) + beneficiaryAmt) | |
90 | + | let newProtocolAmt = (parseIntValue(nodeRewardsArray[3]) + protocolAmt) | |
91 | + | let newProtocolAmtPart1 = (parseIntValue(nodeRewardsArray[4]) + protocolAmtPart1) | |
92 | + | let newProtocolAmtPart2 = (parseIntValue(nodeRewardsArray[5]) + protocolAmtPart2) | |
93 | + | StringEntry(nodeRewardsTotalsKEY, dataRewardTotals(newMinedAmt, newBeneficiaryAmt, newProtocolAmt, newProtocolAmtPart1, newProtocolAmtPart2)) | |
94 | + | } | |
95 | + | ||
96 | + | ||
97 | + | @Callable(i) | |
98 | + | func constructor (depositAmount,neutrinoAddressStr,masterNodeAddressStr,protocolPartX6,benificaryPartX6) = if ((i.caller != this)) | |
99 | + | then throw("permissions denied") | |
100 | + | else if ((0 > depositAmount)) | |
101 | + | then throw("depositAmount less then zero") | |
102 | + | else if ((0 > protocolPartX6)) | |
103 | + | then throw("protocolPartX6 less then zero") | |
104 | + | else if ((0 > benificaryPartX6)) | |
105 | + | then throw("benificaryPartX6 less then zero") | |
106 | + | else if (((protocolPartX6 + benificaryPartX6) != MULT6)) | |
107 | + | then throw("parts sum must be 1") | |
108 | + | else [IntegerEntry(keyDepositAmount(), depositAmount), StringEntry(keyNeutrinoAddressStr(), validateAddressOrFail(neutrinoAddressStr)), StringEntry(keyMasterNodeAddressStr(), validateAddressOrFail(masterNodeAddressStr)), IntegerEntry(keyProtocolPartX6(), protocolPartX6), IntegerEntry(keyBenificaryPartX6(), benificaryPartX6)] | |
109 | + | ||
110 | + | ||
111 | + | ||
112 | + | @Callable(i) | |
113 | + | func sumbitApplication () = if ((size(i.payments) != 1)) | |
114 | + | then throw("exact 1 payment must be attached") | |
115 | + | else if ((i.caller != i.originCaller)) | |
116 | + | then throw("dapp to dapp calls are not allowed") | |
117 | + | else { | |
118 | + | let pmt = i.payments[0] | |
119 | + | let deposit = pmt.amount | |
120 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
121 | + | let expectedDepositAmount = getIntOrFail(keyDepositAmount()) | |
122 | + | let txId = toBase58String(i.transactionId) | |
123 | + | let nodeAddress = toString(i.caller) | |
124 | + | let nodeRegistryKEY = keyNodeRegistry(nodeAddress) | |
125 | + | if ((pmtAssetId != WAVESID)) | |
126 | + | then throw("only Waves can be used for deposit") | |
127 | + | else if ((deposit != expectedDepositAmount)) | |
128 | + | then throw((("exactly " + toString(expectedDepositAmount)) + " Wavelets are expected")) | |
129 | + | else if ((getStrOrElse(nodeRegistryKEY, "") != "")) | |
130 | + | then throw("your node already registered") | |
131 | + | else [StringEntry(nodeRegistryKEY, formatDepositAdd(txId, deposit, deposit, "PENDING"))] | |
132 | + | } | |
133 | + | ||
134 | + | ||
135 | + | ||
136 | + | @Callable(i) | |
137 | + | func distibuteMinerReward (benificaryAddressStr) = if ((size(i.payments) != 1)) | |
138 | + | then throw("exact 1 payment must be attached") | |
139 | + | else if ((i.caller != i.originCaller)) | |
140 | + | then throw("dapp to dapp calls are not allowed") | |
141 | + | else { | |
142 | + | let pmt = i.payments[0] | |
143 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
144 | + | let feeAmt = i.fee | |
145 | + | let feeAssetId = valueOrElse(i.feeAssetId, WAVESID) | |
146 | + | let callReward = (feeAmt * 2) | |
147 | + | let minedAmt = (pmt.amount - callReward) | |
148 | + | if ((pmtAssetId != WAVESID)) | |
149 | + | then throw("only Waves can be used in payment") | |
150 | + | else if ((feeAssetId != WAVESID)) | |
151 | + | then throw("only Waves can be used in fees") | |
152 | + | else if ((feeAmt != ((5 * MULT8) / 1000))) | |
153 | + | then throw("fee amount couldn't exceed 0.005") | |
154 | + | else { | |
155 | + | let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr()) | |
156 | + | let masterNodeAddress = getAddressOrFail(keyMasterNodeAddressStr()) | |
157 | + | let minerAddress = i.caller | |
158 | + | let minerScriptHash = scriptHash(minerAddress) | |
159 | + | let beneficaryFromParam = addressFromStringValue(benificaryAddressStr) | |
160 | + | let beneficcaryFromMinerState = addressFromStringValue(getStringOrFail(minerAddress, keyBeneficiaryAddress())) | |
161 | + | let $t075137705 = if ((minerScriptHash == unit)) | |
162 | + | then $Tuple2(beneficaryFromParam, beneficaryFromParam) | |
163 | + | else $Tuple2(beneficcaryFromMinerState, beneficaryFromParam) | |
164 | + | let benificaryAddress = $t075137705._1 | |
165 | + | let callRewardReceiver = $t075137705._2 | |
166 | + | let protocolPart = getIntOrFail(keyProtocolPartX6()) | |
167 | + | let benificaryPart = getIntOrFail(keyBenificaryPartX6()) | |
168 | + | let availableBalance = (wavesBalance(minerAddress).available - feeAmt) | |
169 | + | if ((availableBalance != 0)) | |
170 | + | then throw((("all " + toString(availableBalance)) + " Wavelets from the Node balance must be attached into the payment")) | |
171 | + | else { | |
172 | + | let benificaryAmt = fraction(minedAmt, benificaryPart, MULT6) | |
173 | + | let protocolAmt = (minedAmt - benificaryAmt) | |
174 | + | let protocolAmt1 = (protocolAmt / 2) | |
175 | + | let protocolAmt2 = (protocolAmt - protocolAmt1) | |
176 | + | [ScriptTransfer(benificaryAddress, benificaryAmt, unit), ScriptTransfer(neutrinoAddress, protocolAmt1, unit), ScriptTransfer(masterNodeAddress, protocolAmt2, unit), ScriptTransfer(callRewardReceiver, callReward, unit), RewardHistoryEntry(minerAddress, i.transactionId, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2), RewardTotalsEntry(minerAddress, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2)] | |
177 | + | } | |
178 | + | } | |
179 | + | } | |
180 | + | ||
181 | + | ||
182 | + | ||
183 | + | @Callable(i) | |
184 | + | func validateAndApproveLeasings (nListS) = { | |
185 | + | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
186 | + | let nList = split(nListS, SEP) | |
187 | + | let expectedCount = size(nIdxs) | |
188 | + | let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr()) | |
189 | + | if ((i.caller != neutrinoAddress)) | |
190 | + | then throw("validateAndApproveLeasings not authorized") | |
191 | + | else if (((size(nList) % 2) != 0)) | |
192 | + | then throw("Only even number of nodes is allowed") | |
193 | + | else if ((size(nList) != expectedCount)) | |
194 | + | then throw((("Only " + toString(expectedCount)) + " node's address cab be passed")) | |
195 | + | else { | |
196 | + | func forEachNodeChangeStatus (acc,i) = { | |
197 | + | let nodeAddr = nList[i] | |
198 | + | let nodeRegistryKEY = keyNodeRegistry(nodeAddr) | |
199 | + | let nodeDataOpt = getString(this, nodeRegistryKEY) | |
200 | + | if (!(isDefined(nodeDataOpt))) | |
201 | + | then throw(("invalid Node in list " + nodeAddr)) | |
202 | + | else { | |
203 | + | let nodeData = split(value(nodeDataOpt), SEP) | |
204 | + | let nodeStatus = nodeData[6] | |
205 | + | if (if ((size(nodeData) >= 9)) | |
206 | + | then (nodeStatus != "PENDING") | |
207 | + | else false) | |
208 | + | then throw(((("node " + nodeAddr) + " already has a final status ") + nodeStatus)) | |
209 | + | else (acc :+ StringEntry(nodeRegistryKEY, formatDepositChangeStatus(value(nodeDataOpt), "APPROVED"))) | |
210 | + | } | |
211 | + | } | |
212 | + | ||
213 | + | let approvedNodesData = { | |
214 | + | let $l = nIdxs | |
215 | + | let $s = size($l) | |
216 | + | let $acc0 = nil | |
217 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
218 | + | then $a | |
219 | + | else forEachNodeChangeStatus($a, $l[$i]) | |
220 | + | ||
221 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
222 | + | then $a | |
223 | + | else throw("List size exceeds 8") | |
224 | + | ||
225 | + | $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) | |
226 | + | } | |
227 | + | $Tuple2(approvedNodesData, nil) | |
228 | + | } | |
229 | + | } | |
230 | + | ||
231 | + | ||
232 | + | ||
233 | + | @Callable(i) | |
234 | + | func returnDeposit (nodeAddress) = if ((size(i.payments) != 0)) | |
235 | + | then throw("No payments allowed") | |
236 | + | else { | |
237 | + | let callerAddress = i.caller | |
238 | + | if (if ((callerAddress != this)) | |
239 | + | then (nodeAddress != toString(callerAddress)) | |
240 | + | else false) | |
241 | + | then throw("returnDeposit permissions denied") | |
242 | + | else { | |
243 | + | let nodeRegistryKEY = keyNodeRegistry(nodeAddress) | |
244 | + | let nodeDataOpt = getString(this, nodeRegistryKEY) | |
245 | + | if (!(isDefined(nodeDataOpt))) | |
246 | + | then throw(("Address is not applied as neutrino node: " + nodeAddress)) | |
247 | + | else { | |
248 | + | let nodeData = split(value(nodeDataOpt), SEP) | |
249 | + | let status = if ((size(nodeData) >= 9)) | |
250 | + | then nodeData[6] | |
251 | + | else "PENDING" | |
252 | + | if ((status != "PENDING")) | |
253 | + | then throw("Application status is not PENDING!") | |
254 | + | else { | |
255 | + | let depoAmount = parseIntValue(nodeData[4]) | |
256 | + | [DeleteEntry(nodeRegistryKEY), ScriptTransfer(addressFromStringValue(nodeAddress), depoAmount, unit)] | |
257 | + | } | |
258 | + | } | |
259 | + | } | |
260 | + | } | |
261 | + | ||
262 | + |
github/deemru/w8io/169f3d6 41.33 ms ◑