current position:Home>Can one method in solidity call two methods of transferring tokens

Can one method in solidity call two methods of transferring tokens

2022-02-03 23:23:20 Q & A of Denglian community

function invest (uint amount) public {    uint _hjlAmount = amount.mul(hjlProportion).div(100);    uint _hjAmount = amount.mul(usdtProportion).div(100);    IERC20(HJ).transferFrom(msg.sender, investDataAddress, _hjAmount);    IERC20(HJL).transferFrom(msg.sender, investDataAddress, _hjlAmount);  }} This always fails , But it's OK to turn to another one 



Take the answer 1:

Tolerable , Make sure both coins are authorized , And have enough balance .

And make sure Both coins are standard ERC20 ( Some coins can not be , Such as USDT






Other answers 1:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032323180577.html

Random recommended