Buytoken function in ERC20TokenEmitters lacks of slippage parameters #82
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-397
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2023-12-revolutionprotocol/blob/main/packages/revolution/src/ERC20TokenEmitter.sol#L152
Vulnerability details
Impact
Risk of users receiving significantly fewer ERC20Tokens than expected.
Proof of Concept
The prices of ERC20Tokens are dynamically calculated based on the implemented VRGDA. Consequently, purchasing ERC20Tokens leads to an increase in the token selling price.
Therefore, individuals purchasing ERC20Tokens by invoking the buyTokens function may receive significantly fewer tokens than expected, as they could potentially be front-run by another user acquiring tokens just before them.
Tools Used
Manual review.
Recommended Mitigation Steps
Consider adhering to best practices by introducing a slippage input parameter in the buyToken function to mitigate potential consequences of front-running for buyers.
By setting a zero slippage the slippage protection could be disabled allowing that auctions still can buy ERC20Tokens.
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: