EVM Transactions In-Depth
EVM Transactions In-Depth
How Coinflow EVM transactions work end-to-end and how to debug them.
This page is for advanced / cryptocurrency-native companies. If that’s not you, head back to the Quickstart for the standard flows.
How Coinflow EVM transactions work
- User enters card info.
- Card gets authorized and passes chargeback checks.
- Coinflow runs the transaction. At this point, the Coinflow contract has a USDC balance that can be deducted from to send USDC to the merchant for settlement. The Coinflow contract receives:
- The amount of USDC to approve
- Merchant contract address
- Function call data (the data to call the merchant contract with)
- The Coinflow contract calls
approve()on the USDC contract, allowing the merchant’s contract to pull $X amount of USDC from the Coinflow contract. - The Coinflow contract calls the merchant’s contract with the provided function call data.
- Inside the merchant’s contract, a call to the USDC contract’s
transferFrom()function is made. This takes in the merchant’s contract address, the amount of USDC to transfer, and the destination that will receive USDC (destination could be the end-user wallet, merchant wallet, or merchant contract). This represents fulfillment of payment or settlement. - Inside the function data passed to the Coinflow contract, the merchant needs to include the end user’s wallet address so that the merchant’s contract can send the NFT to the end user.
- Inside the merchant’s contract, a call to the USDC contract’s
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

