tx · 9bhqVSCHrwUJGqQ1BKvwtTUA4hTSgZo9X7z8L78YGS6b 3MyzPou5b4wqX1yKewzD9Q842nZfEsrmmdA: -0.14000000 Waves 2022.10.24 16:37 [2286562] smart account 3MyzPou5b4wqX1yKewzD9Q842nZfEsrmmdA > SELF 0.00000000 Waves
{ "type": 13, "id": "9bhqVSCHrwUJGqQ1BKvwtTUA4hTSgZo9X7z8L78YGS6b", "fee": 14000000, "feeAssetId": null, "timestamp": 1666618747597, "version": 2, "chainId": 84, "sender": "3MyzPou5b4wqX1yKewzD9Q842nZfEsrmmdA", "senderPublicKey": "J7rgH9Evbm92drmc4Tf5qZVRXhZDjak1uHg31HriTLxD", "proofs": [ "2MmLAX48orntZcWa6wTFjsraFhsv1aKbkLhY8k9ZGtNoHbopBybTELWFTzqtfpbsTed2EpS7Ngc339mo6wXpRzEX", "u2YCo9JHWt6sp28PYmYF32LKUnPvVuZzPKKxizv421nWvH5rhC4RCeNtWR8LGAn6GbJyz11fYQ8uEXooqaouLWh" ], "script": "base64:BgIYCAISBAoCCBgSABIAEgUKAwQBCBIDCgEBJgAHa0FjdGl2ZQIGYWN0aXZlAAZrQ2F1c2UCDnNodXRkb3duX2NhdXNlAAxrVVNETkFkZHJlc3MCGHN0YWtpbmdfdXNkbm5zYnRfYWRkcmVzcwAMa0VVUk5BZGRyZXNzAhRzdGFraW5nX2V1cm5fYWRkcmVzcwAMa0xlYXNpbmdQb29sAg9sZWFzaW5nX2FkZHJlc3MADmtMZWFzaW5nQW1vdW50Ag5sZWFzaW5nX2Ftb3VudAAKa0xlYXNpbmdJZAIKbGVhc2luZ19pZAANa0FkbWluUHViS2V5MQILYWRtaW5fcHViXzEADWtBZG1pblB1YktleTICC2FkbWluX3B1Yl8yAA1rQWRtaW5QdWJLZXkzAgthZG1pbl9wdWJfMwASa0FkbWluSW52b2tlUHViS2V5AhBhZG1pbl9pbnZva2VfcHViAA1rQ3BtbUNvbnRyYWN0Ag1jcG1tX2NvbnRyYWN0AA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k3NzYwODACXzMECHBheW1lbnRzCAULJHQwNTk3NzYwODACXzQEA2ludgkA/AcEBQRhZGRyBQRjYWxsBQZwYXJhbXMFCHBheW1lbnRzAwkAAAIFA2ludgUDaW52BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQERcmVpc3N1ZVNoYXJlVG9rZW4BBmFtb3VudAkBC3ZhbHVlT3JFbHNlAgkBDmlzR2xvYmFsQ2FsbGVyAQgFAWkGY2FsbGVyCQELdmFsdWVPckVsc2UCCQEIaXNBY3RpdmUABAxzaGFyZUFzc2V0SWQJANkEAQkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwUNa1NoYXJlQXNzZXRJZAkAzAgCCQEHUmVpc3N1ZQMFDHNoYXJlQXNzZXRJZAUGYW1vdW50BgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFBmFtb3VudAUMc2hhcmVBc3NldElkBQNuaWwBAnR4AQZ2ZXJpZnkABBNtdWx0aVNpZ25lZEJ5QWRtaW5zBBJhZG1pblB1YktleTFTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQxhZG1pblB1YktleTEAAQAABBJhZG1pblB1YktleTJTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQxhZG1pblB1YktleTIAAQAABBJhZG1pblB1YktleTNTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAIFE211bHRpU2lnbmVkQnlBZG1pbnNoVo6P", "height": 2286562, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 762ihRp7dZevnk4gYeWbtc6BynRMiA8SbYVpDb8UATNQ Next: 8uMDS5JfUA7Qyd82WvmvCouVmhES9ZDRwEjkkjgXGweE Diff:
Old | New | Differences | |
---|---|---|---|
111 | 111 | let $t028532896 = acc | |
112 | 112 | let paymentAmounts = $t028532896._1 | |
113 | 113 | let paymentAssetIds = $t028532896._2 | |
114 | - | $Tuple2((paymentAmounts :+ payment.amount), (paymentAssetIds :+ payment.assetId)) | |
114 | + | $Tuple2((paymentAmounts :+ payment.amount), (paymentAssetIds :+ (if ((payment.assetId == unit)) | |
115 | + | then base58'' | |
116 | + | else payment.assetId))) | |
115 | 117 | } | |
116 | 118 | ||
117 | 119 | ||
139 | 141 | ||
140 | 142 | @Callable(i) | |
141 | 143 | func callFunction (funcName,args) = valueOrElse(isActive(), { | |
142 | - | let $ | |
144 | + | let $t037383824 = { | |
143 | 145 | let $l = i.payments | |
144 | 146 | let $s = size($l) | |
145 | 147 | let $acc0 = $Tuple2(nil, nil) | |
153 | 155 | ||
154 | 156 | $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) | |
155 | 157 | } | |
156 | - | let paymentAmounts = $ | |
157 | - | let paymentAssetIds = $ | |
158 | - | let $ | |
158 | + | let paymentAmounts = $t037383824._1 | |
159 | + | let paymentAssetIds = $t037383824._2 | |
160 | + | let $t038273983 = { | |
159 | 161 | let @ = reentrantInvoke(cpmmContract, funcName, [i.caller.bytes, args, paymentAmounts, paymentAssetIds], nil) | |
160 | 162 | if ($isInstanceOf(@, "(List[Any], List[Any])")) | |
161 | 163 | then @ | |
162 | 164 | else throw(($getType(@) + " couldn't be cast to (List[Any], List[Any])")) | |
163 | 165 | } | |
164 | - | if (($ | |
166 | + | if (($t038273983 == $t038273983)) | |
165 | 167 | then { | |
166 | - | let data = $ | |
167 | - | let actions = $ | |
168 | + | let data = $t038273983._2 | |
169 | + | let actions = $t038273983._1 | |
168 | 170 | let mappedData = { | |
169 | 171 | let $l = data | |
170 | 172 | let $s = size($l) | |
236 | 238 | } | |
237 | 239 | } | |
238 | 240 | else { | |
239 | - | let $ | |
240 | - | let call = $ | |
241 | - | let addr = $ | |
242 | - | let params = $ | |
243 | - | let payments = $ | |
241 | + | let $t059776080 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
242 | + | let call = $t059776080._1 | |
243 | + | let addr = $t059776080._2 | |
244 | + | let params = $t059776080._3 | |
245 | + | let payments = $t059776080._4 | |
244 | 246 | let inv = invoke(addr, call, params, payments) | |
245 | 247 | if ((inv == inv)) | |
246 | 248 | then nil |
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 | 36 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
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 | - | $Tuple2((paymentAmounts :+ payment.amount), (paymentAssetIds :+ payment.assetId)) | |
114 | + | $Tuple2((paymentAmounts :+ payment.amount), (paymentAssetIds :+ (if ((payment.assetId == unit)) | |
115 | + | then base58'' | |
116 | + | else payment.assetId))) | |
115 | 117 | } | |
116 | 118 | ||
117 | 119 | ||
118 | 120 | func collectState (result,source) = match source { | |
119 | 121 | case e: Issue|Burn|Reissue|ScriptTransfer|BinaryEntry|BooleanEntry|StringEntry|IntegerEntry => | |
120 | 122 | (result :+ e) | |
121 | 123 | case _ => | |
122 | 124 | result | |
123 | 125 | } | |
124 | 126 | ||
125 | 127 | ||
126 | 128 | func collectData (result,source) = match source { | |
127 | 129 | case v: String => | |
128 | 130 | (result :+ v) | |
129 | 131 | case v: Int => | |
130 | 132 | (result :+ v) | |
131 | 133 | case v: Boolean => | |
132 | 134 | (result :+ v) | |
133 | 135 | case v: ByteVector => | |
134 | 136 | (result :+ v) | |
135 | 137 | case _ => | |
136 | 138 | throw() | |
137 | 139 | } | |
138 | 140 | ||
139 | 141 | ||
140 | 142 | @Callable(i) | |
141 | 143 | func callFunction (funcName,args) = valueOrElse(isActive(), { | |
142 | - | let $ | |
144 | + | let $t037383824 = { | |
143 | 145 | let $l = i.payments | |
144 | 146 | let $s = size($l) | |
145 | 147 | let $acc0 = $Tuple2(nil, nil) | |
146 | 148 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
147 | 149 | then $a | |
148 | 150 | else collectPayments($a, $l[$i]) | |
149 | 151 | ||
150 | 152 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
151 | 153 | then $a | |
152 | 154 | else throw("List size exceeds 10") | |
153 | 155 | ||
154 | 156 | $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) | |
155 | 157 | } | |
156 | - | let paymentAmounts = $ | |
157 | - | let paymentAssetIds = $ | |
158 | - | let $ | |
158 | + | let paymentAmounts = $t037383824._1 | |
159 | + | let paymentAssetIds = $t037383824._2 | |
160 | + | let $t038273983 = { | |
159 | 161 | let @ = reentrantInvoke(cpmmContract, funcName, [i.caller.bytes, args, paymentAmounts, paymentAssetIds], nil) | |
160 | 162 | if ($isInstanceOf(@, "(List[Any], List[Any])")) | |
161 | 163 | then @ | |
162 | 164 | else throw(($getType(@) + " couldn't be cast to (List[Any], List[Any])")) | |
163 | 165 | } | |
164 | - | if (($ | |
166 | + | if (($t038273983 == $t038273983)) | |
165 | 167 | then { | |
166 | - | let data = $ | |
167 | - | let actions = $ | |
168 | + | let data = $t038273983._2 | |
169 | + | let actions = $t038273983._1 | |
168 | 170 | let mappedData = { | |
169 | 171 | let $l = data | |
170 | 172 | let $s = size($l) | |
171 | 173 | let $acc0 = nil | |
172 | 174 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
173 | 175 | then $a | |
174 | 176 | else collectData($a, $l[$i]) | |
175 | 177 | ||
176 | 178 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
177 | 179 | then $a | |
178 | 180 | else throw("List size exceeds 10") | |
179 | 181 | ||
180 | 182 | $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) | |
181 | 183 | } | |
182 | 184 | let mappedActions = { | |
183 | 185 | let $l = actions | |
184 | 186 | let $s = size($l) | |
185 | 187 | let $acc0 = nil | |
186 | 188 | func $f2_1 ($a,$i) = if (($i >= $s)) | |
187 | 189 | then $a | |
188 | 190 | else collectState($a, $l[$i]) | |
189 | 191 | ||
190 | 192 | func $f2_2 ($a,$i) = if (($i >= $s)) | |
191 | 193 | then $a | |
192 | 194 | else throw("List size exceeds 15") | |
193 | 195 | ||
194 | 196 | $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) | |
195 | 197 | } | |
196 | 198 | $Tuple2(mappedActions, mappedData) | |
197 | 199 | } | |
198 | 200 | else throw("Strict value is not equal to itself.") | |
199 | 201 | }) | |
200 | 202 | ||
201 | 203 | ||
202 | 204 | ||
203 | 205 | @Callable(i) | |
204 | 206 | func shutdown () = valueOrElse(isAdminCall(i.callerPublicKey), if (!(active)) | |
205 | 207 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
206 | 208 | else suspend("Paused by admin")) | |
207 | 209 | ||
208 | 210 | ||
209 | 211 | ||
210 | 212 | @Callable(i) | |
211 | 213 | func activate () = valueOrElse(isAdminCall(i.callerPublicKey), if (active) | |
212 | 214 | then throw("DApp is already active") | |
213 | 215 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
214 | 216 | ||
215 | 217 | ||
216 | 218 | ||
217 | 219 | @Callable(i) | |
218 | 220 | func stakeUnstake (stake,amount,assetIdString) = valueOrElse(isGlobalCaller(i.caller), valueOrElse(isActive(), if ((i.caller != cpmmContract)) | |
219 | 221 | then throw("Only global Contract can invoke this function") | |
220 | 222 | else if ((assetIdString == "WAVES")) | |
221 | 223 | then { | |
222 | 224 | let pool = addressFromStringValue(valueOrErrorMessage(getString(oracle, kLeasingPool), "No leasing pool in oracle")) | |
223 | 225 | let leasingId = getBinary(this, kLeasingId) | |
224 | 226 | let leasingAmount = valueOrElse(getInteger(this, kLeasingAmount), 0) | |
225 | 227 | let newLeaseAmount = if (stake) | |
226 | 228 | then (leasingAmount + amount) | |
227 | 229 | else (leasingAmount - amount) | |
228 | 230 | let newLease = Lease(pool, newLeaseAmount) | |
229 | 231 | let newLeaseId = calculateLeaseId(newLease) | |
230 | 232 | let baseEtry = [newLease, BinaryEntry(kLeasingId, newLeaseId), IntegerEntry(kLeasingAmount, newLeaseAmount)] | |
231 | 233 | match leasingId { | |
232 | 234 | case lId: ByteVector => | |
233 | 235 | ([LeaseCancel(lId)] ++ baseEtry) | |
234 | 236 | case _ => | |
235 | 237 | baseEtry | |
236 | 238 | } | |
237 | 239 | } | |
238 | 240 | else { | |
239 | - | let $ | |
240 | - | let call = $ | |
241 | - | let addr = $ | |
242 | - | let params = $ | |
243 | - | let payments = $ | |
241 | + | let $t059776080 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
242 | + | let call = $t059776080._1 | |
243 | + | let addr = $t059776080._2 | |
244 | + | let params = $t059776080._3 | |
245 | + | let payments = $t059776080._4 | |
244 | 246 | let inv = invoke(addr, call, params, payments) | |
245 | 247 | if ((inv == inv)) | |
246 | 248 | then nil | |
247 | 249 | else throw("Strict value is not equal to itself.") | |
248 | 250 | })) | |
249 | 251 | ||
250 | 252 | ||
251 | 253 | ||
252 | 254 | @Callable(i) | |
253 | 255 | func reissueShareToken (amount) = valueOrElse(isGlobalCaller(i.caller), valueOrElse(isActive(), { | |
254 | 256 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
255 | 257 | [Reissue(shareAssetId, amount, true), ScriptTransfer(i.caller, amount, shareAssetId)] | |
256 | 258 | })) | |
257 | 259 | ||
258 | 260 | ||
259 | 261 | @Verifier(tx) | |
260 | 262 | func verify () = { | |
261 | 263 | let multiSignedByAdmins = { | |
262 | 264 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
263 | 265 | then 1 | |
264 | 266 | else 0 | |
265 | 267 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
266 | 268 | then 1 | |
267 | 269 | else 0 | |
268 | 270 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
269 | 271 | then 1 | |
270 | 272 | else 0 | |
271 | 273 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
272 | 274 | } | |
273 | 275 | multiSignedByAdmins | |
274 | 276 | } | |
275 | 277 |
github/deemru/w8io/026f985 39.10 ms ◑