CRYPTO NEWS

transferFrom result in execution reverted: Insufficient allowance

I am trying to make working the transferFrom process. I follow the steps who are :

  1. approve(address spender, uint256 amount) -> returning 1 so it is working
  2. transferFrom(address sender, address recipient, uint256 amount) -> returning an error message : execution reverted: Insufficient allowance

I can confirm you that I have enough ETH in the two wallets to pay gas fees. I try to call allowance function but returning me 0

If I call the balanceOf method of 0xbe71b68f1cbe13561ab882f590fa91c6d79dd193, I got in return : 0x0000000000000000000000000000000000000000000000056bc75e2d63100000 = 100000000000000000000

Please find the parameters for the two functions :

  • The main wallet from which I would like to manage funds of my sub wallet : 0xe08b7d9464193616cb97086744caf8cae06a73c3
  • The sub wallet : 0xbe71b68f1cbe13561ab882f590fa91c6d79dd193 Wallets are working on Rinkeby Test Network.

approve :

  • Address : 0xe08b7d9464193616cb97086744caf8cae06a73c3
  • Unit256 : 100000000000000000000000

transferFrom :

  • Address : 0xbe71b68f1cbe13561ab882f590fa91c6d79dd193
  • Address : 0xe08b7d9464193616cb97086744caf8cae06a73c3
  • Unit256 : 100000000000000000000

So that’s why I’m asking you some help on this, the approve call is working properly but not the transferFrom, and I don’t know why…

Thanks

Why openzeppeling use require instead of cursom errors?

As far as I know custom errors are more gas efficient but for example the openzeppelin contracts still use require instead of custom errors ERC20.sol function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner,::Listen

As far as I know custom errors are more gas efficient but for example the openzeppelin contracts still use require instead of custom errors

ERC20.sol

function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {     address owner = _msgSender();     uint256 currentAllowance = allowance(owner, spender);     require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");     unchecked {         _approve(owner, spender, currentAllowance - subtractedValue);     }      return true; } 

so my question is: Why openzeppelin use require instead of custom errors?

transferFrom result in execution reverted: Insufficient allowance

Shopping cart
There are no products in the cart!
Continue shopping
0