IMPORTANT DISCLAIMER: This repository is NOT maintained by the Across Protocol team and is intended for educational purposes only. The examples provided here are for demonstration and learning purposes. Use at your own risk. The maintainers of this repository assume no responsibility or liability for any errors or issues that may arise from using these examples.
This repository demonstrates how to use the Across Protocol SDK to interact with the Across bridge, showing various examples of cross-chain token transfers and bridge interactions.
To create a new example:
- Copy the
templatefolder - Rename it based on your use case (e.g.,
token-bridge,usdc-transfer) - Add your configuration in
config.ts - Modify the message handler in
message.ts
Install dependencies using yarn:
yarn installYou can run examples using the following command:
yarn start --project <example-directory> --simulate <true|false>Where:
<example-directory>is the name of the example folder you want to run--simulate:true: Uses Tenderly virtual networks for simulationfalse: Executes actual transactions (requires PRIVATE_KEY in env)
Example:
# To simulate a protocol-fees bridge example
yarn start --project protocol-fees --simulate true
# To execute a real transaction
yarn start --project protocol-fees --simulate falseCreate a .env file with the following Tenderly credentials:
TENDERLY_ACCESS_KEY=your_access_key
TENDERLY_ACCOUNT=your_account_name
TENDERLY_PROJECT=your_project_nameNote: A fallback Tenderly configuration is provided, but it's recommended to use your own credentials as the fallback cannot be guaranteed to always work.
When running with --simulate false, add PRIVATE_KEY to your environment variables:
PRIVATE_KEY=your_wallet_private_key[Add specific examples and their descriptions here]
Feel free to contribute by adding new examples or improving existing ones. Follow the project structure guidelines mentioned above.