1

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

This is the params send for each requests :

approve :

"params": [
        {
            "from": "0xbe71b68f1cbe13561ab882f590fa91c6d79dd193",
            "to": "0xd9ba894e0097f8cc2bbc9d24d308b98e36dc6d02",
            "data": "0x095ea7b3000000000000000000000000e08b7d9464193616cb97086744caf8cae06a73c300000000000000000000000000000000000000000000152d02c7e14af6800000"
        },
        "latest"
    ]

transferFrom :

"params": [
        {
            "from": "0xe08b7d9464193616cb97086744caf8cae06a73c3",
            "to": "0xd9ba894e0097f8cc2bbc9d24d308b98e36dc6d02",
            "data": "0x23b872dd000000000000000000000000be71b68f1cbe13561ab882f590fa91c6d79dd193000000000000000000000000e08b7d9464193616cb97086744caf8cae06a73c30000000000000000000000000000000000000000000000008ac7230489e80000"
        },
        "latest"
    ]

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

2 Answers 2

0

It does not seem like the approve worked fine.

https://rinkeby.etherscan.io/address/0xd9ba894e0097f8cc2bbc9d24d308b98e36dc6d02#readContract

In the screenshot below we can see that the address 0xbe71b68f1cbe13561ab882f590fa91c6d79dd193 balance is 100000000000000000000.

But when calling the allowance method to check how much balance the 0xbe71b68f1cbe13561ab882f590fa91c6d79dd193 address is allowing 0xe08b7d9464193616cb97086744caf8cae06a73c3 to spend, we see 0:

enter image description here

Check and make sure to approve it correctly.

You can try doing it manually from here to test: https://rinkeby.etherscan.io/address/0xd9ba894e0097f8cc2bbc9d24d308b98e36dc6d02#writeContract

0

I found my error, I send the approve with "eth_call" instead of "eth_sendTransaction" method with my RPC server...

Thank you all for your help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.