{"id":29747395,"url":"https://github.com/AngleProtocol/bridge-framework","last_synced_at":"2025-07-26T08:40:02.514Z","repository":{"id":110073295,"uuid":"563358345","full_name":"AngleProtocol/bridge-framework","owner":"AngleProtocol","description":"🌉 A framework to safely bring an ERC-20 token cross-chain using LayerZero","archived":false,"fork":false,"pushed_at":"2022-11-29T10:20:54.000Z","size":351,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T12:57:18.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AngleProtocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-08T12:58:42.000Z","updated_at":"2023-02-03T09:50:39.000Z","dependencies_parsed_at":"2023-03-11T05:00:48.014Z","dependency_job_id":null,"html_url":"https://github.com/AngleProtocol/bridge-framework","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"AngleProtocol/boilerplate","purl":"pkg:github/AngleProtocol/bridge-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fbridge-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fbridge-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fbridge-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fbridge-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AngleProtocol","download_url":"https://codeload.github.com/AngleProtocol/bridge-framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fbridge-framework/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267141225,"owners_count":24041983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-26T08:39:27.730Z","updated_at":"2025-07-26T08:40:02.498Z","avatar_url":"https://github.com/AngleProtocol.png","language":"TypeScript","funding_links":[],"categories":["Use Cases"],"sub_categories":["Github Repositories from Ecosystem Projects"],"readme":"# \u003cimg src=\"logo.svg\" alt=\"Angle Bridge Framework\" height=\"40px\"\u003e Angle Bridge Framework\n\n[![CI](https://github.com/AngleProtocol/bridge-framework/workflows/CI/badge.svg)](https://github.com/AngleProtocol/bridge-framework/actions?query=workflow%3ACI)\n\nThis repository introduces a modular framework to bring a token that exists natively on a chain across different chains using whitelisted bridge solutions.\n\nThe system proposed here with [LayerZero](https://layerzero.network) as a bridge solution is currently used by [Angle Protocol](https://angle.money) to bring agEUR and the ANGLE token cross-chain while preserving:\n\n- a single standard for each token on each chain\n- high security requirements\n- a smooth experience for bridgers which do not have to deal with several transactions\n\nFor more details, take a look at [Angle Docs](https://docs.angle.money/other-aspects/cross-chain).\n\n## 💻 Setup\n\nThis repo is designed to help you get a full cross-chain infrastructure for a token that already exists natively on a chain. Before getting started, make sure to follow the following setup steps.\n\n### Prerequisites\n\nThis repo assumes that on each chain there is what is called a `CoreBorrow` contract that will handle the different access control levels of your future contracts. So before anything, you may want to check that you have a contract that complies with the `ICoreBorrow` interface on each of the desired chain.\n\nYou can use [this contract](https://polygonscan.com/address/0x78754109cb73772d70A6560297037657C2AF51b8) as an implementation example.\n\nYou also obviously need a token natively deployed on a chain. It can work with any token.\n\nOn top of that, contracts in this setup are upgradeable and use a Transparent Proxy pattern, so you need to have a `ProxyAdmin` contract deployed across the different chains you are dealing with.\n\n### Install packages\n\nTo run scripts on this repo, you need to install packages by running:\n\n```bash\nyarn\n```\n\n### Create `.env` file\n\nIn order to interact with non local networks, you must create an `.env` that has:\n\n- `MNEMONIC`\n- network key (eg. an Alchemy or Infura network key)\n- `ETHERSCAN_API_KEY`\n\nFor additional keys, you can check the `.env.example` file.\n\nWarning: always keep your confidential information safe.\n\n### Tests\n\nContracts in this repo are tested with Hardhat. You can run tests as follows:\n\n```bash\nyarn hardhat:test ./test/hardhat/bridgeERC20/tokenSideChainMultiBridge.test.ts\n```\n\nYou can also check the coverage of the tests with:\n\n```bash\nyarn hardhat:coverage\n```\n\n## ⚙️ Deploying\n\nDeployment examples used in this repo are based around the [`ANGLE`](https://etherscan.io/address/0x31429d1856aD1377A8A0079410B297e1a9e214c2) token and `LayerZero` as a bridge solution. The system introduced here is modular so you can obviously adapt to a new token or to different bridge solutions.\n\n### Deployment flow\n\nTo build a cross-chain infrastructure for your token, you need to deploy various contracts:\n\n- a `LayerZeroBridgeERC20` contract on the chain on which your token already exists. This contract will route the LayerZero bridge messages from the native chain to the other chains where bridging is to be allowed\n- a `TokenSideChainMultiBridge` contract on all the chains on which you want your token to be. This contract is going to be the canonical version of your token on each the desired chains\n- a `LayerZeroBridgeTokenERC20` contract on all the chains on which you want your token to be. This contract's role is to receive bridge messages that instruct the `TokenSideChainMultiBridge` token to mint tokens to the desired address. It is also used to send bridge messages and hence burn canonical tokens from the chain where tokens should be bridged. This contract is what effectively allows bridging from one canonical token to another to be done in just one transaction without ever interacting with a bridge token.\n\n### LayerZeroBridgeERC20\n\nTo deploy the `LayerZeroBridgeERC20` contract on `CHAIN` (like mainnet or `polygon`), just run:\n\n```bash\nyarn deploy CHAIN --tags LayerZeroBridgeERC20\n```\n\nBefore that, make sure to replace in the associated deployment file in `deploy/LayerZeroBridgeERC20.ts` the `CoreBorrow`, the `ProxyAdmin` and the token address by the addresses you want to rely on.\n\n### TokenSideChainMultiBridge\n\nTo deploy the `TokenSideChainMultiBridge` and the associated `LayerZeroBridgeTokenERC20` contract run:\n\n```bash\nyarn deploy CHAIN --tags LayerZeroBridgeTokenERC20\n```\n\nIn the `deploy/1_LayerZeroBridgeTokenERC20.ts` and `deploy/0_angleSideChainMultiBridge.ts`, make sure to specify the correct `CoreBorrow` and `ProxyAdmin` contract. In ths first file, you can also change the total and hourly limits that can be bridged with LayerZero to the given chain.\n\n### Set Sources\n\nThe last thing you need to do to be fully operational with your bridge system is to link the contracts you have deployed to one another.\n\nOn each chain where you want the token to be supported (including the native chain), you need to call `setTrustedRemote` on the LayerZero bridge contract.\n\nFor instance, if your token exists natively on Ethereum, and has been bridged to Polygon and Optimism, then on Ethereum for instance, you need to add at trusted remote the version of the LayerZero contract on Polygon and Optimism, on Polygon you need to do it for Ethereum and Optimism, and last on Optimism, you need to do it for Ethereum and Polygon.\n\nThe script at `deploy/LayerZeroSetSources.ts` can help you build the transactions for a given chain provided that you specify the right `LayerZeroBridgeTokenERC20` or `LayerZeroBridgeERC20` on the other chains.\n\n## 🌉 Adding a new chain\n\nTo add support for a new chain you just have to deploy on this chain the `TokenSideChainMultiBridge` and the `LayerZeroBridgeTokenERC20`, and then to correctly set trusted remotes across all chains for this new chain.\n\n## 📰 Media\n\nDon't hesitate to reach out on [Twitter 🐦](https://twitter.com/AngleProtocol) or on [Discord](https://discord.gg/4FtNgnpPgE) should you have any question.\n\nIf you want to see how this setup looks like in production, check out [Angle Bridge interface](https://app.angle.money/#/bridges).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAngleProtocol%2Fbridge-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAngleProtocol%2Fbridge-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAngleProtocol%2Fbridge-framework/lists"}