tx · GMMhKUU76PpgDBTWs7PaEVDBitEAsfHGuTkncsMvEvao

3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV:  -1.00400000 Waves

2019.08.08 18:36 [622172] smart asset 3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV > SELF 0.000000 TXRP

{ "type": 15, "id": "GMMhKUU76PpgDBTWs7PaEVDBitEAsfHGuTkncsMvEvao", "fee": 100400000, "feeAssetId": null, "timestamp": 1565278588520, "version": 1, "sender": "3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV", "senderPublicKey": "DANkK8NJhJ9K7AHbve8QzKkbyvJzr5pbttLhba7d9BGm", "proofs": [ "Xr6797heZU84tAb6DcfAqXEfxBrPtCVeVX4NddA4PeZasosHMhJigqwUmjVicakNdebLcHTPDbxuVu9f4x8kgw2" ], "assetId": "HUdXNRE4VcCx64PCPYwh6KL2cxvRaKcR8bXe3Ar9fG4p", "script": "base64:AwQAAAAObWF0Y2hlckFkZHJlc3MJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNNczhmU2ZBeEJMRGpLdk5WZ0FDUnpRb0JMQ3RDV3h0YXd1BAAAABBtYXRjaGVyUHVibGljS2V5AQAAACBThDuRiQKq/0TcMlLglZN11ZQJlziVeFsi3R5LSjzVTwQAAAAOZ2F0ZXdheUFkZHJlc3MJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNNcmh0enY5S0V0ang0bUc0N294Z2phaEhLVzMzb1RudEVWBAAAABB3aGl0ZWxpc3RBZGRyZXNzCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTjZEd1d4VDgybkdKVXdCd2Q3TDUxNHIydTcxZ3I3V2h3SgQAAAAUZEFwcFdoaXRlbGlzdEFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVR+ZQJfWyfFbW//7FjY3Cz3zzwo/8TmrxYEAAAAGmdhdGV3YXlDb250cm9sQXNzZXRBZGRyZ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QEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABBQAAABZ3aGl0ZTFMaXN0T3ZlcmFsbEVudHJ5BgQAAAALY3VyMUJhbGFuY2UJAAPrAAAAAggFAAAAAnR4AAAABnNlbmRlcgUAAAAHYXNzZXRJZAMJAABmAAAAAgkBAAAAB2V4dHJhY3QAAAABBQAAABZ3aGl0ZTFMaXN0T3ZlcmFsbEVudHJ5CQAAZQAAAAIFAAAAC2N1cjFCYWxhbmNlCAUAAAAHcGF5bWVudAAAAAZhbW91bnQJAAACAAAAAQIAAAAjVW5hYmxlIHRvIHNlbmQgc3VjaCBhbW91bnQgKHR5cGU9MSkGBAAAAAtjdXIxQmFsYW5jZQkAA+sAAAACCAUAAAACdHgAAAAGc2VuZGVyBQAAAAdhc3NldElkAwkAAGYAAAACCQEAAAAHZXh0cmFjdAAAAAEFAAAAFHdoaXRlMUxpc3RBc3NldEVudHJ5CQAAZQAAAAIFAAAAC2N1cjFCYWxhbmNlCAUAAAAHcGF5bWVudAAAAAZhbW91bnQJAAACAAAAAQIAAAAjVW5hYmxlIHRvIHNlbmQgc3VjaCBhbW91bnQgKHR5cGU9MikGBwfNUMWy", "chainId": 84, "height": 622172, "spentComplexity": 0 } View: original | compacted Prev: EhaQQrqbwFgyWKCoRVkqqnQYZQ4YrKg46buqUwKGsyKU Next: FbJMNP2pZ4MC7Hoq9hfgRQBQvfFqrGe1pDr9d5ZZjLta Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 2 #-}
1+{-# STDLIB_VERSION 3 #-}
22 {-# CONTENT_TYPE EXPRESSION #-}
33 let matcherAddress = addressFromString("3Ms8fSfAxBLDjKvNVgACRzQoBLCtCWxtawu")
4+let matcherPublicKey = base58'6d1nbhBxLCxjUyL9xXcX2VVxj2kcKiYny7VqH4FwbApv'
45 let gatewayAddress = addressFromString("3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV")
5-let WhitelistAddr = addressFromString("3N6DwWxT82nGJUwBwd7L514r2u71gr7WhwJ")
6+let whitelistAddress = addressFromString("3N6DwWxT82nGJUwBwd7L514r2u71gr7WhwJ")
7+let dAppWhitelistAddress = Address(base58'3N1SPvLZgv6FMfe5WNUtnPzt3okYxcJhYnR')
8+let gatewayControlAssetAddress = base58'3w8UGTKzu3YvwRrvWeDuXkUVxdg1RuX1VCy6QRw86Fw4'
9+let pAddress1 = addressFromString("3NCVDaT1ASbRd42hBSw4EG6ojGVRGtvMiz1")
10+let pAddress2 = addressFromString("3Ms2kTAxdrcXDxwedfbNjSi6ewGCUqt3heZ")
11+let pAddress3 = addressFromString("3N6ognm7xnQSFiownS1Df1LacJUQXvfDFLe")
12+let pAddress4 = addressFromString("3MtVCmN9MZbWf9qxiMFoEPBrdc2fLp3SvuC")
13+let pAddress5 = addressFromString("3MuWG8gsTK4RQBsm97sMCuUXW99JvRxwYSg")
614 let validState = 1000
7-let Ver = "1.1.4-testnet"
15+let ver = "2.0.0-testnet"
816 match tx {
917 case tx: MassTransferTransaction =>
1018 false
1119 case tx: TransferTransaction =>
12- if (if ((tx.sender != gatewayAddress))
13- then (tx.recipient != gatewayAddress)
14- else false)
15- then throw("Only transactions with a gateway are allowed")
16- else if ((tx.sender == gatewayAddress))
17- then true
18- else {
19- let white1List = toBase58String(tx.sender.bytes)
20- let assetTxt = toBase58String(extract(tx.assetId))
21- let white1ListAsset = ((white1List + "_") + assetTxt)
22- let white1ListOverall = ("res_" + assetTxt)
23- let white1ListEntry = getInteger(extract(WhitelistAddr), white1List)
24- if (!(isDefined(white1ListEntry)))
25- then throw("The sender's address is not in the white list")
26- else if ((white1ListEntry != validState))
27- then throw("Sender is not in valid state")
28- else {
29- let white1ListAssetEntry = getInteger(extract(WhitelistAddr), white1ListAsset)
30- if (!(isDefined(white1ListAssetEntry)))
31- then {
32- let white1ListOverallEntry = getInteger(extract(WhitelistAddr), white1ListOverall)
33- if (!(isDefined(white1ListOverallEntry)))
34- then true
35- else {
36- let cur1Balance = assetBalance(tx.sender, tx.assetId)
37- if ((extract(white1ListOverallEntry) > (cur1Balance - tx.amount)))
38- then throw("Unable to send such amount (type=1)")
39- else true
40- }
41- }
42- else {
43- let cur1Balance = assetBalance(tx.sender, tx.assetId)
44- if ((extract(white1ListAssetEntry) > (cur1Balance - tx.amount)))
45- then throw("Unable to send such amount (type=2)")
46- else true
47- }
48- }
49- }
20+ let isDAppAllowed = match getInteger(dAppWhitelistAddress, toBase58String(tx.sender.bytes)) {
21+ case a: Int =>
22+ a
23+ case _ =>
24+ -255
25+ }
26+ if ((isDAppAllowed != -255))
27+ then true
28+ else if (if ((tx.sender != gatewayAddress))
29+ then (tx.recipient != gatewayAddress)
30+ else false)
31+ then throw("Only transactions with a gateway are allowed")
32+ else if ((tx.sender == gatewayAddress))
33+ then true
34+ else {
35+ let white1List = toBase58String(tx.sender.bytes)
36+ let assetTxt = toBase58String(extract(tx.assetId))
37+ let white1ListAsset = ((white1List + "_") + assetTxt)
38+ let white1ListOverall = ("res_" + assetTxt)
39+ let white1ListEntry = getInteger(extract(whitelistAddress), white1List)
40+ if (!(isDefined(white1ListEntry)))
41+ then throw("The sender's address is not in the white list")
42+ else if ((white1ListEntry != validState))
43+ then throw("Sender is not in valid state")
44+ else {
45+ let white1ListAssetEntry = getInteger(extract(whitelistAddress), white1ListAsset)
46+ if (!(isDefined(white1ListAssetEntry)))
47+ then {
48+ let white1ListOverallEntry = getInteger(extract(whitelistAddress), white1ListOverall)
49+ if (!(isDefined(white1ListOverallEntry)))
50+ then true
51+ else {
52+ let cur1Balance = assetBalance(tx.sender, tx.assetId)
53+ if ((extract(white1ListOverallEntry) > (cur1Balance - tx.amount)))
54+ then throw("Unable to send such amount (type=1)")
55+ else true
56+ }
57+ }
58+ else {
59+ let cur1Balance = assetBalance(tx.sender, tx.assetId)
60+ if ((extract(white1ListAssetEntry) > (cur1Balance - tx.amount)))
61+ then throw("Unable to send such amount (type=2)")
62+ else true
63+ }
64+ }
65+ }
5066 case tx: ExchangeTransaction =>
5167 if ((tx.sender != matcherAddress))
5268 then throw("Incorrect matcher address")
5571 let outcoming2Account = tx.sellOrder.sender
5672 let white1List = toBase58String(outcoming1Account.bytes)
5773 let white2List = toBase58String(outcoming2Account.bytes)
58- let white1ListEntry = getInteger(extract(WhitelistAddr), toBase58String(outcoming1Account.bytes))
59- let white2ListEntry = getInteger(extract(WhitelistAddr), toBase58String(outcoming2Account.bytes))
74+ let white1ListEntry = getInteger(extract(whitelistAddress), toBase58String(outcoming1Account.bytes))
75+ let white2ListEntry = getInteger(extract(whitelistAddress), toBase58String(outcoming2Account.bytes))
6076 if (!(isDefined(white1ListEntry)))
6177 then throw((("User " + white1List) + " not in white list"))
6278 else if ((white1ListEntry != validState))
6884 else true
6985 }
7086 case tx: SetAssetScriptTransaction =>
71- let pAddress1 = addressFromString("3NCVDaT1ASbRd42hBSw4EG6ojGVRGtvMiz1")
72- let pAddress2 = addressFromString("3Ms2kTAxdrcXDxwedfbNjSi6ewGCUqt3heZ")
73- let pAddress3 = addressFromString("3N6ognm7xnQSFiownS1Df1LacJUQXvfDFLe")
74- let pAddress4 = addressFromString("3MtVCmN9MZbWf9qxiMFoEPBrdc2fLp3SvuC")
75- let pAddress5 = addressFromString("3MuWG8gsTK4RQBsm97sMCuUXW99JvRxwYSg")
7687 let pKey1Signed = if (isDefined(getInteger(extract(pAddress1), toBase58String(tx.id))))
7788 then 1
7889 else 0
93104 (tx.sender == gatewayAddress)
94105 case tx: ReissueTransaction =>
95106 (tx.sender == gatewayAddress)
107+ case tx: InvokeScriptTransaction =>
108+ let isDAppAllowed = match getInteger(dAppWhitelistAddress, toBase58String(addressFromRecipient(tx.dApp).bytes)) {
109+ case a: Int =>
110+ a
111+ case _ =>
112+ -255
113+ }
114+ if ((isDAppAllowed != -255))
115+ then {
116+ let white1List = toBase58String(tx.sender.bytes)
117+ let isPaymentExist = match tx.payment {
118+ case a: AttachedPayment =>
119+ true
120+ case _ =>
121+ false
122+ }
123+ if ((isPaymentExist == false))
124+ then true
125+ else {
126+ let payment = extract(tx.payment)
127+ let assetId = extract(payment.assetId)
128+ let assetTxt = toBase58String(assetId)
129+ let white1ListAsset = ((white1List + "_") + assetTxt)
130+ let white1ListOverall = ("res_" + assetTxt)
131+ let white1ListEntry = getInteger(extract(whitelistAddress), white1List)
132+ if (!(isDefined(white1ListEntry)))
133+ then throw("The sender's address is not in the white list")
134+ else if ((white1ListEntry != validState))
135+ then throw("Sender is not in valid state")
136+ else {
137+ let white1ListAssetEntry = getInteger(extract(whitelistAddress), white1ListAsset)
138+ if (!(isDefined(white1ListAssetEntry)))
139+ then {
140+ let white1ListOverallEntry = getInteger(extract(whitelistAddress), white1ListOverall)
141+ if (!(isDefined(white1ListOverallEntry)))
142+ then true
143+ else {
144+ let cur1Balance = assetBalance(tx.sender, assetId)
145+ if ((extract(white1ListOverallEntry) > (cur1Balance - payment.amount)))
146+ then throw("Unable to send such amount (type=1)")
147+ else true
148+ }
149+ }
150+ else {
151+ let cur1Balance = assetBalance(tx.sender, assetId)
152+ if ((extract(white1ListAssetEntry) > (cur1Balance - payment.amount)))
153+ then throw("Unable to send such amount (type=2)")
154+ else true
155+ }
156+ }
157+ }
158+ }
159+ else false
96160 case _ =>
97161 false
98162 }
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 2 #-}
1+{-# STDLIB_VERSION 3 #-}
22 {-# CONTENT_TYPE EXPRESSION #-}
33 let matcherAddress = addressFromString("3Ms8fSfAxBLDjKvNVgACRzQoBLCtCWxtawu")
4+let matcherPublicKey = base58'6d1nbhBxLCxjUyL9xXcX2VVxj2kcKiYny7VqH4FwbApv'
45 let gatewayAddress = addressFromString("3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV")
5-let WhitelistAddr = addressFromString("3N6DwWxT82nGJUwBwd7L514r2u71gr7WhwJ")
6+let whitelistAddress = addressFromString("3N6DwWxT82nGJUwBwd7L514r2u71gr7WhwJ")
7+let dAppWhitelistAddress = Address(base58'3N1SPvLZgv6FMfe5WNUtnPzt3okYxcJhYnR')
8+let gatewayControlAssetAddress = base58'3w8UGTKzu3YvwRrvWeDuXkUVxdg1RuX1VCy6QRw86Fw4'
9+let pAddress1 = addressFromString("3NCVDaT1ASbRd42hBSw4EG6ojGVRGtvMiz1")
10+let pAddress2 = addressFromString("3Ms2kTAxdrcXDxwedfbNjSi6ewGCUqt3heZ")
11+let pAddress3 = addressFromString("3N6ognm7xnQSFiownS1Df1LacJUQXvfDFLe")
12+let pAddress4 = addressFromString("3MtVCmN9MZbWf9qxiMFoEPBrdc2fLp3SvuC")
13+let pAddress5 = addressFromString("3MuWG8gsTK4RQBsm97sMCuUXW99JvRxwYSg")
614 let validState = 1000
7-let Ver = "1.1.4-testnet"
15+let ver = "2.0.0-testnet"
816 match tx {
917 case tx: MassTransferTransaction =>
1018 false
1119 case tx: TransferTransaction =>
12- if (if ((tx.sender != gatewayAddress))
13- then (tx.recipient != gatewayAddress)
14- else false)
15- then throw("Only transactions with a gateway are allowed")
16- else if ((tx.sender == gatewayAddress))
17- then true
18- else {
19- let white1List = toBase58String(tx.sender.bytes)
20- let assetTxt = toBase58String(extract(tx.assetId))
21- let white1ListAsset = ((white1List + "_") + assetTxt)
22- let white1ListOverall = ("res_" + assetTxt)
23- let white1ListEntry = getInteger(extract(WhitelistAddr), white1List)
24- if (!(isDefined(white1ListEntry)))
25- then throw("The sender's address is not in the white list")
26- else if ((white1ListEntry != validState))
27- then throw("Sender is not in valid state")
28- else {
29- let white1ListAssetEntry = getInteger(extract(WhitelistAddr), white1ListAsset)
30- if (!(isDefined(white1ListAssetEntry)))
31- then {
32- let white1ListOverallEntry = getInteger(extract(WhitelistAddr), white1ListOverall)
33- if (!(isDefined(white1ListOverallEntry)))
34- then true
35- else {
36- let cur1Balance = assetBalance(tx.sender, tx.assetId)
37- if ((extract(white1ListOverallEntry) > (cur1Balance - tx.amount)))
38- then throw("Unable to send such amount (type=1)")
39- else true
40- }
41- }
42- else {
43- let cur1Balance = assetBalance(tx.sender, tx.assetId)
44- if ((extract(white1ListAssetEntry) > (cur1Balance - tx.amount)))
45- then throw("Unable to send such amount (type=2)")
46- else true
47- }
48- }
49- }
20+ let isDAppAllowed = match getInteger(dAppWhitelistAddress, toBase58String(tx.sender.bytes)) {
21+ case a: Int =>
22+ a
23+ case _ =>
24+ -255
25+ }
26+ if ((isDAppAllowed != -255))
27+ then true
28+ else if (if ((tx.sender != gatewayAddress))
29+ then (tx.recipient != gatewayAddress)
30+ else false)
31+ then throw("Only transactions with a gateway are allowed")
32+ else if ((tx.sender == gatewayAddress))
33+ then true
34+ else {
35+ let white1List = toBase58String(tx.sender.bytes)
36+ let assetTxt = toBase58String(extract(tx.assetId))
37+ let white1ListAsset = ((white1List + "_") + assetTxt)
38+ let white1ListOverall = ("res_" + assetTxt)
39+ let white1ListEntry = getInteger(extract(whitelistAddress), white1List)
40+ if (!(isDefined(white1ListEntry)))
41+ then throw("The sender's address is not in the white list")
42+ else if ((white1ListEntry != validState))
43+ then throw("Sender is not in valid state")
44+ else {
45+ let white1ListAssetEntry = getInteger(extract(whitelistAddress), white1ListAsset)
46+ if (!(isDefined(white1ListAssetEntry)))
47+ then {
48+ let white1ListOverallEntry = getInteger(extract(whitelistAddress), white1ListOverall)
49+ if (!(isDefined(white1ListOverallEntry)))
50+ then true
51+ else {
52+ let cur1Balance = assetBalance(tx.sender, tx.assetId)
53+ if ((extract(white1ListOverallEntry) > (cur1Balance - tx.amount)))
54+ then throw("Unable to send such amount (type=1)")
55+ else true
56+ }
57+ }
58+ else {
59+ let cur1Balance = assetBalance(tx.sender, tx.assetId)
60+ if ((extract(white1ListAssetEntry) > (cur1Balance - tx.amount)))
61+ then throw("Unable to send such amount (type=2)")
62+ else true
63+ }
64+ }
65+ }
5066 case tx: ExchangeTransaction =>
5167 if ((tx.sender != matcherAddress))
5268 then throw("Incorrect matcher address")
5369 else {
5470 let outcoming1Account = tx.buyOrder.sender
5571 let outcoming2Account = tx.sellOrder.sender
5672 let white1List = toBase58String(outcoming1Account.bytes)
5773 let white2List = toBase58String(outcoming2Account.bytes)
58- let white1ListEntry = getInteger(extract(WhitelistAddr), toBase58String(outcoming1Account.bytes))
59- let white2ListEntry = getInteger(extract(WhitelistAddr), toBase58String(outcoming2Account.bytes))
74+ let white1ListEntry = getInteger(extract(whitelistAddress), toBase58String(outcoming1Account.bytes))
75+ let white2ListEntry = getInteger(extract(whitelistAddress), toBase58String(outcoming2Account.bytes))
6076 if (!(isDefined(white1ListEntry)))
6177 then throw((("User " + white1List) + " not in white list"))
6278 else if ((white1ListEntry != validState))
6379 then throw((("User " + white1List) + " not in valid state"))
6480 else if (!(isDefined(white2ListEntry)))
6581 then throw((("User " + white2List) + " not in white list"))
6682 else if ((white2ListEntry != validState))
6783 then throw((("User " + white2List) + " not in valid state"))
6884 else true
6985 }
7086 case tx: SetAssetScriptTransaction =>
71- let pAddress1 = addressFromString("3NCVDaT1ASbRd42hBSw4EG6ojGVRGtvMiz1")
72- let pAddress2 = addressFromString("3Ms2kTAxdrcXDxwedfbNjSi6ewGCUqt3heZ")
73- let pAddress3 = addressFromString("3N6ognm7xnQSFiownS1Df1LacJUQXvfDFLe")
74- let pAddress4 = addressFromString("3MtVCmN9MZbWf9qxiMFoEPBrdc2fLp3SvuC")
75- let pAddress5 = addressFromString("3MuWG8gsTK4RQBsm97sMCuUXW99JvRxwYSg")
7687 let pKey1Signed = if (isDefined(getInteger(extract(pAddress1), toBase58String(tx.id))))
7788 then 1
7889 else 0
7990 let pKey2Signed = if (isDefined(getInteger(extract(pAddress2), toBase58String(tx.id))))
8091 then 1
8192 else 0
8293 let pKey3Signed = if (isDefined(getInteger(extract(pAddress3), toBase58String(tx.id))))
8394 then 1
8495 else 0
8596 let pKey4Signed = if (isDefined(getInteger(extract(pAddress4), toBase58String(tx.id))))
8697 then 1
8798 else 0
8899 let pKey5Signed = if (isDefined(getInteger(extract(pAddress5), toBase58String(tx.id))))
89100 then 1
90101 else 0
91102 (((((pKey1Signed + pKey2Signed) + pKey3Signed) + pKey4Signed) + pKey5Signed) >= 3)
92103 case tx: BurnTransaction =>
93104 (tx.sender == gatewayAddress)
94105 case tx: ReissueTransaction =>
95106 (tx.sender == gatewayAddress)
107+ case tx: InvokeScriptTransaction =>
108+ let isDAppAllowed = match getInteger(dAppWhitelistAddress, toBase58String(addressFromRecipient(tx.dApp).bytes)) {
109+ case a: Int =>
110+ a
111+ case _ =>
112+ -255
113+ }
114+ if ((isDAppAllowed != -255))
115+ then {
116+ let white1List = toBase58String(tx.sender.bytes)
117+ let isPaymentExist = match tx.payment {
118+ case a: AttachedPayment =>
119+ true
120+ case _ =>
121+ false
122+ }
123+ if ((isPaymentExist == false))
124+ then true
125+ else {
126+ let payment = extract(tx.payment)
127+ let assetId = extract(payment.assetId)
128+ let assetTxt = toBase58String(assetId)
129+ let white1ListAsset = ((white1List + "_") + assetTxt)
130+ let white1ListOverall = ("res_" + assetTxt)
131+ let white1ListEntry = getInteger(extract(whitelistAddress), white1List)
132+ if (!(isDefined(white1ListEntry)))
133+ then throw("The sender's address is not in the white list")
134+ else if ((white1ListEntry != validState))
135+ then throw("Sender is not in valid state")
136+ else {
137+ let white1ListAssetEntry = getInteger(extract(whitelistAddress), white1ListAsset)
138+ if (!(isDefined(white1ListAssetEntry)))
139+ then {
140+ let white1ListOverallEntry = getInteger(extract(whitelistAddress), white1ListOverall)
141+ if (!(isDefined(white1ListOverallEntry)))
142+ then true
143+ else {
144+ let cur1Balance = assetBalance(tx.sender, assetId)
145+ if ((extract(white1ListOverallEntry) > (cur1Balance - payment.amount)))
146+ then throw("Unable to send such amount (type=1)")
147+ else true
148+ }
149+ }
150+ else {
151+ let cur1Balance = assetBalance(tx.sender, assetId)
152+ if ((extract(white1ListAssetEntry) > (cur1Balance - payment.amount)))
153+ then throw("Unable to send such amount (type=2)")
154+ else true
155+ }
156+ }
157+ }
158+ }
159+ else false
96160 case _ =>
97161 false
98162 }

github/deemru/w8io/169f3d6 
36.48 ms