tx · 8egnpN8ni4wvEeZTEQndwqHJs7sWjcbTqaVqSKCEJc9M 3NBhCjipaSBkkoRSBdcyx2ui7wnY4HnxiVW: -0.01300000 Waves 2023.05.04 13:11 [2562877] smart account 3NBhCjipaSBkkoRSBdcyx2ui7wnY4HnxiVW > SELF 0.00000000 Waves
{ "type": 13, "id": "8egnpN8ni4wvEeZTEQndwqHJs7sWjcbTqaVqSKCEJc9M", "fee": 1300000, "feeAssetId": null, "timestamp": 1683195127225, "version": 2, "chainId": 84, "sender": "3NBhCjipaSBkkoRSBdcyx2ui7wnY4HnxiVW", "senderPublicKey": "FwXakLfcNwZygjHPVBd5TDZ4C5Wrgpoi9U69GufmFkQ", "proofs": [ "4SfLDikSbsx3gnsfQdBn1meYJHtjxzxtDs9cgaujNoRBBn1JFXwktRyHDkURfYcpa1mvYhevcoDAZ1gZQcjWqYFk" ], "script": "base64:BgIlCAISCgoICAgBAQEBAQESAwoBCBIDCgEIEgUKAwgIARIECgIICBIAA1NFUAICX18BE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc19fbWFuYWdlclB1YmxpY0tleQEWa2V5TWFuYWdlclZhdWx0QWRkcmVzcwACFyVzX19tYW5hZ2VyVmF1bHRBZGRyZXNzARdnZXRNYW5hZ2VyQWRkcmVzc09yRmFpbAAJARFAZXh0ck5hdGl2ZSgxMDYyKQEJARFAZXh0ck5hdGl2ZSgxMDU4KQEJARZrZXlNYW5hZ2VyVmF1bHRBZGRyZXNzAAEQa2V5V2l0aGRyYXdEZWxheQIGYXNzZXRBBmFzc2V0QgkAuQkCCQDMCAICBiVzJXMlcwkAzAgCAg13aXRoZHJhd0RlbGF5CQDMCAIFBmFzc2V0QQkAzAgCBQZhc3NldEIFA25pbAUDU0VQARVrZXlEZXBvc2l0RmVlUGVybWlsbGUCBmFzc2V0QQZhc3NldEIJALkJAgkAzAgCAgYlcyVzJXMJAMwIAgISZGVwb3NpdEZlZVBlcm1pbGxlCQDMCAIFBmFzc2V0QQkAzAgC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YXNzZXRBBQZhc3NldEIAAAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFC3RvV2l0aGRyYXdBBQ53aXRoZHJhd0Fzc2V0QQUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAQPdGFyZ2V0UHVibGljS2V5BAckbWF0Y2gwCQEWbWFuYWdlclB1YmxpY0tleU9yVW5pdAADCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQCcGsFByRtYXRjaDAFAnBrAwkAAQIFByRtYXRjaDACBFVuaXQIBQJ0eA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5FVMfmg==", "height": 2562877, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CLSZFcsU3jobwVaGwq9wqTvsA9R4hKieuD4Fezk7fgAU Next: none Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
7 | 7 | ||
8 | 8 | ||
9 | - | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
9 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
10 | + | ||
11 | + | ||
12 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
10 | 13 | ||
11 | 14 | ||
12 | 15 | func keyWithdrawDelay (assetA,assetB) = makeString(["%s%s%s", "withdrawDelay", assetA, assetB], SEP) | |
39 | 42 | func keyProcessDone (userAddress,assetA,assetB,heightInKey) = makeString(["%s%s%s%s%s%d", "withdrawProcess", "done", userAddress, assetA, assetB, toString(heightInKey)], SEP) | |
40 | 43 | ||
41 | 44 | ||
42 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
43 | - | case s: String => | |
44 | - | fromBase58String(s) | |
45 | - | case _: Unit => | |
46 | - | unit | |
47 | - | case _ => | |
48 | - | throw("Match error") | |
49 | - | } | |
50 | - | ||
51 | - | ||
52 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
53 | - | case s: String => | |
54 | - | fromBase58String(s) | |
55 | - | case _: Unit => | |
56 | - | unit | |
57 | - | case _ => | |
58 | - | throw("Match error") | |
59 | - | } | |
45 | + | func managerPublicKeyOrUnit () = { | |
46 | + | let managerVaultAddress = getManagerAddressOrFail() | |
47 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
48 | + | case s: String => | |
49 | + | fromBase58String(s) | |
50 | + | case _: Unit => | |
51 | + | unit | |
52 | + | case _ => | |
53 | + | throw("Match error") | |
54 | + | } | |
55 | + | } | |
60 | 56 | ||
61 | 57 | ||
62 | 58 | func mustManager (i) = { | |
204 | 200 | } | |
205 | 201 | ||
206 | 202 | ||
207 | - | ||
208 | - | @Callable(i) | |
209 | - | func setManager (pendingManagerPublicKey) = { | |
210 | - | let checkCaller = mustManager(i) | |
211 | - | if ((checkCaller == checkCaller)) | |
212 | - | then { | |
213 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
214 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
215 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
216 | - | else throw("Strict value is not equal to itself.") | |
217 | - | } | |
218 | - | else throw("Strict value is not equal to itself.") | |
219 | - | } | |
220 | - | ||
221 | - | ||
222 | - | ||
223 | - | @Callable(i) | |
224 | - | func confirmManager () = { | |
225 | - | let pm = pendingManagerPublicKeyOrUnit() | |
226 | - | let hasPM = if (isDefined(pm)) | |
227 | - | then true | |
228 | - | else throwErr("No pending manager.") | |
229 | - | if ((hasPM == hasPM)) | |
230 | - | then { | |
231 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
232 | - | then true | |
233 | - | else throwErr("You are not pending manager.") | |
234 | - | if ((checkPM == checkPM)) | |
235 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
236 | - | else throw("Strict value is not equal to itself.") | |
237 | - | } | |
238 | - | else throw("Strict value is not equal to itself.") | |
239 | - | } | |
240 | - | ||
241 | - | ||
242 | 203 | @Verifier(tx) | |
243 | 204 | func verify () = { | |
244 | 205 | let targetPublicKey = match managerPublicKeyOrUnit() { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
7 | 7 | ||
8 | 8 | ||
9 | - | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
9 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
10 | + | ||
11 | + | ||
12 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
10 | 13 | ||
11 | 14 | ||
12 | 15 | func keyWithdrawDelay (assetA,assetB) = makeString(["%s%s%s", "withdrawDelay", assetA, assetB], SEP) | |
13 | 16 | ||
14 | 17 | ||
15 | 18 | func keyDepositFeePermille (assetA,assetB) = makeString(["%s%s%s", "depositFeePermille", assetA, assetB], SEP) | |
16 | 19 | ||
17 | 20 | ||
18 | 21 | func keyWithdrawFeePermille (assetA,assetB) = makeString(["%s%s%s", "withdrawFeePermille", assetA, assetB], SEP) | |
19 | 22 | ||
20 | 23 | ||
21 | 24 | func keyMinAmountDeposit (assetA,assetB) = makeString(["%s%s%s", "minAmountDeposit", assetA, assetB], SEP) | |
22 | 25 | ||
23 | 26 | ||
24 | 27 | func keyAssetsPairStatus (assetA,assetB) = makeString(["%s%s%s", "assetsPairStatus", assetA, assetB], SEP) | |
25 | 28 | ||
26 | 29 | ||
27 | 30 | func keyMinAmountWithdraw (assetA,assetB) = makeString(["%s%s%s", "minAmountWithdraw", assetA, assetB], SEP) | |
28 | 31 | ||
29 | 32 | ||
30 | 33 | func keyBalance (assetA,assetB,userAddress) = makeString(["%s%s%s%s", "balance", assetA, assetB, userAddress], SEP) | |
31 | 34 | ||
32 | 35 | ||
33 | 36 | func keyTotalFeeCollectedDeposit (assetA,assetB) = makeString(["%s%s%s%s", "totalFeeCollected", "deposit", assetA, assetB], SEP) | |
34 | 37 | ||
35 | 38 | ||
36 | 39 | func keyProcessInProgress (userAddress,assetA,assetB,heightInKey) = makeString(["%s%s%s%s%s%d", "withdrawProcess", "inProgress", userAddress, assetA, assetB, toString(heightInKey)], SEP) | |
37 | 40 | ||
38 | 41 | ||
39 | 42 | func keyProcessDone (userAddress,assetA,assetB,heightInKey) = makeString(["%s%s%s%s%s%d", "withdrawProcess", "done", userAddress, assetA, assetB, toString(heightInKey)], SEP) | |
40 | 43 | ||
41 | 44 | ||
42 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
43 | - | case s: String => | |
44 | - | fromBase58String(s) | |
45 | - | case _: Unit => | |
46 | - | unit | |
47 | - | case _ => | |
48 | - | throw("Match error") | |
49 | - | } | |
50 | - | ||
51 | - | ||
52 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
53 | - | case s: String => | |
54 | - | fromBase58String(s) | |
55 | - | case _: Unit => | |
56 | - | unit | |
57 | - | case _ => | |
58 | - | throw("Match error") | |
59 | - | } | |
45 | + | func managerPublicKeyOrUnit () = { | |
46 | + | let managerVaultAddress = getManagerAddressOrFail() | |
47 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
48 | + | case s: String => | |
49 | + | fromBase58String(s) | |
50 | + | case _: Unit => | |
51 | + | unit | |
52 | + | case _ => | |
53 | + | throw("Match error") | |
54 | + | } | |
55 | + | } | |
60 | 56 | ||
61 | 57 | ||
62 | 58 | func mustManager (i) = { | |
63 | 59 | let pd = throw("Permission denied.") | |
64 | 60 | match managerPublicKeyOrUnit() { | |
65 | 61 | case pk: ByteVector => | |
66 | 62 | if ((i.callerPublicKey == pk)) | |
67 | 63 | then true | |
68 | 64 | else pd | |
69 | 65 | case _: Unit => | |
70 | 66 | if ((i.caller == this)) | |
71 | 67 | then true | |
72 | 68 | else pd | |
73 | 69 | case _ => | |
74 | 70 | throw("Match error") | |
75 | 71 | } | |
76 | 72 | } | |
77 | 73 | ||
78 | 74 | ||
79 | 75 | func fmtErr (msg) = makeString(["otc_multiasset.ride:", msg], " ") | |
80 | 76 | ||
81 | 77 | ||
82 | 78 | func throwErr (msg) = throw(fmtErr(msg)) | |
83 | 79 | ||
84 | 80 | ||
85 | 81 | @Callable(i) | |
86 | 82 | func registerAsset (assetA,assetB,withdrawDelay,depositFee,withdrawFee,minAmountDeposit,minAmountWithdraw,pairStatus) = { | |
87 | 83 | let checkCaller = mustManager(i) | |
88 | 84 | if ((checkCaller == checkCaller)) | |
89 | 85 | then { | |
90 | 86 | let withdrawDelayKey = keyWithdrawDelay(assetA, assetB) | |
91 | 87 | let depositFeePermilleKey = keyDepositFeePermille(assetA, assetB) | |
92 | 88 | let withdrawFeePermilleKey = keyWithdrawFeePermille(assetA, assetB) | |
93 | 89 | let minAmountDepositKey = keyMinAmountDeposit(assetA, assetB) | |
94 | 90 | let minAmountWithdrawKey = keyMinAmountWithdraw(assetA, assetB) | |
95 | 91 | let pairStatusKey = keyAssetsPairStatus(assetA, assetB) | |
96 | 92 | [IntegerEntry(withdrawDelayKey, withdrawDelay), IntegerEntry(depositFeePermilleKey, depositFee), IntegerEntry(withdrawFeePermilleKey, withdrawFee), IntegerEntry(minAmountDepositKey, minAmountDeposit), IntegerEntry(minAmountWithdrawKey, minAmountWithdraw), IntegerEntry(pairStatusKey, pairStatus)] | |
97 | 93 | } | |
98 | 94 | else throw("Strict value is not equal to itself.") | |
99 | 95 | } | |
100 | 96 | ||
101 | 97 | ||
102 | 98 | ||
103 | 99 | @Callable(i) | |
104 | 100 | func swapAssetsAToB (assetB) = { | |
105 | 101 | let payment = value(i.payments[0]) | |
106 | 102 | let assetA = toBase58String(value(payment.assetId)) | |
107 | 103 | let asset = fromBase58String(value(assetB)) | |
108 | 104 | let userAddress = toString(i.caller) | |
109 | 105 | let minAmountDeposit = valueOrErrorMessage(getInteger(keyMinAmountDeposit(assetA, assetB)), fmtErr("This asset pair does not exist.")) | |
110 | 106 | let toDeposit = payment.amount | |
111 | 107 | let depositFee = valueOrErrorMessage(getInteger(keyDepositFeePermille(assetA, assetB)), fmtErr("The deposit fee for this pair of assets is not set.")) | |
112 | 108 | let fee = ((toDeposit / 1000) * depositFee) | |
113 | 109 | let currentUserBalance = valueOrElse(getInteger(keyBalance(assetA, assetB, userAddress)), 0) | |
114 | 110 | let totalCommissions = valueOrElse(getInteger(keyTotalFeeCollectedDeposit(assetA, assetB)), 0) | |
115 | 111 | let pairStatus = valueOrErrorMessage(getInteger(keyAssetsPairStatus(assetA, assetB)), fmtErr("The asset pair status for this pair of assets is not set.")) | |
116 | 112 | let checkPairStatus = if ((pairStatus == 0)) | |
117 | 113 | then true | |
118 | 114 | else throwErr("The couple's deposit is blocked.") | |
119 | 115 | if ((checkPairStatus == checkPairStatus)) | |
120 | 116 | then { | |
121 | 117 | let checkPayment = if ((toDeposit >= minAmountDeposit)) | |
122 | 118 | then true | |
123 | 119 | else throwErr("The deposit amount is less than the minimum.") | |
124 | 120 | if ((checkPayment == checkPayment)) | |
125 | 121 | then { | |
126 | 122 | let newBalance = ((currentUserBalance + toDeposit) - fee) | |
127 | 123 | let checkBalance = if ((newBalance > 0)) | |
128 | 124 | then true | |
129 | 125 | else throwErr("The final balance is less than or equal to 0.") | |
130 | 126 | if ((checkBalance == checkBalance)) | |
131 | 127 | then [IntegerEntry(keyBalance(assetA, assetB, userAddress), newBalance), IntegerEntry(keyTotalFeeCollectedDeposit(assetA, assetB), (totalCommissions + fee)), ScriptTransfer(i.caller, (toDeposit - fee), asset)] | |
132 | 128 | else throw("Strict value is not equal to itself.") | |
133 | 129 | } | |
134 | 130 | else throw("Strict value is not equal to itself.") | |
135 | 131 | } | |
136 | 132 | else throw("Strict value is not equal to itself.") | |
137 | 133 | } | |
138 | 134 | ||
139 | 135 | ||
140 | 136 | ||
141 | 137 | @Callable(i) | |
142 | 138 | func initializationSwapAssetsBToA (assetA) = { | |
143 | 139 | let payment = value(i.payments[0]) | |
144 | 140 | let toWithdraw = payment.amount | |
145 | 141 | let assetB = toBase58String(value(payment.assetId)) | |
146 | 142 | let userAddress = toString(i.caller) | |
147 | 143 | let minAmountWithdraw = valueOrErrorMessage(getInteger(keyMinAmountWithdraw(assetA, assetB)), fmtErr("The minimum withdrawal amount for this pair of assets is not set.")) | |
148 | 144 | let assetLockHeight = (height + valueOrErrorMessage(getInteger(keyWithdrawDelay(assetA, assetB)), fmtErr("Withdrawal delay is not set for the specified pair."))) | |
149 | 145 | let currentUserBalance = valueOrErrorMessage(getInteger(keyBalance(assetA, assetB, userAddress)), fmtErr("This user balance does not exist.")) | |
150 | 146 | let totalCommissions = valueOrElse(getInteger(keyTotalFeeCollectedDeposit(assetA, assetB)), 0) | |
151 | 147 | let withdrawFeePermilleKey = keyWithdrawFeePermille(assetA, assetB) | |
152 | 148 | let withdrawFee = valueOrErrorMessage(getInteger(withdrawFeePermilleKey), fmtErr("The withdrawal fee for this pair of assets is not set.")) | |
153 | 149 | let fee = ((toWithdraw / 1000) * withdrawFee) | |
154 | 150 | let newBalance = (currentUserBalance - toWithdraw) | |
155 | 151 | let checkBalance = if ((newBalance >= 0)) | |
156 | 152 | then true | |
157 | 153 | else throwErr("Swap amount fail, amount is to small.") | |
158 | 154 | if ((checkBalance == checkBalance)) | |
159 | 155 | then { | |
160 | 156 | let checkPayment = if ((toWithdraw >= minAmountWithdraw)) | |
161 | 157 | then true | |
162 | 158 | else throwErr("The withdraw amount is less than the minimum.") | |
163 | 159 | if ((checkPayment == checkPayment)) | |
164 | 160 | then { | |
165 | 161 | let checkProcessInProgress = if ((getInteger(keyProcessInProgress(userAddress, assetA, assetB, assetLockHeight)) == unit)) | |
166 | 162 | then true | |
167 | 163 | else throwErr("At this height, there is already an exchange of this pair.") | |
168 | 164 | if ((checkProcessInProgress == checkProcessInProgress)) | |
169 | 165 | then [IntegerEntry(keyBalance(assetA, assetB, userAddress), newBalance), IntegerEntry(keyProcessInProgress(userAddress, assetA, assetB, assetLockHeight), (toWithdraw - fee)), IntegerEntry(keyTotalFeeCollectedDeposit(assetA, assetB), (totalCommissions + fee))] | |
170 | 166 | else throw("Strict value is not equal to itself.") | |
171 | 167 | } | |
172 | 168 | else throw("Strict value is not equal to itself.") | |
173 | 169 | } | |
174 | 170 | else throw("Strict value is not equal to itself.") | |
175 | 171 | } | |
176 | 172 | ||
177 | 173 | ||
178 | 174 | ||
179 | 175 | @Callable(i) | |
180 | 176 | func withdrawAsset (assetA,assetB,heightInKey) = { | |
181 | 177 | let userAddress = toString(i.caller) | |
182 | 178 | let toWithdraw = valueOrErrorMessage(getInteger(keyProcessInProgress(userAddress, assetA, assetB, heightInKey)), fmtErr("At this height, withdraw was not initialized with this pair of assets.")) | |
183 | 179 | let asset = fromBase58String(value(assetA)) | |
184 | 180 | let checkHeight = if ((height >= heightInKey)) | |
185 | 181 | then true | |
186 | 182 | else throwErr((("Withdrawal is possible after " + toString(heightInKey)) + " height or you have already withdrawn.")) | |
187 | 183 | if ((checkHeight == checkHeight)) | |
188 | 184 | then [DeleteEntry(keyProcessInProgress(userAddress, assetA, assetB, heightInKey)), IntegerEntry(keyProcessDone(userAddress, assetA, assetB, heightInKey), toWithdraw), ScriptTransfer(i.caller, toWithdraw, asset)] | |
189 | 185 | else throw("Strict value is not equal to itself.") | |
190 | 186 | } | |
191 | 187 | ||
192 | 188 | ||
193 | 189 | ||
194 | 190 | @Callable(i) | |
195 | 191 | func withdrawFee (assetA,assetB) = { | |
196 | 192 | let checkCaller = mustManager(i) | |
197 | 193 | if ((checkCaller == checkCaller)) | |
198 | 194 | then { | |
199 | 195 | let toWithdrawA = valueOrElse(getInteger(keyTotalFeeCollectedDeposit(assetA, assetB)), 0) | |
200 | 196 | let withdrawAssetA = fromBase58String(value(assetA)) | |
201 | 197 | [IntegerEntry(keyTotalFeeCollectedDeposit(assetA, assetB), 0), ScriptTransfer(i.caller, toWithdrawA, withdrawAssetA)] | |
202 | 198 | } | |
203 | 199 | else throw("Strict value is not equal to itself.") | |
204 | 200 | } | |
205 | 201 | ||
206 | 202 | ||
207 | - | ||
208 | - | @Callable(i) | |
209 | - | func setManager (pendingManagerPublicKey) = { | |
210 | - | let checkCaller = mustManager(i) | |
211 | - | if ((checkCaller == checkCaller)) | |
212 | - | then { | |
213 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
214 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
215 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
216 | - | else throw("Strict value is not equal to itself.") | |
217 | - | } | |
218 | - | else throw("Strict value is not equal to itself.") | |
219 | - | } | |
220 | - | ||
221 | - | ||
222 | - | ||
223 | - | @Callable(i) | |
224 | - | func confirmManager () = { | |
225 | - | let pm = pendingManagerPublicKeyOrUnit() | |
226 | - | let hasPM = if (isDefined(pm)) | |
227 | - | then true | |
228 | - | else throwErr("No pending manager.") | |
229 | - | if ((hasPM == hasPM)) | |
230 | - | then { | |
231 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
232 | - | then true | |
233 | - | else throwErr("You are not pending manager.") | |
234 | - | if ((checkPM == checkPM)) | |
235 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
236 | - | else throw("Strict value is not equal to itself.") | |
237 | - | } | |
238 | - | else throw("Strict value is not equal to itself.") | |
239 | - | } | |
240 | - | ||
241 | - | ||
242 | 203 | @Verifier(tx) | |
243 | 204 | func verify () = { | |
244 | 205 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
245 | 206 | case pk: ByteVector => | |
246 | 207 | pk | |
247 | 208 | case _: Unit => | |
248 | 209 | tx.senderPublicKey | |
249 | 210 | case _ => | |
250 | 211 | throw("Match error") | |
251 | 212 | } | |
252 | 213 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
253 | 214 | } | |
254 | 215 |
github/deemru/w8io/169f3d6 55.10 ms ◑