tx · 6RABzX8ZBZnt2GEAkhKeJyjr5xuoutocqmmVhA3a5VSz 3MyBtJnMg6n7m1sDczbrijVyosLnRh4FFbc: -0.01000000 Waves 2022.05.25 13:44 [2067113] smart account 3MyBtJnMg6n7m1sDczbrijVyosLnRh4FFbc > SELF 0.00000000 Waves
{ "type": 13, "id": "6RABzX8ZBZnt2GEAkhKeJyjr5xuoutocqmmVhA3a5VSz", "fee": 1000000, "feeAssetId": null, "timestamp": 1653475469310, "version": 2, "chainId": 84, "sender": "3MyBtJnMg6n7m1sDczbrijVyosLnRh4FFbc", "senderPublicKey": "H3EzJ6fSm7jHKo92xYdNTXaaQYKj9z5q2DJFovRDLJpf", "proofs": [ "4dUear54wpyg4ntAxErvsRTu8igRivMRyWs9qdLytEtTzGYa7cBya4Vvu8GkCRjjR2Lnm85NNkB3g9TrkLqwRBWk" ], "script": "base64:AAIFAAAAAAAAABIIAhIHCgUBCAgBARIAEgMKAQgAAAAXAAAAAANTRVACAAAAAl9fAAAAAAVNVUxUNgAAAAAAAA9CQAAAAAAFTVVMVDgAAAAAAAX14QAAAAAACldBVkVTSURTVFICAAAABVdBVkVTAAAAAAdXQVZFU0lECQACWQAAAAEFAAAACldBVkVTSURTVFIBAAAADGdldEludE9yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgIAAAAPTWFuZGF0b3J5IHRoaXMuBQAAAANrZXkCAAAADyBpcyBub3QgZGVmaW5lZAEAAAAMZ2V0U3RyT3JFbHNlAAAAAgAAAANrZXkAAAAKZGVmYXVsdFZhbAkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkFAAAACmRlZmF1bHRWYWwBAAAAD2dldFN0cmluZ09yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQ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J5AAAABgUAAAAMbWluZXJBZGRyZXNzBQAAAAhtaW5lZEFtdAUAAAANYmVuaWZpY2FyeUFtdAUAAAALcHJvdG9jb2xBbXQFAAAADHByb3RvY29sQW10MQUAAAAMcHJvdG9jb2xBbXQyBQAAAANuaWwAAAAA4HtpJw==", "height": 2067113, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9nia82e4Yq21GC4gPheu1k4ewKj7aTMRDzjeTZj8SLxR Next: BkfyGK3pZkEeWk3LYDiZeTbQtcZqCtekwit6mzWuE4WK Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | - | func keyControlAddress () = "%s%s__config__controlAddress" | |
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")) | |
7 | 15 | ||
8 | 16 | ||
9 | - | func | |
17 | + | func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal) | |
10 | 18 | ||
11 | 19 | ||
12 | - | func | |
20 | + | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("Mandatory this." + key) + " is not defined")) | |
13 | 21 | ||
14 | 22 | ||
15 | - | func getAddressOrFail (key) = valueOrErrorMessage(addressFromString( | |
23 | + | func getAddressOrFail (key) = valueOrErrorMessage(addressFromString(getStringOrFail(key)), (("Fail to convert this." + key) + " value into Address")) | |
16 | 24 | ||
17 | 25 | ||
18 | - | func asString (val) = match val { | |
19 | - | case valStr: String => | |
20 | - | valStr | |
21 | - | case _ => | |
22 | - | throw("fail to cast into String") | |
23 | - | } | |
24 | - | ||
25 | - | ||
26 | - | func parseRestResult (restResultStr) = { | |
27 | - | let idx = valueOrErrorMessage(indexOf(restResultStr, SEP), "unsupported REST format") | |
28 | - | let metaPart = take(restResultStr, idx) | |
29 | - | let dataPart = drop(restResultStr, (idx + size(SEP))) | |
30 | - | $Tuple2(metaPart, dataPart) | |
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 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | - | func produceJson (strMap) = { | |
35 | - | let indexes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
36 | - | let length = size(strMap) | |
37 | - | if (((length % 2) != 0)) | |
38 | - | then throw("only even args size is accepeted") | |
39 | - | else if ((length > size(indexes))) | |
40 | - | then throw(("strMap length is greater then " + toString(size(indexes)))) | |
41 | - | else { | |
42 | - | func produceJson (jsonAccum,nextIdx) = if (if (((nextIdx % 2) == 0)) | |
43 | - | then (length >= (nextIdx + 1)) | |
44 | - | else false) | |
45 | - | then (((((jsonAccum + " | |
46 | - | \"") + strMap[nextIdx]) + "\": \"") + strMap[(nextIdx + 1)]) + "\",") | |
47 | - | else jsonAccum | |
34 | + | func keyNodeRegistry (address) = ("%s__" + address) | |
48 | 35 | ||
49 | - | let preJsonResult = { | |
50 | - | let $l = indexes | |
51 | - | let $s = size($l) | |
52 | - | let $acc0 = "" | |
53 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
54 | - | then $a | |
55 | - | else produceJson($a, $l[$i]) | |
56 | 36 | ||
57 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
58 | - | then $a | |
59 | - | else throw("List size exceeds 20") | |
37 | + | func keyNodeRewardsTotals (address) = ("%s%s__totals__" + address) | |
60 | 38 | ||
61 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
62 | - | } | |
63 | - | (("{" + dropRight(preJsonResult, 1)) + "}") | |
64 | - | } | |
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 formatDepositRecord (txIdStr,depositAmount,remainingDepositAmount) = makeString(["%s%d%d%d%d", txIdStr, toString(lastBlock.height), toString(lastBlock.timestamp), toString(depositAmount), toString(remainingDepositAmount)], SEP) | |
56 | + | ||
57 | + | ||
58 | + | func keyRewardHistory (nodeAddress,txId) = makeString(["%s%s%s", "history", toString(nodeAddress), toBase58String(txId)], SEP) | |
59 | + | ||
60 | + | ||
61 | + | 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) | |
62 | + | ||
63 | + | ||
64 | + | func RewardHistoryEntry (nodeAddress,txId,minedAmt,beneficiaryAmt,protocolAmt,protocolAmt1,protocolAmt2) = StringEntry(keyRewardHistory(nodeAddress, txId), dataRewardHistory(minedAmt, beneficiaryAmt, protocolAmt, protocolAmt1, protocolAmt2)) | |
65 | + | ||
66 | + | ||
67 | + | func dataRewardTotals (minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d", toString(minedAmt), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP) | |
68 | + | ||
69 | + | ||
70 | + | func RewardTotalsEntry (miner,minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = { | |
71 | + | let nodeRewardsTotalsKEY = keyNodeRewardsTotals(toString(miner)) | |
72 | + | let nodeRewardsArray = split(getStrOrElse(nodeRewardsTotalsKEY, dataRewardTotals(0, 0, 0, 0, 0)), SEP) | |
73 | + | let newMinedAmt = (parseIntValue(nodeRewardsArray[1]) + minedAmt) | |
74 | + | let newBeneficiaryAmt = (parseIntValue(nodeRewardsArray[2]) + beneficiaryAmt) | |
75 | + | let newProtocolAmt = (parseIntValue(nodeRewardsArray[3]) + protocolAmt) | |
76 | + | let newProtocolAmtPart1 = (parseIntValue(nodeRewardsArray[4]) + protocolAmtPart1) | |
77 | + | let newProtocolAmtPart2 = (parseIntValue(nodeRewardsArray[5]) + protocolAmtPart2) | |
78 | + | StringEntry(nodeRewardsTotalsKEY, dataRewardTotals(newMinedAmt, newBeneficiaryAmt, newProtocolAmt, newProtocolAmtPart1, newProtocolAmtPart2)) | |
65 | 79 | } | |
66 | 80 | ||
67 | 81 | ||
68 | - | let controlAcc = getAddressOrFail(keyControlAddress()) | |
69 | - | ||
70 | - | let restAcc = getAddressOrFail(keyRestAddress()) | |
71 | - | ||
72 | 82 | @Callable(i) | |
73 | - | func constructor (controlAddress58,restAddress58) = if ((i.caller != this)) | |
74 | - | then throw("not authorized") | |
75 | - | else [StringEntry(keyControlAddress(), controlAddress58), StringEntry(keyRestAddress(), restAddress58)] | |
83 | + | func constructor (depositAmount,neutrinoAddressStr,masterNodeAddressStr,protocolPartX6,benificaryPartX6) = if ((i.caller != this)) | |
84 | + | then throw("permissions denied") | |
85 | + | else if ((0 > depositAmount)) | |
86 | + | then throw("depositAmount less then zero") | |
87 | + | else if ((0 > protocolPartX6)) | |
88 | + | then throw("protocolPartX6 less then zero") | |
89 | + | else if ((0 > benificaryPartX6)) | |
90 | + | then throw("benificaryPartX6 less then zero") | |
91 | + | else if (((protocolPartX6 + benificaryPartX6) != MULT6)) | |
92 | + | then throw("parts sum must be 1") | |
93 | + | else [IntegerEntry(keyDepositAmount(), depositAmount), StringEntry(keyNeutrinoAddressStr(), validateAddressOrFail(neutrinoAddressStr)), StringEntry(keyMasterNodeAddressStr(), validateAddressOrFail(masterNodeAddressStr)), IntegerEntry(keyProtocolPartX6(), protocolPartX6), IntegerEntry(keyBenificaryPartX6(), benificaryPartX6)] | |
76 | 94 | ||
77 | 95 | ||
78 | 96 | ||
79 | 97 | @Callable(i) | |
80 | - | func stakeNsbtPageREADONLY (userAddressStrOpt,nsbtAmtDiff) = { | |
81 | - | let gnsbtInfo = asString(invoke(restAcc, "gnsbtInfoREADONLY", [userAddressStrOpt, nsbtAmtDiff], nil)) | |
82 | - | let $t021152203 = parseRestResult(gnsbtInfo) | |
83 | - | let gNsbtInfoMETA = $t021152203._1 | |
84 | - | let gNsbtInfoDATA = $t021152203._2 | |
85 | - | let swapInfo = asString(invoke(restAcc, "swapInfoREADONLY", [userAddressStrOpt], nil)) | |
86 | - | let swapInfoArray = split(swapInfo, SEP) | |
87 | - | let blocks2LmtReset = swapInfoArray[8] | |
88 | - | $Tuple2(nil, produceJson(["gnsbtInfoREADONLY", gnsbtInfo, "swapInfoREADONLY", swapInfo])) | |
89 | - | } | |
98 | + | func wouldLikeToBeNeutrinoNode () = if ((size(i.payments) != 1)) | |
99 | + | then throw("exact 1 payment must be attached") | |
100 | + | else if ((i.caller != i.originCaller)) | |
101 | + | then throw("dapp to dapp calls are not allowed") | |
102 | + | else { | |
103 | + | let pmt = i.payments[0] | |
104 | + | let deposit = pmt.amount | |
105 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
106 | + | let expectedDepositAmount = getIntOrFail(keyDepositAmount()) | |
107 | + | let txId = toBase58String(i.transactionId) | |
108 | + | let nodeAddress = toString(i.caller) | |
109 | + | let nodeRegistryKEY = keyNodeRegistry(nodeAddress) | |
110 | + | if ((pmtAssetId != WAVESID)) | |
111 | + | then throw("only Waves can be used for deposit") | |
112 | + | else if ((deposit != expectedDepositAmount)) | |
113 | + | then throw((("exactly " + toString(expectedDepositAmount)) + " Wavelets are expected")) | |
114 | + | else if ((getStrOrElse(nodeRegistryKEY, "") != "")) | |
115 | + | then throw("your node already registered") | |
116 | + | else [StringEntry(nodeRegistryKEY, formatDepositRecord(txId, deposit, deposit))] | |
117 | + | } | |
90 | 118 | ||
91 | 119 | ||
92 | 120 | ||
93 | 121 | @Callable(i) | |
94 | - | func buyNsbtPageREADONLY (userAddressStrOpt) = { | |
95 | - | let gnsbtInfo = asString(invoke(restAcc, "gnsbtInfoREADONLY", [userAddressStrOpt, 100000000], nil)) | |
96 | - | let neutrinoStats = asString(invoke(restAcc, "neutrinoStatsREADONLY", nil, nil)) | |
97 | - | $Tuple2(nil, produceJson(["gnsbtInfoREADONLY", gnsbtInfo, "neutrinoStatsREADONLY", neutrinoStats])) | |
98 | - | } | |
122 | + | func distibuteMinerReward (benificaryAddressStr) = 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 minedAmt = pmt.amount | |
129 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
130 | + | if ((pmtAssetId != WAVESID)) | |
131 | + | then throw("only Waves can be used") | |
132 | + | else { | |
133 | + | let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr()) | |
134 | + | let masterNodeAddress = getAddressOrFail(keyMasterNodeAddressStr()) | |
135 | + | let minerAddress = i.caller | |
136 | + | let benificaryAddress = addressFromStringValue(benificaryAddressStr) | |
137 | + | let protocolPart = getIntOrFail(keyProtocolPartX6()) | |
138 | + | let benificaryPart = getIntOrFail(keyBenificaryPartX6()) | |
139 | + | if ((wavesBalance(minerAddress).available != 0)) | |
140 | + | then throw("all Waves must be sent from Node") | |
141 | + | else { | |
142 | + | let benificaryAmt = fraction(minedAmt, benificaryPart, MULT6) | |
143 | + | let protocolAmt = (minedAmt - benificaryAmt) | |
144 | + | let protocolAmt1 = (protocolAmt / 2) | |
145 | + | let protocolAmt2 = (protocolAmt - protocolAmt1) | |
146 | + | [ScriptTransfer(benificaryAddress, benificaryAmt, unit), ScriptTransfer(neutrinoAddress, protocolAmt1, unit), ScriptTransfer(masterNodeAddress, protocolAmt2, unit), RewardHistoryEntry(minerAddress, i.transactionId, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2), RewardTotalsEntry(minerAddress, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2)] | |
147 | + | } | |
148 | + | } | |
149 | + | } | |
99 | 150 | ||
100 | 151 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | - | func keyControlAddress () = "%s%s__config__controlAddress" | |
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")) | |
7 | 15 | ||
8 | 16 | ||
9 | - | func | |
17 | + | func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal) | |
10 | 18 | ||
11 | 19 | ||
12 | - | func | |
20 | + | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("Mandatory this." + key) + " is not defined")) | |
13 | 21 | ||
14 | 22 | ||
15 | - | func getAddressOrFail (key) = valueOrErrorMessage(addressFromString( | |
23 | + | func getAddressOrFail (key) = valueOrErrorMessage(addressFromString(getStringOrFail(key)), (("Fail to convert this." + key) + " value into Address")) | |
16 | 24 | ||
17 | 25 | ||
18 | - | func asString (val) = match val { | |
19 | - | case valStr: String => | |
20 | - | valStr | |
21 | - | case _ => | |
22 | - | throw("fail to cast into String") | |
23 | - | } | |
24 | - | ||
25 | - | ||
26 | - | func parseRestResult (restResultStr) = { | |
27 | - | let idx = valueOrErrorMessage(indexOf(restResultStr, SEP), "unsupported REST format") | |
28 | - | let metaPart = take(restResultStr, idx) | |
29 | - | let dataPart = drop(restResultStr, (idx + size(SEP))) | |
30 | - | $Tuple2(metaPart, dataPart) | |
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 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | - | func produceJson (strMap) = { | |
35 | - | let indexes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
36 | - | let length = size(strMap) | |
37 | - | if (((length % 2) != 0)) | |
38 | - | then throw("only even args size is accepeted") | |
39 | - | else if ((length > size(indexes))) | |
40 | - | then throw(("strMap length is greater then " + toString(size(indexes)))) | |
41 | - | else { | |
42 | - | func produceJson (jsonAccum,nextIdx) = if (if (((nextIdx % 2) == 0)) | |
43 | - | then (length >= (nextIdx + 1)) | |
44 | - | else false) | |
45 | - | then (((((jsonAccum + " | |
46 | - | \"") + strMap[nextIdx]) + "\": \"") + strMap[(nextIdx + 1)]) + "\",") | |
47 | - | else jsonAccum | |
34 | + | func keyNodeRegistry (address) = ("%s__" + address) | |
48 | 35 | ||
49 | - | let preJsonResult = { | |
50 | - | let $l = indexes | |
51 | - | let $s = size($l) | |
52 | - | let $acc0 = "" | |
53 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
54 | - | then $a | |
55 | - | else produceJson($a, $l[$i]) | |
56 | 36 | ||
57 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
58 | - | then $a | |
59 | - | else throw("List size exceeds 20") | |
37 | + | func keyNodeRewardsTotals (address) = ("%s%s__totals__" + address) | |
60 | 38 | ||
61 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
62 | - | } | |
63 | - | (("{" + dropRight(preJsonResult, 1)) + "}") | |
64 | - | } | |
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 formatDepositRecord (txIdStr,depositAmount,remainingDepositAmount) = makeString(["%s%d%d%d%d", txIdStr, toString(lastBlock.height), toString(lastBlock.timestamp), toString(depositAmount), toString(remainingDepositAmount)], SEP) | |
56 | + | ||
57 | + | ||
58 | + | func keyRewardHistory (nodeAddress,txId) = makeString(["%s%s%s", "history", toString(nodeAddress), toBase58String(txId)], SEP) | |
59 | + | ||
60 | + | ||
61 | + | 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) | |
62 | + | ||
63 | + | ||
64 | + | func RewardHistoryEntry (nodeAddress,txId,minedAmt,beneficiaryAmt,protocolAmt,protocolAmt1,protocolAmt2) = StringEntry(keyRewardHistory(nodeAddress, txId), dataRewardHistory(minedAmt, beneficiaryAmt, protocolAmt, protocolAmt1, protocolAmt2)) | |
65 | + | ||
66 | + | ||
67 | + | func dataRewardTotals (minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = makeString(["%d%d%d%d%d", toString(minedAmt), toString(beneficiaryAmt), toString(protocolAmt), toString(protocolAmtPart1), toString(protocolAmtPart2)], SEP) | |
68 | + | ||
69 | + | ||
70 | + | func RewardTotalsEntry (miner,minedAmt,beneficiaryAmt,protocolAmt,protocolAmtPart1,protocolAmtPart2) = { | |
71 | + | let nodeRewardsTotalsKEY = keyNodeRewardsTotals(toString(miner)) | |
72 | + | let nodeRewardsArray = split(getStrOrElse(nodeRewardsTotalsKEY, dataRewardTotals(0, 0, 0, 0, 0)), SEP) | |
73 | + | let newMinedAmt = (parseIntValue(nodeRewardsArray[1]) + minedAmt) | |
74 | + | let newBeneficiaryAmt = (parseIntValue(nodeRewardsArray[2]) + beneficiaryAmt) | |
75 | + | let newProtocolAmt = (parseIntValue(nodeRewardsArray[3]) + protocolAmt) | |
76 | + | let newProtocolAmtPart1 = (parseIntValue(nodeRewardsArray[4]) + protocolAmtPart1) | |
77 | + | let newProtocolAmtPart2 = (parseIntValue(nodeRewardsArray[5]) + protocolAmtPart2) | |
78 | + | StringEntry(nodeRewardsTotalsKEY, dataRewardTotals(newMinedAmt, newBeneficiaryAmt, newProtocolAmt, newProtocolAmtPart1, newProtocolAmtPart2)) | |
65 | 79 | } | |
66 | 80 | ||
67 | 81 | ||
68 | - | let controlAcc = getAddressOrFail(keyControlAddress()) | |
69 | - | ||
70 | - | let restAcc = getAddressOrFail(keyRestAddress()) | |
71 | - | ||
72 | 82 | @Callable(i) | |
73 | - | func constructor (controlAddress58,restAddress58) = if ((i.caller != this)) | |
74 | - | then throw("not authorized") | |
75 | - | else [StringEntry(keyControlAddress(), controlAddress58), StringEntry(keyRestAddress(), restAddress58)] | |
83 | + | func constructor (depositAmount,neutrinoAddressStr,masterNodeAddressStr,protocolPartX6,benificaryPartX6) = if ((i.caller != this)) | |
84 | + | then throw("permissions denied") | |
85 | + | else if ((0 > depositAmount)) | |
86 | + | then throw("depositAmount less then zero") | |
87 | + | else if ((0 > protocolPartX6)) | |
88 | + | then throw("protocolPartX6 less then zero") | |
89 | + | else if ((0 > benificaryPartX6)) | |
90 | + | then throw("benificaryPartX6 less then zero") | |
91 | + | else if (((protocolPartX6 + benificaryPartX6) != MULT6)) | |
92 | + | then throw("parts sum must be 1") | |
93 | + | else [IntegerEntry(keyDepositAmount(), depositAmount), StringEntry(keyNeutrinoAddressStr(), validateAddressOrFail(neutrinoAddressStr)), StringEntry(keyMasterNodeAddressStr(), validateAddressOrFail(masterNodeAddressStr)), IntegerEntry(keyProtocolPartX6(), protocolPartX6), IntegerEntry(keyBenificaryPartX6(), benificaryPartX6)] | |
76 | 94 | ||
77 | 95 | ||
78 | 96 | ||
79 | 97 | @Callable(i) | |
80 | - | func stakeNsbtPageREADONLY (userAddressStrOpt,nsbtAmtDiff) = { | |
81 | - | let gnsbtInfo = asString(invoke(restAcc, "gnsbtInfoREADONLY", [userAddressStrOpt, nsbtAmtDiff], nil)) | |
82 | - | let $t021152203 = parseRestResult(gnsbtInfo) | |
83 | - | let gNsbtInfoMETA = $t021152203._1 | |
84 | - | let gNsbtInfoDATA = $t021152203._2 | |
85 | - | let swapInfo = asString(invoke(restAcc, "swapInfoREADONLY", [userAddressStrOpt], nil)) | |
86 | - | let swapInfoArray = split(swapInfo, SEP) | |
87 | - | let blocks2LmtReset = swapInfoArray[8] | |
88 | - | $Tuple2(nil, produceJson(["gnsbtInfoREADONLY", gnsbtInfo, "swapInfoREADONLY", swapInfo])) | |
89 | - | } | |
98 | + | func wouldLikeToBeNeutrinoNode () = if ((size(i.payments) != 1)) | |
99 | + | then throw("exact 1 payment must be attached") | |
100 | + | else if ((i.caller != i.originCaller)) | |
101 | + | then throw("dapp to dapp calls are not allowed") | |
102 | + | else { | |
103 | + | let pmt = i.payments[0] | |
104 | + | let deposit = pmt.amount | |
105 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
106 | + | let expectedDepositAmount = getIntOrFail(keyDepositAmount()) | |
107 | + | let txId = toBase58String(i.transactionId) | |
108 | + | let nodeAddress = toString(i.caller) | |
109 | + | let nodeRegistryKEY = keyNodeRegistry(nodeAddress) | |
110 | + | if ((pmtAssetId != WAVESID)) | |
111 | + | then throw("only Waves can be used for deposit") | |
112 | + | else if ((deposit != expectedDepositAmount)) | |
113 | + | then throw((("exactly " + toString(expectedDepositAmount)) + " Wavelets are expected")) | |
114 | + | else if ((getStrOrElse(nodeRegistryKEY, "") != "")) | |
115 | + | then throw("your node already registered") | |
116 | + | else [StringEntry(nodeRegistryKEY, formatDepositRecord(txId, deposit, deposit))] | |
117 | + | } | |
90 | 118 | ||
91 | 119 | ||
92 | 120 | ||
93 | 121 | @Callable(i) | |
94 | - | func buyNsbtPageREADONLY (userAddressStrOpt) = { | |
95 | - | let gnsbtInfo = asString(invoke(restAcc, "gnsbtInfoREADONLY", [userAddressStrOpt, 100000000], nil)) | |
96 | - | let neutrinoStats = asString(invoke(restAcc, "neutrinoStatsREADONLY", nil, nil)) | |
97 | - | $Tuple2(nil, produceJson(["gnsbtInfoREADONLY", gnsbtInfo, "neutrinoStatsREADONLY", neutrinoStats])) | |
98 | - | } | |
122 | + | func distibuteMinerReward (benificaryAddressStr) = 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 minedAmt = pmt.amount | |
129 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
130 | + | if ((pmtAssetId != WAVESID)) | |
131 | + | then throw("only Waves can be used") | |
132 | + | else { | |
133 | + | let neutrinoAddress = getAddressOrFail(keyNeutrinoAddressStr()) | |
134 | + | let masterNodeAddress = getAddressOrFail(keyMasterNodeAddressStr()) | |
135 | + | let minerAddress = i.caller | |
136 | + | let benificaryAddress = addressFromStringValue(benificaryAddressStr) | |
137 | + | let protocolPart = getIntOrFail(keyProtocolPartX6()) | |
138 | + | let benificaryPart = getIntOrFail(keyBenificaryPartX6()) | |
139 | + | if ((wavesBalance(minerAddress).available != 0)) | |
140 | + | then throw("all Waves must be sent from Node") | |
141 | + | else { | |
142 | + | let benificaryAmt = fraction(minedAmt, benificaryPart, MULT6) | |
143 | + | let protocolAmt = (minedAmt - benificaryAmt) | |
144 | + | let protocolAmt1 = (protocolAmt / 2) | |
145 | + | let protocolAmt2 = (protocolAmt - protocolAmt1) | |
146 | + | [ScriptTransfer(benificaryAddress, benificaryAmt, unit), ScriptTransfer(neutrinoAddress, protocolAmt1, unit), ScriptTransfer(masterNodeAddress, protocolAmt2, unit), RewardHistoryEntry(minerAddress, i.transactionId, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2), RewardTotalsEntry(minerAddress, minedAmt, benificaryAmt, protocolAmt, protocolAmt1, protocolAmt2)] | |
147 | + | } | |
148 | + | } | |
149 | + | } | |
99 | 150 | ||
100 | 151 |
github/deemru/w8io/026f985 36.23 ms ◑