jonah1005
A non standard erc20 token would always raise error when calling _safeTransferFrom. If a user creates a USDT/DAI pool and deposit into the pool he would find out thereβs never a counterpart deposit.
TransferHelper does not uses SafeERC20 library as the function name implies.
A sample POC:
script:
usdt.functions.approve(lending_pair.address, deposit_amount).transact({'from': w3.eth.accounts[0]})
lending_pair.functions.deposit(w3.eth.accounts[0], usdt.address, deposit_amount).transact({'from': w3.eth.accounts[0]})
Error Message:
Error: Transaction reverted: function returned an unexpected amount of data
at LendingPair._safeTransferFrom (contracts/TransferHelper.sol:20)
at LendingPair.deposit (contracts/LendingPair.sol:95)
Hardhat
Uses openzeppelin SafeERC20 in transfer helper (and any other contract that uses IERC20).
The text was updated successfully, but these errors were encountered:
All reactions