Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: low
Invalid

Inconsistent support for `fixedratio` causes marketplaces cannot be settled

Summary

The createMarketPlace function allows marketplaces to be created with the fixedratio option enabled. However, marketplaces with this option cannot be settled due to restrictions in the DeliveryPlace contract, leading to marketplaces that cannot complete their intended function. Since the fixedratio setting cannot be modified after creation, any orders associated with such marketplaces become ineffective, rendering the marketplace unusable.

Vulnerability Details

The SystemConfig::createMarketPlace function allows for the creation of a marketplace with the fixedratio enabled:

File: SystemConfig.sol
90: function createMarketPlace(
91: string calldata _marketPlaceName,
92:> bool _fixedratio
93: ) external onlyOwner {
...
106: marketPlaceInfo.fixedratio = _fixedratio;

However, the DeliveryPlace contract prevents marketplaces with fixedratio enabled from being settled:

File: DeliveryPlace.sol
222: function settleAskMaker(address _offer, uint256 _settledPoints) external {
...
234: if (marketPlaceInfo.fixedratio) {
235: revert FixedRatioUnsupported();
236: }
335: function settleAskTaker(address _stock, uint256 _settledPoints) external {
...
350: if (marketPlaceInfo.fixedratio) {
351: revert FixedRatioUnsupported();
352: }

Furthermore, since the marketPlaceInfo.fixedratio cannot be updated and set to false by the updateMarket() after marketplace creation, any orders associated with such a marketplace are rendered ineffective, making the marketplace non-operational.

Impact

The inability to settle marketplaces with fixedratio enabled renders these marketplaces unusable.

Tools Used

vscode

Recommendations

The SystemConfig::createMarketPlace function should set marketPlaceInfo.fixedratio to false.

Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

[invalid] finding-SystemConfig-fixed-ratio

Invalid, design decision, this is decided when market place is created. If a fixed ratio market place is allowed, then admin can simply create a new market place to cater to that in which manual arbitrartion is required instead of allowing settlements by makers, as noted in comments [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/SystemConfig.sol#L88)

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.