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 StakeLocker.sol #46

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

Inconsistent NatSpec comment in StakeLocker.sol #46

code423n4 opened this issue Apr 19, 2021 · 1 comment

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

Function _isValidPoolDelegate() is not about pause/unpause but about msg.sender being a valid Pool Delegate, which is used to check if msg.sender can set lockup period and open staking to public in StakeLocker.sol.

Therefore, the Natspec comment for this function is incorrect:
@dev Function to determine if msg.sender is eligible to trigger pause/unpause.

Proof of Concept

https://github.com/maple-labs/maple-core/blob/355141befa89c7623150a83b7d56a5f5820819e9/contracts/StakeLocker.sol#L302-L307

Tools Used

Manual Analysis

Recommended Mitigation Steps

Change @dev Natspec comment to correctly indicate the functionality of _isValidPoolDelegate().

@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