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

Open
code423n4 opened this issue Oct 30, 2022 · 1 comment
Open

QA Report #168

code423n4 opened this issue Oct 30, 2022 · 1 comment
Labels
bug Something isn't working grade-b Q-41 QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

code423n4 commented Oct 30, 2022

[N-01] Pledged event is emitted with a wrong amount of delegated votes

Targets

Proof of Concept

The actual amount of delegated votes is bias, not amount (WardenPledge.sol#L255-L263):

uint256 slope = amount / boostDuration;
uint256 bias = slope * boostDuration;

// Rewards are set in the Pledge as reward/veToken/sec
// To find the total amount of veToken delegated through the whole Boost duration
// based on the Boost bias & the Boost duration, to take in account that the delegated amount decreases
// each second of the Boost duration
uint256 totalDelegatedAmount = ((bias * boostDuration) + bias) / 2;

Tools Used

Manual review

Recommended Mitigation Steps

Consider using bias instead of amount.

@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 Oct 30, 2022
code423n4 added a commit that referenced this issue Oct 30, 2022
code423n4 added a commit that referenced this issue Oct 30, 2022
@c4-judge
Copy link
Contributor

kirk-baird marked the issue as grade-b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working grade-b Q-41 QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

3 participants