DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Some functions has pure modifier although they access the storage pointer.

Summary

Some functions has pure modifier although they access the storage pointer.

Vulnerability Details

Some functions are marked as pure, indicating that it does not read or modify the contract's state, but they use inline assembly to manipulate storage, which contradicts the pure modifier.
For instance, MarketOrder.load() function is the following.

function load(uint128 tradingAccountId) internal pure returns (Data storage self) {
bytes32 slot = keccak256(abi.encode(MARKET_ORDER_LOCATION, tradingAccountId));
assembly {
self.slot := slot
}
}

Tens of other functions have the same problems.

Impact

It may cause misunderstanding and errors during maintenance.

Tools Used

Manual Review

Recommendations

Remove pure modifier and add view modifier to the functions.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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