tx · 91q125RS1LVATYvvTeumC7EUEvZ1EXsauzp2ZUCPqbQe 3N4Ph9WAuB4cPRsTbeicm8T6Pqr9vS88EjT: -0.01300000 Waves 2023.03.16 13:50 [2492482] smart account 3N4Ph9WAuB4cPRsTbeicm8T6Pqr9vS88EjT > SELF 0.00000000 Waves
{ "type": 13, "id": "91q125RS1LVATYvvTeumC7EUEvZ1EXsauzp2ZUCPqbQe", "fee": 1300000, "feeAssetId": null, "timestamp": 1678963811065, "version": 2, "chainId": 84, "sender": "3N4Ph9WAuB4cPRsTbeicm8T6Pqr9vS88EjT", "senderPublicKey": "ETecocSPYjiwv1GLwr7mcAMPpBjfWaK95CSKoJckSnzn", "proofs": [ "5rvoDw5qDRqC36K1TYD9wQS2JXPRcrMVJ1XFvyHS2JrgdrTogBymHxm2zcmGqkdvkETREyUGDxBqHU2WQsgxSMTX" ], "script": "base64:BgIsCAISCgoICAgBAQEBAQESAwoBCBIDCgEIEgUKAwgIARIECgIICBIDCgEIEgASAANTRVACAl9fARNrZXlNYW5hZ2VyUHVibGljS2V5AAIUJXNfX21hbmFnZXJQdWJsaWNLZXkBGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAIbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5ARBrZXlXaXRoZHJhd0RlbGF5AgZhc3NldEEGYXNzZXRCCQC5CQIJAMwIAgIGJXMlcyVzCQDMCAICDXdpdGhkcmF3RGVsYXkJAMwIAgUGYXNzZXRBCQDMCAIFBmFzc2V0QgUDbmlsBQNTRVABFWtleURlcG9zaXRGZWVQZXJtaWxsZQIGYXNzZXRBBmFzc2V0QgkAuQkCCQDMCAICBiVzJXMlcwkAzAgCAhJkZXBvc2l0RmVlUGVybWlsbGUJAMwIAgUGYXNzZXRBCQDMCAIFBmFzc2V0QgUDbmlsBQNTRVABFmtleVdpdGhkcmF3RmVlUGVybWlsbGUCBmFzc2V0QQZhc3NldEIJALkJAgkAzAgCAgYlcyVzJXMJAMwIAgITd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V2YWx1ZQEFAnBtCQDMCAIJAQtEZWxldGVFbnRyeQEJARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tleXMxdBQ=", "height": 2492482, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8msCvEVu5SpPbTHf78PWC4E9jXQSyKJmVSppcu6V6Geh Next: 5a7ZLuDn5KykLceXgCgHAdoicnRddLYyDkgjAtU9EzK8 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func keyWithdrawDelay (assetA,assetB) = makeString(["%s%s%s", "withdrawDelay", assetA, assetB], SEP) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func keyDepositFeePermille (assetA,assetB) = makeString(["%s%s%s", "depositFeePermille", assetA, assetB], SEP) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func keyWithdrawFeePermille (assetA,assetB) = makeString(["%s%s%s", "withdrawFeePermille", assetA, assetB], SEP) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func keyMinAmountDeposit (assetA,assetB) = makeString(["%s%s%s", "minAmountDeposit", assetA, assetB], SEP) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func keyAssetsPairStatus (assetA,assetB) = makeString(["%s%s%s", "assetsPairStatus", assetA, assetB], SEP) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func keyMinAmountWithdraw (assetA,assetB) = makeString(["%s%s%s", "minAmountWithdraw", assetA, assetB], SEP) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func keyBalance (assetA,assetB,userAddress) = makeString(["%s%s%s%s", "balance", assetA, assetB, userAddress], SEP) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func keyTotalFeeCollectedDeposit (assetA,assetB) = makeString(["%s%s%s%s", "totalFeeCollected", "deposit", assetA, assetB], SEP) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func keyProcessInProgress (userAddress,assetA,assetB,heightInKey) = makeString(["%s%s%s%s%s%d", "withdrawProcess", "inProgress", userAddress, assetA, assetB, toString(heightInKey)], SEP) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func keyProcessDone (userAddress,assetA,assetB,heightInKey) = makeString(["%s%s%s%s%s%d", "withdrawProcess", "done", userAddress, assetA, assetB, toString(heightInKey)], SEP) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
43 | 43 | case s: String => | |
44 | 44 | fromBase58String(s) | |
45 | 45 | case _: Unit => | |
46 | 46 | unit | |
47 | 47 | case _ => | |
48 | 48 | throw("Match error") | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
53 | 53 | case s: String => | |
54 | 54 | fromBase58String(s) | |
55 | 55 | case _: Unit => | |
56 | 56 | unit | |
57 | 57 | case _ => | |
58 | 58 | throw("Match error") | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func mustManager (i) = { | |
63 | 63 | let pd = throw("Permission denied.") | |
64 | 64 | match managerPublicKeyOrUnit() { | |
65 | 65 | case pk: ByteVector => | |
66 | 66 | if ((i.callerPublicKey == pk)) | |
67 | 67 | then true | |
68 | 68 | else pd | |
69 | 69 | case _: Unit => | |
70 | 70 | if ((i.caller == this)) | |
71 | 71 | then true | |
72 | 72 | else pd | |
73 | 73 | case _ => | |
74 | 74 | throw("Match error") | |
75 | 75 | } | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func fmtErr (msg) = makeString(["otc_multiasset.ride:", msg], " ") | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func throwErr (msg) = throw(fmtErr(msg)) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | @Callable(i) | |
86 | 86 | func registerAsset (assetA,assetB,withdrawDelay,depositFee,withdrawFee,minAmountDeposit,minAmountWithdraw,pairStatus) = { | |
87 | 87 | let checkCaller = mustManager(i) | |
88 | 88 | if ((checkCaller == checkCaller)) | |
89 | 89 | then { | |
90 | 90 | let withdrawDelayKey = keyWithdrawDelay(assetA, assetB) | |
91 | 91 | let depositFeePermilleKey = keyDepositFeePermille(assetA, assetB) | |
92 | 92 | let withdrawFeePermilleKey = keyWithdrawFeePermille(assetA, assetB) | |
93 | 93 | let minAmountDepositKey = keyMinAmountDeposit(assetA, assetB) | |
94 | 94 | let minAmountWithdrawKey = keyMinAmountWithdraw(assetA, assetB) | |
95 | 95 | let pairStatusKey = keyAssetsPairStatus(assetA, assetB) | |
96 | 96 | [IntegerEntry(withdrawDelayKey, withdrawDelay), IntegerEntry(depositFeePermilleKey, depositFee), IntegerEntry(withdrawFeePermilleKey, withdrawFee), IntegerEntry(minAmountDepositKey, minAmountDeposit), IntegerEntry(minAmountWithdrawKey, minAmountWithdraw), IntegerEntry(pairStatusKey, pairStatus)] | |
97 | 97 | } | |
98 | 98 | else throw("Strict value is not equal to itself.") | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | ||
103 | 103 | @Callable(i) | |
104 | 104 | func swapAssetsAToB (assetB) = { | |
105 | 105 | let payment = value(i.payments[0]) | |
106 | 106 | let assetA = toBase58String(value(payment.assetId)) | |
107 | 107 | let asset = fromBase58String(value(assetB)) | |
108 | 108 | let userAddress = toString(i.caller) | |
109 | 109 | let minAmountDeposit = valueOrErrorMessage(getInteger(keyMinAmountDeposit(assetA, assetB)), fmtErr("This asset pair does not exist.")) | |
110 | 110 | let toDeposit = payment.amount | |
111 | 111 | let depositFee = valueOrErrorMessage(getInteger(keyDepositFeePermille(assetA, assetB)), fmtErr("The deposit fee for this pair of assets is not set.")) | |
112 | 112 | let fee = ((toDeposit / 1000) * depositFee) | |
113 | 113 | let currentUserBalance = valueOrElse(getInteger(keyBalance(assetA, assetB, userAddress)), 0) | |
114 | 114 | let totalCommissions = valueOrElse(getInteger(keyTotalFeeCollectedDeposit(assetA, assetB)), 0) | |
115 | 115 | let pairStatus = valueOrErrorMessage(getInteger(keyAssetsPairStatus(assetA, assetB)), fmtErr("The asset pair status for this pair of assets is not set.")) | |
116 | 116 | let checkPairStatus = if ((pairStatus == 0)) | |
117 | 117 | then true | |
118 | 118 | else throwErr("The couple's deposit is blocked.") | |
119 | 119 | if ((checkPairStatus == checkPairStatus)) | |
120 | 120 | then { | |
121 | 121 | let checkPayment = if ((toDeposit >= minAmountDeposit)) | |
122 | 122 | then true | |
123 | 123 | else throwErr("The deposit amount is less than the minimum.") | |
124 | 124 | if ((checkPayment == checkPayment)) | |
125 | 125 | then { | |
126 | 126 | let newBalance = ((currentUserBalance + toDeposit) - fee) | |
127 | 127 | let checkBalance = if ((newBalance > 0)) | |
128 | 128 | then true | |
129 | 129 | else throwErr("The final balance is less than or equal to 0.") | |
130 | 130 | if ((checkBalance == checkBalance)) | |
131 | 131 | then [IntegerEntry(keyBalance(assetA, assetB, userAddress), newBalance), IntegerEntry(keyTotalFeeCollectedDeposit(assetA, assetB), (totalCommissions + fee)), ScriptTransfer(i.caller, (toDeposit - fee), asset)] | |
132 | 132 | else throw("Strict value is not equal to itself.") | |
133 | 133 | } | |
134 | 134 | else throw("Strict value is not equal to itself.") | |
135 | 135 | } | |
136 | 136 | else throw("Strict value is not equal to itself.") | |
137 | 137 | } | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | ||
141 | 141 | @Callable(i) | |
142 | 142 | func initializationSwapAssetsBToA (assetA) = { | |
143 | 143 | let payment = value(i.payments[0]) | |
144 | 144 | let toWithdraw = payment.amount | |
145 | 145 | let assetB = toBase58String(value(payment.assetId)) | |
146 | 146 | let userAddress = toString(i.caller) | |
147 | 147 | let minAmountWithdraw = valueOrErrorMessage(getInteger(keyMinAmountWithdraw(assetA, assetB)), fmtErr("The minimum withdrawal amount for this pair of assets is not set.")) | |
148 | 148 | let assetLockHeight = (height + valueOrErrorMessage(getInteger(keyWithdrawDelay(assetA, assetB)), fmtErr("Withdrawal delay is not set for the specified pair."))) | |
149 | 149 | let currentUserBalance = valueOrErrorMessage(getInteger(keyBalance(assetA, assetB, userAddress)), fmtErr("This user balance does not exist.")) | |
150 | 150 | let totalCommissions = valueOrElse(getInteger(keyTotalFeeCollectedDeposit(assetA, assetB)), 0) | |
151 | 151 | let withdrawFeePermilleKey = keyWithdrawFeePermille(assetA, assetB) | |
152 | 152 | let withdrawFee = valueOrErrorMessage(getInteger(withdrawFeePermilleKey), fmtErr("The withdrawal fee for this pair of assets is not set.")) | |
153 | 153 | let fee = ((toWithdraw / 1000) * withdrawFee) | |
154 | 154 | let newBalance = (currentUserBalance - toWithdraw) | |
155 | 155 | let checkBalance = if ((newBalance >= 0)) | |
156 | 156 | then true | |
157 | 157 | else throwErr("Swap amount fail, amount is to small.") | |
158 | 158 | if ((checkBalance == checkBalance)) | |
159 | 159 | then { | |
160 | 160 | let checkPayment = if ((toWithdraw >= minAmountWithdraw)) | |
161 | 161 | then true | |
162 | 162 | else throwErr("The withdraw amount is less than the minimum.") | |
163 | 163 | if ((checkPayment == checkPayment)) | |
164 | 164 | then { | |
165 | 165 | let checkProcessInProgress = if ((getInteger(keyProcessInProgress(userAddress, assetA, assetB, assetLockHeight)) == unit)) | |
166 | 166 | then true | |
167 | 167 | else throwErr("At this height, there is already an exchange of this pair.") | |
168 | 168 | if ((checkProcessInProgress == checkProcessInProgress)) | |
169 | 169 | then [IntegerEntry(keyBalance(assetA, assetB, userAddress), newBalance), IntegerEntry(keyProcessInProgress(userAddress, assetA, assetB, assetLockHeight), (toWithdraw - fee)), IntegerEntry(keyTotalFeeCollectedDeposit(assetA, assetB), (totalCommissions + fee))] | |
170 | 170 | else throw("Strict value is not equal to itself.") | |
171 | 171 | } | |
172 | 172 | else throw("Strict value is not equal to itself.") | |
173 | 173 | } | |
174 | 174 | else throw("Strict value is not equal to itself.") | |
175 | 175 | } | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | ||
179 | 179 | @Callable(i) | |
180 | 180 | func withdrawAsset (assetA,assetB,heightInKey) = { | |
181 | 181 | let userAddress = toString(i.caller) | |
182 | 182 | let toWithdraw = valueOrErrorMessage(getInteger(keyProcessInProgress(userAddress, assetA, assetB, heightInKey)), fmtErr("At this height, withdraw was not initialized with this pair of assets.")) | |
183 | 183 | let asset = fromBase58String(value(assetA)) | |
184 | 184 | let checkHeight = if ((height >= heightInKey)) | |
185 | 185 | then true | |
186 | 186 | else throwErr((("Withdrawal is possible after " + toString(heightInKey)) + " height or you have already withdrawn.")) | |
187 | 187 | if ((checkHeight == checkHeight)) | |
188 | 188 | then [DeleteEntry(keyProcessInProgress(userAddress, assetA, assetB, heightInKey)), IntegerEntry(keyProcessDone(userAddress, assetA, assetB, heightInKey), toWithdraw), ScriptTransfer(i.caller, toWithdraw, asset)] | |
189 | 189 | else throw("Strict value is not equal to itself.") | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | ||
194 | 194 | @Callable(i) | |
195 | 195 | func withdrawFee (assetA,assetB) = { | |
196 | 196 | let checkCaller = mustManager(i) | |
197 | 197 | if ((checkCaller == checkCaller)) | |
198 | 198 | then { | |
199 | 199 | let toWithdrawA = valueOrElse(getInteger(keyTotalFeeCollectedDeposit(assetA, assetB)), 0) | |
200 | 200 | let withdrawAssetA = fromBase58String(value(assetA)) | |
201 | 201 | [IntegerEntry(keyTotalFeeCollectedDeposit(assetA, assetB), 0), ScriptTransfer(i.caller, toWithdrawA, withdrawAssetA)] | |
202 | 202 | } | |
203 | 203 | else throw("Strict value is not equal to itself.") | |
204 | 204 | } | |
205 | 205 | ||
206 | 206 | ||
207 | 207 | ||
208 | 208 | @Callable(i) | |
209 | 209 | func setManager (pendingManagerPublicKey) = { | |
210 | 210 | let checkCaller = mustManager(i) | |
211 | 211 | if ((checkCaller == checkCaller)) | |
212 | 212 | then { | |
213 | 213 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
214 | 214 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
215 | 215 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
216 | 216 | else throw("Strict value is not equal to itself.") | |
217 | 217 | } | |
218 | 218 | else throw("Strict value is not equal to itself.") | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | ||
223 | 223 | @Callable(i) | |
224 | 224 | func confirmManager () = { | |
225 | 225 | let pm = pendingManagerPublicKeyOrUnit() | |
226 | 226 | let hasPM = if (isDefined(pm)) | |
227 | 227 | then true | |
228 | 228 | else throwErr("No pending manager.") | |
229 | 229 | if ((hasPM == hasPM)) | |
230 | 230 | then { | |
231 | 231 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
232 | 232 | then true | |
233 | 233 | else throwErr("You are not pending manager.") | |
234 | 234 | if ((checkPM == checkPM)) | |
235 | 235 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
236 | 236 | else throw("Strict value is not equal to itself.") | |
237 | 237 | } | |
238 | 238 | else throw("Strict value is not equal to itself.") | |
239 | 239 | } | |
240 | 240 | ||
241 | 241 | ||
242 | 242 | @Verifier(tx) | |
243 | 243 | func verify () = { | |
244 | 244 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
245 | 245 | case pk: ByteVector => | |
246 | 246 | pk | |
247 | 247 | case _: Unit => | |
248 | 248 | tx.senderPublicKey | |
249 | 249 | case _ => | |
250 | 250 | throw("Match error") | |
251 | 251 | } | |
252 | 252 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
253 | 253 | } | |
254 | 254 |
github/deemru/w8io/026f985 30.48 ms ◑