DittoETH

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

Consider refactoring redundant code into modifiers

Summary

When developing EVM smart contracts, it's best practice to refactor redundant code into modifiers or internal functions to assure easy readability and maintainability

Vulnerability Details

The linked codes are redundant and can be instead be refactored into a modifier or internal function

Impact

Code does'nt follow EVM smart contracts development best practices.

Tools Used

Manual review

Recommendations

refactor the linked code into an internal function. For example:

function validVault(address zeth) internal returns(uint256) {
uint256 vault;
if (zeth == carbonZeth) {
vault = Vault.CARBON;
} else {
if (s.zethVault[zeth] == 0) revert Errors.InvalidZeth();
vault = s.zethVault[zeth];
}
return vault;
}
Updates

Lead Judging Commences

0xnevi Lead Judge
about 2 years ago
0xnevi Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: User experience and design improvement

Support

FAQs

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