-
Notifications
You must be signed in to change notification settings - Fork 11
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
SurplusGuildMinter define MIN_STAKE constant to 1e18, which is large amount for minimum, if protocol wants to support gWETH #597
Comments
0xSorryNotSorry marked the issue as sufficient quality report |
0xSorryNotSorry marked the issue as primary issue |
Acknowledging, there would be a bunch of constants through the protocol that need update, depending on the value of the pegToken and the network where we deploy. I'd flag this a QA. |
eswak (sponsor) acknowledged |
eswak marked the issue as disagree with severity |
Trumpero changed the severity to QA (Quality Assurance) |
Trumpero marked the issue as grade-a |
Trumpero marked the issue as grade-b |
Hello, @Trumpero, thanks for judging this. While it costs $1 to start staking in gUSDC gauge, for wBTC (8 decimals) 1e10 tokens will be needed to meet the minimum requirement for participating, and for ETH (18 decimals) 1 token which will cost around $2000. As seen this will limit the amount of users willing to stake in such gauges. There is a similar confirmed issue from the Moonwell contest: code-423n4/2023-07-moonwell-findings#143 |
I totally agree with @AydoanB. Also in terms of C4 it is stated that code in the README should be audited/judged as if it were going to be uploaded that way, which would lead to major impact, because large amount of the participants won't have the capital for the minStake, or don't wan't to use such big amount. Also it is confirmed several times that ETH would be supported on launch, which confirms the severity and validity of the issue. |
This kind of issue will be judged by the individual opinion of the judge. In my opinion, the severity of this issue is pretty low since it doesn't have any impact to be considered medium:
Its maximum impact is that users can't stake below 1 WBTC in the WBTC market, which I consider a business issue since 1 WBTC is a possible amount. The issue from the Moonwell contest mentions the impact that deployment will fail, so I believe it's not similar. |
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/SurplusGuildMinter.sol#L26
Vulnerability details
Impact
The value uint256 public constant MIN_STAKE = 1e18; inside
SurplusGuildMinter
is hardcoded based on USDC (1 USD as minimum), which is a rational decision, but as the sponsors has confirmed the protocol plan to support other credit tokens such as gWETH, which minimum stake amount would cost > $2300 (in time of writing this report 1 ETH = $2300), which is 230000% value difference between gUSDC SurplusGuildMinter and gWETH SurplusGuildMinter.Proof of Concept
Sponsor has confirmed that this is a valid concern and a code change should be applied based on this finding.
Tools Used
Manual Review
Recommended Mitigation Steps
Don't hardcode the
MIN_STAKE
insideSurplusGuildMinter
. Instead, pass it as a constructor parameter:Assessed type
Context
The text was updated successfully, but these errors were encountered: