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