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

Feature: L1 <> L2 messaging with Token Bridge example #253

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

Conversation

0xNeshi
Copy link
Contributor

@0xNeshi 0xNeshi commented Oct 23, 2024

Issue(s): Close ##186

Description

Adds a simple token bridge example that sends and receives tokens from L1 to L2 and vice versa.

Checklist

@0xNeshi 0xNeshi changed the title L1 l2 token bridge Feature: L1 <> L2 messaging with Token Bridge example Oct 23, 2024
@@ -0,0 +1 @@
src/Vm.sol linguist-generated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A couple of notes/questions:

  • I added tests for the Solidity contracts to ensure correctness, and opted for Foundry for consistency (as we already use it for Starknet contract tests). If you think this adds to many other files (see next point), and don't think they're that necessary for this example, we can delete.
  • forge-std library is included in the source, as it makes it any extra setup unnecessary to run tests for the Solidity TokenBridge in the future. Let me know if you want this removed, and we can add a README note with instructions on how to set this up.
  • I didn't update ./scripts/cairo_programs_verifier.sh to run Solidity tests, but this can be done.

import "starknet/IStarknetMessaging.sol";

/**
* @title Contract to bridge tokens to and from Starknet. Has basic access control
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if you want me to remove some of these comments, I aimed for a contract that respects best dev practices, but not sure if it adds to much clutter to the code on the website.

@julio4 julio4 self-assigned this Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants