tx · bWGRDB5hE6bHYZwKuMxh6zzJYwoFdwmeDyokDjAZhxG 3Mv8f9tSNJHWEzeJ79YbSTSAAuoCjRw4uyP: -0.01300000 Waves 2022.08.17 12:41 [2188303] smart account 3Mv8f9tSNJHWEzeJ79YbSTSAAuoCjRw4uyP > SELF 0.00000000 Waves
{ "type": 13, "id": "bWGRDB5hE6bHYZwKuMxh6zzJYwoFdwmeDyokDjAZhxG", "fee": 1300000, "feeAssetId": null, "timestamp": 1660729325697, "version": 2, "chainId": 84, "sender": "3Mv8f9tSNJHWEzeJ79YbSTSAAuoCjRw4uyP", "senderPublicKey": "J7toGWdoqBgK7hh8WbEEBg7SqoqvAtCbKM9S7bXgn4YN", "proofs": [ "22F5grwnoEUzuLHSNZ7JYKC3BaKvrS3Eej3JAywxpfiJRGtTXTcHZisCbkGkqWwN3LfvNEGDWRbDJpTusPDGhtjZ" ], "script": "base64:AAIFAAAAAAAAABwIAhIHCgUBCAgBARIAEgMKAQgSAwoBCBIDCgEIAAAAHAAAAAADU0VQAgAAAAJfXwAAAAAFTVVMVDYAAAAAAAAPQkAAAAAABU1VTFQ4AAAAAAAF9eEAAAAAAApXQVZFU0lEU1RSAgAAAAVXQVZFUwAAAAAHV0FWRVNJRAkAAlkAAAABBQAAAApXQVZFU0lEU1RSAQAAAAxnZXRJbnRPckZhaWwAAAABAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQkAASwAAAACCQABLAAAAAICAAAAD01hbmRhdG9yeSB0aGlzLgUAAAADa2V5AgAAAA8gaXMgbm90IGRlZmluZWQBAAAADGdldFN0ck9yRWxzZQAAAAIAAAADa2V5AAAACmRlZmF1bHRWYWwJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5BQAAAApkZWZhdWx0VmFsAQAAAA9nZXRTdHJpbmdPckZhaWwAAAACAAAAB2FkZHJlc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VQBAAAAAZzdGF0dXMDCQAAZwAAAAIJAAGQAAAAAQUAAAAIbm9kZURhdGEAAAAAAAAAAAkJAAGRAAAAAgUAAAAIbm9kZURhdGEAAAAAAAAAAAYCAAAAB1BFTkRJTkcDCQEAAAACIT0AAAACBQAAAAZzdGF0dXMCAAAAB1BFTkRJTkcJAAACAAAAAQIAAAAiQXBwbGljYXRpb24gc3RhdHVzIGlzIG5vdCBQRU5ESU5HIQQAAAAKZGVwb0Ftb3VudAkBAAAADXBhcnNlSW50VmFsdWUAAAABCQABkQAAAAIFAAAACG5vZGVEYXRhAAAAAAAAAAAEBAAAABJiZW5lZmljaWFyeUFkZHJlc3MJAQAAABRyZXNvbHZlQmVuZWZpY2lhcmllcwAAAAIFAAAAC25vZGVBZGRyZXNzBQAAAAtub2RlQWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAA9ub2RlUmVnaXN0cnlLRVkJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAASYmVuZWZpY2lhcnlBZGRyZXNzBQAAAApkZXBvQW1vdW50BQAAAAR1bml0BQAAAANuaWwAAAAA+vyoGQ==", "height": 2188303, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 2JiQrsWdckAoLEaEoRBQo5BATwt16btJJAHzH3wvcTHM 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 keyApprovedNodeList () = "%s__approvedNodeList" | |
41 | + | ||
42 | + | ||
43 | + | func keyDepositAmount () = "%s%s__cfg__depositAmount" | |
44 | + | ||
45 | + | ||
46 | + | func keyNeutrinoAddressStr () = "%s%s__cfg__neutrinoAddress" | |
47 | + | ||
48 | + | ||
49 | + | func keyMasterNodeAddressStr () = "%s%s__cfg__mainNeutrinoNodeAddress" | |
50 | + | ||
51 | + | ||
52 | + | func keyProtocolPartX6 () = "%s%s__cfg__protocolPartX6" | |
53 | + | ||
54 | + | ||
55 | + | func keyBenificaryPartX6 () = "%s%s__cfg__benificaryPartX6" | |
56 | + | ||
57 | + | ||
58 | + | func keyMinDistributeAmount () = "%s%s__cfg__minDistributeAmount" | |
59 | + | ||
60 | + | ||
61 | + | func keyBeneficiaryAddress () = "%s%s__cfg__beneficiaryAddress" | |
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 | + | func resolveBeneficiaries (minerAddress,beneficiaryFromParam) = { | |
98 | + | let minerScriptHash = scriptHash(minerAddress) | |
99 | + | let beneficiaryFromMinerState = addressFromStringValue(getStringOrFail(minerAddress, keyBeneficiaryAddress())) | |
100 | + | if ((minerScriptHash == unit)) | |
101 | + | then beneficiaryFromParam | |
102 | + | else beneficiaryFromMinerState | |
103 | + | } | |
104 | + | ||
105 | + | ||
106 | + | @Callable(i) | |
107 | + | func constructor (depositAmount,neutrinoAddressStr,masterNodeAddressStr,protocolPartX6,benificaryPartX6) = if ((i.caller != this)) | |
108 | + | then throw("permissions denied") | |
109 | + | else if ((0 > depositAmount)) | |
110 | + | then throw("depositAmount less then zero") | |
111 | + | else if ((0 > protocolPartX6)) | |
112 | + | then throw("protocolPartX6 less then zero") | |
113 | + | else if ((0 > benificaryPartX6)) | |
114 | + | then throw("benificaryPartX6 less then zero") | |
115 | + | else if (((protocolPartX6 + benificaryPartX6) != MULT6)) | |
116 | + | then throw("parts sum must be 1") | |
117 | + | else [IntegerEntry(keyDepositAmount(), depositAmount), StringEntry(keyNeutrinoAddressStr(), validateAddressOrFail(neutrinoAddressStr)), StringEntry(keyMasterNodeAddressStr(), validateAddressOrFail(masterNodeAddressStr)), IntegerEntry(keyProtocolPartX6(), protocolPartX6), IntegerEntry(keyBenificaryPartX6(), benificaryPartX6)] | |
118 | + | ||
119 | + | ||
120 | + | ||
121 | + | @Callable(i) | |
122 | + | func sumbitApplication () = if ((size(i.payments) != 1)) | |
123 | + | then throw("exact 1 payment must be attached") | |
124 | + | else if ((i.caller != i.originCaller)) | |
125 | + | then throw("dapp to dapp calls are not allowed") | |
126 | + | else { | |
127 | + | let pmt = i.payments[0] | |
128 | + | let deposit = pmt.amount | |
129 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
130 | + | let expectedDepositAmount = getIntOrFail(keyDepositAmount()) | |
131 | + | let txId = toBase58String(i.transactionId) | |
132 | + | let nodeAddress = toString(i.caller) | |
133 | + | let nodeRegistryKEY = keyNodeRegistry(nodeAddress) | |
134 | + | if ((pmtAssetId != WAVESID)) | |
135 | + | then throw("only Waves can be used for deposit") | |
136 | + | else if ((deposit != expectedDepositAmount)) | |
137 | + | then throw((("exactly " + toString(expectedDepositAmount)) + " Wavelets are expected")) | |
138 | + | else if ((getStrOrElse(nodeRegistryKEY, "") != "")) | |
139 | + | then throw("your node already registered") | |
140 | + | else [StringEntry(nodeRegistryKEY, formatDepositAdd(txId, deposit, deposit, "PENDING"))] | |
141 | + | } | |
142 | + | ||
143 | + | ||
144 | + | ||
145 | + | @Callable(i) | |
146 | + | func distributeMinerReward (beneficiaryAddressStr) = { | |
147 | + | let minDistributeAmount = valueOrElse(getInteger(this, keyMinDistributeAmount()), (24 * MULT8)) | |
148 | + | if ((size(i.payments) != 1)) | |
149 | + | then throw("exact 1 payment must be attached") | |
150 | + | else if ((i.caller != i.originCaller)) | |
151 | + | then throw("dapp to dapp calls are not allowed") | |
152 | + | else { | |
153 | + | let pmt = i.payments[0] | |
154 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
155 | + | let feeAmt = i.fee | |
156 | + | let feeAssetId = valueOrElse(i.feeAssetId, WAVESID) | |
157 | + | let callReward = (feeAmt * 3) | |
158 | + | let minedAmt = (pmt.amount - callReward) | |
159 | + | if ((pmt.amount != minDistributeAmount)) | |
160 | + | then throw((("attached payment must be exact " + toString(minDistributeAmount)) + " Wavelets")) | |
161 | + | else if ((pmtAssetId != WAVESID)) | |
162 | + | then throw("only Waves can be used in payment") | |
163 | + | else if ((feeAssetId != WAVESID)) | |
164 | + | then throw("only Waves can be used in fees") | |
165 | + | else if ((feeAmt != ((5 * MULT8) / 1000))) | |
166 | + | then throw("fee amount couldn't exceed 0.005") | |
167 | + | else { | |
168 | + | let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr()) | |
169 | + | let masterNodeAddress = getAddressOrFail(keyMasterNodeAddressStr()) | |
170 | + | let minerAddress = i.caller | |
171 | + | let beneficiaryFromParam = addressFromStringValue(beneficiaryAddressStr) | |
172 | + | let beneficiaryAddress = resolveBeneficiaries(minerAddress, beneficiaryFromParam) | |
173 | + | let txRewardReceiver = beneficiaryFromParam | |
174 | + | let protocolPart = getIntOrFail(keyProtocolPartX6()) | |
175 | + | let beneficiaryPart = getIntOrFail(keyBenificaryPartX6()) | |
176 | + | let beneficiaryAmt = fraction(minedAmt, beneficiaryPart, MULT6) | |
177 | + | let protocolAmt = (minedAmt - beneficiaryAmt) | |
178 | + | let protocolAmt1 = (protocolAmt / 2) | |
179 | + | let protocolAmt2 = (protocolAmt - protocolAmt1) | |
180 | + | [ScriptTransfer(beneficiaryAddress, beneficiaryAmt, unit), ScriptTransfer(neutrinoAddress, protocolAmt1, unit), ScriptTransfer(masterNodeAddress, protocolAmt2, unit), ScriptTransfer(txRewardReceiver, callReward, unit), RewardHistoryEntry(minerAddress, i.transactionId, minedAmt, beneficiaryAmt, protocolAmt, protocolAmt1, protocolAmt2), RewardTotalsEntry(minerAddress, minedAmt, beneficiaryAmt, protocolAmt, protocolAmt1, protocolAmt2)] | |
181 | + | } | |
182 | + | } | |
183 | + | } | |
184 | + | ||
185 | + | ||
186 | + | ||
187 | + | @Callable(i) | |
188 | + | func validateAndApproveLeasings (nListS) = { | |
189 | + | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
190 | + | let nList = split(nListS, SEP) | |
191 | + | let expectedCount = size(nIdxs) | |
192 | + | let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr()) | |
193 | + | if ((i.caller != neutrinoAddress)) | |
194 | + | then throw("validateAndApproveLeasings not authorized") | |
195 | + | else if (((size(nList) % 2) != 0)) | |
196 | + | then throw("Only even number of nodes is allowed") | |
197 | + | else if ((size(nList) != expectedCount)) | |
198 | + | then throw((("Only " + toString(expectedCount)) + " node's address cab be passed")) | |
199 | + | else { | |
200 | + | func forEachNodeChangeStatus (acc,i) = { | |
201 | + | let nodeAddr = nList[i] | |
202 | + | let nodeRegistryKEY = keyNodeRegistry(nodeAddr) | |
203 | + | let nodeDataOpt = getString(this, nodeRegistryKEY) | |
204 | + | if (!(isDefined(nodeDataOpt))) | |
205 | + | then throw(("invalid Node in list " + nodeAddr)) | |
206 | + | else { | |
207 | + | let nodeData = split(value(nodeDataOpt), SEP) | |
208 | + | let nodeStatus = nodeData[6] | |
209 | + | if (if ((size(nodeData) >= 9)) | |
210 | + | then (nodeStatus != "PENDING") | |
211 | + | else false) | |
212 | + | then throw(((("node " + nodeAddr) + " already has a final status ") + nodeStatus)) | |
213 | + | else (acc :+ StringEntry(nodeRegistryKEY, formatDepositChangeStatus(value(nodeDataOpt), "APPROVED"))) | |
214 | + | } | |
215 | + | } | |
216 | + | ||
217 | + | let approvedNodesData = { | |
218 | + | let $l = nIdxs | |
219 | + | let $s = size($l) | |
220 | + | let $acc0 = nil | |
221 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
222 | + | then $a | |
223 | + | else forEachNodeChangeStatus($a, $l[$i]) | |
224 | + | ||
225 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
226 | + | then $a | |
227 | + | else throw("List size exceeds 8") | |
228 | + | ||
229 | + | $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) | |
230 | + | } | |
231 | + | $Tuple2(approvedNodesData, nil) | |
232 | + | } | |
233 | + | } | |
234 | + | ||
235 | + | ||
236 | + | ||
237 | + | @Callable(i) | |
238 | + | func returnDeposit (nodeAddressStr) = if ((size(i.payments) != 0)) | |
239 | + | then throw("No payments allowed") | |
240 | + | else { | |
241 | + | let callerAddress = i.caller | |
242 | + | let nodeAddress = addressFromStringValue(nodeAddressStr) | |
243 | + | let approvedNodeList = getStringOrFail(this, keyApprovedNodeList()) | |
244 | + | if (if ((callerAddress != this)) | |
245 | + | then (nodeAddress != callerAddress) | |
246 | + | else false) | |
247 | + | then throw("returnDeposit permissions denied") | |
248 | + | else { | |
249 | + | let nodeRegistryKEY = keyNodeRegistry(nodeAddressStr) | |
250 | + | let nodeDataOpt = getString(this, nodeRegistryKEY) | |
251 | + | if (!(isDefined(nodeDataOpt))) | |
252 | + | then throw(("Address is not applied as neutrino node: " + nodeAddressStr)) | |
253 | + | else if (contains(approvedNodeList, nodeAddressStr)) | |
254 | + | then throw("Impossible to return deposit from approved Node, please contact support team") | |
255 | + | else { | |
256 | + | let nodeData = split(value(nodeDataOpt), SEP) | |
257 | + | let status = if ((size(nodeData) >= 9)) | |
258 | + | then nodeData[6] | |
259 | + | else "PENDING" | |
260 | + | if ((status != "PENDING")) | |
261 | + | then throw("Application status is not PENDING!") | |
262 | + | else { | |
263 | + | let depoAmount = parseIntValue(nodeData[4]) | |
264 | + | let beneficiaryAddress = resolveBeneficiaries(nodeAddress, nodeAddress) | |
265 | + | [DeleteEntry(nodeRegistryKEY), ScriptTransfer(beneficiaryAddress, depoAmount, unit)] | |
266 | + | } | |
267 | + | } | |
268 | + | } | |
269 | + | } | |
270 | + | ||
271 | + |
github/deemru/w8io/169f3d6 23.46 ms ◑