Stratax::recoverTokens uses unsafe transfer which silently fails for non-standard ERC20 tokens like USDTStratax::recoverTokens uses IERC20.transfer directly without checking the return value:
Some widely-used ERC20 tokens — most notably USDT (Tether) — do not return a bool from transfer. When the Solidity IERC20 interface expects a bool return value and the token returns nothing, the call reverts at the ABI decoding step. This means Stratax::recoverTokens will always revert when attempting to recover USDT or any other non-standard token that omits the return value.
This is particularly relevant to Stratax because the protocol is deployed on Ethereum mainnet and interacts with Aave, where USDT is one of the most commonly used assets. If a user opens a leveraged position using USDT as collateral or borrow token, any USDT that ends up in the contract (from excess withdrawals, swap leftovers, or direct transfers) becomes permanently unrecoverable via Stratax::recoverTokens.
Likelihood:
USDT is one of the most widely used stablecoins on Aave, so positions involving USDT are common.
The issue only occurs when Stratax::recoverTokens is called with a non-standard token like USDT, and also when trying to call Stratax::openLeveragedPosition where the non-standard token is the collateral token. This will revert
Impact:
Tokens that don't conform to the standard ERC20 transfer return value cannot be recovered from the contract.
Stratax::recoverTokens is the only mechanism to retrieve tokens sitting in the contract, so these funds are permanently locked.
Trying to open a position where a non-standard token eg: USDT is the collateral token will revert
Add the following constants to Constants.t.sol
Add the folliwing to the setUp() function in /test/fork/Stratax.t.sol
Add the following test to /test/fork/Stratax.t.sol
Use OpenZeppelin's SafeERC20 library which handles non-standard return values:
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.
The contest is complete and the rewards are being distributed.