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

docs: fix Token Bridge tutorial #10638

Closed
critesjosh opened this issue Dec 11, 2024 · 3 comments · Fixed by #11578
Closed

docs: fix Token Bridge tutorial #10638

critesjosh opened this issue Dec 11, 2024 · 3 comments · Fixed by #11578
Assignees
Labels
A-documentation Area: relates to documentation

Comments

@critesjosh
Copy link
Contributor

The token bridge tutorial does not currently work.

As it's currently designed, the tests rely on many files:

The tutorial broke because many of these files changed recently. I am starting to think it would easier to have people to clone the monorepo and list commands in the tutorial to copy files directly out of the monorepo into their project rather than have them copy+paste large code blocks. If we set up a foundry project and list aztec-packages as a dependency, it will clone it into lib/ when running forge install. A drawback of this approach is that devs need to have forge installed (may not be a big issue).

Adding these to foundry.toml enables the TokenPortal.sol as its written to compile (even though it's not strictly necessary for the tutorial tests to run).

# foundry.toml
remappings = [
  "@aztec/=lib/aztec-packages/l1-contracts/src/",
  "@oz/=lib/openzeppelin-contracts/contracts/",
]

[dependencies]
aztec-packages = "https://github.com/AztecProtocol/aztec-packages:aztec-packages-v0.66.0"
@critesjosh critesjosh added the A-documentation Area: relates to documentation label Dec 11, 2024
@critesjosh critesjosh changed the title docs: Token Bridge tutorial docs: fix Token Bridge tutorial Dec 11, 2024
@critesjosh
Copy link
Contributor Author

As an alternative, we could set up a test file, specifically designed to be used only with published npm packages. It could use these helper functions from aztec.js

The test file would:

  1. deploy token contract to ethereum
  2. deploy token bridge to ethereum
  3. deploy token to aztec
  4. deploy token bridge to aztec
  5. send tokens to token bridge on ethereum
  6. claim tokens on aztec
  7. burn tokens on aztec
  8. claim tokens on ethereum

The tutorial would grab sections of this test file.

@critesjosh
Copy link
Contributor Author

critesjosh commented Jan 8, 2025

Trying out a simple script here: https://github.com/critesjosh/token-bridge-tutorial-test/blob/0.66/index.ts

blocked by getting L2ToL1MessageMembershipWitness. discussion here

@signorecello
Copy link
Contributor

I'm taking this @critesjosh

critesjosh added a commit that referenced this issue Feb 12, 2025
This PR updates the token bridge tutorial pages in the docs, and adds an
e2e test to ensure that referenced code is always working.

closes #10638
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: relates to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants