tx · 8uMDS5JfUA7Qyd82WvmvCouVmhES9ZDRwEjkkjgXGweE 3MyzPou5b4wqX1yKewzD9Q842nZfEsrmmdA: -0.14000000 Waves 2022.11.14 15:43 [2316817] smart account 3MyzPou5b4wqX1yKewzD9Q842nZfEsrmmdA > SELF 0.00000000 Waves
{ "type": 13, "id": "8uMDS5JfUA7Qyd82WvmvCouVmhES9ZDRwEjkkjgXGweE", "fee": 14000000, "feeAssetId": null, "timestamp": 1668429878207, "version": 2, "chainId": 84, "sender": "3MyzPou5b4wqX1yKewzD9Q842nZfEsrmmdA", "senderPublicKey": "J7rgH9Evbm92drmc4Tf5qZVRXhZDjak1uHg31HriTLxD", "proofs": [ "5ETbisymrmEzrS9ozPpiJmHEosgzqQAbEzUNGxFMFHDJetxQBPmPkNf5zvEgw3hQFKwnEAKC3bvZFwnxRpXTAtDR", "JTefR8R3N5rAYCdEHphSAeJVwok3aXPqP7BuAAeUSzpec8TJvzeRfaSYWJNJJpTXGEyC4ECj3ztF6gZMv4ssCVF" ], "script": "base64:BgIkCAISBAoCCBgSABIAEgUKAwQBCBIDCgEBEgMKAQESABIDCgEBJwAHa0FjdGl2ZQIGYWN0aXZlAAZrQ2F1c2UCDnNodXRkb3duX2NhdXNlAAxrVVNETkFkZHJlc3MCGHN0YWtpbmdfdXNkbm5zYnRfYWRkcmVzcwAMa0VVUk5BZGRyZXNzAhRzdGFraW5nX2V1cm5fYWRkcmVzcwAMa0xlYXNpbmdQb29sAg9sZWFzaW5nX2FkZHJlc3MADmtMZWFzaW5nQW1vdW50Ag5sZWFzaW5nX2Ftb3VudAAKa0xlYXNpbmdJZAIKbGVhc2luZ19pZAANa0FkbWluUHViS2V5MQILYWRtaW5fcHViXzEADWtBZG1pblB1YktleTICC2FkbWluX3B1Yl8yAA1rQWRtaW5QdWJLZXkzAgthZG1pbl9wdWJfMwASa0FkbWluSW52b2tlUHViS2V5AhBhZG1pbl9pbnZva2VfcHViAA1rQ3BtbUNvbnRyYWN0Ag1jc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aQhwYXltZW50cwECdHgBBnZlcmlmeQAEE211bHRpU2lnbmVkQnlBZG1pbnMEEmFkbWluUHViS2V5MVNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MQABAAAEEmFkbWluUHViS2V5MlNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFDGFkbWluUHViS2V5MgABAAAEEmFkbWluUHViS2V5M1NpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFDGFkbWluUHViS2V5MwABAAAJAGcCCQBkAgkAZAIFEmFkbWluUHViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAgUTbXVsdGlTaWduZWRCeUFkbWluc18ca1c=", "height": 2316817, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9bhqVSCHrwUJGqQ1BKvwtTUA4hTSgZo9X7z8L78YGS6b Next: none Diff:
Old | New | Differences | |
---|---|---|---|
33 | 33 | ||
34 | 34 | let kShareAssetId = "share_asset_id" | |
35 | 35 | ||
36 | - | let oracle = Address(base58' | |
36 | + | let oracle = Address(base58'3PEbqViERCoKnmcSULh6n2aiMvUdSQdCsom') | |
37 | 37 | ||
38 | 38 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
39 | 39 | case string: String => | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | - | @Callable(i) | |
143 | - | func callFunction (funcName,args) = valueOrElse(isActive(), { | |
144 | - | let $t037383824 = { | |
145 | - | let $l = i.payments | |
142 | + | func callCommon (funcName,caller,args,payments) = valueOrElse(isActive(), { | |
143 | + | let $t037773861 = { | |
144 | + | let $l = payments | |
146 | 145 | let $s = size($l) | |
147 | 146 | let $acc0 = $Tuple2(nil, nil) | |
148 | 147 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
155 | 154 | ||
156 | 155 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
157 | 156 | } | |
158 | - | let paymentAmounts = $ | |
159 | - | let paymentAssetIds = $ | |
160 | - | let $ | |
161 | - | let @ = reentrantInvoke(cpmmContract, funcName, [ | |
157 | + | let paymentAmounts = $t037773861._1 | |
158 | + | let paymentAssetIds = $t037773861._2 | |
159 | + | let $t038664014 = { | |
160 | + | let @ = reentrantInvoke(cpmmContract, funcName, [caller, args, paymentAmounts, paymentAssetIds], nil) | |
162 | 161 | if ($isInstanceOf(@, "(List[Any], List[Any])")) | |
163 | 162 | then @ | |
164 | 163 | else throw(($getType(@) + " couldn't be cast to (List[Any], List[Any])")) | |
165 | 164 | } | |
166 | - | if (($ | |
165 | + | if (($t038664014 == $t038664014)) | |
167 | 166 | then { | |
168 | - | let data = $ | |
169 | - | let actions = $ | |
167 | + | let data = $t038664014._2 | |
168 | + | let actions = $t038664014._1 | |
170 | 169 | let mappedData = { | |
171 | 170 | let $l = data | |
172 | 171 | let $s = size($l) | |
201 | 200 | }) | |
202 | 201 | ||
203 | 202 | ||
203 | + | @Callable(i) | |
204 | + | func callFunction (funcName,args) = callCommon(funcName, i.caller.bytes, args, i.payments) | |
205 | + | ||
206 | + | ||
204 | 207 | ||
205 | 208 | @Callable(i) | |
206 | 209 | func shutdown () = valueOrElse(isAdminCall(i.callerPublicKey), if (!(active)) | |
217 | 220 | ||
218 | 221 | ||
219 | 222 | @Callable(i) | |
220 | - | func stakeUnstake (stake,amount,assetIdString) = | |
223 | + | func stakeUnstake (stake,amount,assetIdString) = valueOrElse(isActive(), if ((i.caller != cpmmContract)) | |
221 | 224 | then throw("Only global Contract can invoke this function") | |
222 | 225 | else if ((assetIdString == "WAVES")) | |
223 | 226 | then { | |
238 | 241 | } | |
239 | 242 | } | |
240 | 243 | else { | |
241 | - | let $ | |
242 | - | let call = $ | |
243 | - | let addr = $ | |
244 | - | let params = $ | |
245 | - | let payments = $ | |
244 | + | let $t060106113 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
245 | + | let call = $t060106113._1 | |
246 | + | let addr = $t060106113._2 | |
247 | + | let params = $t060106113._3 | |
248 | + | let payments = $t060106113._4 | |
246 | 249 | let inv = invoke(addr, call, params, payments) | |
247 | 250 | if ((inv == inv)) | |
248 | 251 | then nil | |
249 | 252 | else throw("Strict value is not equal to itself.") | |
250 | - | }) | |
253 | + | }) | |
251 | 254 | ||
252 | 255 | ||
253 | 256 | ||
256 | 259 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
257 | 260 | [Reissue(shareAssetId, amount, true), ScriptTransfer(i.caller, amount, shareAssetId)] | |
258 | 261 | })) | |
262 | + | ||
263 | + | ||
264 | + | ||
265 | + | @Callable(i) | |
266 | + | func replenishWithTwoTokens (slippageTolerance) = callCommon("replenishWithTwoTokens", i.caller.bytes, ["false", "0"], i.payments) | |
267 | + | ||
268 | + | ||
269 | + | ||
270 | + | @Callable(i) | |
271 | + | func withdraw () = callCommon("withdraw", i.caller.bytes, ["0"], i.payments) | |
272 | + | ||
273 | + | ||
274 | + | ||
275 | + | @Callable(i) | |
276 | + | func exchange (minAmountToReceive) = callCommon("exchange", i.caller.bytes, [toString(minAmountToReceive)], i.payments) | |
259 | 277 | ||
260 | 278 | ||
261 | 279 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kActive = "active" | |
5 | 5 | ||
6 | 6 | let kCause = "shutdown_cause" | |
7 | 7 | ||
8 | 8 | let kUSDNAddress = "staking_usdnnsbt_address" | |
9 | 9 | ||
10 | 10 | let kEURNAddress = "staking_eurn_address" | |
11 | 11 | ||
12 | 12 | let kLeasingPool = "leasing_address" | |
13 | 13 | ||
14 | 14 | let kLeasingAmount = "leasing_amount" | |
15 | 15 | ||
16 | 16 | let kLeasingId = "leasing_id" | |
17 | 17 | ||
18 | 18 | let kAdminPubKey1 = "admin_pub_1" | |
19 | 19 | ||
20 | 20 | let kAdminPubKey2 = "admin_pub_2" | |
21 | 21 | ||
22 | 22 | let kAdminPubKey3 = "admin_pub_3" | |
23 | 23 | ||
24 | 24 | let kAdminInvokePubKey = "admin_invoke_pub" | |
25 | 25 | ||
26 | 26 | let kCpmmContract = "cpmm_contract" | |
27 | 27 | ||
28 | 28 | let kUSDNAssetId = "usdn_asset_id" | |
29 | 29 | ||
30 | 30 | let kEURNAssetId = "eurn_asset_id" | |
31 | 31 | ||
32 | 32 | let kStakingAssets = "staking_assets" | |
33 | 33 | ||
34 | 34 | let kShareAssetId = "share_asset_id" | |
35 | 35 | ||
36 | - | let oracle = Address(base58' | |
36 | + | let oracle = Address(base58'3PEbqViERCoKnmcSULh6n2aiMvUdSQdCsom') | |
37 | 37 | ||
38 | 38 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
39 | 39 | case string: String => | |
40 | 40 | fromBase58String(string) | |
41 | 41 | case nothing => | |
42 | 42 | throw((key + "is empty")) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
47 | 47 | ||
48 | 48 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
49 | 49 | ||
50 | 50 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
51 | 51 | ||
52 | 52 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
53 | 53 | ||
54 | 54 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
55 | 55 | ||
56 | 56 | let stakingEURNAddress = Address(getBase58FromOracle(kEURNAddress)) | |
57 | 57 | ||
58 | 58 | let cpmmContract = Address(getBase58FromOracle(kCpmmContract)) | |
59 | 59 | ||
60 | 60 | let USDN = getBase58FromOracle(kUSDNAssetId) | |
61 | 61 | ||
62 | 62 | let EURN = getBase58FromOracle(kEURNAssetId) | |
63 | 63 | ||
64 | 64 | let stakingAssets = getStringValue(oracle, kStakingAssets) | |
65 | 65 | ||
66 | 66 | let active = valueOrElse(getBoolean(this, kActive), true) | |
67 | 67 | ||
68 | 68 | func isActive () = if (active) | |
69 | 69 | then unit | |
70 | 70 | else throw("DApp is inactive at this moment") | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func isGlobalCaller (caller) = if ((caller == cpmmContract)) | |
74 | 74 | then unit | |
75 | 75 | else throw("Only global Contract can invoke this function") | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func isAdminCall (callerPubKey) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], callerPubKey)) | |
79 | 79 | then unit | |
80 | 80 | else throw("Only admin can call this function") | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
87 | 87 | then if ((assetId == USDN)) | |
88 | 88 | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
89 | 89 | else $Tuple2("startStaking", stakingEURNAddress) | |
90 | 90 | else if ((assetId == USDN)) | |
91 | 91 | then $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
92 | 92 | else $Tuple2("stopStaking", stakingEURNAddress) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
96 | 96 | then { | |
97 | 97 | let $t024732539 = calcStakingFuncAndAddres(stake, assetId) | |
98 | 98 | let call = $t024732539._1 | |
99 | 99 | let stakingAddr = $t024732539._2 | |
100 | 100 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
101 | 101 | } | |
102 | 102 | else { | |
103 | 103 | let $t026252691 = calcStakingFuncAndAddres(stake, assetId) | |
104 | 104 | let call = $t026252691._1 | |
105 | 105 | let stakingAddr = $t026252691._2 | |
106 | 106 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
107 | 107 | } | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func collectPayments (acc,payment) = { | |
111 | 111 | let $t028532896 = acc | |
112 | 112 | let paymentAmounts = $t028532896._1 | |
113 | 113 | let paymentAssetIds = $t028532896._2 | |
114 | 114 | $Tuple2((paymentAmounts :+ payment.amount), (paymentAssetIds :+ (if ((payment.assetId == unit)) | |
115 | 115 | then base58'' | |
116 | 116 | else payment.assetId))) | |
117 | 117 | } | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func collectState (result,source) = match source { | |
121 | 121 | case e: Issue|Burn|Reissue|ScriptTransfer|BinaryEntry|BooleanEntry|StringEntry|IntegerEntry => | |
122 | 122 | (result :+ e) | |
123 | 123 | case _ => | |
124 | 124 | result | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func collectData (result,source) = match source { | |
129 | 129 | case v: String => | |
130 | 130 | (result :+ v) | |
131 | 131 | case v: Int => | |
132 | 132 | (result :+ v) | |
133 | 133 | case v: Boolean => | |
134 | 134 | (result :+ v) | |
135 | 135 | case v: ByteVector => | |
136 | 136 | (result :+ v) | |
137 | 137 | case _ => | |
138 | 138 | throw() | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | - | @Callable(i) | |
143 | - | func callFunction (funcName,args) = valueOrElse(isActive(), { | |
144 | - | let $t037383824 = { | |
145 | - | let $l = i.payments | |
142 | + | func callCommon (funcName,caller,args,payments) = valueOrElse(isActive(), { | |
143 | + | let $t037773861 = { | |
144 | + | let $l = payments | |
146 | 145 | let $s = size($l) | |
147 | 146 | let $acc0 = $Tuple2(nil, nil) | |
148 | 147 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
149 | 148 | then $a | |
150 | 149 | else collectPayments($a, $l[$i]) | |
151 | 150 | ||
152 | 151 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
153 | 152 | then $a | |
154 | 153 | else throw("List size exceeds 10") | |
155 | 154 | ||
156 | 155 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
157 | 156 | } | |
158 | - | let paymentAmounts = $ | |
159 | - | let paymentAssetIds = $ | |
160 | - | let $ | |
161 | - | let @ = reentrantInvoke(cpmmContract, funcName, [ | |
157 | + | let paymentAmounts = $t037773861._1 | |
158 | + | let paymentAssetIds = $t037773861._2 | |
159 | + | let $t038664014 = { | |
160 | + | let @ = reentrantInvoke(cpmmContract, funcName, [caller, args, paymentAmounts, paymentAssetIds], nil) | |
162 | 161 | if ($isInstanceOf(@, "(List[Any], List[Any])")) | |
163 | 162 | then @ | |
164 | 163 | else throw(($getType(@) + " couldn't be cast to (List[Any], List[Any])")) | |
165 | 164 | } | |
166 | - | if (($ | |
165 | + | if (($t038664014 == $t038664014)) | |
167 | 166 | then { | |
168 | - | let data = $ | |
169 | - | let actions = $ | |
167 | + | let data = $t038664014._2 | |
168 | + | let actions = $t038664014._1 | |
170 | 169 | let mappedData = { | |
171 | 170 | let $l = data | |
172 | 171 | let $s = size($l) | |
173 | 172 | let $acc0 = nil | |
174 | 173 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
175 | 174 | then $a | |
176 | 175 | else collectData($a, $l[$i]) | |
177 | 176 | ||
178 | 177 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
179 | 178 | then $a | |
180 | 179 | else throw("List size exceeds 10") | |
181 | 180 | ||
182 | 181 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
183 | 182 | } | |
184 | 183 | let mappedActions = { | |
185 | 184 | let $l = actions | |
186 | 185 | let $s = size($l) | |
187 | 186 | let $acc0 = nil | |
188 | 187 | func $f2_1 ($a,$i) = if (($i >= $s)) | |
189 | 188 | then $a | |
190 | 189 | else collectState($a, $l[$i]) | |
191 | 190 | ||
192 | 191 | func $f2_2 ($a,$i) = if (($i >= $s)) | |
193 | 192 | then $a | |
194 | 193 | else throw("List size exceeds 15") | |
195 | 194 | ||
196 | 195 | $f2_2($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
197 | 196 | } | |
198 | 197 | $Tuple2(mappedActions, mappedData) | |
199 | 198 | } | |
200 | 199 | else throw("Strict value is not equal to itself.") | |
201 | 200 | }) | |
202 | 201 | ||
203 | 202 | ||
203 | + | @Callable(i) | |
204 | + | func callFunction (funcName,args) = callCommon(funcName, i.caller.bytes, args, i.payments) | |
205 | + | ||
206 | + | ||
204 | 207 | ||
205 | 208 | @Callable(i) | |
206 | 209 | func shutdown () = valueOrElse(isAdminCall(i.callerPublicKey), if (!(active)) | |
207 | 210 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
208 | 211 | else suspend("Paused by admin")) | |
209 | 212 | ||
210 | 213 | ||
211 | 214 | ||
212 | 215 | @Callable(i) | |
213 | 216 | func activate () = valueOrElse(isAdminCall(i.callerPublicKey), if (active) | |
214 | 217 | then throw("DApp is already active") | |
215 | 218 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
216 | 219 | ||
217 | 220 | ||
218 | 221 | ||
219 | 222 | @Callable(i) | |
220 | - | func stakeUnstake (stake,amount,assetIdString) = | |
223 | + | func stakeUnstake (stake,amount,assetIdString) = valueOrElse(isActive(), if ((i.caller != cpmmContract)) | |
221 | 224 | then throw("Only global Contract can invoke this function") | |
222 | 225 | else if ((assetIdString == "WAVES")) | |
223 | 226 | then { | |
224 | 227 | let pool = addressFromStringValue(valueOrErrorMessage(getString(oracle, kLeasingPool), "No leasing pool in oracle")) | |
225 | 228 | let leasingId = getBinary(this, kLeasingId) | |
226 | 229 | let leasingAmount = valueOrElse(getInteger(this, kLeasingAmount), 0) | |
227 | 230 | let newLeaseAmount = if (stake) | |
228 | 231 | then (leasingAmount + amount) | |
229 | 232 | else (leasingAmount - amount) | |
230 | 233 | let newLease = Lease(pool, newLeaseAmount) | |
231 | 234 | let newLeaseId = calculateLeaseId(newLease) | |
232 | 235 | let baseEtry = [newLease, BinaryEntry(kLeasingId, newLeaseId), IntegerEntry(kLeasingAmount, newLeaseAmount)] | |
233 | 236 | match leasingId { | |
234 | 237 | case lId: ByteVector => | |
235 | 238 | ([LeaseCancel(lId)] ++ baseEtry) | |
236 | 239 | case _ => | |
237 | 240 | baseEtry | |
238 | 241 | } | |
239 | 242 | } | |
240 | 243 | else { | |
241 | - | let $ | |
242 | - | let call = $ | |
243 | - | let addr = $ | |
244 | - | let params = $ | |
245 | - | let payments = $ | |
244 | + | let $t060106113 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
245 | + | let call = $t060106113._1 | |
246 | + | let addr = $t060106113._2 | |
247 | + | let params = $t060106113._3 | |
248 | + | let payments = $t060106113._4 | |
246 | 249 | let inv = invoke(addr, call, params, payments) | |
247 | 250 | if ((inv == inv)) | |
248 | 251 | then nil | |
249 | 252 | else throw("Strict value is not equal to itself.") | |
250 | - | }) | |
253 | + | }) | |
251 | 254 | ||
252 | 255 | ||
253 | 256 | ||
254 | 257 | @Callable(i) | |
255 | 258 | func reissueShareToken (amount) = valueOrElse(isGlobalCaller(i.caller), valueOrElse(isActive(), { | |
256 | 259 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
257 | 260 | [Reissue(shareAssetId, amount, true), ScriptTransfer(i.caller, amount, shareAssetId)] | |
258 | 261 | })) | |
262 | + | ||
263 | + | ||
264 | + | ||
265 | + | @Callable(i) | |
266 | + | func replenishWithTwoTokens (slippageTolerance) = callCommon("replenishWithTwoTokens", i.caller.bytes, ["false", "0"], i.payments) | |
267 | + | ||
268 | + | ||
269 | + | ||
270 | + | @Callable(i) | |
271 | + | func withdraw () = callCommon("withdraw", i.caller.bytes, ["0"], i.payments) | |
272 | + | ||
273 | + | ||
274 | + | ||
275 | + | @Callable(i) | |
276 | + | func exchange (minAmountToReceive) = callCommon("exchange", i.caller.bytes, [toString(minAmountToReceive)], i.payments) | |
259 | 277 | ||
260 | 278 | ||
261 | 279 | @Verifier(tx) | |
262 | 280 | func verify () = { | |
263 | 281 | let multiSignedByAdmins = { | |
264 | 282 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
265 | 283 | then 1 | |
266 | 284 | else 0 | |
267 | 285 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
268 | 286 | then 1 | |
269 | 287 | else 0 | |
270 | 288 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
271 | 289 | then 1 | |
272 | 290 | else 0 | |
273 | 291 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
274 | 292 | } | |
275 | 293 | multiSignedByAdmins | |
276 | 294 | } | |
277 | 295 |
github/deemru/w8io/026f985 55.76 ms ◑