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

deployement will fail for fee on transfer tokens #831

Open
codehawks-bot opened this issue Aug 6, 2023 · 0 comments
Open

deployement will fail for fee on transfer tokens #831

codehawks-bot opened this issue Aug 6, 2023 · 0 comments

Comments

@codehawks-bot
Copy link

deployement will fail for fee on transfer tokens

Severity

Medium Risk

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L44

https://github.com/Cyfrin/2023-07-escrow/blob/main/src/EscrowFactory.sol#L39

Summary

As mentioned many times almost all type of tokens but for fee on transfer token deployement will fail everytime

Vulnerability Details

in newEscrow first price tokens sent to computedAddress then deployment occurs and for deployment price should not be less than balance of tokenContract.

In the case fee on transfer , transferred price will be less than param price and hence the actual token balance of the tokenCOntract will be less than price resulting fail deployment
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/EscrowFactory.sol#L39
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L44

Impact

deployment will fail

Tools Used

Manual

Recommendations

Check balance before and after the transfer and then pass actual transfer amount in deployement function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants