Discrepancy in MAX_PROPOSAL_NUMERATOR Value in
The AlchemixGovernor contract sets MAX_PROPOSAL_NUMERATOR to 5000 (50%) instead of the documented 6600 (66%), so the admin cannot set the proposal threshold above 50%. This prevents the governance system from operating as intended, but does not cause loss of funds.
- Disclosed after under an hour
31558 - [SC - Insight] Discrepancy in MAX_PROPOSAL_NUMERATOR Value in ...
Submitted on May 21st 2024 at 09:40:57 UTC by @Limbooo for Boost | Alchemix
Report ID: #31558
Report type: Smart Contract
Report severity: Insight
Target: https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/AlchemixGovernor.sol
Impacts:
- Contract fails to deliver promised returns, but doesn't lose value
Description
Introduction
The AlchemixGovernor contract contains a discrepancy between the implemented MAX_PROPOSAL_NUMERATOR value and the value specified in the official veALCX Launch Parameters Proposal document. The contract currently uses a value of 5000 (50%), while the documentation specifies a value of 6600 (66%).
Vulnerability Details
Current Implementation
The AlchemixGovernor contract defines the MAX_PROPOSAL_NUMERATOR as follows:
src/AlchemixGovernor.sol:
19: uint256 public constant MAX_PROPOSAL_NUMERATOR = 5000; // 50% of total supply to create a proposal
This means that currently, setting the % of total supply required to create a proposal (proposalNumerator) to a value more than 50% and less than 66% will revert with 'numerator too high' error.
src/AlchemixGovernor.sol:
64: /**
65: * @dev Set the % of total supply required to create a proposal
66: * @param numerator The new numerator value for the quorum fraction
67: */
68: function setProposalNumerator(uint256 numerator) external {
69: require(msg.sender == admin, "not admin");
@>70: require(numerator <= MAX_PROPOSAL_NUMERATOR, "numerator too high");
71: proposalNumerator = numerator;
72: emit ProposalNumberSet(numerator);
73: }
Documented Parameters
According to the veALCX Launch Parameters Proposal document, the MAX_PROPOSAL_NUMERATOR should be set to 6600 (66%):
MAX_PROPOSAL_NUMERATOR, 6600 (66%), Maximum threshold for quorum, hard coded, set up to never be changed except by an upgrade
Impact Details
The discrepancy between the documented and implemented values can have the following impacts:
- Governance Integrity: The governance process may not function as intended, as the max threshold for creating proposals is lower than what was documented.
- Community Trust: Community members who refer to the documentation may be confused by the mismatch, leading to mistrust in the governance system.
References
Proof of Concept
Here is a simple test case that you can use to verify the correct discrepancy behavior
// SPDX-License-Identifier: UNLICENSED
import "./BaseTest.sol";
contract AlchemixGovernorPoCTest is BaseTest {
function setUp() public {
setupContracts(block.timestamp);
}
function testMaxProposalNumerator() public {
assertTrue(governor.MAX_PROPOSAL_NUMERATOR() != 6600, "MAX_PROPOSAL_NUMERATOR is not 6600");
hevm.prank(admin);
hevm.expectRevert(abi.encodePacked("numerator too high"));
governor.setProposalNumerator(6000);
}
}
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a typo or oversight in the constant value, where 5000 was used instead of the documented 6600.
Impact
The governance process may not function as intended because the maximum threshold for creating proposals is lower than documented, which could confuse community members and reduce trust.
What the attacker needed
Admin access to call setProposalNumerator
The fix
The constant should be updated to 6600 to match the documented value.
How it was found
- Check that the contract's MAX_PROPOSAL_NUMERATOR is not 6600.
- As admin, try to set the proposal numerator to 6000.
- Observe that the transaction reverts with 'numerator too high'.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract has a hard-coded limit on how high a certain governance setting can be. The limit is lower than what the project's documentation says it should be, so the setting cannot be raised as far as promised. This is a mismatch between code and documentation, not a direct theft risk.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.