DittoETH

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

Wrong implementation of `modifier onlyDiamond()` in `AppStorage.sol` contract

Summary

The current implementation of the onlyDiamond() modifier is incorrect and can be misleading

Vulnerability Details

  • Take a look at onlyDiamond() modifier in AppStorage.sol contract: here

72 modifier onlyDiamond() {
73 if (msg.sender != address(this)) revert Errors.NotDiamond(); <--- address(this) is not diamond
74 _;
75 }
  • Because address(this) is address of AppStorage.sol not diamond'address, so this implementation is incorrect and can be misleading

Impact

Improper implementation of the modifier can be misleading and cause trouble when it is used

Tools Used

Manual review

Recommendations

Consider re-implementing it for correct functionality

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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