tx · AcP9fHThEBmPtsUuoQ7o4yrnxLXhSXkaAKGnc3jRNGvr 3MyVvNfXht9piazyf1e5BVFsqv1R7z5cWJL: -0.01800000 Waves 2022.06.01 16:32 [2077352] smart account 3MyVvNfXht9piazyf1e5BVFsqv1R7z5cWJL > SELF 0.00000000 Waves
{ "type": 13, "id": "AcP9fHThEBmPtsUuoQ7o4yrnxLXhSXkaAKGnc3jRNGvr", "fee": 1800000, "feeAssetId": null, "timestamp": 1654090398163, "version": 1, "sender": "3MyVvNfXht9piazyf1e5BVFsqv1R7z5cWJL", "senderPublicKey": "DnPyGWCgpQChvoQrnXQRcC9FtN32mPGrcog2wcKHdkVn", "proofs": [ "3fb5ztyjVdVNuCWxa7NpoV5R1v3n4ioMJN8dXb86geD4ov7enWDQeL2k7inUGJByEFq3KdWoQwkYXdWsejY6VHF7" ], "script": "base64:AAIFAAAAAAAAADUIAhIDCgEIEgASBAoCCAESBQoDCAgBEgQKAggIEgUKAwgIARIECgIICBIDCgEBEgASAwoBCAAAABwAAAAACXNlcGFyYXRvcgIAAAACX18AAAAACG1heFNoYXJlAAAAAAAAAABkAAAAAA5rZXlFcG9jaExlbmd0aAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAAC2Vwb2NoTGVuZ3RoBQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAAPa2V5Q3VycmVudEVwb2NoCQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAAMY3VycmVudEVwb2NoBQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAAOa2V5U3RhcnRIZWlnaHQJAAS5AAAAAgkABEwAAAACAgAAAAIlcwkABEwAAAACAgAAAAtzdGFydEhlaWdodAUAAAADbmlsBQAAAAlzZXBhcmF0b3IAAAAAImtleVZvdGluZ0VtaXNzaW9uQ2FuZGlkYXRlQ29udHJhY3QJAAS5AAAAAgkABEwAAAACAgAAAAIlcwkABEwAAAACAgAAAB92b3RpbmdFbWlzc2lvbkNh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dW5pdAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABaQEAAAAIZmluYWxpemUAAAAACQAFFAAAAAIFAAAAA25pbAUAAAAEdW5pdAAAAAFpAQAAABJvblZlcmlmaWNhdGlvbkxvc3MAAAABAAAAB2Fzc2V0SWQJAAUUAAAAAgUAAAADbmlsBQAAAAR1bml0AAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAPdGFyZ2V0UHVibGljS2V5BAAAAAckbWF0Y2gwCQEAAAAWbWFuYWdlclB1YmxpY0tleU9yVW5pdAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAnBrBQAAAAckbWF0Y2gwBQAAAAJwawMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAD3RhcmdldFB1YmxpY0tleb/czuM=", "chainId": 84, "height": 2077352, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7ymi4VA8L6BBGzUEHZWwPCUYSdHywrG4wqYa36sz8Kn6 Next: 8BtWfTksDrcodFa3aCMbnt7DuXESFgbnX5Dk6jDrwevW Diff:
Old | New | Differences | |
---|---|---|---|
74 | 74 | let poolsListName = "__pools" | |
75 | 75 | ||
76 | 76 | func getVotesListName (pool) = { | |
77 | - | let $ | |
78 | - | let amountAssetId = $ | |
79 | - | let priceAssetId = $ | |
77 | + | let $t021122152 = pool | |
78 | + | let amountAssetId = $t021122152._1 | |
79 | + | let priceAssetId = $t021122152._2 | |
80 | 80 | makeString(["%s%s__votes", amountAssetId, priceAssetId], separator) | |
81 | 81 | } | |
82 | 82 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | func containsNode (listName,id) = { | |
97 | - | let head = getString(this, keyListHead(listName)) | |
97 | + | let head = valueOrElse(getString(this, keyListHead(listName)), "") | |
98 | 98 | let prev = getString(this, keyListPrev(listName, id)) | |
99 | 99 | let next = getString(this, keyListNext(listName, id)) | |
100 | 100 | if (if ((id == head)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let maxShare = 100 | |
7 | 7 | ||
8 | 8 | let keyEpochLength = makeString(["%s", "epochLength"], separator) | |
9 | 9 | ||
10 | 10 | let keyCurrentEpoch = makeString(["%s", "currentEpoch"], separator) | |
11 | 11 | ||
12 | 12 | let keyStartHeight = makeString(["%s", "startHeight"], separator) | |
13 | 13 | ||
14 | 14 | let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], separator) | |
15 | 15 | ||
16 | 16 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
17 | 17 | ||
18 | 18 | func keyInList (pool) = { | |
19 | 19 | let $t0594634 = pool | |
20 | 20 | let amountAssetId = $t0594634._1 | |
21 | 21 | let priceAssetId = $t0594634._2 | |
22 | 22 | makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator) | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func keyShareUsed (address) = makeString(["%s%s", "shareUsed", toString(address)], separator) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func keyVoteShare (address,pool) = { | |
30 | 30 | let $t0879919 = pool | |
31 | 31 | let amountAssetId = $t0879919._1 | |
32 | 32 | let priceAssetId = $t0879919._2 | |
33 | 33 | makeString(["%s%s%s%s", "voteShare", amountAssetId, priceAssetId, toString(address)], separator) | |
34 | 34 | } | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func keyVotingResult (pool) = { | |
38 | 38 | let $t013181358 = pool | |
39 | 39 | let amountAssetId = $t013181358._1 | |
40 | 40 | let priceAssetId = $t013181358._2 | |
41 | 41 | makeString(["%s%s%s", "votingResult", amountAssetId, priceAssetId], separator) | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func getValueOrFail (address,key,type) = { | |
46 | 46 | let error = makeString(["mandatory ", toString(address), ".", key, " is not defined"], "") | |
47 | 47 | valueOrErrorMessage( match type { | |
48 | 48 | case str: String => | |
49 | 49 | getString(address, key) | |
50 | 50 | case int: Int => | |
51 | 51 | getInteger(address, key) | |
52 | 52 | case _ => | |
53 | 53 | throw("invalid entry type") | |
54 | 54 | }, error) | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getStrOrFail (address,key) = { | |
59 | 59 | let @ = getValueOrFail(address, key, "") | |
60 | 60 | if ($isInstanceOf(@, "String")) | |
61 | 61 | then @ | |
62 | 62 | else throw("Couldn't cast Int|String to String") | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func getIntOrFail (address,key) = { | |
67 | 67 | let @ = getValueOrFail(address, key, 0) | |
68 | 68 | if ($isInstanceOf(@, "Int")) | |
69 | 69 | then @ | |
70 | 70 | else throw("Couldn't cast Int|String to Int") | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | let poolsListName = "__pools" | |
75 | 75 | ||
76 | 76 | func getVotesListName (pool) = { | |
77 | - | let $ | |
78 | - | let amountAssetId = $ | |
79 | - | let priceAssetId = $ | |
77 | + | let $t021122152 = pool | |
78 | + | let amountAssetId = $t021122152._1 | |
79 | + | let priceAssetId = $t021122152._2 | |
80 | 80 | makeString(["%s%s__votes", amountAssetId, priceAssetId], separator) | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyListHead (listName) = makeString([("%s%s" + listName), "head"], separator) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyListSize (listName) = makeString([("%s%s" + listName), "size"], separator) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyListPrev (listName,id) = makeString([("%s%s%s" + listName), id, "prev"], separator) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyListNext (listName,id) = makeString([("%s%s%s" + listName), id, "next"], separator) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func containsNode (listName,id) = { | |
97 | - | let head = getString(this, keyListHead(listName)) | |
97 | + | let head = valueOrElse(getString(this, keyListHead(listName)), "") | |
98 | 98 | let prev = getString(this, keyListPrev(listName, id)) | |
99 | 99 | let next = getString(this, keyListNext(listName, id)) | |
100 | 100 | if (if ((id == head)) | |
101 | 101 | then true | |
102 | 102 | else (prev != unit)) | |
103 | 103 | then true | |
104 | 104 | else (next != unit) | |
105 | 105 | } | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func insertNodeActions (listName,id) = { | |
109 | 109 | let head = getString(this, keyListHead(listName)) | |
110 | 110 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
111 | 111 | let checkNode = if (!(containsNode(listName, id))) | |
112 | 112 | then true | |
113 | 113 | else throw("Node exists") | |
114 | 114 | if ((checkNode == checkNode)) | |
115 | 115 | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if (isDefined(head)) | |
116 | 116 | then [StringEntry(keyListNext(listName, id), value(head)), StringEntry(keyListPrev(listName, value(head)), id)] | |
117 | 117 | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
118 | 118 | else throw("Strict value is not equal to itself.") | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func deleteNodeActions (listName,id) = { | |
123 | 123 | let head = getString(this, keyListHead(listName)) | |
124 | 124 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
125 | 125 | let prev = getString(this, keyListPrev(listName, id)) | |
126 | 126 | let next = getString(this, keyListNext(listName, id)) | |
127 | 127 | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if (isDefined(prev)) | |
128 | 128 | then isDefined(next) | |
129 | 129 | else false) | |
130 | 130 | then [StringEntry(keyListNext(listName, value(prev)), value(next)), StringEntry(keyListPrev(listName, value(next)), value(prev)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
131 | 131 | else if (isDefined(next)) | |
132 | 132 | then [StringEntry(keyListHead(listName), value(next)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(next)))] | |
133 | 133 | else if (isDefined(prev)) | |
134 | 134 | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prev)))] | |
135 | 135 | else if ((id == head)) | |
136 | 136 | then [DeleteEntry(keyListHead(listName))] | |
137 | 137 | else throw("Invalid node"))) | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
148 | 148 | case s: String => | |
149 | 149 | fromBase58String(s) | |
150 | 150 | case _: Unit => | |
151 | 151 | unit | |
152 | 152 | case _ => | |
153 | 153 | throw("Match error") | |
154 | 154 | } | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
158 | 158 | case s: String => | |
159 | 159 | fromBase58String(s) | |
160 | 160 | case _: Unit => | |
161 | 161 | unit | |
162 | 162 | case _ => | |
163 | 163 | throw("Match error") | |
164 | 164 | } | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func mustManager (i) = { | |
168 | 168 | let pd = throw("Permission denied") | |
169 | 169 | match managerPublicKeyOrUnit() { | |
170 | 170 | case pk: ByteVector => | |
171 | 171 | if ((i.callerPublicKey == pk)) | |
172 | 172 | then true | |
173 | 173 | else pd | |
174 | 174 | case _: Unit => | |
175 | 175 | if ((i.caller == this)) | |
176 | 176 | then true | |
177 | 177 | else pd | |
178 | 178 | case _ => | |
179 | 179 | throw("Match error") | |
180 | 180 | } | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | @Callable(i) | |
185 | 185 | func setManager (pendingManagerPublicKey) = { | |
186 | 186 | let checkCaller = mustManager(i) | |
187 | 187 | if ((checkCaller == checkCaller)) | |
188 | 188 | then { | |
189 | 189 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
190 | 190 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
191 | 191 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
192 | 192 | else throw("Strict value is not equal to itself.") | |
193 | 193 | } | |
194 | 194 | else throw("Strict value is not equal to itself.") | |
195 | 195 | } | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | ||
199 | 199 | @Callable(i) | |
200 | 200 | func confirmManager () = { | |
201 | 201 | let pm = pendingManagerPublicKeyOrUnit() | |
202 | 202 | let hasPM = if (isDefined(pm)) | |
203 | 203 | then true | |
204 | 204 | else throw("No pending manager") | |
205 | 205 | if ((hasPM == hasPM)) | |
206 | 206 | then { | |
207 | 207 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
208 | 208 | then true | |
209 | 209 | else throw("You are not pending manager") | |
210 | 210 | if ((checkPM == checkPM)) | |
211 | 211 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
212 | 212 | else throw("Strict value is not equal to itself.") | |
213 | 213 | } | |
214 | 214 | else throw("Strict value is not equal to itself.") | |
215 | 215 | } | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | ||
219 | 219 | @Callable(i) | |
220 | 220 | func getUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
221 | 221 | let boostingContractAddress = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyBoostingContract)), "invalid boosting contract address") | |
222 | 222 | $Tuple2(nil, { | |
223 | 223 | let @ = invoke(boostingContractAddress, "getUserGwxAmountAtHeightREADONLY", [userAddress, targetHeight], nil) | |
224 | 224 | if ($isInstanceOf(@, "Int")) | |
225 | 225 | then @ | |
226 | 226 | else throw("Couldn't cast Any to Int") | |
227 | 227 | }) | |
228 | 228 | } | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | ||
232 | 232 | @Callable(i) | |
233 | 233 | func constructor (votingEmissionCandidateContract,boostingContract,epochLength) = { | |
234 | 234 | let cheks = [mustManager(i), if ((addressFromString(votingEmissionCandidateContract) != unit)) | |
235 | 235 | then true | |
236 | 236 | else "invalid voting emission candidate contract address", if ((addressFromString(boostingContract) != unit)) | |
237 | 237 | then true | |
238 | 238 | else "invalid boosting contract address", if ((epochLength > 0)) | |
239 | 239 | then true | |
240 | 240 | else throw("invalid epoch length")] | |
241 | 241 | if ((cheks == cheks)) | |
242 | 242 | then $Tuple2([StringEntry(keyVotingEmissionCandidateContract, votingEmissionCandidateContract), StringEntry(keyBoostingContract, boostingContract), IntegerEntry(keyEpochLength, epochLength)], unit) | |
243 | 243 | else throw("Strict value is not equal to itself.") | |
244 | 244 | } | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | ||
248 | 248 | @Callable(i) | |
249 | 249 | func create (amountAssetId,priceAssetId) = { | |
250 | 250 | let checks = [if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionCandidateContract), ""))) | |
251 | 251 | then true | |
252 | 252 | else mustManager(i)] | |
253 | 253 | if ((checks == checks)) | |
254 | 254 | then { | |
255 | 255 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
256 | 256 | let inListActions = [BooleanEntry(keyInList(pool), true)] | |
257 | 257 | let startHeightIsNotDefined = (getString(this, keyStartHeight) == unit) | |
258 | 258 | let startHeightActions = if (startHeightIsNotDefined) | |
259 | 259 | then [IntegerEntry(keyCurrentEpoch, 0), IntegerEntry(keyStartHeight, height)] | |
260 | 260 | else nil | |
261 | 261 | $Tuple2((inListActions ++ startHeightActions), unit) | |
262 | 262 | } | |
263 | 263 | else throw("Strict value is not equal to itself.") | |
264 | 264 | } | |
265 | 265 | ||
266 | 266 | ||
267 | 267 | ||
268 | 268 | @Callable(i) | |
269 | 269 | func vote (amountAssetId,priceAssetId,share) = { | |
270 | 270 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
271 | 271 | let startHeight = getIntOrFail(this, keyStartHeight) | |
272 | 272 | let epochLength = getIntOrFail(this, keyEpochLength) | |
273 | 273 | let endHeight = (startHeight + epochLength) | |
274 | 274 | let shareUsed = valueOrElse(getInteger(this, keyShareUsed(i.caller)), 0) | |
275 | 275 | let poolVoteShare = valueOrElse(getInteger(this, keyVoteShare(i.caller, pool)), 0) | |
276 | 276 | let userMaxShare = (maxShare - shareUsed) | |
277 | 277 | let newShare = (poolVoteShare + share) | |
278 | 278 | let gwxAmountAtEndTotal = { | |
279 | 279 | let @ = invoke(this, "getUserGwxAmountAtHeight", [toBase58String(i.caller.bytes), endHeight], nil) | |
280 | 280 | if ($isInstanceOf(@, "Int")) | |
281 | 281 | then @ | |
282 | 282 | else throw("Couldn't cast Any to Int") | |
283 | 283 | } | |
284 | 284 | let gwxAmountAtEnd = fraction(gwxAmountAtEndTotal, newShare, maxShare) | |
285 | 285 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
286 | 286 | then true | |
287 | 287 | else throw("invalid assets"), if ((endHeight > height)) | |
288 | 288 | then true | |
289 | 289 | else throw("invalid height"), if ((gwxAmountAtEnd > 0)) | |
290 | 290 | then true | |
291 | 291 | else throw("you do not have gWX"), if (if ((share > 0)) | |
292 | 292 | then (userMaxShare >= share) | |
293 | 293 | else false) | |
294 | 294 | then true | |
295 | 295 | else throw("invalid share")] | |
296 | 296 | if ((checks == checks)) | |
297 | 297 | then $Tuple2([IntegerEntry(keyShareUsed(i.caller), (shareUsed + share)), IntegerEntry(keyVoteShare(i.caller, pool), newShare)], unit) | |
298 | 298 | else throw("Strict value is not equal to itself.") | |
299 | 299 | } | |
300 | 300 | ||
301 | 301 | ||
302 | 302 | ||
303 | 303 | @Callable(i) | |
304 | 304 | func cancelVote (amountAssetId,priceAssetId) = { | |
305 | 305 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
306 | 306 | let startHeight = getIntOrFail(this, keyStartHeight) | |
307 | 307 | let epochLength = getIntOrFail(this, keyEpochLength) | |
308 | 308 | let endHeight = (startHeight + epochLength) | |
309 | 309 | let poolVoteShare = valueOrElse(getInteger(this, keyVoteShare(i.caller, pool)), 0) | |
310 | 310 | let shareUsed = valueOrElse(getInteger(this, keyShareUsed(i.caller)), 0) | |
311 | 311 | let checks = [if ((getBoolean(keyInList(pool)) != unit)) | |
312 | 312 | then true | |
313 | 313 | else throw("invalid assets"), if ((endHeight > height)) | |
314 | 314 | then true | |
315 | 315 | else throw("invalid height"), if ((poolVoteShare > 0)) | |
316 | 316 | then true | |
317 | 317 | else throw("no vote")] | |
318 | 318 | if ((checks == checks)) | |
319 | 319 | then $Tuple2([IntegerEntry(keyShareUsed(i.caller), max([(shareUsed - poolVoteShare), 0])), DeleteEntry(keyVoteShare(i.caller, pool))], unit) | |
320 | 320 | else throw("Strict value is not equal to itself.") | |
321 | 321 | } | |
322 | 322 | ||
323 | 323 | ||
324 | 324 | ||
325 | 325 | @Callable(i) | |
326 | 326 | func setEpochLength (newEpochLength) = { | |
327 | 327 | let cheks = [mustManager(i), if ((newEpochLength > 0)) | |
328 | 328 | then true | |
329 | 329 | else throw("invalid epoch length")] | |
330 | 330 | if ((cheks == cheks)) | |
331 | 331 | then $Tuple2([IntegerEntry(keyEpochLength, newEpochLength)], unit) | |
332 | 332 | else throw("Strict value is not equal to itself.") | |
333 | 333 | } | |
334 | 334 | ||
335 | 335 | ||
336 | 336 | ||
337 | 337 | @Callable(i) | |
338 | 338 | func finalize () = $Tuple2(nil, unit) | |
339 | 339 | ||
340 | 340 | ||
341 | 341 | ||
342 | 342 | @Callable(i) | |
343 | 343 | func onVerificationLoss (assetId) = $Tuple2(nil, unit) | |
344 | 344 | ||
345 | 345 | ||
346 | 346 | @Verifier(tx) | |
347 | 347 | func verify () = { | |
348 | 348 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
349 | 349 | case pk: ByteVector => | |
350 | 350 | pk | |
351 | 351 | case _: Unit => | |
352 | 352 | tx.senderPublicKey | |
353 | 353 | case _ => | |
354 | 354 | throw("Match error") | |
355 | 355 | } | |
356 | 356 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
357 | 357 | } | |
358 | 358 |
github/deemru/w8io/169f3d6 45.70 ms ◑