you can see that the accountability of the funds is done before the transfer. This is not compatible with tokens that have a fee on transfer because eventually the bridge will receive less funds that the user sent.
Impact
Optimism will be unable to birdge the tokens to the receiver because there won't be enough funds in the bridge contract.
0xWeiss
medium
[M-05] Incompatibility with fee on transfer tokens
Summary
Fee on transfer tokens are not supported.
Vulnerability Detail
In contract: https://github.com/sherlock-audit/2023-01-optimism/blob/main/optimism/packages/contracts-bedrock/contracts/universal/StandardBridge.sol?plain=1#L414
In lines:
you can see that the accountability of the funds is done before the transfer. This is not compatible with tokens that have a fee on transfer because eventually the bridge will receive less funds that the user sent.
Impact
Optimism will be unable to birdge the tokens to the receiver because there won't be enough funds in the bridge contract.
Code Snippet
/home/sherlock/optimism/packages/contracts-bedrock/contracts/universal/StandardBridge.sol?plain=1
Tool used
Manual Review
Recommendation