EVM Transactions In-Depth
How Coinflow EVM transactions work
- User enters card info
- Card gets authorized + passes chargeback checks
- Coinflow runs transaction
At this point, Coinflow contract has a USDC balance that can be deducted from to send USDC to the merchant for settlement. Coinflow contract receives:
- The amount of USDC to approve
- Merchant contract address
- Function call data (aka the data to call the merchant contract with)
- Coinflow contract calls approve() on the USDC contract, allowing a merchant’s contract to pull $X amount of USDC from coinflows contract.
- Coinflow’s contract calls the merchant’s contract with their provided function call data.
- Inside the merchants contract, a call to the USDC contract transferFrom() function is made. This takes in merchants’ contract address, the amount of USDC to transfer, and the destination that will receive USDC (destination could be end-user wallet/ merchant wallets/ merchant contract). This represents fulfillment of payment or settlement.
- Then, inside the function data passed to the Coinflow contract, the merchant needs to include the end users wallet address so that the merchants contract can send the NFT to the end user.
How to debug EVM transactions
When merchants submit transaction data, Coinflow simulates it upfront to ensure successful execution. The response includes any revert reasons and the corresponding transaction data. Receiving an error message INSUFFICIENT FUNDS TO REDEEM indicates the transaction failed due to inadequate funds.
Steps to debug
- Check response details
- Look for the
revertReasonmessages to understand why the transaction failed. - Identify which addresses (to and from) are involved in the failure.
- Look for the
- Use a transaction simulator tool like Tenderly
- Copy the transaction data into a simulation tool like Tenderly for more detailed reasons of where the transaction failed
- Analyze transaction data
- Verify the to field in the transaction data matches the Coinflow contract
- Ensure the from field correctly corresponds to the wallet paying USDC

