The _transferToken function in PerpetualVault.sol uses unsafe ERC-20 transfer operations, which do not check return values. This could lead to silent transaction failures, causing funds to be lost, stuck, or misdirected if a token does not return true as expected.
In PerpetualVault.sol, the _transferToken function calls transfer() without verifying the return value. Certain tokens (e.g., USDT, BNB) do not return true on success, which can cause issues.
Steps to Reproduce:
Deploy a custom ERC-20 token that does not return a boolean value for transfer().
Call _transferToken() using this token.
The transfer may fail silently, leaving the contract in an inconsistent state.
The funds may not reach the recipient or treasury, yet the function execution continues.
Loss of Funds: If collateralToken.transfer() fails, funds may be permanently stuck or lost.
Incomplete Transactions: The contract assumes success and does not revert, leading to incorrect accounting.
Compatibility Issues: Certain tokens like USDT or BNB do not return true, which can cause execution to break.
Manual Review
SafeERC20.safeTransfer() correctly handles ERC-20 return values and reverts on failure.
Check Transfer Return Values
Ensure that transfers succeed before continuing execution.
Emit Failure Events & Handle Errors
If a transfer fails, halt execution instead of continuing with an inconsistent state.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
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.