You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fee mismatch in invest() function leading to round limit breach
Summary
The invest() function in VVVVCInvestmentLedger.sol applies an off-chain signed fee only to the accounting values but not to the actual token transfer. This discrepancy allows an investment round to exceed its limit in real token value, despite appearing compliant in the contract's recorded data.
Root Cause
The root cause is the mismatch between how the fee is applied in the accounting logic versus the token transfer logic:
The fee-adjusted accounting value (postFeeStableAmountEquivalent) is used to update the ledger:
Actual token balance in the contract is 1100 tokens (equivalent to 1100 USDC).
The investment round effectively holds 1100 USDC worth of tokens, exceeding the 900 USDC limit by 200 USDC.
Impact
Limit Violation:
Exceeds the defined investment round limits.
Breaches governance rules for investment caps.
Trust Breach:
Creates a discrepancy between stated and actual behavior.
Undermines user trust and compliance with the stated terms.
Exploitation Potential:
A malicious user could inflate the round's holdings by exploiting this mismatch.
PoC
No response
Mitigation
Adjust the invest() function to transfer the fee-adjusted token amount instead of the full amount:
The text was updated successfully, but these errors were encountered:
sherlock-admin3
changed the title
Tricky Mahogany Vulture - Fee mismatch in invest() function leading to round limit breach
0xKann - Fee mismatch in invest() function leading to round limit breach
Nov 23, 2024
0xKann
Medium
Fee mismatch in invest() function leading to round limit breach
Summary
The
invest()
function inVVVVCInvestmentLedger.sol
applies an off-chain signed fee only to the accounting values but not to the actual token transfer. This discrepancy allows an investment round to exceed its limit in real token value, despite appearing compliant in the contract's recorded data.Root Cause
The root cause is the mismatch between how the fee is applied in the accounting logic versus the token transfer logic:
The fee-adjusted accounting value (postFeeStableAmountEquivalent) is used to update the ledger:
As a result, while the accounting logic deducts the fee, the actual tokens transferred to the contract do not reflect this deduction.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
Setup
amountToInvest
: 1100 tokensfeeNumerator
: 1000 (10% fee)exchangeRateNumerator/Denominator
: 1:1 (1 token = 1 USDC).invest()
with these parameters.Execution
Contract computes the pre-fee accounting value:
Contract calculates the post-fee accounting value:
Investment checks pass because
990 USDC <= 900 USDC
round limit.Contract updates the accounting values:
However, the full amount is transferred to the contract:
Outcome
Impact
Limit Violation:
Exceeds the defined investment round limits.
Breaches governance rules for investment caps.
Trust Breach:
Creates a discrepancy between stated and actual behavior.
Undermines user trust and compliance with the stated terms.
Exploitation Potential:
A malicious user could inflate the round's holdings by exploiting this mismatch.
PoC
No response
Mitigation
Adjust the invest() function to transfer the fee-adjusted token amount instead of the full amount:
The text was updated successfully, but these errors were encountered: