The WrappedTokenBridge::_transferTokens function does not offer protection against an undesired amount of wrapped token output
The WrappedTokenBridge::_transferTokens function helps to send wrapped tokens to a destination chain, the token is transferred to the contract, then the deposited amount is converted to a number of wrapped tokens and finally it is sent to the destination chain:
The problem is that the function WrappedTokenBridge::_transferTokens does not offer a protection to NOT execute the transaction if the amount of wrapped tokens is not a convenient amount for the user. This can happen if the transaction is in process in the mempool and while it is there, the number of wrapped tokens changes to an unwanted amount, causing the user to lose tokens.
The user may receive an undesired amount of wrapped tokens because the transaction may be executed in an unforeseen amount of time, causing the amount of wrapped tokens that the user receives to be an undesired amount.
Manual review
Add a protection so that the transaction is not executed if the number of wrapped tokens is not desired:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.