-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SIP-406 Add trading enabled feature flag #2339
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see comments
while we are at it, do we also have a feature flag to turn on/off all markets?
and do we have a feature flag to only turn off withdrawals/deposits? I feel like this is a level of granularity we might actuall ywant to have, but I understand we probably don't want to expand the scope.
@@ -31,6 +34,11 @@ contract AtomicOrderModule is IAtomicOrderModule { | |||
SpotMarketFactory.Data storage spotMarketFactory = SpotMarketFactory.load(); | |||
spotMarketFactory.validateMarket(marketId); | |||
|
|||
ITokenModule synth = SynthUtil.getToken(marketId); | |||
FeatureFlag.ensureAccessToFeature( | |||
bytes32(abi.encodePacked(Flags.TRADING_ENABLED, marketId)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: while this works fine for progmatic use cases, afaict its not like the human readable text of the flag would be:
tradingEnabledSynthId75
if the pool ID was 75. we would need to first encode the integer as a string i am pretty sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, it's hard to decipher which FeatureUnavailable
is thrown with this setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this line to encode the marketId
to string as well.
This SIP is quite specific so I'd like to avoid expanding the scope but maybe @kaleb-keny can chime in here when he gets back on adding more flags. |
hey @0xMithrandir i am happy to alter the sip, i think it makes sense to add a master control for killing the entire spot market... So it would be more like a |
You'd prefer having separate flags for each module like:
|
replied in discord, but the context is
|
I've updated the new feature flags, I'll add more specific tests but lmk if this is looking good now @dbeal-eth |
@0xMithrandir lgtm! do we have a audit completed for this change? normally we wait for audit before merging. |
I'll submit it today for audit, after their approval it can be merged. |
Adds a feature flag
tradingEnabled
which has to be enabled to be trading/wrapping synths.https://sips.synthetix.io/sips/sip-406/