The current implementation's direct use of ERC20 transferFrom
function calls presents a critical incompatibility issue with non-standard ERC20 tokens, particularly those like USDT that don't return boolean values. This vulnerability can cause all membership purchases to fail when using such tokens, effectively breaking core protocol functionality and potentially leading to significant user friction and lost revenue opportunities. The impact is severe as USDT is one of the most widely used stablecoins in the ecosystem, and its incompatibility would severely limit the protocol's usability and adoption potential. Furthermore, this issue extends to other tokens that don't strictly follow the ERC20 standard's return value specifications.
The root cause stems from Solidity's strict type checking and the assumption that all ERC20 tokens follow the standard implementation of returning a boolean value for transfers. When interacting with tokens like USDT that don't return any value for transfers, the EVM attempts to decode a non-existent return value as a boolean, causing the transaction to revert. This occurs because the contract directly calls transferFrom without any safe handling of return values, making it incompatible with tokens that deviate from the standard ERC20 implementation.
https://github.com/Cyfrin/2024-11-one-world/blob/main/contracts/dao/MembershipFactory.sol#L140
Implement OpenZeppelin's SafeERC20 library to safely handle transfers for all ERC20 tokens, including non-standard implementations:
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.