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:AAIFAAAAAAAAAFIIAhIHCgUCAgICARIJCgcCAgEICAEBEgQKAgICEgUKAwICAhIICgYCAgECAgISBAoCCAISAwoBAhIDCgECEgASABIECgICARIDCgEBEgQKAgIEAAAAKQAAAAAPa2V5QXNzZXRBZGRyZXNzAgAAAANfYWEAAAAADGtleUFzc2V0VHlwZQIAAAADX2F0AAAAABFrZXlBc3NldFByZWNpc2lvbgIAAAADX2FwAAAAAA5rZXlBc3NldE1pbkZlZQIAAAAEX2FtZgAAAAAQa2V5QXNzZXRJc0FjdGl2ZQIAAAAEX2FpYQAAAAAQa2V0QmFzZUZlZVJhdGVCUAIAAAAEX2JmcgAAAAAMa2V5VmFsaWRhdG9yAgAAAAJfdgAAAAAPa2V5RmVlQ29sbGVjdG9yAgAAAANfZmMAAAAAD2tleVVubG9ja1NpZ25lcgIAAAADX3VzAAAAAAtrZXlJc0FjdGl2ZQIAAAADX2lhAAAAAAprZXlNYW5hZ2VyAgAAAAJfbQAAAAAOQlJJREdFX01BTkFHRVICAAAADkJSSURHRV9NQU5BR0VSAAAAAA1BU1NFVF9NQU5BR0VSA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3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABaQEAAAAOc2V0QmFzZUZlZVJhdGUAAAABAAAADWJhc2VGZWVSYXRlQlAEAAAAC2NhbGxlckNoZWNrCQEAAAAVYXNzZXJ0Q2FsbGVySXNNYW5hZ2VyAAAAAgUAAAABaQUAAAAOQlJJREdFX01BTkFHRVIDCQAAAAAAAAIFAAAAC2NhbGxlckNoZWNrBQAAAAtjYWxsZXJDaGVjawkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAQa2V0QmFzZUZlZVJhdGVCUAUAAAANYmFzZUZlZVJhdGVCUAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAFpAQAAAA1zZXRBc3NldFN0YXRlAAAAAgAAAAdhc3NldElkAAAABXN0YXRlBAAAAAtjYWxsZXJDaGVjawkBAAAAFWFzc2VydENhbGxlcklzTWFuYWdlcgAAAAIFAAAAAWkFAAAADkJSSURHRV9NQU5BR0VSAwkAAAAAAAACBQAAAAtjYWxsZXJDaGVjawUAAAALY2FsbGVyQ2hlY2sEAAAACmFzc2V0SWRTdHIJAAJaAAAAAQUAAAAHYXNzZXRJZAkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgkAASwAAAACBQAAAAphc3NldElkU3RyBQAAABBrZXlBc3NldElzQWN0aXZlBQAAAAVzdGF0ZQUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAABzmHYt", "height": 2044306, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8NXo6LJRLkxcSdf1yB48ecExcpEjtQA75rFXtEP8C3Ka Next: Ackk3pwzabjaxB36jNgnzEzwBbLCRSLxVVg4KjpndFu6 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyAssetAddress = "_aa"
55
66 let keyAssetType = "_at"
77
88 let keyAssetPrecision = "_ap"
99
1010 let keyAssetMinFee = "_amf"
1111
1212 let keyAssetIsActive = "_aia"
1313
1414 let ketBaseFeeRateBP = "_bfr"
1515
1616 let keyValidator = "_v"
1717
1818 let keyFeeCollector = "_fc"
1919
2020 let keyUnlockSigner = "_us"
2121
2222 let keyIsActive = "_ia"
2323
2424 let keyManager = "_m"
2525
2626 let BRIDGE_MANAGER = "BRIDGE_MANAGER"
2727
2828 let ASSET_MANAGER = "ASSET_MANAGER"
2929
3030 let STOP_MANAGER = "STOP_MANAGER"
3131
3232 let baseAssetSourceAndAddress = base58'FbV8QW7Jusz'
3333
3434 let baseAssetId = base58'3EMsPJ'
3535
3636 let chainWaves = base58'3EMsPJ'
3737
3838 let BP = 10000
3939
4040 let systemPrecision = 9
4141
4242 let errUnauthorized = "unauthorized"
4343
4444 let errUninitialized = "uninitialized"
4545
4646 let errInitialized = "initialized"
4747
4848 let errAlreadyExists = "exists"
4949
5050 let errNotExists = "not exists"
5151
5252 let errInvalidValues = "invalid values"
5353
5454 let errNotOnePayment = "not one payment"
5555
5656 let errAssetNotFound = "asset not found"
5757
5858 let errNotEnoughBalance = "not enough balance"
5959
6060 let errBigPowValue = "pow value too big"
6161
6262 let errBridgeDisabled = "birdge is disabled"
6363
6464 let errAssetDisabled = "asset is disabled"
6565
6666 let typeBase = 0
6767
6868 let typeNative = 1
6969
7070 let typeWrapped = 2
7171
7272 func assertCallerIsManager (i,managerType) = match getBinary((managerType + keyManager)) {
7373 case authority: ByteVector =>
7474 if ((authority != i.caller.bytes))
7575 then throw(errUnauthorized)
7676 else unit
7777 case _ =>
7878 throw(errUninitialized)
7979 }
8080
8181
8282 func assertBridgeIsActive () = if (!(valueOrElse(getBoolean(keyIsActive), false)))
8383 then throw(errBridgeDisabled)
8484 else unit
8585
8686
8787 func assertAssetIsActive (assetIdStr) = match getBoolean((assetIdStr + keyAssetIsActive)) {
8888 case isActive: Boolean =>
8989 if (isActive)
9090 then unit
9191 else throw(errAssetDisabled)
9292 case _ =>
9393 throw(errAssetNotFound)
9494 }
9595
9696
9797 func getFee (amount,assetIdStr) = {
9898 let baseFeeRateBP = valueOrErrorMessage(getInteger(ketBaseFeeRateBP), errUninitialized)
9999 let minFee = valueOrErrorMessage(getInteger((assetIdStr + keyAssetMinFee)), errAssetNotFound)
100100 let fee = ((amount * baseFeeRateBP) / BP)
101101 if ((minFee > fee))
102102 then minFee
103103 else fee
104104 }
105105
106106
107107 func pow10 (value,power) = {
108108 let absPow = if ((0 > power))
109109 then -(power)
110110 else power
111111 let powerValue = if ((absPow == 0))
112112 then 1
113113 else if ((absPow == 1))
114114 then 10
115115 else if ((absPow == 2))
116116 then 100
117117 else if ((absPow == 3))
118118 then 1000
119119 else if ((absPow == 4))
120120 then 10000
121121 else if ((absPow == 5))
122122 then 100000
123123 else if ((absPow == 6))
124124 then 1000000
125125 else if ((absPow == 7))
126126 then 10000000
127127 else if ((absPow == 8))
128128 then 100000000
129129 else if ((absPow == 9))
130130 then 1000000000
131131 else throw(errBigPowValue)
132132 if ((0 > power))
133133 then (value / powerValue)
134134 else (value * powerValue)
135135 }
136136
137137
138138 func toSystemPrecision (amount,precision) = pow10(amount, (systemPrecision - precision))
139139
140140
141141 func fromSystemPrecision (amount,precision) = pow10(amount, (precision - systemPrecision))
142142
143143
144144 @Callable(i)
145145 func setConfig (admin,validatorAddress,feeCollector,unlockSigner,baseFeeRateBP) = if (isDefined(getBinary((BRIDGE_MANAGER + keyManager))))
146146 then throw(errInitialized)
147147 else [BinaryEntry((BRIDGE_MANAGER + keyManager), admin), BinaryEntry(keyValidator, validatorAddress), BinaryEntry(keyFeeCollector, feeCollector), BinaryEntry(keyUnlockSigner, unlockSigner), IntegerEntry(ketBaseFeeRateBP, baseFeeRateBP), BooleanEntry(keyIsActive, true)]
148148
149149
150150
151151 @Callable(i)
152152 func addAsset (assetSourceAndAddress,assetIdArg,type,name,description,precision,minFee) = {
153153 let callerCheck = assertCallerIsManager(i, ASSET_MANAGER)
154154 if ((callerCheck == callerCheck))
155155 then {
156156 let $t040994858 = if ((type == typeBase))
157157 then if (if (if ((assetSourceAndAddress != baseAssetSourceAndAddress))
158158 then true
159159 else (assetIdArg != baseAssetId))
160160 then true
161161 else (precision != 8))
162162 then throw(errInvalidValues)
163163 else $Tuple2(nil, assetIdArg)
164164 else if ((type == typeNative))
165165 then $Tuple2(nil, assetIdArg)
166166 else if ((type == typeWrapped))
167167 then if ((size(assetIdArg) == 0))
168168 then {
169169 let issue = Issue(name, description, 0, precision, true)
170170 $Tuple2([issue], calculateAssetId(issue))
171171 }
172172 else $Tuple2(nil, assetIdArg)
173173 else throw(errInvalidValues)
174174 let actions = $t040994858._1
175175 let assetId = $t040994858._2
176176 let assetIdStr = toBase64String(assetId)
177177 let keySourceAddress = (toBase64String(assetSourceAndAddress) + keyAssetAddress)
178178 let keyNativeAddress = (assetIdStr + keyAssetAddress)
179179 if (if (isDefined(getBinary(keySourceAddress)))
180180 then true
181181 else isDefined(getBinary(keyNativeAddress)))
182182 then throw(errAlreadyExists)
183183 else (actions ++ [BinaryEntry(keySourceAddress, assetId), BinaryEntry(keyNativeAddress, assetSourceAndAddress), IntegerEntry((assetIdStr + keyAssetType), type), IntegerEntry((assetIdStr + keyAssetPrecision), precision), IntegerEntry((assetIdStr + keyAssetMinFee), minFee), BooleanEntry((assetIdStr + keyAssetIsActive), true)])
184184 }
185185 else throw("Strict value is not equal to itself.")
186186 }
187187
188188
189189
190190 @Callable(i)
191191 func removeAsset (assetSourceAndAddress,newAuthority) = {
192192 let callerCheck = assertCallerIsManager(i, ASSET_MANAGER)
193193 if ((callerCheck == callerCheck))
194194 then {
195195 let keySourceAddress = (toBase64String(assetSourceAndAddress) + keyAssetAddress)
196196 let assetId = valueOrErrorMessage(getBinary(keySourceAddress), errNotExists)
197197 let assetIdStr = toBase64String(assetId)
198198 let type = valueOrErrorMessage(getInteger((assetIdStr + keyAssetType)), errNotExists)
199199 let actions = if ((type == typeBase))
200200 then {
201201 let balance = wavesBalance(this)
202202 if ((balance.available > 0))
203203 then [ScriptTransfer(Address(newAuthority), balance.available, unit)]
204204 else nil
205205 }
206206 else if ((type == typeNative))
207207 then {
208208 let balance = assetBalance(this, assetId)
209209 if ((balance > 0))
210210 then [ScriptTransfer(Address(newAuthority), balance, assetId)]
211211 else nil
212212 }
213213 else if ((type == typeWrapped))
214214 then nil
215215 else throw(errInvalidValues)
216216 (actions ++ [DeleteEntry(keySourceAddress), DeleteEntry((assetIdStr + keyAssetAddress)), DeleteEntry((assetIdStr + keyAssetType)), DeleteEntry((assetIdStr + keyAssetPrecision)), DeleteEntry((assetIdStr + keyAssetMinFee)), DeleteEntry((assetIdStr + keyAssetIsActive))])
217217 }
218218 else throw("Strict value is not equal to itself.")
219219 }
220220
221221
222222
223223 @Callable(i)
224224 func lock (lockId,recipient,destination) = {
225225 let birdgeCheck = assertBridgeIsActive()
226226 if ((birdgeCheck == birdgeCheck))
227227 then if ((size(i.payments) != 1))
228228 then throw(errNotOnePayment)
229229 else {
230230 let assetId = valueOrElse(i.payments[0].assetId, baseAssetId)
231231 let assetIdStr = toBase64String(assetId)
232232 let assetCheck = assertAssetIsActive(assetIdStr)
233233 if ((assetCheck == assetCheck))
234234 then {
235235 let amount = i.payments[0].amount
236236 let validatorAddress = valueOrErrorMessage(getBinary(keyValidator), errUninitialized)
237237 let fee = getFee(amount, assetIdStr)
238238 let amountWithoutFee = (amount - fee)
239239 if ((0 >= amountWithoutFee))
240240 then throw(errNotEnoughBalance)
241241 else {
242242 let assetSourceAndAddress = valueOrErrorMessage(getBinary((assetIdStr + keyAssetAddress)), errAssetNotFound)
243243 let type = valueOrErrorMessage(getInteger((assetIdStr + keyAssetType)), errAssetNotFound)
244244 let precision = valueOrErrorMessage(getInteger((assetIdStr + keyAssetPrecision)), errAssetNotFound)
245245 let feeCollector = valueOrErrorMessage(getBinary(keyFeeCollector), errUninitialized)
246246 let createLock = invoke(Address(validatorAddress), "createLock", [lockId, recipient, toSystemPrecision(amountWithoutFee, precision), destination, assetSourceAndAddress], nil)
247247 if ((createLock == createLock))
248248 then if ((type == typeBase))
249249 then [ScriptTransfer(Address(feeCollector), fee, unit)]
250250 else if ((type == typeNative))
251251 then [ScriptTransfer(Address(feeCollector), fee, assetId)]
252252 else if ((type == typeWrapped))
253253 then [Burn(assetId, amountWithoutFee), ScriptTransfer(Address(feeCollector), fee, assetId)]
254254 else throw(errInvalidValues)
255255 else throw("Strict value is not equal to itself.")
256256 }
257257 }
258258 else throw("Strict value is not equal to itself.")
259259 }
260260 else throw("Strict value is not equal to itself.")
261261 }
262262
263263
264264
265265 @Callable(i)
266266 func unlock (lockId,recipient,amount,lockSource,assetSourceAndAddress,signature) = {
267267 let birdgeCheck = assertBridgeIsActive()
268268 if ((birdgeCheck == birdgeCheck))
269269 then {
270270 let assetId = valueOrErrorMessage(getBinary((toBase64String(assetSourceAndAddress) + keyAssetAddress)), errAssetNotFound)
271271 let assetIdStr = toBase64String(assetId)
272272 let type = valueOrErrorMessage(getInteger((assetIdStr + keyAssetType)), errAssetNotFound)
273273 let precision = valueOrErrorMessage(getInteger((assetIdStr + keyAssetPrecision)), errAssetNotFound)
274274 let validatorAddress = valueOrErrorMessage(getBinary(keyValidator), errUninitialized)
275275 let unlockSigner = valueOrErrorMessage(getBinary(keyUnlockSigner), errUninitialized)
276276 let feeCollector = valueOrErrorMessage(getBinary(keyFeeCollector), errUninitialized)
277277 let createUnlock = invoke(Address(validatorAddress), "createUnlock", [lockId, recipient, amount, lockSource, assetSourceAndAddress, signature], nil)
278278 if ((createUnlock == createUnlock))
279279 then {
280280 let isValid = match createUnlock {
281281 case v: Boolean =>
282282 v
283283 case _ =>
284284 false
285285 }
286286 if (!(isValid))
287287 then throw(errInvalidValues)
288288 else {
289289 let fee = if ((unlockSigner == i.caller.bytes))
290290 then valueOrErrorMessage(getInteger((assetIdStr + keyAssetMinFee)), errAssetNotFound)
291291 else 0
292292 let amountToSend = fromSystemPrecision(amount, precision)
293293 let amountToSendWithoutFee = (amountToSend - fee)
294294 if ((0 >= amountToSendWithoutFee))
295295 then throw(errNotEnoughBalance)
296296 else if ((type == typeBase))
297297 then ([ScriptTransfer(Address(recipient), amountToSendWithoutFee, unit)] ++ (if ((fee > 0))
298298 then [ScriptTransfer(Address(feeCollector), fee, unit)]
299299 else nil))
300300 else if ((type == typeNative))
301301 then ([ScriptTransfer(Address(recipient), amountToSendWithoutFee, assetId)] ++ (if ((fee > 0))
302302 then [ScriptTransfer(Address(feeCollector), fee, assetId)]
303303 else nil))
304304 else if ((type == typeWrapped))
305305 then ([Reissue(assetId, amountToSend, true), ScriptTransfer(Address(recipient), amountToSendWithoutFee, assetId)] ++ (if ((fee > 0))
306306 then [ScriptTransfer(Address(feeCollector), fee, assetId)]
307307 else nil))
308308 else throw(errInvalidValues)
309309 }
310310 }
311311 else throw("Strict value is not equal to itself.")
312312 }
313313 else throw("Strict value is not equal to itself.")
314314 }
315315
316316
317317
318318 @Callable(i)
319319 func setManager (managerType,manager) = {
320320 let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER)
321321 if ((callerCheck == callerCheck))
322322 then [BinaryEntry((managerType + keyManager), manager)]
323323 else throw("Strict value is not equal to itself.")
324324 }
325325
326326
327327
328328 @Callable(i)
329329 func setFeeCollector (feeCollector) = {
330330 let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER)
331331 if ((callerCheck == callerCheck))
332332 then [BinaryEntry(keyFeeCollector, feeCollector)]
333333 else throw("Strict value is not equal to itself.")
334334 }
335335
336336
337337
338338 @Callable(i)
339339 func setValidator (validator) = {
340340 let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER)
341341 if ((callerCheck == callerCheck))
342342 then [BinaryEntry(keyValidator, validator)]
343343 else throw("Strict value is not equal to itself.")
344344 }
345345
346346
347347
348348 @Callable(i)
349349 func startBridge () = {
350350 let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER)
351351 if ((callerCheck == callerCheck))
352352 then [BooleanEntry(keyIsActive, true)]
353353 else throw("Strict value is not equal to itself.")
354354 }
355355
356356
357357
358358 @Callable(i)
359359 func stopBridge () = {
360360 let callerCheck = assertCallerIsManager(i, STOP_MANAGER)
361361 if ((callerCheck == callerCheck))
362362 then [BooleanEntry(keyIsActive, false)]
363363 else throw("Strict value is not equal to itself.")
364364 }
365365
366366
367367
368368 @Callable(i)
369369 func setMinFee (assetId,minFee) = {
370370 let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER)
371371 if ((callerCheck == callerCheck))
372372 then {
373373 let assetIdStr = toBase64String(assetId)
374374 [IntegerEntry((assetIdStr + keyAssetMinFee), minFee)]
375375 }
376376 else throw("Strict value is not equal to itself.")
377377 }
378378
379379
380380
381381 @Callable(i)
382382 func setBaseFeeRate (baseFeeRateBP) = {
383383 let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER)
384384 if ((callerCheck == callerCheck))
385385 then [IntegerEntry(ketBaseFeeRateBP, baseFeeRateBP)]
386386 else throw("Strict value is not equal to itself.")
387387 }
388388
389389
390390
391391 @Callable(i)
392392 func setAssetState (assetId,state) = {
393393 let callerCheck = assertCallerIsManager(i, BRIDGE_MANAGER)
394394 if ((callerCheck == callerCheck))
395395 then {
396396 let assetIdStr = toBase64String(assetId)
397397 [BooleanEntry((assetIdStr + keyAssetIsActive), state)]
398398 }
399399 else throw("Strict value is not equal to itself.")
400400 }
401401
402402

github/deemru/w8io/026f985 
38.25 ms