Moonwell

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

nonReentrant modifier not defined

Summary

The nonReentrant modifier is typically provided by libraries, such as OpenZeppelin's ReentrancyGuard, to prevent re-entrancy attacks.

Vulnerability Details

The nonReentrant modifier is not defined within the contract. This modifier is crucial for preventing re-entrancy attacks, where an external contract can call back into the calling contract before the first call is finished, potentially leading to unexpected behavior or security vulnerabilities.

The contract likely intended to use the nonReentrant modifier from the OpenZeppelin ReentrancyGuard library but did not import this library.

Impact

As a result, the compiler does not recognize the modifier, leading to compilation errors.

DeclarationError: Identifier not found or not unique.
--> contracts/MErc20DelegateFixer.sol:12:62:
|
12 | function repayBadDebtWithCash(uint256 amount) external nonReentrant {
| ^^^^^^^^^^^^

Tools Used

Manual Review

Recommendations

To resolve this issue, the contract must import the OpenZeppelin ReentrancyGuard library, which provides the nonReentrant modifier. This is done by adding an import statement at the beginning of the contract file, specifying the path to the ReentrancyGuard.sol file from the OpenZeppelin contracts library.

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
Updates

Lead Judging Commences

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

Support

FAQs

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