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: 82/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 buyToken
function within the ERC20TokenEmitter
contract allows users to acquire the governance token using a VRGDA
. This function lacks any form of slippage control, which becomes significant in the context of the buyToken
function, as the token's price increases exponentially when the supply surpasses the schedule.
As can be observed by looking at its parameters and implementation, the buyToken
function of the ERC20TokenEmitter
contract, doesnโt have any type of slippage protection:
function buyToken( address[] calldata addresses, uint[] calldata basisPointSplits, ProtocolRewardAddresses calldata protocolRewardsRecipients ) public payable nonReentrant whenNotPaused returns (uint256 tokensSoldWad) {
This means that users have no control over the number of ERC20 tokens they will receive. Due to the exponential pricing function, there is an incentive to delay token purchases as much as possible.
For instance, if Alice intends to use the buyToken
function and has either set a low gas usage or is outpaced by a more sophisticated user, she could end up with far fewer tokens than anticipated.
Manual Review
An additional parameter could be added to the buyToken
function, to let users decide the minimum amount of tokens to be received, with a relative check after minting.
Other
#0 - c4-pre-sort
2023-12-22T21:41:15Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2023-12-22T21:41:24Z
raymondfam marked the issue as duplicate of #26
#2 - c4-pre-sort
2023-12-24T06:00:55Z
raymondfam marked the issue as duplicate of #397
#3 - c4-judge
2024-01-06T16:31:18Z
MarioPoneder marked the issue as satisfactory