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

Upgraded Q -> M from 234 [1659038052827] #275

Closed
code423n4 opened this issue Jul 28, 2022 · 1 comment
Closed

Upgraded Q -> M from 234 [1659038052827] #275

code423n4 opened this issue Jul 28, 2022 · 1 comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate This issue or pull request already exists upgraded by judge

Comments

@code423n4
Copy link
Contributor

code423n4 commented Jul 28, 2022

Judge has assessed an item in Issue #234 as Medium risk. The relevant finding follows:

  1. Update asset weight when calling VeTokenMinter.removeOperator
    When removing operator, there is no check to make sure that veAssetWeights[operator] has been removed. If governance forgot to call updateveAssetWeight before removing the operator, totalWeight would be inflated and user would get lesser amount when claiming reward:

uint256 _veAssetEarned = _amount.mul(veTokenMinter.veAssetWeights(address(this))).div(
veTokenMinter.totalWeight()
);
Recommended Mitigation
Ensure that weight is updated to zero when removing operator:

function removeOperator(address _operator) public onlyOwner {
updateveAssetWeight(_operator, 0); // modify visibility to public
operators.remove(_operator);
}
Relevant Links
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/VeTokenMinter.sol#L36-L46
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/Booster.sol#L607-L609

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working upgraded by judge labels Jul 28, 2022
code423n4 added a commit that referenced this issue Jul 28, 2022
@JeeberC4
Copy link

Duplicate of #120

@JeeberC4 JeeberC4 marked this as a duplicate of #120 Jul 28, 2022
@JeeberC4 JeeberC4 added the duplicate This issue or pull request already exists label Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate This issue or pull request already exists upgraded by judge
Projects
None yet
Development

No branches or pull requests

2 participants