Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add batched EVM transaction walkthrough #983

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

sisyphusSmiling
Copy link
Contributor

@sisyphusSmiling sisyphusSmiling commented Nov 13, 2024

Related: onflow/batched-evm-exec-example#7

ℹ️ Please do not merge - plans to coordinate publishing with a blog post, but opening PR for feedback

Description

  • Adds a walkthrough detailing how to conditionally execute multiple EVM transactions in a single Cadence transaction

Copy link

vercel bot commented Nov 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 26, 2024 1:02am

@sisyphusSmiling sisyphusSmiling requested a review from a team November 13, 2024 20:08
@sisyphusSmiling sisyphusSmiling self-assigned this Nov 13, 2024
@sisyphusSmiling sisyphusSmiling added the documentation Improvements or additions to documentation label Nov 13, 2024
@sisyphusSmiling sisyphusSmiling marked this pull request as ready for review November 13, 2024 21:38
@sisyphusSmiling sisyphusSmiling changed the title Add batched EVM transaction walkthrough [DO NOT MERGE] Add batched EVM transaction walkthrough Nov 13, 2024
@sisyphusSmiling sisyphusSmiling marked this pull request as draft November 15, 2024 23:35
@sisyphusSmiling sisyphusSmiling changed the title [DO NOT MERGE] Add batched EVM transaction walkthrough Add batched EVM transaction walkthrough Nov 15, 2024
@sisyphusSmiling sisyphusSmiling marked this pull request as ready for review November 21, 2024 19:22

### Approve ERC721 Transfer

Our example `MaybeMintERC721` contract accepts WFLOW in exchange for minting an NFT. However, the contract cannot move
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great description of what wrapped Flow is, but why would we need it here instead of just regular, unwrapped Flow?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine if it's just to demonstrate the complex chain of transactions, but I'd be explicit as to why.

self.coa.deposit(from: <-fundingVault)
```

Taking a look at the full transaction, we can see an explicit check that the COA has enough FLOW to cover the mint cost
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have enough Flow and failed before this. Got the error that there wasn't enough in the vault to transfer to.

Tried to repro by switching accounts and even after refreshing, I'm getting: Error
1 error occurred:
* transaction verification failed: [Error Code: 1006] invalid proposal key: public key 0 on account d83e39fd1baa9ac3 does not have a valid signature: [Error Code: 1008] invalid payload signature: public key 0 on account d83e39fd1baa9ac3 does not have a valid signature: signature is not valid

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that account only has 0.001 FLOW, try again after funding from faucet. The other invalid signer errors may be wallet issues.

Copy link
Contributor

@briandoyle81 briandoyle81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great tutorial! Left some non-blocking feedback.

I really would try to guide people through building and testing the Cadence script step-by-step if you have time. Learning through doing is much more powerful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: 👀 In Review
Development

Successfully merging this pull request may close these issues.

2 participants