tx · 6ErSoC9tfjpbNLCLLAwq9Ga9pwhBBG2SBu67Aq6NPigf 3NBV6YavDsu2ProYhUqUac69N8RC8BBTCJN: -0.01000000 Waves 2022.05.09 18:19 [2044306] smart account 3NBV6YavDsu2ProYhUqUac69N8RC8BBTCJN > SELF 0.00000000 Waves
{ "type": 13, "id": "6ErSoC9tfjpbNLCLLAwq9Ga9pwhBBG2SBu67Aq6NPigf", "fee": 1000000, "feeAssetId": null, "timestamp": 1652109604963, "version": 2, "chainId": 84, "sender": "3NBV6YavDsu2ProYhUqUac69N8RC8BBTCJN", "senderPublicKey": "HMwdLbwQuprhi3kaJNPXUEAtXSKEAA8DKYfsrmLYxaWW", "proofs": [ "5DkSmSZg89UTuwzMB9tJoVLWJhcYRKuCKPWx18hYgjNXPfGwgUmW6pVcNbA8LLsrjwP8qo4GzdDFZqtThvasD7DN" ], "script": "base64:AAIFAAAAAAAAAFIIAhIHCgUCAgICARIJCgcCAgEICAEBEgQKAgICEgUKAwICAhIICgYCAgECAgISBAoCCAISAwoBAhIDCgECEgASABIECgICARIDCgEBEgQKAgIEAAAAKQAAAAAPa2V5QXNzZXRBZGRyZXNzAgAAAANfYWEAAAAADGtleUFzc2V0VHlwZQIAAAADX2F0AAAAABFrZXlBc3NldFByZWNpc2lvbgIAAAADX2FwAAAAAA5rZXlBc3NldE1pbkZlZQIAAAAEX2FtZgAAAAAQa2V5QXNzZXRJc0FjdGl2ZQIAAAAEX2FpYQAAAAAQa2V0QmFzZUZlZVJhdGVCUAIAAAAEX2JmcgAAAAAMa2V5VmFsaWRhdG9yAgAAAAJfdgAAAAAPa2V5RmVlQ29sbGVjdG9yAgAAAANfZmMAAAAAD2tleVVubG9ja1NpZ25lcgIAAAADX3VzAAAAAAtrZXlJc0FjdGl2ZQIAAAADX2lhAAAAAAprZXlNYW5hZ2VyAgAAAAJfbQAAAAAOQlJJREdFX01BTkFHRVICAAAADkJSSURHRV9NQU5BR0VSAAAAAA1BU1NFVF9NQU5BR0VSAg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QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABaQEAAAAOc2V0QmFzZUZlZVJhdGUAAAABAAAADWJhc2VGZWVSYXRlQlAEAAAAC2NhbGxlckNoZWNrCQEAAAAVYXNzZXJ0Q2FsbGVySXNNYW5hZ2VyAAAAAgUAAAABaQUAAAAOQlJJREdFX01BTkFHRVIDCQAAAAAAAAIFAAAAC2NhbGxlckNoZWNrBQAAAAtjYWxsZXJDaGVjawkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAQa2V0QmFzZUZlZVJhdGVCUAUAAAANYmFzZUZlZVJhdGVCUAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAFpAQAAAA1zZXRBc3NldFN0YXRlAAAAAgAAAAdhc3NldElkAAAABXN0YXRlBAAAAAtjYWxsZXJDaGVjawkBAAAAFWFzc2VydENhbGxlcklzTWFuYWdlcgAAAAIFAAAAAWkFAAAADkJSSURHRV9NQU5BR0VSAwkAAAAAAAACBQAAAAtjYWxsZXJDaGVjawUAAAALY2FsbGVyQ2hlY2sEAAAACmFzc2V0SWRTdHIJAAJaAAAAAQUAAAAHYXNzZXRJZAkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgkAASwAAAACBQAAAAphc3NldElkU3RyBQAAABBrZXlBc3NldElzQWN0aXZlBQAAAAVzdGF0ZQUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAABzmHYt", "height": 2044306, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8NXo6LJRLkxcSdf1yB48ecExcpEjtQA75rFXtEP8C3Ka Next: Ackk3pwzabjaxB36jNgnzEzwBbLCRSLxVVg4KjpndFu6 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let keyAssetAddress = "_aa" | |
5 | 5 | ||
6 | 6 | let keyAssetType = "_at" | |
7 | 7 | ||
8 | 8 | let keyAssetPrecision = "_ap" | |
9 | 9 | ||
10 | 10 | let keyAssetMinFee = "_amf" | |
11 | 11 | ||
12 | 12 | let keyAssetIsActive = "_aia" | |
13 | 13 | ||
14 | 14 | let ketBaseFeeRateBP = "_bfr" | |
15 | 15 | ||
16 | 16 | let keyValidator = "_v" | |
17 | 17 | ||
18 | 18 | let keyFeeCollector = "_fc" | |
19 | 19 | ||
20 | 20 | let keyUnlockSigner = "_us" | |
21 | 21 | ||
22 | 22 | let keyIsActive = "_ia" | |
23 | 23 | ||
24 | 24 | let keyManager = "_m" | |
25 | 25 | ||
26 | 26 | let BRIDGE_MANAGER = "BRIDGE_MANAGER" | |
27 | 27 | ||
28 | 28 | let ASSET_MANAGER = "ASSET_MANAGER" | |
29 | 29 | ||
30 | 30 | let STOP_MANAGER = "STOP_MANAGER" | |
31 | 31 | ||
32 | 32 | let baseAssetSourceAndAddress = base58'FbV8QW7Jusz' | |
33 | 33 | ||
34 | 34 | let baseAssetId = base58'3EMsPJ' | |
35 | 35 | ||
36 | 36 | let chainWaves = base58'3EMsPJ' | |
37 | 37 | ||
38 | 38 | let BP = 10000 | |
39 | 39 | ||
40 | 40 | let systemPrecision = 9 | |
41 | 41 | ||
42 | 42 | let errUnauthorized = "unauthorized" | |
43 | 43 | ||
44 | 44 | let errUninitialized = "uninitialized" | |
45 | 45 | ||
46 | 46 | let errInitialized = "initialized" | |
47 | 47 | ||
48 | 48 | let errAlreadyExists = "exists" | |
49 | 49 | ||
50 | 50 | let errNotExists = "not exists" | |
51 | 51 | ||
52 | 52 | let errInvalidValues = "invalid values" | |
53 | 53 | ||
54 | 54 | let errNotOnePayment = "not one payment" | |
55 | 55 | ||
56 | 56 | let errAssetNotFound = "asset not found" | |
57 | 57 | ||
58 | 58 | let errNotEnoughBalance = "not enough balance" | |
59 | 59 | ||
60 | 60 | let errBigPowValue = "pow value too big" | |
61 | 61 | ||
62 | 62 | let errBridgeDisabled = "birdge is disabled" | |
63 | 63 | ||
64 | 64 | let errAssetDisabled = "asset is disabled" | |
65 | 65 | ||
66 | 66 | let typeBase = 0 | |
67 | 67 | ||
68 | 68 | let typeNative = 1 | |
69 | 69 | ||
70 | 70 | let typeWrapped = 2 | |
71 | 71 | ||
72 | 72 | func assertCallerIsManager (i,managerType) = match getBinary((managerType + keyManager)) { | |
73 | 73 | case authority: ByteVector => | |
74 | 74 | if ((authority != i.caller.bytes)) | |
75 | 75 | then throw(errUnauthorized) | |
76 | 76 | else unit | |
77 | 77 | case _ => | |
78 | 78 | throw(errUninitialized) | |
79 | 79 | } | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func assertBridgeIsActive () = if (!(valueOrElse(getBoolean(keyIsActive), false))) | |
83 | 83 | then throw(errBridgeDisabled) | |
84 | 84 | else unit | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func assertAssetIsActive (assetIdStr) = match getBoolean((assetIdStr + keyAssetIsActive)) { | |
88 | 88 | case isActive: Boolean => | |
89 | 89 | if (isActive) | |
90 | 90 | then unit | |
91 | 91 | else throw(errAssetDisabled) | |
92 | 92 | case _ => | |
93 | 93 | throw(errAssetNotFound) | |
94 | 94 | } | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func getFee (amount,assetIdStr) = { | |
98 | 98 | let baseFeeRateBP = valueOrErrorMessage(getInteger(ketBaseFeeRateBP), errUninitialized) | |
99 | 99 | let minFee = valueOrErrorMessage(getInteger((assetIdStr + keyAssetMinFee)), errAssetNotFound) | |
100 | 100 | let fee = ((amount * baseFeeRateBP) / BP) | |
101 | 101 | if ((minFee > fee)) | |
102 | 102 | then minFee | |
103 | 103 | else fee | |
104 | 104 | } | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func pow10 (value,power) = { | |
108 | 108 | let absPow = if ((0 > power)) | |
109 | 109 | then -(power) | |
110 | 110 | else power | |
111 | 111 | let powerValue = if ((absPow == 0)) | |
112 | 112 | then 1 | |
113 | 113 | else if ((absPow == 1)) | |
114 | 114 | then 10 | |
115 | 115 | else if ((absPow == 2)) | |
116 | 116 | then 100 | |
117 | 117 | else if ((absPow == 3)) | |
118 | 118 | then 1000 | |
119 | 119 | else if ((absPow == 4)) | |
120 | 120 | then 10000 | |
121 | 121 | else if ((absPow == 5)) | |
122 | 122 | then 100000 | |
123 | 123 | else if ((absPow == 6)) | |
124 | 124 | then 1000000 | |
125 | 125 | else if ((absPow == 7)) | |
126 | 126 | then 10000000 | |
127 | 127 | else if ((absPow == 8)) | |
128 | 128 | then 100000000 | |
129 | 129 | else if ((absPow == 9)) | |
130 | 130 | then 1000000000 | |
131 | 131 | else throw(errBigPowValue) | |
132 | 132 | if ((0 > power)) | |
133 | 133 | then (value / powerValue) | |
134 | 134 | else (value * powerValue) | |
135 | 135 | } | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func toSystemPrecision (amount,precision) = pow10(amount, (systemPrecision - precision)) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func fromSystemPrecision (amount,precision) = pow10(amount, (precision - systemPrecision)) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | @Callable(i) | |
145 | 145 | func setConfig (admin,validatorAddress,feeCollector,unlockSigner,baseFeeRateBP) = if (isDefined(getBinary((BRIDGE_MANAGER + keyManager)))) | |
146 | 146 | then throw(errInitialized) | |
147 | 147 | else [BinaryEntry((BRIDGE_MANAGER + keyManager), admin), BinaryEntry(keyValidator, validatorAddress), BinaryEntry(keyFeeCollector, feeCollector), BinaryEntry(keyUnlockSigner, unlockSigner), IntegerEntry(ketBaseFeeRateBP, baseFeeRateBP), BooleanEntry(keyIsActive, true)] | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | ||
151 | 151 | @Callable(i) | |
152 | 152 | func addAsset (assetSourceAndAddress,assetIdArg,type,name,description,precision,minFee) = { | |
153 | 153 | let callerCheck = assertCallerIsManager(i, ASSET_MANAGER) | |
154 | 154 | if ((callerCheck == callerCheck)) | |
155 | 155 | then { | |
156 | 156 | let $t040994858 = if ((type == typeBase)) | |
157 | 157 | then if (if (if ((assetSourceAndAddress != baseAssetSourceAndAddress)) | |
158 | 158 | then true | |
159 | 159 | else (assetIdArg != baseAssetId)) | |
160 | 160 | then true | |
161 | 161 | else (precision != 8)) | |
162 | 162 | then throw(errInvalidValues) | |
163 | 163 | else $Tuple2(nil, assetIdArg) | |
164 | 164 | else if ((type == typeNative)) | |
165 | 165 | then $Tuple2(nil, assetIdArg) | |
166 | 166 | else if ((type == typeWrapped)) | |
167 | 167 | then if ((size(assetIdArg) == 0)) | |
168 | 168 | then { | |
169 | 169 | let issue = Issue(name, description, 0, precision, true) | |
170 | 170 | $Tuple2([issue], calculateAssetId(issue)) | |
171 | 171 | } | |
172 | 172 | else $Tuple2(nil, assetIdArg) | |
173 | 173 | else throw(errInvalidValues) | |
174 | 174 | let actions = $t040994858._1 | |
175 | 175 | let assetId = $t040994858._2 | |
176 | 176 | let assetIdStr = toBase64String(assetId) | |
177 | 177 | let keySourceAddress = (toBase64String(assetSourceAndAddress) + keyAssetAddress) | |
178 | 178 | let keyNativeAddress = (assetIdStr + keyAssetAddress) | |
179 | 179 | if (if (isDefined(getBinary(keySourceAddress))) | |
180 | 180 | then true | |
181 | 181 | else isDefined(getBinary(keyNativeAddress))) | |
182 | 182 | then throw(errAlreadyExists) | |
183 | 183 | else (actions ++ [BinaryEntry(keySourceAddress, assetId), BinaryEntry(keyNativeAddress, assetSourceAndAddress), IntegerEntry((assetIdStr + keyAssetType), type), IntegerEntry((assetIdStr + keyAssetPrecision), precision), IntegerEntry((assetIdStr + keyAssetMinFee), minFee), BooleanEntry((assetIdStr + keyAssetIsActive), true)]) | |
184 | 184 | } | |
185 | 185 | else throw("Strict value is not equal to itself.") | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | ||
190 | 190 | @Callable(i) | |
191 | 191 | func removeAsset (assetSourceAndAddress,newAuthority) = { | |
192 | 192 | let callerCheck = assertCallerIsManager(i, ASSET_MANAGER) | |
193 | 193 | if ((callerCheck == callerCheck)) | |
194 | 194 | then { | |
195 | 195 | let keySourceAddress = (toBase64String(assetSourceAndAddress) + keyAssetAddress) | |
196 | 196 | let assetId = valueOrErrorMessage(getBinary(keySourceAddress), errNotExists) | |
197 | 197 | let assetIdStr = toBase64String(assetId) | |
198 | 198 | let type = valueOrErrorMessage(getInteger((assetIdStr + keyAssetType)), errNotExists) | |
199 | 199 | let actions = if ((type == typeBase)) | |
200 | 200 | then { | |
201 | 201 | let balance = wavesBalance(this) | |
202 | 202 | if ((balance.available > 0)) | |
203 | 203 | then [ScriptTransfer(Address(newAuthority), balance.available, unit)] | |
204 | 204 | else nil | |
205 | 205 | } | |
206 | 206 | else if ((type == typeNative)) | |
207 | 207 | then { | |
208 | 208 | let balance = assetBalance(this, assetId) | |
209 | 209 | if ((balance > 0)) | |
210 | 210 | then [ScriptTransfer(Address(newAuthority), balance, assetId)] | |
211 | 211 | else nil | |
212 | 212 | } | |
213 | 213 | else if ((type == typeWrapped)) | |
214 | 214 | then nil | |
215 | 215 | else throw(errInvalidValues) | |
216 | 216 | (actions ++ [DeleteEntry(keySourceAddress), DeleteEntry((assetIdStr + keyAssetAddress)), DeleteEntry((assetIdStr + keyAssetType)), DeleteEntry((assetIdStr + keyAssetPrecision)), DeleteEntry((assetIdStr + keyAssetMinFee)), DeleteEntry((assetIdStr + keyAssetIsActive))]) | |
217 | 217 | } | |
218 | 218 | else throw("Strict value is not equal to itself.") | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | ||
223 | 223 | @Callable(i) | |
224 | 224 | func lock (lockId,recipient,destination) = { | |
225 | 225 | let birdgeCheck = assertBridgeIsActive() | |
226 | 226 | if ((birdgeCheck == birdgeCheck)) | |
227 | 227 | then if ((size(i.payments) != 1)) | |
228 | 228 | then throw(errNotOnePayment) | |
229 | 229 | else { | |
230 | 230 | let assetId = valueOrElse(i.payments[0].assetId, baseAssetId) | |
231 | 231 | let assetIdStr = toBase64String(assetId) | |
232 | 232 | let assetCheck = assertAssetIsActive(assetIdStr) | |
233 | 233 | if ((assetCheck == assetCheck)) | |
234 | 234 | then { | |
235 | 235 | let amount = i.payments[0].amount | |
236 | 236 | let validatorAddress = valueOrErrorMessage(getBinary(keyValidator), errUninitialized) | |
237 | 237 | let fee = getFee(amount, assetIdStr) | |
238 | 238 | let amountWithoutFee = (amount - fee) | |
239 | 239 | if ((0 >= amountWithoutFee)) | |
240 | 240 | then throw(errNotEnoughBalance) | |
241 | 241 | else { | |
242 | 242 | let assetSourceAndAddress = valueOrErrorMessage(getBinary((assetIdStr + keyAssetAddress)), errAssetNotFound) | |
243 | 243 | let type = valueOrErrorMessage(getInteger((assetIdStr + keyAssetType)), errAssetNotFound) | |
244 | 244 | let precision = valueOrErrorMessage(getInteger((assetIdStr + keyAssetPrecision)), errAssetNotFound) | |
245 | 245 | let feeCollector = valueOrErrorMessage(getBinary(keyFeeCollector), errUninitialized) | |
246 | 246 | let createLock = invoke(Address(validatorAddress), "createLock", [lockId, recipient, toSystemPrecision(amountWithoutFee, precision), destination, assetSourceAndAddress], nil) | |
247 | 247 | if ((createLock == createLock)) | |
248 | 248 | then if ((type == typeBase)) | |
249 | 249 | then [ScriptTransfer(Address(feeCollector), fee, unit)] | |
250 | 250 | else if ((type == typeNative)) | |
251 | 251 | then [ScriptTransfer(Address(feeCollector), fee, assetId)] | |
252 | 252 | else if ((type == typeWrapped)) | |
253 | 253 | then [Burn(assetId, amountWithoutFee), ScriptTransfer(Address(feeCollector), fee, assetId)] | |
254 | 254 | else throw(errInvalidValues) | |
255 | 255 | else throw("Strict value is not equal to itself.") | |
256 | 256 | } | |
257 | 257 | } | |
258 | 258 | else throw("Strict value is not equal to itself.") | |
259 | 259 | } | |
260 | 260 | else throw("Strict value is not equal to itself.") | |
261 | 261 | } | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | ||
265 | 265 | @Callable(i) | |
266 | 266 | func unlock (lockId,recipient,amount,lockSource,assetSourceAndAddress,signature) = { | |
267 | 267 | let birdgeCheck = assertBridgeIsActive() | |
268 | 268 | if ((birdgeCheck == birdgeCheck)) | |
269 | 269 | then { | |
270 | 270 | let assetId = valueOrErrorMessage(getBinary((toBase64String(assetSourceAndAddress) + keyAssetAddress)), errAssetNotFound) | |
271 | 271 | let assetIdStr = toBase64String(assetId) | |
272 | 272 | let type = valueOrErrorMessage(getInteger((assetIdStr + keyAssetType)), errAssetNotFound) | |
273 | 273 | let precision = valueOrErrorMessage(getInteger((assetIdStr + keyAssetPrecision)), errAssetNotFound) | |
274 | 274 | let validatorAddress = valueOrErrorMessage(getBinary(keyValidator), errUninitialized) | |
275 | 275 | let unlockSigner = valueOrErrorMessage(getBinary(keyUnlockSigner), errUninitialized) | |
276 | 276 | let feeCollector = valueOrErrorMessage(getBinary(keyFeeCollector), errUninitialized) | |
277 | 277 | let createUnlock = invoke(Address(validatorAddress), "createUnlock", [lockId, recipient, amount, lockSource, assetSourceAndAddress, signature], nil) | |
278 | 278 | if ((createUnlock == createUnlock)) | |
279 | 279 | then { | |
280 | 280 | let isValid = match createUnlock { | |
281 | 281 | case v: Boolean => | |
282 | 282 | v | |
283 | 283 | case _ => | |
284 | 284 | false | |
285 | 285 | } | |
286 | 286 | if (!(isValid)) | |
287 | 287 | then throw(errInvalidValues) | |
288 | 288 | else { | |
289 | 289 | let fee = if ((unlockSigner == i.caller.bytes)) | |
290 | 290 | then valueOrErrorMessage(getInteger((assetIdStr + keyAssetMinFee)), errAssetNotFound) | |
291 | 291 | else 0 | |
292 | 292 | let amountToSend = fromSystemPrecision(amount, precision) | |
293 | 293 | let amountToSendWithoutFee = (amountToSend - fee) | |
294 | 294 | if ((0 >= amountToSendWithoutFee)) | |
295 | 295 | then throw(errNotEnoughBalance) | |
296 | 296 | else if ((type == typeBase)) | |
297 | 297 | then ([ScriptTransfer(Address(recipient), amountToSendWithoutFee, unit)] ++ (if ((fee > 0)) | |
298 | 298 | then [ScriptTransfer(Address(feeCollector), fee, unit)] | |
299 | 299 | else nil)) | |
300 | 300 | else if ((type == typeNative)) | |
301 | 301 | then ([ScriptTransfer(Address(recipient), amountToSendWithoutFee, assetId)] ++ (if ((fee > 0)) | |
302 | 302 | then [ScriptTransfer(Address(feeCollector), fee, assetId)] | |
303 | 303 | else nil)) | |
304 | 304 | else if ((type == typeWrapped)) | |
305 | 305 | then ([Reissue(assetId, amountToSend, true), ScriptTransfer(Address(recipient), amountToSendWithoutFee, assetId)] ++ (if ((fee > 0)) | |
306 | 306 | then [ScriptTransfer(Address(feeCollector), fee, assetId)] | |
307 | 307 | else nil)) | |
308 | 308 | else throw(errInvalidValues) | |
309 | 309 | } | |
310 | 310 | } | |
311 | 311 | else throw("Strict value is not equal to itself.") | |
312 | 312 | } | |
313 | 313 | else throw("Strict value is not equal to itself.") | |
314 | 314 | } | |
315 | 315 | ||
316 | 316 | ||
317 | 317 | ||
318 | 318 | @Callable(i) | |
319 | 319 | func setManager (managerType,manager) = { | |
320 | 320 | let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER) | |
321 | 321 | if ((callerCheck == callerCheck)) | |
322 | 322 | then [BinaryEntry((managerType + keyManager), manager)] | |
323 | 323 | else throw("Strict value is not equal to itself.") | |
324 | 324 | } | |
325 | 325 | ||
326 | 326 | ||
327 | 327 | ||
328 | 328 | @Callable(i) | |
329 | 329 | func setFeeCollector (feeCollector) = { | |
330 | 330 | let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER) | |
331 | 331 | if ((callerCheck == callerCheck)) | |
332 | 332 | then [BinaryEntry(keyFeeCollector, feeCollector)] | |
333 | 333 | else throw("Strict value is not equal to itself.") | |
334 | 334 | } | |
335 | 335 | ||
336 | 336 | ||
337 | 337 | ||
338 | 338 | @Callable(i) | |
339 | 339 | func setValidator (validator) = { | |
340 | 340 | let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER) | |
341 | 341 | if ((callerCheck == callerCheck)) | |
342 | 342 | then [BinaryEntry(keyValidator, validator)] | |
343 | 343 | else throw("Strict value is not equal to itself.") | |
344 | 344 | } | |
345 | 345 | ||
346 | 346 | ||
347 | 347 | ||
348 | 348 | @Callable(i) | |
349 | 349 | func startBridge () = { | |
350 | 350 | let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER) | |
351 | 351 | if ((callerCheck == callerCheck)) | |
352 | 352 | then [BooleanEntry(keyIsActive, true)] | |
353 | 353 | else throw("Strict value is not equal to itself.") | |
354 | 354 | } | |
355 | 355 | ||
356 | 356 | ||
357 | 357 | ||
358 | 358 | @Callable(i) | |
359 | 359 | func stopBridge () = { | |
360 | 360 | let callerCheck = assertCallerIsManager(i, STOP_MANAGER) | |
361 | 361 | if ((callerCheck == callerCheck)) | |
362 | 362 | then [BooleanEntry(keyIsActive, false)] | |
363 | 363 | else throw("Strict value is not equal to itself.") | |
364 | 364 | } | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | ||
368 | 368 | @Callable(i) | |
369 | 369 | func setMinFee (assetId,minFee) = { | |
370 | 370 | let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER) | |
371 | 371 | if ((callerCheck == callerCheck)) | |
372 | 372 | then { | |
373 | 373 | let assetIdStr = toBase64String(assetId) | |
374 | 374 | [IntegerEntry((assetIdStr + keyAssetMinFee), minFee)] | |
375 | 375 | } | |
376 | 376 | else throw("Strict value is not equal to itself.") | |
377 | 377 | } | |
378 | 378 | ||
379 | 379 | ||
380 | 380 | ||
381 | 381 | @Callable(i) | |
382 | 382 | func setBaseFeeRate (baseFeeRateBP) = { | |
383 | 383 | let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER) | |
384 | 384 | if ((callerCheck == callerCheck)) | |
385 | 385 | then [IntegerEntry(ketBaseFeeRateBP, baseFeeRateBP)] | |
386 | 386 | else throw("Strict value is not equal to itself.") | |
387 | 387 | } | |
388 | 388 | ||
389 | 389 | ||
390 | 390 | ||
391 | 391 | @Callable(i) | |
392 | 392 | func setAssetState (assetId,state) = { | |
393 | 393 | let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER) | |
394 | 394 | if ((callerCheck == callerCheck)) | |
395 | 395 | then { | |
396 | 396 | let assetIdStr = toBase64String(assetId) | |
397 | 397 | [BooleanEntry((assetIdStr + keyAssetIsActive), state)] | |
398 | 398 | } | |
399 | 399 | else throw("Strict value is not equal to itself.") | |
400 | 400 | } | |
401 | 401 | ||
402 | 402 |
github/deemru/w8io/026f985 38.25 ms ◑