You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ERC-20 contract requires to set an allowance before depositing tokens into the ERC20Portal contract. cartesi send erc20 does not handle allowance, so it often fails like so:
β cartesi-app cartesi send
? Select send sub-command Send ERC-20 deposit to the application.
? Chain Foundry
? RPC URL http://127.0.0.1:8545
? Wallet Mnemonic
? Mnemonic testtesttesttesttesttesttesttesttesttesttest junk
? Account 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 9999.964983134519619707 ETH
? Application address 0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e
? Token address 0x92C6bcA388E99d6B304f1Af3c3Cd749Ff0b591e2
? Amount 1
ContractFunctionExecutionError: The contract function"depositERC20Tokens" reverted with the following signature:
0xfb8f41b2
Unable to decode signature "0xfb8f41b2" as it was not found on the provided ABI.
Make sure you are using the correct ABI and that the error exists on it.
You can look up the decoded signature here: https://openchain.xyz/signatures?query=0xfb8f41b2.
Contract Call:
address: 0x9C21AEb2093C32DDbC53eEF24B873BDCd1aDa1DB
function: depositERC20Tokens(address _token, address _dapp, uint256 _amount, bytes _execLayerData)
args: (0x92C6bcA388E99d6B304f1Af3c3Cd749Ff0b591e2, 0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e, 1000000000000000000, 0x)
sender: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
Docs: https://viem.sh/docs/contract/decodeErrorResult
Version: [email protected]
βοΈ Solution
cartesi send erc20 could also take care of the allowance transaction.
π― Definition of Done
send erc20 asks for allowance if necessary, and send the allowance transaction before sending the ERC20Portal transaction.
The text was updated successfully, but these errors were encountered:
π Context
The ERC-20 contract requires to set an allowance before depositing tokens into the ERC20Portal contract.
cartesi send erc20
does not handle allowance, so it often fails like so:βοΈ Solution
cartesi send erc20
could also take care of the allowance transaction.π― Definition of Done
The text was updated successfully, but these errors were encountered: