DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: medium
Invalid

_onlyValidShortRecord Function Missing Revert Statements

Location: Modifiers contract, _onlyValidShortRecord function.

Description: The _onlyValidShortRecord function is missing revert statements. This means that if the conditions for a valid short record are not met, the function will not revert, potentially allowing the code execution to continue with invalid data.

Proposed Fix:

Add revert statements within the _onlyValidShortRecord function to ensure that the function reverts when the conditions are not met.

Code Snippet:

function _onlyValidShortRecord(address asset, address shorter, uint8 id)
internal
view
{
uint8 maxId = s.assetUser[asset][shorter].shortRecordId;
if (id >= maxId) revert Errors.InvalidShortId();
if (id < Constants.SHORT_STARTING_ID) revert Errors.InvalidShortId();
if (s.shortRecords[asset][shorter][id].status == SR.Cancelled) {
revert Errors.InvalidShortId();
}
}

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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