across-protocol / contracts
git clone https://github.com/across-protocol/contracts.git
v5.0.27 · 1mo ago
🔥 on GitHub Trending today
Solidity smart contracts for Across, a cross-chain token bridge with a HubPool on Ethereum and SpokePools on other networks.
Why you might care
Source for the on-chain components of the Across bridge, useful for reviewing how liquidity-backed instant transfers and cross-chain admin upgrades work. SpokePools are UUPS proxies administered by the HubPool. The README notes OpenZeppelin audits, and it covers Foundry-based build, test, and deployment.
+1
stars, 24h · #13,807
+~2
stars, 7 days · #22,559
+3
stars, 30 days · #35,776
156
★ total · +1% this week
96
forks · 14 open issues
Star history (as recorded here)
LanguageSolidity
License—
Created2022-01-24 (4y ago)
Last push1d ago
Watchers13
OwnerOrganization
Seen on GitHub Trending
- 2026-10-23 — #10 monthly in solidity · +3 ★
- 2026-10-22 — #12 monthly in solidity · +3 ★
- 2026-10-21 — #12 monthly in solidity · +4 ★
- 2026-10-20 — #12 monthly in solidity · +4 ★
Links
README excerpt
Contains smart contract suite to enable instant token transfers between any two networks. Relays are backstopped by liquidity held in a central `HubPool` on Ethereum, which also serves as the cross-chain administrator of all contracts in the system. `SpokePool` contracts are deployed to any network that wants to originate token deposits or be the final destination for token transfers, and they are all governed by the `HubPool` on Ethereum. These contracts have been continuously audited by OpenZeppelin and the audit reports can be found here. ## Understanding Upgradeability The SpokePool contracts are UUPSUpgradeable Proxy contracts which means that their addresses will always be the same but their implementation code can change. All SpokePools can be upgraded if the "admin" of the contract calls `upgradeTo`. The SpokePool's admin is set by implementing the `_requireAdminSender()` virtual function in the child contract. For example here are the Arbitrum and Optimism implementations of the admin check. All SpokePools are implemented such that the admin is the HubPool, and therefore we describe the SpokePools as having "cross-chain ownership". The owner of the HubPool can call this function to send a cross-chain execution of `upgradeTo` on any SpokePool in order to upgrade it. This script is useful for creating the calldata to execute a cross-chain upgrade via the HubPool. ## Deployed Contract Versions The latest contract deployments can be found in `/broadcast/deployed-addresses.json` (auto-generated by `yarn extract-addresses`). ## Requirements This repository assumes you have Node installed, with a minimum version of 16.18.0. Depending on what you want to do with the repo you might also need foundry and anchor to also be installed. If you have build issues please ensure these are both installed first. Note if you get build issues on the initial `yarn` command try downgrading to node 20.17 (`nvm use 20.17`). If you've never used anchor before you might need to run `avm use latest` as well. ## Build [code] EVM builds and tests use the Foundry version pinned in `.foundry-version`; CI installs exactly that version via `foundry-rs/foundry-toolchain`. Run `yarn pin-foundry` to switch your local toolchain to it (a no-op when it already matches). Bump the pin by editing that file. ## Test [code] ## Lint [code] ## Deploy and Verify ### EVM #### Foundry [code] #### Foundry (ZKSync) To enable ZKSync support, the zksync fork of foundry must be installed (see here for instructions). Also, the `FOUNDRY_PROFILE` environment variable must be set to `zksync`. [code] Alternatively, the `yarn forge-script-zksync` command can be used to deploy the contract. [code] ### SVM Before deploying for the first time make sure all program IDs in `lib.rs` and `Anchor.toml` are the same as listed when running `anchor keys list`. If not, update them to match the deployment keypairs under `target/deploy/` and commit the changes. Make sure to use the verified docker bi
Blurb generated by claude-haiku-5-5 today. Star deltas marked ~ are extrapolated from partial history.