New Escrow
contract instances can not be deployed for tokenContract
tokens that charge transfer fees.
Creating a new Escrow
contract instance via the EscrowFactory.newEscrow
function requires transferring the price
amount of tokens (tokenContract
) to the new Escrow
contract address. However, if the used tokenContract
is a fee-on-transfer token (i.e., deducting a transfer fee), the Escrow
contract will not receive the full price
amount of tokenContract
tokens. The balance check in the Escrow
contract in line 44 will revert with an error due to receiving slightly less than the price
amount of tokenContract
tokens.
Please note that $USDT has theoretically the ability to charge transfer fees (see https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7?a=0x522dffc539c264a8f7e0b91102e899b33f4dabc3#code line 131) once fees are enabled. Moreover, $USDC is an upgradeable contract and, theoretically, could also be upgraded to charge transfer fees.
As the protocol is deployed as immutable contracts, it is assumed that it should continue functioning with widely used ERC-20 tokens well into the future. Thus, the consideration of possible ERC-20 token transfer fees is recommended, and medium severity was chosen.
Escrow
contract instances can not be deployed with fee-on-transfer tokens as the tokenContract
and thus limiting the usability of the Escrow
contract.
Manual Review
Consider determining i_price
by retrieving the current balance of tokenContract
in the Escrow
constructor instead of supplying it as the price
constructor argument.
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.