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

QA Report #130

Open
code423n4 opened this issue May 20, 2022 · 1 comment
Open

QA Report #130

code423n4 opened this issue May 20, 2022 · 1 comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

QA report

[N-01] Use capital letters for constants and immutables

The convention for constants in Solidity is to use capital letters, see Solidity style guide.

Examples of constants not using this convention can be found in AuraLocker.sol L73, L81, L83, L104, L105, L107, L109 and L119.

This means that variables like these:

uint256 public constant denominator = 10000;
address public immutable cvxcrvStaking;

Should be named to:

uint256 public constant DENOMINATOR= 10000;
address public immutable CVXCRV_STAKING;

[N-02] Use time units instead of calculations

The usage of Solidity’s time units can increase the readability of the code. For example in the AuraLocker.sol contract at L81-L83:

uint256 public constant rewardsDuration = 86400 * 7;
//     Duration of lock/earned penalty period
uint256 public constant lockDuration = rewardsDuration * 17;

Can be rewritten into:

uint256 public constant rewardsDuration = 1 weeks;
//     Duration of lock/earned penalty period
uint256 public constant lockDuration = rewardsDuration * 17;

Which makes it much more clear that rewardsDuration is 1 week and lockDuration is 17 weeks.

[N-03] Declaration of functions out of order

In some contracts the order of the methods seems to be more or less random, which makes the contract hard to read through. An example of such contract could be AuraBalRewardPool.sol. The Solidity docs have a style guide which gives some good guidelines on the order of which methods should be declared to improve readability, see the style guide.

@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels May 20, 2022
code423n4 added a commit that referenced this issue May 20, 2022
@0xMaharishi
Copy link

The function layout of convex-platform and any contracts forked from there (like AuraBalRewardPool) have been kept in tact to ensure the diffs are easy to parse. That said, i agree with your reports

@0xMaharishi 0xMaharishi added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

2 participants