As per protocol's README, tokens that will be whitelisted to interact with the protocol will be ETH, WETH and any EIP-20 following standard tokens. However based on the project's current design, not all tokens will be suitable to the codebase. One example is XAUt, which is EIP-20 compilant. According to EIP-20 standard a transfer/transferFrom function should return a bool
value. This token returns false
even when a successul transfer is conducted.
Following the transfer functionalities in the protocol (Rescuable.sol
):
It will not handle this specific edge case properly, thus will make the transfer transactions revert with transfer failed error.
PoC:
Add the following mock token contract in the PreMarkets.t.sol
test file and run forge test --mt testFailTransfer -vvvv
:
Make the setup in PreMarketsTest
:
Result from the traces output:
Impact: Medium, no loss of assets, but breaks functionality, the token will simply not work on this codebase
Likelihood: Low, as it requires XAUt (Tether Gold) token to be whitelisted
Manual Review
Restrict using this specific token, or add a check if that particular is used for transfer, to handle the returned different bool
value accordingly
I believe the issues and duplicates do not warrant low severity severity as even if the call to transfers returns false instead of reverting, there is no impact as it is arguably correct given there will be insufficient funds to perform a rescue/withdrawal. This will not affect `tillIn()` as there are explicit balance [checks that revert accordingly](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/TokenManager.sol#L255-L260) to prevent allowing creation of offers without posting the necessary collateral
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.