Hi, please tell me, I'm doing a test with 3 currencies, DAI, USDC and USDT.
all currencies work correctly, I can use all their methods.
But USDT is behaving very strangely.
I run the test for the first time and it works correctly
await Contract.usdt.methods.approve (Contract.main._address, 20e6)
.send ({from: pathAndAddress.address.holderUsdt});
But if you run the same code a second time, you get the following error "Error: Transaction reverted without a reason".
Likewise, in the USDT.transferFrom contract, it returns the following error "Error: Transaction reverted: function returned an unexpected amount of data". Everything is written correctly in my code, DAI and USDC work out and pass all tests.
May 28, 2021, 7:04 AM
Hi
USDT contract have modifier onlyPayloadSize to prevent ERC20 Short Address Attack,
explanation here https://ethereum.stackexchange.com/a/20839/21292
for calling token functions use SafeERC20
@openzeppelin/contracts/token/ERC20/SafeERC20.sol
USDT contract have modifier onlyPayloadSize to prevent ERC20 Short Address Attack,
explanation here https://ethereum.stackexchange.com/a/20839/21292
for calling token functions use SafeERC20
@openzeppelin/contracts/token/ERC20/SafeERC20.sol
May 28, 2021, 7:41 AM
No threats detected at https://ethereum.stackexchange.com/a/20839/21292.
May 28, 2021, 7:43 AM
Thank you
May 28, 2021, 7:52 AM