Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buytoken function in ERC20TokenEmitters lacks of slippage parameters #82

Closed
c4-bot-6 opened this issue Dec 18, 2023 · 4 comments
Closed
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

Comments

@c4-bot-6
Copy link
Contributor

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

@c4-bot-6 c4-bot-6 added 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 labels Dec 18, 2023
c4-bot-6 added a commit that referenced this issue Dec 18, 2023
@c4-pre-sort c4-pre-sort added the sufficient quality report This report is of sufficient quality label Dec 22, 2023
@c4-pre-sort
Copy link

raymondfam marked the issue as sufficient quality report

@c4-pre-sort
Copy link

raymondfam marked the issue as duplicate of #26

@c4-pre-sort
Copy link

raymondfam marked the issue as duplicate of #397

@c4-judge
Copy link
Contributor

c4-judge commented Jan 6, 2024

MarioPoneder marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants