Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent NatSpec comment in LoanFactory.sol #59

Open
code423n4 opened this issue Apr 19, 2021 · 1 comment
Open

Inconsistent NatSpec comment in LoanFactory.sol #59

code423n4 opened this issue Apr 19, 2021 · 1 comment

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

Function pause() in LoanFactory.sol can be called by both Governor and Admin but the @dev Natspec comment incorrectly says that this is only callable by Governor.

Therefore, the Natspec comment for this function is incorrect:
@dev Triggers paused state. Halts functionality for certain functions. Only Governor can call this function.

Proof of Concept

https://github.com/maple-labs/maple-core/blob/355141befa89c7623150a83b7d56a5f5820819e9/contracts/LoanFactory.sol#L133-L139

Tools Used

Manual Analysis

Recommended Mitigation Steps

Change @dev Natspec comment to correctly indicate this function can be called by both Governor and Admin

@lucas-manuel
Copy link
Collaborator

Informational, will address

deluca-mike added a commit to maple-labs/maple-core that referenced this issue Apr 23, 2021
- Inconsistent NatSpec comment in DebtLocker.sol (code-423n4/2021-04-maple-findings#34)
- Inconsistent NatSpec comment in StakeLocker.sol(code-423n4/2021-04-maple-findings#42)
- Inconsistent NatSpec comment in StakeLocker.sol (code-423n4/2021-04-maple-findings#46)
- Inconsistent NatSpec comment in StakeLocker.sol (code-423n4/2021-04-maple-findings#47)
- Inconsistent NatSpec comment in PoolFactory.sol (code-423n4/2021-04-maple-findings#54)
- Inconsistent NatSpec comment in PoolFactory.sol (code-423n4/2021-04-maple-findings#55)
- Inconsistent NatSpec comment in PoolFactory.sol (code-423n4/2021-04-maple-findings#56)
- Inconsistent NatSpec comment in PoolFactory.sol (code-423n4/2021-04-maple-findings#57)
- Inconsistent NatSpec comment in PoolFactory.sol (code-423n4/2021-04-maple-findings#58)
- Inconsistent NatSpec comment in LoanFactory.sol (code-423n4/2021-04-maple-findings#59)
- Inconsistent NatSpec comment in LoanFactory.sol (code-423n4/2021-04-maple-findings#60)
- Inconsistent NatSpec comment in LoanFactory.sol (code-423n4/2021-04-maple-findings#61)
- Inconsistent NatSpec comment in LoanFactory.sol (code-423n4/2021-04-maple-findings#64)
- Inconsistent NatSpec comment in Pool.sol (code-423n4/2021-04-maple-findings#70)
- Inconsistent NatSpec comment in Pool.sol (code-423n4/2021-04-maple-findings#71)
lucas-manuel added a commit to maple-labs/maple-core that referenced this issue Apr 24, 2021
* chore: Natspec updates from c4 audit

- Inconsistent NatSpec comment in DebtLocker.sol (code-423n4/2021-04-maple-findings#34)
- Inconsistent NatSpec comment in StakeLocker.sol(code-423n4/2021-04-maple-findings#42)
- Inconsistent NatSpec comment in StakeLocker.sol (code-423n4/2021-04-maple-findings#46)
- Inconsistent NatSpec comment in StakeLocker.sol (code-423n4/2021-04-maple-findings#47)
- Inconsistent NatSpec comment in PoolFactory.sol (code-423n4/2021-04-maple-findings#54)
- Inconsistent NatSpec comment in PoolFactory.sol (code-423n4/2021-04-maple-findings#55)
- Inconsistent NatSpec comment in PoolFactory.sol (code-423n4/2021-04-maple-findings#56)
- Inconsistent NatSpec comment in PoolFactory.sol (code-423n4/2021-04-maple-findings#57)
- Inconsistent NatSpec comment in PoolFactory.sol (code-423n4/2021-04-maple-findings#58)
- Inconsistent NatSpec comment in LoanFactory.sol (code-423n4/2021-04-maple-findings#59)
- Inconsistent NatSpec comment in LoanFactory.sol (code-423n4/2021-04-maple-findings#60)
- Inconsistent NatSpec comment in LoanFactory.sol (code-423n4/2021-04-maple-findings#61)
- Inconsistent NatSpec comment in LoanFactory.sol (code-423n4/2021-04-maple-findings#64)
- Inconsistent NatSpec comment in Pool.sol (code-423n4/2021-04-maple-findings#70)
- Inconsistent NatSpec comment in Pool.sol (code-423n4/2021-04-maple-findings#71)

* chore: NatSpec Normalization

- Standardized "Only X [and Y] can call this function"
- Standardized "a" and "the" grammar, to explicitly indicate if there is one or many of that type that can have access
- Standardized "Checks that msg.sender is the X [or Y]" for access control require helpers and modifiers
- Standardized role capitalization (i.e. Owner, Pool Delegate) in access control comments
- Normalized indentation for @dev
- Ensured all access controls are indicated, including those inherited from downstream
- Ensured period at the end of all @dev sentences
- Fixed erroneous comment indentation (lead to broken collapsing)
- Fixed a bad function indent (lead to broken collapsing)

* review: more accurate recoverERC20 description

Co-authored-by: Lucas Manuel <lucas@maple.finance>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants