Platform: Code4rena
Start Date: 13/12/2023
Pot Size: $36,500 USDC
Total HM: 18
Participants: 110
Period: 8 days
Judge: 0xTheC0der
Id: 311
League: ETH
Rank: 81/110
Findings: 1
Award: $25.16
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: deepplus
Also found by: 0xDING99YA, 0xmystery, Aymen0909, DanielArmstrong, Inference, KupiaSec, SadeeqXmosh, SpicyMeatball, Tricko, adeolu, jnforja, passteque, rvierdiiev, wangxx2026, zhaojie
25.1638 USDC - $25.16
The ERC20TokenEmitter contract features a buyToken() method enabling users to acquire governance ERC20VotesToken, with token prices determined by a linear VRGDA contract. This contract's pricing mechanism relies on daily emissions. However, a critical issue arises as users are unable to specify slippage. In the absence of slippage protection, malicious users could front-run trades, increasing the emission schedule. For instance, if a user wants to buy tokens, a malicious user could front run the trade causing an increase in emission schedule, The user's trade would be executed at unexpectedly higher prices. This vulnerability poses a risk of adverse execution outcomes for users.
Users would be forced to accept trades at very bad prices.
//Absence of slippage could allow users to buy tokens at very terrible prices //Alice sends a buyToken[] transaction to the mempool,Bob spots the tx and creates the same trade //further pushing the tokenEmitter schedule forward which exponentially increases price and when alice's trade //get's executed it gets executed at a very high price than expected. function buyToken( address[] calldata addresses, uint256[] calldata basisPointSplits, ProtocolRewardAddresses calldata protocolRewardsRecipients ) public payable nonReentrant whenNotPaused returns (uint256 tokensSoldWad) {
Vscodium
Add a slippage parameter to the buyToken method , to determine minimum acceptable amounts by the users.
MEV
#0 - c4-pre-sort
2023-12-22T04:30:33Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2023-12-22T04:30:52Z
raymondfam marked the issue as duplicate of #26
#2 - c4-pre-sort
2023-12-24T06:00:45Z
raymondfam marked the issue as duplicate of #397
#3 - c4-judge
2024-01-06T16:29:43Z
MarioPoneder changed the severity to 2 (Med Risk)
#4 - c4-judge
2024-01-06T16:29:48Z
MarioPoneder marked the issue as satisfactory