Support of different ERC20 tokens #119
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
invalid
This doesn't seem right
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2022-09-y2k-finance/blob/main/src/Vault.sol#L167
Vulnerability details
Impact
The current version of the codebase does not handle special cases of tokens, e.g. deflationary, rebasing, or those that return true/false on success (see: https://github.com/d-xo/weird-erc20). Function purchase transfers tokens from msg.sender but it does not check the return value, nor how many tokens were actually transferred:
Proof of Concept
https://github.com/code-423n4/2022-09-y2k-finance/blob/main/src/Vault.sol#L167
Tools Used
manul code review
Recommended Mitigation Steps
I have 2 suggestions here:
The text was updated successfully, but these errors were encountered: