The depositTokensToL2
function in the provided Solidity code lacks a check for the existence of sufficient tokens at the specified from address before initiating the transfer. This omission may lead to a vulnerability where tokens are transferred without verifying the availability of the required amount, potentially causing unintended behavior.
The vulnerability lies in the absence of a check for the existence of sufficient tokens at the from address before executing the safeTransferFrom
function. The code assumes that the from address holds the required amount of tokens, making it susceptible to a potential exploit if the balance is insufficient.
SafeERC20.sol
L1BossBridge.sol
they could manipulate the from address to initiate token transfers without having the required balance. This may result in unintended consequences, such as failed transactions or disruptions in the functioning of the contract.
Manual
To address this vulnerability, it is recommended to implement a check for the existence of sufficient tokens at the from address before executing the safeTransferFrom function. This can be achieved by using the balanceOf function provided by the token contract. Below is an updated version of the code:
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.