Tadle

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

Protocol Allows Minting of Phantom Points That Can Never Be Settled

Summary

An attacker can exploit the system, causing receivers of pointTokens to receive fewer tokens than expected.

Vulnerability Details

When Tadle wants to wrap up trading activities for a marketplace, the owner calls SystemConfig::updateMarket, which updates the marketplaceInfo for the target marketplace.

function updateMarket(
string calldata _marketPlaceName,
address _tokenAddress,
uint256 _tokenPerPoint,
uint256 _tge,
uint256 _settlementPeriod
) external onlyOwner {
// ...
marketPlaceInfo.tokenAddress = _tokenAddress;
marketPlaceInfo.tokenPerPoint = _tokenPerPoint;
marketPlaceInfo.tge = _tge;
marketPlaceInfo.settlementPeriod = _settlementPeriod;
// ...

Among the variables set is tokenPerPoint, which determines how many pointTokens a Bidder can receive.

The Issue:
When this variable is set, the amount of pointTokens to be created at the token generation event of the launching protocol is established. However, because the protocol doesn't cease the creation of new offers (i.e., users can still call PreMarket::createOffer) before the marketplace status updates to AskSettling, new points that weren't factored into the tokenPerPoint determination are created. These new points are not part of the allocation plans for the launching protocol, making their creation counterproductive to Tadle's operations.

function getMarketPlaceStatus(
uint256 _blockTimestamp,
MarketPlaceInfo memory _marketPlaceInfo
) internal pure returns (MarketPlaceStatus _status) {
if (_marketPlaceInfo.status == MarketPlaceStatus.Offline) {
return MarketPlaceStatus.Offline;
}
/// @dev settle not active
if (_marketPlaceInfo.tge == 0) {
return _marketPlaceInfo.status;
}
if (
_blockTimestamp >
_marketPlaceInfo.tge + _marketPlaceInfo.settlementPeriod
) {
return MarketPlaceStatus.BidSettling;
}
if (_blockTimestamp > _marketPlaceInfo.tge) {
return MarketPlaceStatus.AskSettling;
}
return _marketPlaceInfo.status;
}

The getMarketPlaceStatus function clearly shows that the marketplace is still online after SystemConfig::updateMarket is called.

Impact

This situation is problematic because it is not always the intention of an offer maker to create these phantom points that they won't be able to settle. However, regardless of their intentions, someone must bear the inevitable loss if the offer is traded. This issue is similar to the scenario discussed in the submission titled "A Malicious Maker Can Game the System for Risk-Free Profit at the Expense of the Protocol," where a malicious maker causes the protocol to incur losses by leaving the trader of the offer unsettled. These losses fall on the last withdrawers of a specific token in Tadle.

Tools Used

Manual

Recommendations

Once the TGE is set, cease the creation of new offers in the market. No user should be able to call PreMarket::createOffer after this point.

Updates

Lead Judging Commences

0xnevi Lead Judge
12 months ago
0xnevi Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

krisrenzo Submitter
12 months ago
0xnevi Lead Judge
12 months ago
krisrenzo Submitter
12 months ago
0xnevi Lead Judge
11 months ago
0xnevi Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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