Tadle

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

Adding a return statement when the function defines a named return variable is redundant

Summary

Don't add a return statement when the function already defines a named return variable.

Vulnerability Details

In many parts of the code there is a redundant return statement when the function defines a named import. It would be better if we remove return statement.

https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L790

https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L800

https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L810

Impact

Low

Tools Used

Manual Inspection

Recommendations

Add this below code by removing the redundant return variables in the above mentioned functions.

function getOfferInfo(
address _offer
) external view returns (OfferInfo memory _offerInfo) {
- return offerInfoMap[_offer];
+ OfferInfo memory _offerInfo = offerInfoMap[_offer];
}
Updates

Lead Judging Commences

0xnevi Lead Judge
about 1 year ago
0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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