tx · 3nAKnhSedMQtJqsJZrMeQWAwT8JhPG5Mw8XjQaGw5REq 3MpSqJhv64PR2m7Ywctv1Mp2Kjt3EUk3CSK: -0.02800000 Waves 2023.03.15 22:55 [2491587] smart account 3MpSqJhv64PR2m7Ywctv1Mp2Kjt3EUk3CSK > SELF 0.00000000 Waves
{ "type": 13, "id": "3nAKnhSedMQtJqsJZrMeQWAwT8JhPG5Mw8XjQaGw5REq", "fee": 2800000, "feeAssetId": null, "timestamp": 1678910040022, "version": 2, "chainId": 84, "sender": "3MpSqJhv64PR2m7Ywctv1Mp2Kjt3EUk3CSK", "senderPublicKey": "ErJhyueNNWWr8GEv71cFyhNnAtRC7sZt2TWFo89gdPo8", "proofs": [ "GRzFxDwEM5QKdSvu8BFAJFvitiA5c1NgLStntdtYPWtb1TCezgkFfPoa5YLLBmGdNpm3k4RC3CGxn1JMG529DpW" ], "script": "base64:BgI5CAISCAoGAQEBCAEIEgUKAwEYARIFCgMBAQgSBwoFAQEICAgSBQoDAQEIEgMKAQgSAwoBARIDCgEIbwAJU0VQQVJBVE9SAgJfXwAIS0VZX0lOSVQCBElOSVQADEtFWV9NVUxUSVNJRwIITVVMVElTSUcACktFWV9TVEFUVVMCBlNUQVRVUwAQS0VZX01JTl9TRUNfREVQTwIMTUlOX1NFQ19ERVBPAA5LRVlfUFVOSVNITUVOVAIKUFVOSVNITUVOVAAVS0VZX1JFU0VUX0JMT0NLX0RFTFRBAhFSRVNFVF9CTE9DS19ERUxUQQAMS0VZX1NFQ19ERVBPAghTRUNfREVQTwAYS0VZX1JFV0FSRF9UT0tFTl9BRERSRVNTAhRSRVdBUkRfVE9LRU5fQUREUkVTUwARS0VZX1JFV0FSRF9BTU9VTlQCDVJFV0FSRF9BTU9VTlQAE0tFWV9XSU5URVNTX0FERFJFU1MCD1dJTlRFU1NfQUREUkVTUwARS0VZX0NVUlJFTlRfRVBPQ0gCDUNVUlJFTlRfRVBPQ0gAFUtFWV9TSUdORVJTX1BFUl9FUE9DS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QEFCG11bHRpc2lnCQC5CQIJAMwIAgUKS0VZX1NUQVRVUwkAzAgCCQClCAEFBHRoaXMJAMwIAgkA2AQBCAUCdHgCaWQFA25pbAUJU0VQQVJBVE9SBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleYD7u8s=", "height": 2491587, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2CgR6yGrPGnXnGHpfkZ5cF1EdAeUuHNnZ8E8i94fFK1m Next: BTYja6QxptZ1NwMXPkixQaRBk3FHwjxbY5y6bjBn3ojP Diff:
Old | New | Differences | |
---|---|---|---|
20 | 20 | let KEY_REWARD_TOKEN_ADDRESS = "REWARD_TOKEN_ADDRESS" | |
21 | 21 | ||
22 | 22 | let KEY_REWARD_AMOUNT = "REWARD_AMOUNT" | |
23 | + | ||
24 | + | let KEY_WINTESS_ADDRESS = "WINTESS_ADDRESS" | |
23 | 25 | ||
24 | 26 | let KEY_CURRENT_EPOCH = "CURRENT_EPOCH" | |
25 | 27 | ||
49 | 51 | ||
50 | 52 | let KEY_SIZE = "SIZE" | |
51 | 53 | ||
54 | + | let KEY_SIGNER_GROUP_PUBLIC_KEY = "SIGNER_GROUP_PUBLIC_KEY" | |
55 | + | ||
52 | 56 | let FUNC_MINT_MANY = "mintMany" | |
57 | + | ||
58 | + | let FUNC_IS_CONFIRMED_EVENT = "isConfirmedEvent" | |
59 | + | ||
60 | + | let FUNC_GET_RAW_EVENT = "getRawEvent" | |
61 | + | ||
62 | + | let EVENT_TYPE_WAVES = "WAVES" | |
63 | + | ||
64 | + | let EVENT_TYPE_EVM = "EVM" | |
53 | 65 | ||
54 | 66 | let EVENT_STATUS_INIT = 1 | |
55 | 67 | ||
213 | 225 | ||
214 | 226 | ||
215 | 227 | func _saveRewardAmount (val_) = [IntegerEntry(KEY_REWARD_AMOUNT, val_)] | |
228 | + | ||
229 | + | ||
230 | + | func _loadWitnessAddress () = match getString(KEY_WINTESS_ADDRESS) { | |
231 | + | case a: String => | |
232 | + | addressFromStringValue(a) | |
233 | + | case _ => | |
234 | + | Address(base58'') | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | func _saveWitnessAddress (val_) = [StringEntry(KEY_WINTESS_ADDRESS, toString(val_))] | |
216 | 239 | ||
217 | 240 | ||
218 | 241 | func _loadCurrentEpoch (execChainId_) = match getInteger(makeString([KEY_CURRENT_EPOCH, toString(execChainId_)], SEPARATOR)) { | |
421 | 444 | else true | |
422 | 445 | ||
423 | 446 | ||
447 | + | func _isConfirmedEvent (eventId_,execChainId_,err_) = { | |
448 | + | let result = invoke(_loadWitnessAddress(), FUNC_IS_CONFIRMED_EVENT, [eventId_, execChainId_], nil) | |
449 | + | if ((result == result)) | |
450 | + | then match result { | |
451 | + | case a: Boolean => | |
452 | + | if (!(a)) | |
453 | + | then throw(err_) | |
454 | + | else true | |
455 | + | case _ => | |
456 | + | throw(err_) | |
457 | + | } | |
458 | + | else throw("Strict value is not equal to itself.") | |
459 | + | } | |
460 | + | ||
461 | + | ||
424 | 462 | func _isActiveSigner (publicKey_,publicKeys_,err_) = if (!(containsElement(publicKeys_, publicKey_))) | |
425 | 463 | then throw(err_) | |
426 | 464 | else true | |
563 | 601 | ||
564 | 602 | ||
565 | 603 | @Callable(i) | |
566 | - | func init (minSecDepo_,punishment_,resetBlockDelta_,rewardTokenAddress_,rewardAmount_) = { | |
567 | - | let err = if (if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
604 | + | func init (minSecDepo_,punishment_,resetBlockDelta_,rewardTokenAddress_,rewardAmount_,witnessAddress_) = { | |
605 | + | let err = if (if (if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
568 | 606 | then _whenNotInitialized() | |
569 | 607 | else false) | |
570 | 608 | then _whenMultisigSet() | |
578 | 616 | then _validateAddress(rewardTokenAddress_, "init: invalid rewardTokenAddress") | |
579 | 617 | else false) | |
580 | 618 | then _validateInt(rewardAmount_, 0, MAX_INT, "init: invalid rewardAmount") | |
619 | + | else false) | |
620 | + | then _validateAddress(witnessAddress_, "init: invalid witnessAddress") | |
581 | 621 | else false | |
582 | 622 | if ((err == err)) | |
583 | - | then $Tuple2((((((_saveInit(true) ++ _saveMinSecDepo(minSecDepo_)) ++ _savePunishment(punishment_)) ++ _saveResetBlockDelta(resetBlockDelta_)) ++ _saveRewardTokenAddress(addressFromStringValue(rewardTokenAddress_))) ++ _saveRewardAmount(rewardAmount_)), unit) | |
623 | + | then $Tuple2(((((((_saveInit(true) ++ _saveMinSecDepo(minSecDepo_)) ++ _savePunishment(punishment_)) ++ _saveResetBlockDelta(resetBlockDelta_)) ++ _saveRewardTokenAddress(addressFromStringValue(rewardTokenAddress_))) ++ _saveRewardAmount(rewardAmount_)) ++ _saveWitnessAddress(addressFromStringValue(witnessAddress_))), unit) | |
584 | 624 | else throw("Strict value is not equal to itself.") | |
585 | 625 | } | |
586 | 626 | ||
610 | 650 | let callerPublicKey = toBase58String(i.callerPublicKey) | |
611 | 651 | let epoch = _loadCurrentEpoch(execChainId_) | |
612 | 652 | let t = _loadT(execChainId_, epoch) | |
613 | - | let err = if (if (if (if (if (if (if (_whenInitialized()) | |
653 | + | let err = if (if (if (if (if (if (if (if (_whenInitialized()) | |
614 | 654 | then _validateInt(eventId_, 0, MAX_INT, "submitR: invalid eventId") | |
615 | 655 | else false) | |
616 | 656 | then _validateInt(execChainId_, 0, MAX_INT, "submitR: invalid execChainId") | |
617 | 657 | else false) | |
618 | 658 | then _validateString(r_, "submitR: invalid r") | |
659 | + | else false) | |
660 | + | then _isConfirmedEvent(eventId_, execChainId_, "submitR: event not confirmed") | |
619 | 661 | else false) | |
620 | 662 | then _isActiveSigner(callerPublicKey, _loadSigners(execChainId_, epoch), "submitR: not active") | |
621 | 663 | else false) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEPARATOR = "__" | |
5 | 5 | ||
6 | 6 | let KEY_INIT = "INIT" | |
7 | 7 | ||
8 | 8 | let KEY_MULTISIG = "MULTISIG" | |
9 | 9 | ||
10 | 10 | let KEY_STATUS = "STATUS" | |
11 | 11 | ||
12 | 12 | let KEY_MIN_SEC_DEPO = "MIN_SEC_DEPO" | |
13 | 13 | ||
14 | 14 | let KEY_PUNISHMENT = "PUNISHMENT" | |
15 | 15 | ||
16 | 16 | let KEY_RESET_BLOCK_DELTA = "RESET_BLOCK_DELTA" | |
17 | 17 | ||
18 | 18 | let KEY_SEC_DEPO = "SEC_DEPO" | |
19 | 19 | ||
20 | 20 | let KEY_REWARD_TOKEN_ADDRESS = "REWARD_TOKEN_ADDRESS" | |
21 | 21 | ||
22 | 22 | let KEY_REWARD_AMOUNT = "REWARD_AMOUNT" | |
23 | + | ||
24 | + | let KEY_WINTESS_ADDRESS = "WINTESS_ADDRESS" | |
23 | 25 | ||
24 | 26 | let KEY_CURRENT_EPOCH = "CURRENT_EPOCH" | |
25 | 27 | ||
26 | 28 | let KEY_SIGNERS_PER_EPOCH = "SIGNERS_PER_EPOCH" | |
27 | 29 | ||
28 | 30 | let KEY_EVENT_STATUS = "EVENT_STATUS" | |
29 | 31 | ||
30 | 32 | let KEY_LOCKS = "LOCKS" | |
31 | 33 | ||
32 | 34 | let KEY_T = "T" | |
33 | 35 | ||
34 | 36 | let KEY_R = "R" | |
35 | 37 | ||
36 | 38 | let KEY_S = "S" | |
37 | 39 | ||
38 | 40 | let KEY_R_SIGNERS = "R_SIGNERS" | |
39 | 41 | ||
40 | 42 | let KEY_EVENT_START_BLOCK = "EVENT_START_BLOCK" | |
41 | 43 | ||
42 | 44 | let KEY_R_SIGMA = "R_SIGMA" | |
43 | 45 | ||
44 | 46 | let KEY_S_SIGMA = "S_SIGMA" | |
45 | 47 | ||
46 | 48 | let KEY_S_SIGNERS = "S_SIGNERS" | |
47 | 49 | ||
48 | 50 | let KEY_SIGNED_EVENT_EXECUTOR = "SIGNED_EVENT_EXECUTOR" | |
49 | 51 | ||
50 | 52 | let KEY_SIZE = "SIZE" | |
51 | 53 | ||
54 | + | let KEY_SIGNER_GROUP_PUBLIC_KEY = "SIGNER_GROUP_PUBLIC_KEY" | |
55 | + | ||
52 | 56 | let FUNC_MINT_MANY = "mintMany" | |
57 | + | ||
58 | + | let FUNC_IS_CONFIRMED_EVENT = "isConfirmedEvent" | |
59 | + | ||
60 | + | let FUNC_GET_RAW_EVENT = "getRawEvent" | |
61 | + | ||
62 | + | let EVENT_TYPE_WAVES = "WAVES" | |
63 | + | ||
64 | + | let EVENT_TYPE_EVM = "EVM" | |
53 | 65 | ||
54 | 66 | let EVENT_STATUS_INIT = 1 | |
55 | 67 | ||
56 | 68 | let EVENT_STATUS_SIGN = 2 | |
57 | 69 | ||
58 | 70 | let EVENT_STATUS_DONE = 3 | |
59 | 71 | ||
60 | 72 | let MAX_INT = 9223372036854775807 | |
61 | 73 | ||
62 | 74 | func _validateAddress (address_,err_) = match addressFromString(address_) { | |
63 | 75 | case a: Address => | |
64 | 76 | true | |
65 | 77 | case _ => | |
66 | 78 | throw(err_) | |
67 | 79 | } | |
68 | 80 | ||
69 | 81 | ||
70 | 82 | func _validateAsset (assetId_,err_) = match assetInfo(fromBase58String(assetId_)) { | |
71 | 83 | case a: Asset => | |
72 | 84 | true | |
73 | 85 | case _ => | |
74 | 86 | throw(err_) | |
75 | 87 | } | |
76 | 88 | ||
77 | 89 | ||
78 | 90 | func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_)) | |
79 | 91 | then true | |
80 | 92 | else (val_ > upperBoundary_)) | |
81 | 93 | then throw(err_) | |
82 | 94 | else true | |
83 | 95 | ||
84 | 96 | ||
85 | 97 | func _validateString (val_,err_) = if (if ((0 >= size(val_))) | |
86 | 98 | then true | |
87 | 99 | else contains(val_, SEPARATOR)) | |
88 | 100 | then throw(err_) | |
89 | 101 | else true | |
90 | 102 | ||
91 | 103 | ||
92 | 104 | func _validatePaymentsSize (payments_,target_,err_) = if ((size(payments_) != target_)) | |
93 | 105 | then throw(err_) | |
94 | 106 | else true | |
95 | 107 | ||
96 | 108 | ||
97 | 109 | func _validatePaymentAsset (payment_,asset_,err_) = if ((payment_.assetId != asset_)) | |
98 | 110 | then throw(err_) | |
99 | 111 | else true | |
100 | 112 | ||
101 | 113 | ||
102 | 114 | func _validatePublicKey (publicKey_,err_) = if ((size(fromBase58String(publicKey_)) != 32)) | |
103 | 115 | then throw(err_) | |
104 | 116 | else true | |
105 | 117 | ||
106 | 118 | ||
107 | 119 | func _validatePublicKeys (publicKeys_,err_) = { | |
108 | 120 | func foldFunc (acc,elem) = $Tuple2(if (acc._1) | |
109 | 121 | then _validatePublicKey(elem, acc._2) | |
110 | 122 | else false, acc._2) | |
111 | 123 | ||
112 | 124 | let result = { | |
113 | 125 | let $l = publicKeys_ | |
114 | 126 | let $s = size($l) | |
115 | 127 | let $acc0 = $Tuple2(true, err_) | |
116 | 128 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
117 | 129 | then $a | |
118 | 130 | else foldFunc($a, $l[$i]) | |
119 | 131 | ||
120 | 132 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
121 | 133 | then $a | |
122 | 134 | else throw("List size exceeds 10") | |
123 | 135 | ||
124 | 136 | $f0_2($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) | |
125 | 137 | } | |
126 | 138 | result._1 | |
127 | 139 | } | |
128 | 140 | ||
129 | 141 | ||
130 | 142 | func _loadInit () = match getBoolean(KEY_INIT) { | |
131 | 143 | case a: Boolean => | |
132 | 144 | a | |
133 | 145 | case _ => | |
134 | 146 | false | |
135 | 147 | } | |
136 | 148 | ||
137 | 149 | ||
138 | 150 | func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)] | |
139 | 151 | ||
140 | 152 | ||
141 | 153 | func _loadMultisig () = match getString(KEY_MULTISIG) { | |
142 | 154 | case a: String => | |
143 | 155 | addressFromStringValue(a) | |
144 | 156 | case _ => | |
145 | 157 | Address(base58'') | |
146 | 158 | } | |
147 | 159 | ||
148 | 160 | ||
149 | 161 | func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))] | |
150 | 162 | ||
151 | 163 | ||
152 | 164 | func _loadMinSecDepo () = match getInteger(KEY_MIN_SEC_DEPO) { | |
153 | 165 | case a: Int => | |
154 | 166 | a | |
155 | 167 | case _ => | |
156 | 168 | 0 | |
157 | 169 | } | |
158 | 170 | ||
159 | 171 | ||
160 | 172 | func _saveMinSecDepo (val_) = [IntegerEntry(KEY_MIN_SEC_DEPO, val_)] | |
161 | 173 | ||
162 | 174 | ||
163 | 175 | func _loadSecDepo (account_) = match getInteger(makeString([KEY_SEC_DEPO, toString(account_)], SEPARATOR)) { | |
164 | 176 | case a: Int => | |
165 | 177 | a | |
166 | 178 | case _ => | |
167 | 179 | 0 | |
168 | 180 | } | |
169 | 181 | ||
170 | 182 | ||
171 | 183 | func _saveSecDepo (account_,val_) = [IntegerEntry(makeString([KEY_SEC_DEPO, toString(account_)], SEPARATOR), val_)] | |
172 | 184 | ||
173 | 185 | ||
174 | 186 | func _loadPunishment () = match getInteger(KEY_PUNISHMENT) { | |
175 | 187 | case a: Int => | |
176 | 188 | a | |
177 | 189 | case _ => | |
178 | 190 | 0 | |
179 | 191 | } | |
180 | 192 | ||
181 | 193 | ||
182 | 194 | func _savePunishment (val_) = [IntegerEntry(KEY_PUNISHMENT, val_)] | |
183 | 195 | ||
184 | 196 | ||
185 | 197 | func _loadResetBlockDelta () = match getInteger(KEY_RESET_BLOCK_DELTA) { | |
186 | 198 | case a: Int => | |
187 | 199 | a | |
188 | 200 | case _ => | |
189 | 201 | 0 | |
190 | 202 | } | |
191 | 203 | ||
192 | 204 | ||
193 | 205 | func _saveResetBlockDelta (val_) = [IntegerEntry(KEY_RESET_BLOCK_DELTA, val_)] | |
194 | 206 | ||
195 | 207 | ||
196 | 208 | func _loadRewardTokenAddress () = match getString(KEY_REWARD_TOKEN_ADDRESS) { | |
197 | 209 | case a: String => | |
198 | 210 | addressFromStringValue(a) | |
199 | 211 | case _ => | |
200 | 212 | Address(base58'') | |
201 | 213 | } | |
202 | 214 | ||
203 | 215 | ||
204 | 216 | func _saveRewardTokenAddress (val_) = [StringEntry(KEY_REWARD_TOKEN_ADDRESS, toString(val_))] | |
205 | 217 | ||
206 | 218 | ||
207 | 219 | func _loadRewardAmount () = match getInteger(KEY_REWARD_AMOUNT) { | |
208 | 220 | case a: Int => | |
209 | 221 | a | |
210 | 222 | case _ => | |
211 | 223 | 0 | |
212 | 224 | } | |
213 | 225 | ||
214 | 226 | ||
215 | 227 | func _saveRewardAmount (val_) = [IntegerEntry(KEY_REWARD_AMOUNT, val_)] | |
228 | + | ||
229 | + | ||
230 | + | func _loadWitnessAddress () = match getString(KEY_WINTESS_ADDRESS) { | |
231 | + | case a: String => | |
232 | + | addressFromStringValue(a) | |
233 | + | case _ => | |
234 | + | Address(base58'') | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | func _saveWitnessAddress (val_) = [StringEntry(KEY_WINTESS_ADDRESS, toString(val_))] | |
216 | 239 | ||
217 | 240 | ||
218 | 241 | func _loadCurrentEpoch (execChainId_) = match getInteger(makeString([KEY_CURRENT_EPOCH, toString(execChainId_)], SEPARATOR)) { | |
219 | 242 | case a: Int => | |
220 | 243 | a | |
221 | 244 | case _ => | |
222 | 245 | 0 | |
223 | 246 | } | |
224 | 247 | ||
225 | 248 | ||
226 | 249 | func _saveCurrentEpoch (execChainId_,val_) = [IntegerEntry(makeString([KEY_CURRENT_EPOCH, toString(execChainId_)], SEPARATOR), val_)] | |
227 | 250 | ||
228 | 251 | ||
229 | 252 | func _loadSigners (execChainId_,epoch_) = match getString(makeString([KEY_SIGNERS_PER_EPOCH, toString(execChainId_), toString(epoch_)], SEPARATOR)) { | |
230 | 253 | case a: String => | |
231 | 254 | if ((size(a) > 0)) | |
232 | 255 | then split(a, SEPARATOR) | |
233 | 256 | else nil | |
234 | 257 | case _ => | |
235 | 258 | nil | |
236 | 259 | } | |
237 | 260 | ||
238 | 261 | ||
239 | 262 | func _saveSigners (execChainId_,epoch_,signers_) = [StringEntry(makeString([KEY_SIGNERS_PER_EPOCH, toString(execChainId_), toString(epoch_)], SEPARATOR), makeString(signers_, SEPARATOR))] | |
240 | 263 | ||
241 | 264 | ||
242 | 265 | func _loadEventStatus (execChainId_,eventId_) = match getInteger(makeString([KEY_EVENT_STATUS, toString(execChainId_), toString(eventId_)], SEPARATOR)) { | |
243 | 266 | case a: Int => | |
244 | 267 | a | |
245 | 268 | case _ => | |
246 | 269 | EVENT_STATUS_INIT | |
247 | 270 | } | |
248 | 271 | ||
249 | 272 | ||
250 | 273 | func _saveEventStatus (execChainId_,eventId_,status_) = [IntegerEntry(makeString([KEY_EVENT_STATUS, toString(execChainId_), toString(eventId_)], SEPARATOR), status_)] | |
251 | 274 | ||
252 | 275 | ||
253 | 276 | func _loadLock (publicKey_) = match getInteger(makeString([KEY_LOCKS, publicKey_], SEPARATOR)) { | |
254 | 277 | case a: Int => | |
255 | 278 | a | |
256 | 279 | case _ => | |
257 | 280 | 0 | |
258 | 281 | } | |
259 | 282 | ||
260 | 283 | ||
261 | 284 | func _saveLock (publicKey_,val_) = [IntegerEntry(makeString([KEY_LOCKS, publicKey_], SEPARATOR), val_)] | |
262 | 285 | ||
263 | 286 | ||
264 | 287 | func _loadT (execChainId_,epoch_) = match getInteger(makeString([KEY_T, toString(execChainId_), toString(epoch_)], SEPARATOR)) { | |
265 | 288 | case a: Int => | |
266 | 289 | a | |
267 | 290 | case _ => | |
268 | 291 | 0 | |
269 | 292 | } | |
270 | 293 | ||
271 | 294 | ||
272 | 295 | func _saveT (execChainId_,epoch_,val_) = [IntegerEntry(makeString([KEY_T, toString(execChainId_), toString(epoch_)], SEPARATOR), val_)] | |
273 | 296 | ||
274 | 297 | ||
275 | 298 | func _loadRsByEvent (execChainId_,eventId_) = match getString(makeString([KEY_R, toString(execChainId_), toString(eventId_)], SEPARATOR)) { | |
276 | 299 | case a: String => | |
277 | 300 | if ((size(a) > 0)) | |
278 | 301 | then split(a, SEPARATOR) | |
279 | 302 | else nil | |
280 | 303 | case _ => | |
281 | 304 | nil | |
282 | 305 | } | |
283 | 306 | ||
284 | 307 | ||
285 | 308 | func _saveRsByEvent (execChainId_,eventId_,rs_) = [StringEntry(makeString([KEY_R, toString(execChainId_), toString(eventId_)], SEPARATOR), makeString(rs_, SEPARATOR))] | |
286 | 309 | ||
287 | 310 | ||
288 | 311 | func _loadSsByEvent (execChainId_,eventId_) = match getString(makeString([KEY_S, toString(execChainId_), toString(eventId_)], SEPARATOR)) { | |
289 | 312 | case a: String => | |
290 | 313 | if ((size(a) > 0)) | |
291 | 314 | then split(a, SEPARATOR) | |
292 | 315 | else nil | |
293 | 316 | case _ => | |
294 | 317 | nil | |
295 | 318 | } | |
296 | 319 | ||
297 | 320 | ||
298 | 321 | func _saveSsByEvent (execChainId_,eventId_,ss_) = [StringEntry(makeString([KEY_S, toString(execChainId_), toString(eventId_)], SEPARATOR), makeString(ss_, SEPARATOR))] | |
299 | 322 | ||
300 | 323 | ||
301 | 324 | func _loadRSigmaByEvent (execChainId_,eventId_) = match getString(makeString([KEY_R_SIGMA, toString(execChainId_), toString(eventId_)], SEPARATOR)) { | |
302 | 325 | case a: String => | |
303 | 326 | a | |
304 | 327 | case _ => | |
305 | 328 | "" | |
306 | 329 | } | |
307 | 330 | ||
308 | 331 | ||
309 | 332 | func _saveRSigmaByEvent (execChainId_,eventId_,rSigma_) = [StringEntry(makeString([KEY_R_SIGMA, toString(execChainId_), toString(eventId_)], SEPARATOR), rSigma_)] | |
310 | 333 | ||
311 | 334 | ||
312 | 335 | func _loadSSigmaByEvent (execChainId_,eventId_) = match getString(makeString([KEY_S_SIGMA, toString(execChainId_), toString(eventId_)], SEPARATOR)) { | |
313 | 336 | case a: String => | |
314 | 337 | a | |
315 | 338 | case _ => | |
316 | 339 | "" | |
317 | 340 | } | |
318 | 341 | ||
319 | 342 | ||
320 | 343 | func _saveSSigmaByEvent (execChainId_,eventId_,sSigma_) = [StringEntry(makeString([KEY_S_SIGMA, toString(execChainId_), toString(eventId_)], SEPARATOR), sSigma_)] | |
321 | 344 | ||
322 | 345 | ||
323 | 346 | func _loadRByEventAndSigner (execChainId_,eventId_,signer_) = match getString(makeString([KEY_R, toString(execChainId_), toString(eventId_), signer_], SEPARATOR)) { | |
324 | 347 | case a: String => | |
325 | 348 | a | |
326 | 349 | case _ => | |
327 | 350 | "" | |
328 | 351 | } | |
329 | 352 | ||
330 | 353 | ||
331 | 354 | func _saveRByEventAndSigner (execChainId_,eventId_,signer_,r_) = [StringEntry(makeString([KEY_R, toString(execChainId_), toString(eventId_), signer_], SEPARATOR), r_)] | |
332 | 355 | ||
333 | 356 | ||
334 | 357 | func _loadSByEventAndSigner (execChainId_,eventId_,signer_) = match getString(makeString([KEY_S, toString(execChainId_), toString(eventId_), signer_], SEPARATOR)) { | |
335 | 358 | case a: String => | |
336 | 359 | a | |
337 | 360 | case _ => | |
338 | 361 | "" | |
339 | 362 | } | |
340 | 363 | ||
341 | 364 | ||
342 | 365 | func _saveSByEventAndSigner (execChainId_,eventId_,signer_,s_) = [StringEntry(makeString([KEY_S, toString(execChainId_), toString(eventId_), signer_], SEPARATOR), s_)] | |
343 | 366 | ||
344 | 367 | ||
345 | 368 | func _loadSignersWithRByEvent (execChainId_,eventId_) = match getString(makeString([KEY_R_SIGNERS, toString(execChainId_), toString(eventId_)], SEPARATOR)) { | |
346 | 369 | case a: String => | |
347 | 370 | if ((size(a) > 0)) | |
348 | 371 | then split(a, SEPARATOR) | |
349 | 372 | else nil | |
350 | 373 | case _ => | |
351 | 374 | nil | |
352 | 375 | } | |
353 | 376 | ||
354 | 377 | ||
355 | 378 | func _saveSignersWithRByEvent (execChainId_,eventId_,rs_) = [StringEntry(makeString([KEY_R_SIGNERS, toString(execChainId_), toString(eventId_)], SEPARATOR), makeString(rs_, SEPARATOR))] | |
356 | 379 | ||
357 | 380 | ||
358 | 381 | func _loadSignersWithSByEvent (execChainId_,eventId_) = match getString(makeString([KEY_S_SIGNERS, toString(execChainId_), toString(eventId_)], SEPARATOR)) { | |
359 | 382 | case a: String => | |
360 | 383 | if ((size(a) > 0)) | |
361 | 384 | then split(a, SEPARATOR) | |
362 | 385 | else nil | |
363 | 386 | case _ => | |
364 | 387 | nil | |
365 | 388 | } | |
366 | 389 | ||
367 | 390 | ||
368 | 391 | func _saveSignersWithSByEvent (execChainId_,eventId_,ss_) = [StringEntry(makeString([KEY_S_SIGNERS, toString(execChainId_), toString(eventId_)], SEPARATOR), makeString(ss_, SEPARATOR))] | |
369 | 392 | ||
370 | 393 | ||
371 | 394 | func _loadEventStartBlock (execChainId_,eventId_) = match getInteger(makeString([KEY_EVENT_START_BLOCK, toString(execChainId_), toString(eventId_)], SEPARATOR)) { | |
372 | 395 | case a: Int => | |
373 | 396 | a | |
374 | 397 | case _ => | |
375 | 398 | 0 | |
376 | 399 | } | |
377 | 400 | ||
378 | 401 | ||
379 | 402 | func _saveEventStartBlock (execChainId_,eventId_,val_) = [IntegerEntry(makeString([KEY_EVENT_START_BLOCK, toString(execChainId_), toString(eventId_)], SEPARATOR), val_)] | |
380 | 403 | ||
381 | 404 | ||
382 | 405 | func _loadSignedEventExecutorIdxSize (executionChainId_) = match getInteger(makeString([KEY_SIGNED_EVENT_EXECUTOR, toString(executionChainId_), KEY_SIZE], SEPARATOR)) { | |
383 | 406 | case a: Int => | |
384 | 407 | a | |
385 | 408 | case _ => | |
386 | 409 | 0 | |
387 | 410 | } | |
388 | 411 | ||
389 | 412 | ||
390 | 413 | func _saveSignedEventExecutorIdxSize (executionChainId_,val_) = [IntegerEntry(makeString([KEY_SIGNED_EVENT_EXECUTOR, toString(executionChainId_), KEY_SIZE], SEPARATOR), val_)] | |
391 | 414 | ||
392 | 415 | ||
393 | 416 | func _loadSignedEventExecutorIdx (executionChainId_,idx_) = match getInteger(makeString([KEY_SIGNED_EVENT_EXECUTOR, toString(executionChainId_), toString(idx_)], SEPARATOR)) { | |
394 | 417 | case a: Int => | |
395 | 418 | a | |
396 | 419 | case _ => | |
397 | 420 | 0 | |
398 | 421 | } | |
399 | 422 | ||
400 | 423 | ||
401 | 424 | func _saveSignedEventExecutorIdx (executionChainId_,idx_,val_) = [IntegerEntry(makeString([KEY_SIGNED_EVENT_EXECUTOR, toString(executionChainId_), toString(idx_)], SEPARATOR), val_)] | |
402 | 425 | ||
403 | 426 | ||
404 | 427 | func _onlyThisContract (caller_) = if ((caller_ != this)) | |
405 | 428 | then throw("_onlyThisContract: revert") | |
406 | 429 | else true | |
407 | 430 | ||
408 | 431 | ||
409 | 432 | func _whenMultisigSet () = if ((_loadMultisig() == Address(base58''))) | |
410 | 433 | then throw("_whenMultisigSet: revert") | |
411 | 434 | else true | |
412 | 435 | ||
413 | 436 | ||
414 | 437 | func _whenNotInitialized () = if (_loadInit()) | |
415 | 438 | then throw("_whenNotInitialized: revert") | |
416 | 439 | else true | |
417 | 440 | ||
418 | 441 | ||
419 | 442 | func _whenInitialized () = if (!(_loadInit())) | |
420 | 443 | then throw("_whenInitialized: revert") | |
421 | 444 | else true | |
422 | 445 | ||
423 | 446 | ||
447 | + | func _isConfirmedEvent (eventId_,execChainId_,err_) = { | |
448 | + | let result = invoke(_loadWitnessAddress(), FUNC_IS_CONFIRMED_EVENT, [eventId_, execChainId_], nil) | |
449 | + | if ((result == result)) | |
450 | + | then match result { | |
451 | + | case a: Boolean => | |
452 | + | if (!(a)) | |
453 | + | then throw(err_) | |
454 | + | else true | |
455 | + | case _ => | |
456 | + | throw(err_) | |
457 | + | } | |
458 | + | else throw("Strict value is not equal to itself.") | |
459 | + | } | |
460 | + | ||
461 | + | ||
424 | 462 | func _isActiveSigner (publicKey_,publicKeys_,err_) = if (!(containsElement(publicKeys_, publicKey_))) | |
425 | 463 | then throw(err_) | |
426 | 464 | else true | |
427 | 465 | ||
428 | 466 | ||
429 | 467 | func _checkSecDepo (signer_,err_) = if ((_loadMinSecDepo() > _loadSecDepo(addressFromPublicKey(fromBase58String(signer_))))) | |
430 | 468 | then throw(err_) | |
431 | 469 | else true | |
432 | 470 | ||
433 | 471 | ||
434 | 472 | func _checkEventStatusForSubmitR (execChainId_,eventId_,err_) = if ((_loadEventStatus(execChainId_, eventId_) != EVENT_STATUS_INIT)) | |
435 | 473 | then throw(err_) | |
436 | 474 | else true | |
437 | 475 | ||
438 | 476 | ||
439 | 477 | func _checkEventStatusForSubmitS (execChainId_,eventId_,err_) = if ((_loadEventStatus(execChainId_, eventId_) != EVENT_STATUS_SIGN)) | |
440 | 478 | then throw(err_) | |
441 | 479 | else true | |
442 | 480 | ||
443 | 481 | ||
444 | 482 | func _checkEventStatusForReset (execChainId_,eventId_,err_) = if (if ((_loadEventStatus(execChainId_, eventId_) != EVENT_STATUS_SIGN)) | |
445 | 483 | then true | |
446 | 484 | else ((_loadEventStartBlock(execChainId_, eventId_) + _loadResetBlockDelta()) > height)) | |
447 | 485 | then throw(err_) | |
448 | 486 | else true | |
449 | 487 | ||
450 | 488 | ||
451 | 489 | func _incrementLocks (signers_) = { | |
452 | 490 | func foldFunc (acc,elem) = (acc ++ _saveLock(elem, (_loadLock(elem) + 1))) | |
453 | 491 | ||
454 | 492 | let $l = signers_ | |
455 | 493 | let $s = size($l) | |
456 | 494 | let $acc0 = nil | |
457 | 495 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
458 | 496 | then $a | |
459 | 497 | else foldFunc($a, $l[$i]) | |
460 | 498 | ||
461 | 499 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
462 | 500 | then $a | |
463 | 501 | else throw("List size exceeds 10") | |
464 | 502 | ||
465 | 503 | $f0_2($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) | |
466 | 504 | } | |
467 | 505 | ||
468 | 506 | ||
469 | 507 | func _isZeroLock (publicKey_,err_) = if ((_loadLock(publicKey_) > 0)) | |
470 | 508 | then throw(err_) | |
471 | 509 | else true | |
472 | 510 | ||
473 | 511 | ||
474 | 512 | func _notSubmittedR (execChainId_,eventId_,signer_,err_) = { | |
475 | 513 | let r = _loadRByEventAndSigner(execChainId_, eventId_, signer_) | |
476 | 514 | if (if ((r != "")) | |
477 | 515 | then containsElement(_loadRsByEvent(execChainId_, eventId_), r) | |
478 | 516 | else false) | |
479 | 517 | then throw(err_) | |
480 | 518 | else true | |
481 | 519 | } | |
482 | 520 | ||
483 | 521 | ||
484 | 522 | func _notSubmittedS (execChainId_,eventId_,signer_,err_) = { | |
485 | 523 | let s = _loadSByEventAndSigner(execChainId_, eventId_, signer_) | |
486 | 524 | if (if ((s != "")) | |
487 | 525 | then containsElement(_loadSsByEvent(execChainId_, eventId_), s) | |
488 | 526 | else false) | |
489 | 527 | then throw(err_) | |
490 | 528 | else true | |
491 | 529 | } | |
492 | 530 | ||
493 | 531 | ||
494 | 532 | func _submittedR (execChainId_,eventId_,signer_,err_) = { | |
495 | 533 | let r = _loadRByEventAndSigner(execChainId_, eventId_, signer_) | |
496 | 534 | if (if ((r == "")) | |
497 | 535 | then true | |
498 | 536 | else !(containsElement(_loadRsByEvent(execChainId_, eventId_), r))) | |
499 | 537 | then throw(err_) | |
500 | 538 | else true | |
501 | 539 | } | |
502 | 540 | ||
503 | 541 | ||
504 | 542 | func _slashIncorrect (signersWithR_,signersWithS_) = { | |
505 | 543 | let punishment = _loadPunishment() | |
506 | 544 | func foldFunc (acc,elem) = if (containsElement(signersWithS_, elem)) | |
507 | 545 | then $Tuple3(acc._1, (acc._2 :+ elem), acc._3) | |
508 | 546 | else { | |
509 | 547 | let signerAddress = addressFromPublicKey(fromBase58String(elem)) | |
510 | 548 | $Tuple3((acc._1 ++ _saveSecDepo(signerAddress, (_loadSecDepo(signerAddress) - punishment))), acc._2, (acc._3 + punishment)) | |
511 | 549 | } | |
512 | 550 | ||
513 | 551 | let $l = signersWithR_ | |
514 | 552 | let $s = size($l) | |
515 | 553 | let $acc0 = $Tuple3(nil, nil, 0) | |
516 | 554 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
517 | 555 | then $a | |
518 | 556 | else foldFunc($a, $l[$i]) | |
519 | 557 | ||
520 | 558 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
521 | 559 | then $a | |
522 | 560 | else throw("List size exceeds 10") | |
523 | 561 | ||
524 | 562 | $f0_2($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) | |
525 | 563 | } | |
526 | 564 | ||
527 | 565 | ||
528 | 566 | func _compensateCorrect (signers_,compensation_) = { | |
529 | 567 | let perSigner = (compensation_ / size(signers_)) | |
530 | 568 | func foldFunc (acc,elem) = (acc :+ ScriptTransfer(addressFromPublicKey(fromBase58String(elem)), perSigner, unit)) | |
531 | 569 | ||
532 | 570 | let $l = signers_ | |
533 | 571 | let $s = size($l) | |
534 | 572 | let $acc0 = nil | |
535 | 573 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
536 | 574 | then $a | |
537 | 575 | else foldFunc($a, $l[$i]) | |
538 | 576 | ||
539 | 577 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
540 | 578 | then $a | |
541 | 579 | else throw("List size exceeds 10") | |
542 | 580 | ||
543 | 581 | $f0_2($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) | |
544 | 582 | } | |
545 | 583 | ||
546 | 584 | ||
547 | 585 | func _publicKeysToAddrsStr (publicKeys_) = { | |
548 | 586 | func foldfunc (acc_,elem_) = (acc_ :+ toString(addressFromPublicKey(fromBase58String(elem_)))) | |
549 | 587 | ||
550 | 588 | let $l = publicKeys_ | |
551 | 589 | let $s = size($l) | |
552 | 590 | let $acc0 = nil | |
553 | 591 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
554 | 592 | then $a | |
555 | 593 | else foldfunc($a, $l[$i]) | |
556 | 594 | ||
557 | 595 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
558 | 596 | then $a | |
559 | 597 | else throw("List size exceeds 51") | |
560 | 598 | ||
561 | 599 | $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($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($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), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51) | |
562 | 600 | } | |
563 | 601 | ||
564 | 602 | ||
565 | 603 | @Callable(i) | |
566 | - | func init (minSecDepo_,punishment_,resetBlockDelta_,rewardTokenAddress_,rewardAmount_) = { | |
567 | - | let err = if (if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
604 | + | func init (minSecDepo_,punishment_,resetBlockDelta_,rewardTokenAddress_,rewardAmount_,witnessAddress_) = { | |
605 | + | let err = if (if (if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
568 | 606 | then _whenNotInitialized() | |
569 | 607 | else false) | |
570 | 608 | then _whenMultisigSet() | |
571 | 609 | else false) | |
572 | 610 | then _validateInt(minSecDepo_, punishment_, MAX_INT, "init: invalid minSecDepo") | |
573 | 611 | else false) | |
574 | 612 | then _validateInt(punishment_, 0, MAX_INT, "init: invalid punishment") | |
575 | 613 | else false) | |
576 | 614 | then _validateInt(resetBlockDelta_, 0, MAX_INT, "init: invalid resetBlockDelta") | |
577 | 615 | else false) | |
578 | 616 | then _validateAddress(rewardTokenAddress_, "init: invalid rewardTokenAddress") | |
579 | 617 | else false) | |
580 | 618 | then _validateInt(rewardAmount_, 0, MAX_INT, "init: invalid rewardAmount") | |
619 | + | else false) | |
620 | + | then _validateAddress(witnessAddress_, "init: invalid witnessAddress") | |
581 | 621 | else false | |
582 | 622 | if ((err == err)) | |
583 | - | then $Tuple2((((((_saveInit(true) ++ _saveMinSecDepo(minSecDepo_)) ++ _savePunishment(punishment_)) ++ _saveResetBlockDelta(resetBlockDelta_)) ++ _saveRewardTokenAddress(addressFromStringValue(rewardTokenAddress_))) ++ _saveRewardAmount(rewardAmount_)), unit) | |
623 | + | then $Tuple2(((((((_saveInit(true) ++ _saveMinSecDepo(minSecDepo_)) ++ _savePunishment(punishment_)) ++ _saveResetBlockDelta(resetBlockDelta_)) ++ _saveRewardTokenAddress(addressFromStringValue(rewardTokenAddress_))) ++ _saveRewardAmount(rewardAmount_)) ++ _saveWitnessAddress(addressFromStringValue(witnessAddress_))), unit) | |
584 | 624 | else throw("Strict value is not equal to itself.") | |
585 | 625 | } | |
586 | 626 | ||
587 | 627 | ||
588 | 628 | ||
589 | 629 | @Callable(i) | |
590 | 630 | func setActiveSigners (execChainId_,signers_,t_) = { | |
591 | 631 | let err = if (if (if (_onlyThisContract(i.caller)) | |
592 | 632 | then _whenInitialized() | |
593 | 633 | else false) | |
594 | 634 | then _validatePublicKeys(signers_, "setActiveSigners: invalid signers") | |
595 | 635 | else false) | |
596 | 636 | then _validateInt(t_, 2, size(signers_), "setActiveSigners: invalid T") | |
597 | 637 | else false | |
598 | 638 | if ((err == err)) | |
599 | 639 | then { | |
600 | 640 | let epoch = _loadCurrentEpoch(execChainId_) | |
601 | 641 | $Tuple2((((_saveCurrentEpoch(execChainId_, (epoch + 1)) ++ _saveT(execChainId_, (epoch + 1), t_)) ++ _saveSigners(execChainId_, (epoch + 1), signers_)) ++ _incrementLocks(signers_)), unit) | |
602 | 642 | } | |
603 | 643 | else throw("Strict value is not equal to itself.") | |
604 | 644 | } | |
605 | 645 | ||
606 | 646 | ||
607 | 647 | ||
608 | 648 | @Callable(i) | |
609 | 649 | func submitR (eventId_,execChainId_,r_) = { | |
610 | 650 | let callerPublicKey = toBase58String(i.callerPublicKey) | |
611 | 651 | let epoch = _loadCurrentEpoch(execChainId_) | |
612 | 652 | let t = _loadT(execChainId_, epoch) | |
613 | - | let err = if (if (if (if (if (if (if (_whenInitialized()) | |
653 | + | let err = if (if (if (if (if (if (if (if (_whenInitialized()) | |
614 | 654 | then _validateInt(eventId_, 0, MAX_INT, "submitR: invalid eventId") | |
615 | 655 | else false) | |
616 | 656 | then _validateInt(execChainId_, 0, MAX_INT, "submitR: invalid execChainId") | |
617 | 657 | else false) | |
618 | 658 | then _validateString(r_, "submitR: invalid r") | |
659 | + | else false) | |
660 | + | then _isConfirmedEvent(eventId_, execChainId_, "submitR: event not confirmed") | |
619 | 661 | else false) | |
620 | 662 | then _isActiveSigner(callerPublicKey, _loadSigners(execChainId_, epoch), "submitR: not active") | |
621 | 663 | else false) | |
622 | 664 | then _checkSecDepo(callerPublicKey, "submitR: not enough security deposit") | |
623 | 665 | else false) | |
624 | 666 | then _checkEventStatusForSubmitR(execChainId_, eventId_, "submitR: invalid event status") | |
625 | 667 | else false) | |
626 | 668 | then _notSubmittedR(execChainId_, eventId_, callerPublicKey, "submitR: already submitted") | |
627 | 669 | else false | |
628 | 670 | if ((err == err)) | |
629 | 671 | then { | |
630 | 672 | let rArray = _loadRsByEvent(execChainId_, eventId_) | |
631 | 673 | let signersArray = _loadSignersWithRByEvent(execChainId_, eventId_) | |
632 | 674 | let eventStatusActions = if (((size(rArray) + 1) == t)) | |
633 | 675 | then (_saveEventStatus(execChainId_, eventId_, EVENT_STATUS_SIGN) ++ _saveEventStartBlock(execChainId_, eventId_, height)) | |
634 | 676 | else nil | |
635 | 677 | $Tuple2((((_saveRsByEvent(execChainId_, eventId_, (rArray :+ r_)) ++ _saveRByEventAndSigner(execChainId_, eventId_, callerPublicKey, r_)) ++ _saveSignersWithRByEvent(execChainId_, eventId_, (signersArray :+ callerPublicKey))) ++ eventStatusActions), unit) | |
636 | 678 | } | |
637 | 679 | else throw("Strict value is not equal to itself.") | |
638 | 680 | } | |
639 | 681 | ||
640 | 682 | ||
641 | 683 | ||
642 | 684 | @Callable(i) | |
643 | 685 | func submitS (eventId_,execChainId_,rSigma_,s_,sSigma_) = { | |
644 | 686 | let callerPublicKey = toBase58String(i.callerPublicKey) | |
645 | 687 | let epoch = _loadCurrentEpoch(execChainId_) | |
646 | 688 | let t = _loadT(execChainId_, epoch) | |
647 | 689 | let err = if (if (if (if (if (if (if (if (if (_whenInitialized()) | |
648 | 690 | then _validateInt(eventId_, 0, MAX_INT, "submitS: invalid eventId") | |
649 | 691 | else false) | |
650 | 692 | then _validateInt(execChainId_, 0, MAX_INT, "submitS: invalid execChainId") | |
651 | 693 | else false) | |
652 | 694 | then _validateString(rSigma_, "submitS: invalid r sigma") | |
653 | 695 | else false) | |
654 | 696 | then _validateString(s_, "submitS: invalid s") | |
655 | 697 | else false) | |
656 | 698 | then _isActiveSigner(callerPublicKey, _loadSigners(execChainId_, epoch), "submitS: not active") | |
657 | 699 | else false) | |
658 | 700 | then _checkSecDepo(callerPublicKey, "submitS: not enough security deposit") | |
659 | 701 | else false) | |
660 | 702 | then _checkEventStatusForSubmitS(execChainId_, eventId_, "submitS: invalid event status") | |
661 | 703 | else false) | |
662 | 704 | then _notSubmittedS(execChainId_, eventId_, callerPublicKey, "submitS: already submitted") | |
663 | 705 | else false) | |
664 | 706 | then _submittedR(execChainId_, eventId_, callerPublicKey, "submitS: R is not submitted") | |
665 | 707 | else false | |
666 | 708 | if ((err == err)) | |
667 | 709 | then { | |
668 | 710 | let sArray = _loadSsByEvent(execChainId_, eventId_) | |
669 | 711 | let signersArray = _loadSignersWithSByEvent(execChainId_, eventId_) | |
670 | 712 | let eventStatusActions = if (((size(sArray) + 1) == t)) | |
671 | 713 | then { | |
672 | 714 | let err1 = _validateString(sSigma_, "submitS: invalid s sigma") | |
673 | 715 | if ((err1 == err1)) | |
674 | 716 | then { | |
675 | 717 | let executorIdxSize = _loadSignedEventExecutorIdxSize(execChainId_) | |
676 | 718 | let rewardAddresses = _publicKeysToAddrsStr((signersArray :+ callerPublicKey)) | |
677 | 719 | let signersRewards = invoke(_loadRewardTokenAddress(), FUNC_MINT_MANY, [_loadRewardAmount(), rewardAddresses], nil) | |
678 | 720 | if ((signersRewards == signersRewards)) | |
679 | 721 | then (((_saveEventStatus(execChainId_, eventId_, EVENT_STATUS_DONE) ++ _saveSignedEventExecutorIdx(execChainId_, executorIdxSize, eventId_)) ++ _saveSignedEventExecutorIdxSize(execChainId_, (executorIdxSize + 1))) ++ _saveSSigmaByEvent(execChainId_, eventId_, sSigma_)) | |
680 | 722 | else throw("Strict value is not equal to itself.") | |
681 | 723 | } | |
682 | 724 | else throw("Strict value is not equal to itself.") | |
683 | 725 | } | |
684 | 726 | else nil | |
685 | 727 | $Tuple2(((((_saveSsByEvent(execChainId_, eventId_, (sArray :+ s_)) ++ _saveSByEventAndSigner(execChainId_, eventId_, callerPublicKey, s_)) ++ _saveSignersWithSByEvent(execChainId_, eventId_, (signersArray :+ callerPublicKey))) ++ _saveRSigmaByEvent(execChainId_, eventId_, rSigma_)) ++ eventStatusActions), unit) | |
686 | 728 | } | |
687 | 729 | else throw("Strict value is not equal to itself.") | |
688 | 730 | } | |
689 | 731 | ||
690 | 732 | ||
691 | 733 | ||
692 | 734 | @Callable(i) | |
693 | 735 | func reset (eventId_,execChainId_,r_) = { | |
694 | 736 | let callerPublicKey = toBase58String(i.callerPublicKey) | |
695 | 737 | let epoch = _loadCurrentEpoch(execChainId_) | |
696 | 738 | let err = if (if (if (if (if (if (_whenInitialized()) | |
697 | 739 | then _validateInt(eventId_, 0, MAX_INT, "reset: invalid eventId") | |
698 | 740 | else false) | |
699 | 741 | then _validateInt(execChainId_, 0, MAX_INT, "reset: invalid execChainId") | |
700 | 742 | else false) | |
701 | 743 | then _validateString(r_, "reset: invalid r") | |
702 | 744 | else false) | |
703 | 745 | then _isActiveSigner(callerPublicKey, _loadSigners(execChainId_, epoch), "reset: not active") | |
704 | 746 | else false) | |
705 | 747 | then _checkSecDepo(callerPublicKey, "reset: not enough security deposit") | |
706 | 748 | else false) | |
707 | 749 | then _checkEventStatusForReset(execChainId_, eventId_, "reset: invalid event status") | |
708 | 750 | else false | |
709 | 751 | if ((err == err)) | |
710 | 752 | then { | |
711 | 753 | let slashAmount = 0 | |
712 | 754 | let signersWithR = _loadSignersWithRByEvent(execChainId_, eventId_) | |
713 | 755 | let signersWithS = _loadSignersWithSByEvent(execChainId_, eventId_) | |
714 | 756 | let result = _slashIncorrect(signersWithR, signersWithS) | |
715 | 757 | let slashingActions = result._1 | |
716 | 758 | let compensatedSigners = result._2 | |
717 | 759 | let compensation = result._3 | |
718 | 760 | let compensationActions = _compensateCorrect(compensatedSigners, compensation) | |
719 | 761 | $Tuple2((((((((((_saveEventStatus(execChainId_, eventId_, EVENT_STATUS_INIT) ++ _saveRsByEvent(execChainId_, eventId_, [r_])) ++ _saveRByEventAndSigner(execChainId_, eventId_, callerPublicKey, r_)) ++ _saveSignersWithRByEvent(execChainId_, eventId_, [callerPublicKey])) ++ _saveRSigmaByEvent(execChainId_, eventId_, "")) ++ _saveSsByEvent(execChainId_, eventId_, nil)) ++ _saveSignersWithSByEvent(execChainId_, eventId_, nil)) ++ _saveSSigmaByEvent(execChainId_, eventId_, "")) ++ slashingActions) ++ compensationActions), unit) | |
720 | 762 | } | |
721 | 763 | else throw("Strict value is not equal to itself.") | |
722 | 764 | } | |
723 | 765 | ||
724 | 766 | ||
725 | 767 | ||
726 | 768 | @Callable(i) | |
727 | 769 | func addSecurityDeposit (recipient_) = { | |
728 | 770 | let recipient = if ((recipient_ == "")) | |
729 | 771 | then toString(i.caller) | |
730 | 772 | else recipient_ | |
731 | 773 | let err = if (if (_validateAddress(recipient, "addSecurityDeposit: invalid recipient")) | |
732 | 774 | then _validatePaymentsSize(i.payments, 1, "addSecurityDeposit: no payment") | |
733 | 775 | else false) | |
734 | 776 | then _validatePaymentAsset(i.payments[0], unit, "addSecurityDeposit: invalid asset") | |
735 | 777 | else false | |
736 | 778 | if ((err == err)) | |
737 | 779 | then { | |
738 | 780 | let recipientAddr = addressFromStringValue(recipient) | |
739 | 781 | let balance = _loadSecDepo(recipientAddr) | |
740 | 782 | let updatedBalance = (balance + i.payments[0].amount) | |
741 | 783 | $Tuple2(_saveSecDepo(recipientAddr, updatedBalance), unit) | |
742 | 784 | } | |
743 | 785 | else throw("Strict value is not equal to itself.") | |
744 | 786 | } | |
745 | 787 | ||
746 | 788 | ||
747 | 789 | ||
748 | 790 | @Callable(i) | |
749 | 791 | func subSecurityDeposit (amount_) = { | |
750 | 792 | let balance = _loadSecDepo(i.caller) | |
751 | 793 | let err = if (_isZeroLock(toBase58String(i.callerPublicKey), "subSecurityDeposit: locked")) | |
752 | 794 | then if ((amount_ > balance)) | |
753 | 795 | then throw("subSecurityDeposit: insufficient balance") | |
754 | 796 | else true | |
755 | 797 | else false | |
756 | 798 | if ((err == err)) | |
757 | 799 | then $Tuple2((_saveSecDepo(i.caller, (balance - amount_)) ++ [ScriptTransfer(i.caller, amount_, unit)]), unit) | |
758 | 800 | else throw("Strict value is not equal to itself.") | |
759 | 801 | } | |
760 | 802 | ||
761 | 803 | ||
762 | 804 | ||
763 | 805 | @Callable(i) | |
764 | 806 | func setMultisig (multisig_) = { | |
765 | 807 | let err = if (_onlyThisContract(i.caller)) | |
766 | 808 | then _validateAddress(multisig_, "setMultisig: invalid multisig address") | |
767 | 809 | else false | |
768 | 810 | if ((err == err)) | |
769 | 811 | then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit) | |
770 | 812 | else throw("Strict value is not equal to itself.") | |
771 | 813 | } | |
772 | 814 | ||
773 | 815 | ||
774 | 816 | @Verifier(tx) | |
775 | 817 | func verify () = match getString(KEY_MULTISIG) { | |
776 | 818 | case multisig: String => | |
777 | 819 | valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false) | |
778 | 820 | case _ => | |
779 | 821 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
780 | 822 | } | |
781 | 823 |
github/deemru/w8io/169f3d6 89.73 ms ◑