@@ -6,7 +6,7 @@ sidebar_position: 6
66
77Integrating Cadence into EVM applications on Flow enables developers to leverage the best of both worlds. This guide
88demonstrates how to batch EVM transactions using Cadence, allowing applications to embed multiple EVM transactions in a
9- single Cadence transaction, conditioning final execution on the success of all EVM transactions.
9+ single Cadence transaction while conditioning final execution on the success of all EVM transactions.
1010
1111This feature can supercharge your EVM application by unlocking experiences otherwise impossible on traditional EVM
1212platforms.
@@ -21,7 +21,7 @@ After completing this guide, you'll be able to
2121- Run a Cadence transaction from the browser using [ Flow Runner]
2222- Install conceptual understanding of Cadence X EVM interactions
2323- Inspect multiple EVM transactions embedded in a Cadence transaction with [ Flowscan] block explorer
24- - Write code that interacts with the EVM via a COA
24+ - Write code that interacts with the EVM via a CadenceOwnedAccount ( COA)
2525
2626## Prerequisites
2727
@@ -45,10 +45,10 @@ These operations let us focus on the **core concepts** of this guide:
45451 . ** Batching EVM transactions** using Cadence
46462 . ** Conditioning execution** on the results of those EVM transactions.
4747
48- However, using these same principles, you'll have the power to address much more complex and interesting . For instance,
49- replace wrapping FLOW with a DEX swap. Or instead of minting an ERC721, purchase an NFT listing from a marketplace.
50- Combine these two and suddenly you can purchase NFTs with any ERC20 token, all in a single Cadence transaction,
51- reverting everything if a single step fails.
48+ However, using these same principles, you'll have the power to address more complex use cases . For instance, replace
49+ wrapping FLOW with a DEX swap. Or instead of minting an ERC721, purchase an NFT listing from a marketplace. Combine
50+ these two and suddenly you can purchase NFTs with any ERC20 token, all in a single Cadence transaction, reverting
51+ everything if a single step fails.
5252
5353The point is, while a simple use case, this guide will give you the tools to build much more complex and interesting
5454applications. So let's get started!
@@ -61,7 +61,7 @@ As mentioned in the [Overview], this guide involves three main actions:
6161- Approving an ERC721 to transfer WFLOW in exchange for an NFT mint
6262- Minting an ERC721 token
6363
64- Before interacting with these contracts, let's dig in a bit more into the components of this guide.
64+ Before interacting with these contracts, let's dig bit more into the components of this guide.
6565
6666### Wrap FLOW as WFLOW
6767
@@ -90,7 +90,7 @@ transaction was processed.
9090
9191Importantly, if this transaction fails, we want to revert the entire sequence of transactions. After all, you wrapped
9292FLOW to WFLOW and approved the ERC721 transfer specifically to mint this NFT. If the mint fails, you want to unwind
93- everything. This is where batching EVM transactions using Cadence is extremely powerful.
93+ everything. As we'll see shortly, this is where batching EVM transactions using Cadence is extremely powerful.
9494
9595## Interacting with the Contracts
9696
@@ -100,8 +100,8 @@ platforms.
100100
101101::: tip
102102
103- Recall in [ Prerequisites] that you need to have both MetaMask and Flow Wallet installed and funded with Testnet FLOW.
104- Make sure you've done so before proceeding.
103+ Recall in [ Prerequisites] that you need to have both [ MetaMask] and [ Flow Wallet extension ] installed and funded with
104+ Testnet FLOW. Make sure you've done so before proceeding.
105105
106106:::
107107
@@ -126,8 +126,8 @@ unique to Flow and is due to the fact that Cadence & EVM are separate runtimes,
126126Cadence. This orientation - that of EVM running within Cadence - means that the Cadence-side explorer has visibility to
127127EVM transactions embedded within a Cadence transaction.
128128
129- Practically, this means that any transactions ran using a Flow account can be viewed on the Cadence explorer while any
130- transactions run using an EVM account can be viewed on the EVM explorer.
129+ Practically, this means that any transactions ran using a Flow native account can be viewed on the Cadence explorer
130+ while any transactions run using an EVM account can be viewed on the EVM explorer.
131131
132132:::
133133
@@ -188,15 +188,15 @@ On success, you can click on your NFTs in MetaMask to see your newly minted toke
188188
189189#### Recap
190190
191- This process is cumbersome and requires multiple transactions, each of which could fail. Given the intent of the process
192- - minting an NFT - if this were a case where the NFT was a limited edition or time-sensitive, you'd be left with WFLOW
191+ This process is cumbersome and requires multiple transactions, each of which could fail. Given the intent of the process -
192+ minting an NFT - if this were a case where the NFT was a limited edition or time-sensitive, you'd be left with WFLOW
193193wrapped and approved for transfer, but no NFT and would need to manually unwind the process.
194194
195195Or you could just use Cadence to batch these transactions and revert everything if the mint fails. Let's do that.
196196
197197### Using Flow Wallet
198198
199- Before diving into the how, let's execute the batched version of everything we just did using Flow Wallet. This will
199+ Before diving into the " how" , let's execute the batched version of everything we just did using Flow Wallet. This will
200200give you a sense of the power of Cadence and the Flow blockchain.
201201
202202The transaction below, like all Cadence transactions, is scripted, allowing us to execute a series of actions. It may
@@ -722,7 +722,7 @@ Ready to level up your Cadence skills? Take a look at [these Cadence tutorials].
722722[ WFLOW ] : https://evm-testnet.flowscan.io/token/0xd3bF53DAC106A0290B0483EcBC89d40FcC961f3e?tab=write_contract
723723[ here ] : https://docs.soliditylang.org/en/v0.8.28/units-and-global-variables.html#ether-units
724724[ MaybeMintERC721 ] : https://evm-testnet.flowscan.io/address/0x2E2Ed0Cfd3AD2f1d34481277b3204d807Ca2F8c2?tab=write_contract
725- [ `wrap_and_mint.cdc` ] : https://run.dnz.dev/snippet/4fe0d43fdaf968b9
725+ [ `wrap_and_mint.cdc` ] : https://run.dnz.dev/snippet/c99b25e04a2d1f28
726726[ Flowscan Cadence ] : https://testnet.flowscan.io/
727727[ resource ] : https://cadence-lang.org/docs/solidity-to-cadence#resources
728728[ entitlement ] : https://cadence-lang.org/docs/language/access-control#entitlements
0 commit comments