The init
function in the ReseedL2Migration
contract unconditionally transfers ERC-20 tokens to a specified address without verifying the success of these transfers. This can lead to potential vulnerabilities and undesirable behaviors if any of the token transfers fail. Ensuring the success of these transfers is critical to maintain the integrity and reliability of the contract's operations.
See the following code:
In the init
function, several ERC-20 tokens are transferred to the BCM (Beanstalk Community Multisig) address. However, the function does not check the return value of the transfer calls, which can indicate whether the transfer was successful. According to the ERC-20 standard, the transfer function returns a boolean value indicating the success or failure of the operation. Ignoring this return value can lead to the following issues:
If any of the transfers fail, the function will proceed as if the transfer was successful, leading to incorrect assumptions about the contract's state.
Subsequent operations that rely on the successful transfer of funds might be executed under false pretenses, potentially leading to loss or misallocation of assets.
The contract might incorrectly assume that the funds have been transferred when they have not. This can lead to inconsistencies in the contract's state and subsequent operations that depend on these transfers. If the contract proceeds with other operations assuming the transfer was successful, it might result in financial losses or misallocation of assets. The functionality that depends on these transfers might malfunction, causing disruptions in the protocol's operations.
Manual Review
To mitigate these issues, it is crucial to verify the success of each transfer operation by checking the return value of the transfer function. If any transfer fails, the function should revert to prevent further execution.
Invalid as per docs https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
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.