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 #69

Open
code423n4 opened this issue Apr 27, 2022 · 1 comment
Open

QA Report #69

code423n4 opened this issue Apr 27, 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 confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") sponsor todo

Comments

@code423n4
Copy link
Contributor

Lows and non critical

  • Typo in the accrue function of the FlyWheelCore contract - @notice accrue rewards for a two users on a strategy (a is not needed)
  • Pragmas should be locked to a specific compiler version, to avoid contracts getting deployed using a different version, which may have a greater risk of undiscovered bugs.
  • Remove the delegatee anyway (not only if the votes are not zero) - that will make the set not contain delegatees with zero votes
    function _decrementVotesUntilFree(address user, uint256 votes) internal {
        // ...
        for (uint256 i = 0; i < size && (userFreeVotes + totalFreed) < votes; i++) {
            address delegatee = delegateList[i];
            uint256 delegateVotes = _delegatesVotesCount[user][delegatee];
            if (delegateVotes != 0) {
                totalFreed += delegateVotes;
                
                require(_delegates[user].remove(delegatee)); // Remove from set. Should never fail.
                
                _delegatesVotesCount[user][delegatee] = 0;
                _writeCheckpoint(delegatee, _subtract, delegateVotes);
                
                emit Undelegation(user, delegatee, delegateVotes);
            }
        }
        userDelegatedVotes[user] -= totalFreed;
    }
@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 Apr 27, 2022
code423n4 added a commit that referenced this issue Apr 27, 2022
@Joeysantoro Joeysantoro added sponsor todo sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") labels May 13, 2022
@Joeysantoro
Copy link
Collaborator

all good feedback

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 confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") sponsor todo
Projects
None yet
Development

No branches or pull requests

2 participants