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