tx · Djsd1aDex2Jq1UAZyRjDcxNTHQLCgkz8kFEjdPRNT9Z7 3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD: -0.01500000 Waves 2019.10.05 15:43 [706448] smart account 3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD > SELF 0.00000000 Waves
{ "type": 13, "id": "Djsd1aDex2Jq1UAZyRjDcxNTHQLCgkz8kFEjdPRNT9Z7", "fee": 1500000, "feeAssetId": null, "timestamp": 1570279413148, "version": 1, "sender": "3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD", "senderPublicKey": "8W9JLTJTfxrJrBNXxngzueBF4vJqeb6p9jFob7wb6QWQ", "proofs": [ "5oPvTsG7TcVrmB4ccQcfRJ12krkFe4SBwSqKUdT7Qzhq8CyZCcZwfhzcdnzUzuKBa6tG2fQfhS4ZcQM3ZYBegJMy" ], "script": "base64:AAIDAAAAAAAAAAwIARIAEgYKBAgICAgAAAAkAAAAAA1yc2FQdWJsaWNLZXkxCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU9raXV6L0JWNEVqb3hHaFRtTkNidDJUZ2tiU1BIL3c2OWIzRjFyS21ENjFKaVBYdnZGOEwycEk5eE9ZY1c0Rm1vRVpWSGxSUXRBbGFKeWtsMytyc3JFQ0F3RUFBUT09AAAAAA1yc2FQdWJsaWNLZXkyCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQUpuWHpiTS9WMnNEVjFVTGJQU09sSGtsZE9UV1JySGk1ZnhJa0JtdWV2ckNsTVBWSDdycWNjd2lyRE5jTWRJZHdYSEk5QWRoajlGV2p3R0l3ZlUvSzZNQ0F3RUFBUT09AAAAAA1yc2FQdWJsaWNLZXkzCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU9SRGV2eTByNGt6THFPeVNsb0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XRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAARzc3R4BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAARzc3R4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAAEc3N0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAARzc3R4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAABGlzdHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAABGlzdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAARpc3R4AAAABnByb29mcwAAAAAAAAAAAAgFAAAABGlzdHgAAAAPc2VuZGVyUHVibGljS2V5B21kymc=", "chainId": 84, "height": 706448, "spentComplexity": 0 } View: original | compacted Prev: 5mQsmZJmPFCJhXUDARfCcsAjr863bBCGYJrh2mKmdjA1 Next: Ax7Bzp9cDYeE3qjc2L3WuiQ84SeWPUKSRUzYj3tqicJU Diff:
Old | New | Differences | |
---|---|---|---|
35 | 35 | ||
36 | 36 | let WavesMinAmt = (100000000 / divider) | |
37 | 37 | ||
38 | - | let WavesMaxAmt = ( | |
38 | + | let WavesMaxAmt = (WavesMinAmt * 10) | |
39 | 39 | ||
40 | 40 | let BtcMinAmt = (10000 / divider) | |
41 | 41 | ||
42 | - | let BtcMaxAmt = ( | |
42 | + | let BtcMaxAmt = (BtcMinAmt * 10) | |
43 | 43 | ||
44 | 44 | let EthMinAmt = (1000000 / divider) | |
45 | 45 | ||
46 | - | let EthMaxAmt = ( | |
46 | + | let EthMaxAmt = (EthMinAmt * 10) | |
47 | 47 | ||
48 | 48 | let LtcMinAmt = (2000000 / divider) | |
49 | 49 | ||
50 | - | let LtcMaxAmt = ( | |
50 | + | let LtcMaxAmt = (LtcMinAmt * 10) | |
51 | 51 | ||
52 | 52 | let WctMinAmt = (500000000 / divider) | |
53 | 53 | ||
54 | - | let WctMaxAmt = ( | |
54 | + | let WctMaxAmt = (WctMinAmt * 10) | |
55 | 55 | ||
56 | 56 | let VstMinAmt = (500000000 / divider) | |
57 | 57 | ||
58 | - | let VstMaxAmt = ( | |
58 | + | let VstMaxAmt = (VstMinAmt * 10) | |
59 | 59 | ||
60 | 60 | func pmtAmtCheck (pmtAssetId,betAmount) = if ((pmtAssetId == "WAVES")) | |
61 | 61 | then if (if ((betAmount >= WavesMinAmt)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let rsaPublicKey1 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAOkiuz/BV4EjoxGhTmNCbt2TgkbSPH/w69b3F1rKmD61JiPXvvF8L2pI9xOYcW4FmoEZVHlRQtAlaJykl3+rsrECAwEAAQ==") | |
5 | 5 | ||
6 | 6 | let rsaPublicKey2 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJnXzbM/V2sDV1ULbPSOlHkldOTWRrHi5fxIkBmuevrClMPVH7rqccwirDNcMdIdwXHI9Adhj9FWjwGIwfU/K6MCAwEAAQ==") | |
7 | 7 | ||
8 | 8 | let rsaPublicKey3 = fromBase64String("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAORDevy0r4kzLqOySloB63Huv2e4zeHKHjCsy5vtFKmWZbXJa8gZYt4+EklFIo1K9oqu5BAPVfJ3FOzs2U1A+g0CAwEAAQ==") | |
9 | 9 | ||
10 | 10 | let gameTimeFrame = (1440 * 2) | |
11 | 11 | ||
12 | 12 | let commission = 500000 | |
13 | 13 | ||
14 | 14 | let stateAcc = "Accepted" | |
15 | 15 | ||
16 | 16 | let stateWin = "Win" | |
17 | 17 | ||
18 | 18 | let stateTimeout = "WinByTimeout" | |
19 | 19 | ||
20 | 20 | let stateLose = "Lose" | |
21 | 21 | ||
22 | 22 | let wavesId = unit | |
23 | 23 | ||
24 | 24 | let btcId = base58'Gt4HLkHunts7bWbtYP5UCsAPW7TUA4gmQEnjgjbZ2NqB' | |
25 | 25 | ||
26 | 26 | let ethId = base58'6A79GDQj8bdHqUaoJQ3qE1TCPnBc3wFirNCSsAY5RKry' | |
27 | 27 | ||
28 | 28 | let ltcId = base58'7oRhs4zoufHM4KiBDuJwRXUWb9JQaFt98N8ubpmytMmw' | |
29 | 29 | ||
30 | 30 | let vstId = base58'5UyDjBMx1Q8UWhJj1r7JuA6h4aCkKrHE1J19HvMXRpRd' | |
31 | 31 | ||
32 | 32 | let wctId = base58'Ae5W927iuKSLLT6Sdt3bqWze6ZUbYHDWzPY6dLKQusZv' | |
33 | 33 | ||
34 | 34 | let divider = 1000 | |
35 | 35 | ||
36 | 36 | let WavesMinAmt = (100000000 / divider) | |
37 | 37 | ||
38 | - | let WavesMaxAmt = ( | |
38 | + | let WavesMaxAmt = (WavesMinAmt * 10) | |
39 | 39 | ||
40 | 40 | let BtcMinAmt = (10000 / divider) | |
41 | 41 | ||
42 | - | let BtcMaxAmt = ( | |
42 | + | let BtcMaxAmt = (BtcMinAmt * 10) | |
43 | 43 | ||
44 | 44 | let EthMinAmt = (1000000 / divider) | |
45 | 45 | ||
46 | - | let EthMaxAmt = ( | |
46 | + | let EthMaxAmt = (EthMinAmt * 10) | |
47 | 47 | ||
48 | 48 | let LtcMinAmt = (2000000 / divider) | |
49 | 49 | ||
50 | - | let LtcMaxAmt = ( | |
50 | + | let LtcMaxAmt = (LtcMinAmt * 10) | |
51 | 51 | ||
52 | 52 | let WctMinAmt = (500000000 / divider) | |
53 | 53 | ||
54 | - | let WctMaxAmt = ( | |
54 | + | let WctMaxAmt = (WctMinAmt * 10) | |
55 | 55 | ||
56 | 56 | let VstMinAmt = (500000000 / divider) | |
57 | 57 | ||
58 | - | let VstMaxAmt = ( | |
58 | + | let VstMaxAmt = (VstMinAmt * 10) | |
59 | 59 | ||
60 | 60 | func pmtAmtCheck (pmtAssetId,betAmount) = if ((pmtAssetId == "WAVES")) | |
61 | 61 | then if (if ((betAmount >= WavesMinAmt)) | |
62 | 62 | then (WavesMaxAmt >= betAmount) | |
63 | 63 | else false) | |
64 | 64 | then true | |
65 | 65 | else throw("Bet amount is not in range") | |
66 | 66 | else if ((pmtAssetId == "BTC")) | |
67 | 67 | then if (if ((betAmount >= BtcMinAmt)) | |
68 | 68 | then (BtcMaxAmt >= betAmount) | |
69 | 69 | else false) | |
70 | 70 | then true | |
71 | 71 | else throw("Bet amount is not in range") | |
72 | 72 | else if ((pmtAssetId == "ETH")) | |
73 | 73 | then if (if ((betAmount >= EthMinAmt)) | |
74 | 74 | then (EthMaxAmt >= betAmount) | |
75 | 75 | else false) | |
76 | 76 | then true | |
77 | 77 | else throw("Bet amount is not in range") | |
78 | 78 | else if ((pmtAssetId == "LTC")) | |
79 | 79 | then if (if ((betAmount >= LtcMinAmt)) | |
80 | 80 | then (LtcMaxAmt >= betAmount) | |
81 | 81 | else false) | |
82 | 82 | then true | |
83 | 83 | else throw("Bet amount is not in range") | |
84 | 84 | else if ((pmtAssetId == "WCT")) | |
85 | 85 | then if (if ((betAmount >= WctMinAmt)) | |
86 | 86 | then (WctMaxAmt >= betAmount) | |
87 | 87 | else false) | |
88 | 88 | then true | |
89 | 89 | else throw("Bet amount is not in range") | |
90 | 90 | else if (if ((betAmount >= VstMinAmt)) | |
91 | 91 | then (VstMaxAmt >= betAmount) | |
92 | 92 | else false) | |
93 | 93 | then true | |
94 | 94 | else throw("Bet amount is not in range") | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func increaseReservedBalance (pmtAmt,pmtAssetName) = { | |
98 | 98 | let currentReservedBalance = { | |
99 | 99 | let valueReservedBalance = getInteger(this, ("Reserved_" + pmtAssetName)) | |
100 | 100 | match valueReservedBalance { | |
101 | 101 | case a: Int => | |
102 | 102 | a | |
103 | 103 | case _ => | |
104 | 104 | 0 | |
105 | 105 | } | |
106 | 106 | } | |
107 | 107 | let newReservedBalance = (currentReservedBalance + pmtAmt) | |
108 | 108 | if ((wavesBalance(this) >= newReservedBalance)) | |
109 | 109 | then { | |
110 | 110 | let increaseReservedBalance = newReservedBalance | |
111 | 111 | increaseReservedBalance | |
112 | 112 | } | |
113 | 113 | else throw("Bet was rejected. Insufficient funds on game account.") | |
114 | 114 | } | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getDataList (gameId) = { | |
118 | 118 | let getDataString = getString(this, gameId) | |
119 | 119 | let a = match getDataString { | |
120 | 120 | case a: String => | |
121 | 121 | a | |
122 | 122 | case _ => | |
123 | 123 | throw("GameId was not found") | |
124 | 124 | } | |
125 | 125 | split(a, "_") | |
126 | 126 | } | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func intToElem (rsaInt) = if ((2 > rsaInt)) | |
130 | 130 | then "7" | |
131 | 131 | else if ((4 > rsaInt)) | |
132 | 132 | then "6" | |
133 | 133 | else if ((6 > rsaInt)) | |
134 | 134 | then "5" | |
135 | 135 | else if ((8 > rsaInt)) | |
136 | 136 | then "4" | |
137 | 137 | else if ((10 > rsaInt)) | |
138 | 138 | then "3" | |
139 | 139 | else if ((12 > rsaInt)) | |
140 | 140 | then "2" | |
141 | 141 | else "1" | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func rsaToInt (gameId,rsaSign,rsaPublicKey) = { | |
145 | 145 | let rsaCheck = rsaVerify(SHA256, toBytes(gameId), fromBase64String(rsaSign), rsaPublicKey) | |
146 | 146 | if (rsaCheck) | |
147 | 147 | then { | |
148 | 148 | let rsaInt = ((toInt(sha256(fromBase64String(rsaSign))) % 19) + 1) | |
149 | 149 | if (if ((rsaInt > 0)) | |
150 | 150 | then (20 >= rsaInt) | |
151 | 151 | else false) | |
152 | 152 | then rsaInt | |
153 | 153 | else throw("Integer is not in range") | |
154 | 154 | } | |
155 | 155 | else throw("Rsa Signature is invalid") | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func decreaseReservedBalance (betAmt,assetId) = { | |
160 | 160 | let valueReservedBalance = getInteger(this, ("Reserved_" + assetId)) | |
161 | 161 | let extractReservedBalance = match valueReservedBalance { | |
162 | 162 | case a: Int => | |
163 | 163 | a | |
164 | 164 | case _ => | |
165 | 165 | 0 | |
166 | 166 | } | |
167 | 167 | let decreaseReservedBalance = (extractReservedBalance - betAmt) | |
168 | 168 | if ((decreaseReservedBalance > 0)) | |
169 | 169 | then decreaseReservedBalance | |
170 | 170 | else throw("Reserved balance couldn't be less than 0") | |
171 | 171 | } | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func defineMultiplier (threeDrums,twoDrums) = if ((threeDrums == "777")) | |
175 | 175 | then 5370 | |
176 | 176 | else if ((threeDrums == "666")) | |
177 | 177 | then 1300 | |
178 | 178 | else if ((threeDrums == "555")) | |
179 | 179 | then 450 | |
180 | 180 | else if ((threeDrums == "444")) | |
181 | 181 | then 200 | |
182 | 182 | else if ((threeDrums == "333")) | |
183 | 183 | then 150 | |
184 | 184 | else if ((threeDrums == "222")) | |
185 | 185 | then 110 | |
186 | 186 | else if ((threeDrums == "111")) | |
187 | 187 | then 40 | |
188 | 188 | else if ((twoDrums == "77")) | |
189 | 189 | then 270 | |
190 | 190 | else if ((twoDrums == "66")) | |
191 | 191 | then 130 | |
192 | 192 | else if ((twoDrums == "55")) | |
193 | 193 | then 65 | |
194 | 194 | else if ((twoDrums == "44")) | |
195 | 195 | then 30 | |
196 | 196 | else if ((twoDrums == "33")) | |
197 | 197 | then 20 | |
198 | 198 | else if ((twoDrums == "22")) | |
199 | 199 | then 15 | |
200 | 200 | else if ((twoDrums == "11")) | |
201 | 201 | then 10 | |
202 | 202 | else 0 | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func AssetNameToBase58 (assetName) = if ((assetName == "WAVES")) | |
206 | 206 | then wavesId | |
207 | 207 | else if ((assetName == "BTC")) | |
208 | 208 | then btcId | |
209 | 209 | else if ((assetName == "ETH")) | |
210 | 210 | then ethId | |
211 | 211 | else if ((assetName == "LTC")) | |
212 | 212 | then ltcId | |
213 | 213 | else if ((assetName == "VST")) | |
214 | 214 | then vstId | |
215 | 215 | else if ((assetName == "WCT")) | |
216 | 216 | then wctId | |
217 | 217 | else throw("Asset name is incorrect") | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | @Callable(i) | |
221 | 221 | func makeBet () = { | |
222 | 222 | let pmt = extract(i.payment) | |
223 | 223 | let betAmount = (pmt.amount - commission) | |
224 | 224 | let gameId = toBase58String(i.transactionId) | |
225 | 225 | let gameStart = height | |
226 | 226 | let playerPublicKey = toBase58String(i.callerPublicKey) | |
227 | 227 | let pmtAssetName = if (!(isDefined(pmt.assetId))) | |
228 | 228 | then "WAVES" | |
229 | 229 | else if ((pmt.assetId == btcId)) | |
230 | 230 | then "BTC" | |
231 | 231 | else if ((pmt.assetId == ethId)) | |
232 | 232 | then "ETH" | |
233 | 233 | else if ((pmt.assetId == ltcId)) | |
234 | 234 | then "LTC" | |
235 | 235 | else if ((pmt.assetId == wctId)) | |
236 | 236 | then "WCT" | |
237 | 237 | else if ((pmt.assetId == vstId)) | |
238 | 238 | then "VST" | |
239 | 239 | else throw("AssetId is incorrect") | |
240 | 240 | let setReservedBalance = increaseReservedBalance(betAmount, pmtAssetName) | |
241 | 241 | let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, betAmount) | |
242 | 242 | if (pmtAmtCorrect) | |
243 | 243 | then { | |
244 | 244 | let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString(betAmount)) + "_") + pmtAssetName) + "_") + toString(gameStart)) | |
245 | 245 | WriteSet([DataEntry(gameId, dataString), DataEntry(("Reserved_" + pmtAssetName), setReservedBalance)]) | |
246 | 246 | } | |
247 | 247 | else throw("assetId is incorrect") | |
248 | 248 | } | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | ||
252 | 252 | @Callable(i) | |
253 | 253 | func playGame (gameId,rsaSign1,rsaSign2,rsaSign3) = { | |
254 | 254 | let dataList = getDataList(gameId) | |
255 | 255 | let gameState = dataList[0] | |
256 | 256 | let playerAddress = addressFromPublicKey(fromBase58String(dataList[1])) | |
257 | 257 | let betAmt = parseIntValue(dataList[2]) | |
258 | 258 | let assetName = dataList[3] | |
259 | 259 | let gameStart = parseIntValue(dataList[4]) | |
260 | 260 | let assetId58 = AssetNameToBase58(assetName) | |
261 | 261 | let gameTimeCheck = (gameTimeFrame > (height - gameStart)) | |
262 | 262 | let stateCorrect = (gameState == stateAcc) | |
263 | 263 | let setReservedBalance = decreaseReservedBalance(betAmt, assetName) | |
264 | 264 | let droppedElementsList = { | |
265 | 265 | let roll1Int = rsaToInt(gameId, rsaSign1, rsaPublicKey1) | |
266 | 266 | let roll2Int = rsaToInt(gameId, rsaSign2, rsaPublicKey2) | |
267 | 267 | let roll3Int = rsaToInt(gameId, rsaSign3, rsaPublicKey3) | |
268 | 268 | let element1 = intToElem(roll1Int) | |
269 | 269 | let element2 = intToElem(roll2Int) | |
270 | 270 | let element3 = intToElem(roll3Int) | |
271 | 271 | [element1, element2, element3] | |
272 | 272 | } | |
273 | 273 | let winAmt = { | |
274 | 274 | let threeDrums = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2]) | |
275 | 275 | let twoDrums = (droppedElementsList[0] + droppedElementsList[1]) | |
276 | 276 | let multiplier = defineMultiplier(threeDrums, twoDrums) | |
277 | 277 | ((betAmt * multiplier) / 10) | |
278 | 278 | } | |
279 | 279 | let winPmtAmt = { | |
280 | 280 | let balance = assetBalance(this, assetId58) | |
281 | 281 | if ((winAmt > balance)) | |
282 | 282 | then (betAmt * 2) | |
283 | 283 | else winAmt | |
284 | 284 | } | |
285 | 285 | let stringForNewData = ((((((dataList[1] + "_") + dataList[2]) + "_") + dataList[3]) + "_") + dataList[4]) | |
286 | 286 | let droppedElements = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2]) | |
287 | 287 | if (stateCorrect) | |
288 | 288 | then if (gameTimeCheck) | |
289 | 289 | then if ((winAmt == 0)) | |
290 | 290 | then WriteSet([DataEntry(gameId, ((((((stateLose + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]) | |
291 | 291 | else ScriptResult(WriteSet([DataEntry(gameId, ((((((stateWin + "_") + stringForNewData) + "_") + toString(winAmt)) + "_") + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, winPmtAmt, assetId58)])) | |
292 | 292 | else ScriptResult(WriteSet([DataEntry(gameId, (stateTimeout + stringForNewData)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, betAmt, assetId58)])) | |
293 | 293 | else throw("Game state is incorrect") | |
294 | 294 | } | |
295 | 295 | ||
296 | 296 | ||
297 | 297 | @Verifier(tx) | |
298 | 298 | func verify () = match tx { | |
299 | 299 | case ttx: TransferTransaction => | |
300 | 300 | let valueReservedBalance = getInteger(this, "Reserved") | |
301 | 301 | let reservedBalance = match valueReservedBalance { | |
302 | 302 | case a: Int => | |
303 | 303 | a | |
304 | 304 | case _ => | |
305 | 305 | 0 | |
306 | 306 | } | |
307 | 307 | let availableBalance = (wavesBalance(this) - reservedBalance) | |
308 | 308 | let availibleAmount = (availableBalance >= ttx.amount) | |
309 | 309 | let signature = sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey) | |
310 | 310 | if (availibleAmount) | |
311 | 311 | then signature | |
312 | 312 | else false | |
313 | 313 | case sstx: SetScriptTransaction => | |
314 | 314 | sigVerify(sstx.bodyBytes, sstx.proofs[0], sstx.senderPublicKey) | |
315 | 315 | case istx: InvokeScriptTransaction => | |
316 | 316 | sigVerify(istx.bodyBytes, istx.proofs[0], istx.senderPublicKey) | |
317 | 317 | case _ => | |
318 | 318 | false | |
319 | 319 | } | |
320 | 320 |
github/deemru/w8io/169f3d6 51.08 ms ◑