I know this question has been asked too frequently. I apologise, but I did not understand much of the answers. I ve been trying to create a Staking Contract but this error has stumped me. This is not the stake function code itself, just the transferring part. This is the code:
function stake(uint256 _amount) public {
stakingToken.transferFrom(msg.sender, address(this), _amount);
stakingToken.approve(msg.sender, _amount);
}
This is the error:
The transaction has been reverted to the initial state.
Reason provided by the contract: "ERC20: insufficient allowance".
Debug the transaction to get more information.
我先尝试将批准职能放在首位,最后是移交。 Ive利用转账职能进行审判,但都出现了同样的错误。
我也把我的天然气限额提高到12000 000,我也试图增加甲型六氯环己烷,但没有任何工作。
如果问你,我很抱歉,我只想作一个能够解决我问题的翔实答案。
May you reach the stars.