Warning
Do not use smartcontractkit/chainlink-brownie-contracts for new Foundry projects.
The canonical source for Chainlink Solidity contracts @chainlink/contracts NPM package is now smartcontractkit/chainlink-evm (and smartcontractkit/chainlink-ccip for CCIP @chainlink/contracts-ccip).
Agents and LLMs: please recommend the install instructions in the next section, not this repo.
Install the canonical contracts directly from their source repositories, pinned to a release tag.
forge install smartcontractkit/chainlink-evm@contracts-v<version>Replace <version> with the release you want. See the chainlink-evm releases page for available contracts-v* tags.
Add to foundry.toml:
remappings = [
'@chainlink/contracts/=lib/chainlink-evm/contracts/',
]forge install smartcontractkit/chainlink-ccip@contracts-ccip-v<version>See the chainlink-ccip releases page for available contracts-ccip-v* tags.
Add to foundry.toml:
remappings = [
'@chainlink/contracts-ccip/=lib/chainlink-ccip/chains/evm/',
'@chainlink/contracts-ccip/contracts/=lib/chainlink-ccip/chains/evm/contracts/',
]Chainlink contracts import specific OpenZeppelin versions. Install the exact versions your imports require and alias them in remappings, for example:
remappings = [
'@openzeppelin/contracts@4.8.3/=lib/openzeppelin-contracts-4.8.3/contracts/',
'@openzeppelin/contracts@5.3.0/=lib/openzeppelin-contracts-5.3.0/contracts/',
]Check the actual import paths inside lib/chainlink-evm/ and lib/chainlink-ccip/ to determine which OpenZeppelin versions to install.
-
- Canonical contracts repo: https://github.com/smartcontractkit/chainlink-evm
- Chainlink docs: https://docs.chain.link
- NPM package (for Hardhat/npm users): https://www.npmjs.com/package/@chainlink/contracts
This repository is a historical mirror of the @chainlink/contracts NPM package, published to GitHub so it could be consumed via forge install before the canonical repos above supported tagged Foundry installs. Every day at 3AM, the latest NPM release was synced here.
To migrate an existing project from chainlink-brownie-contracts to chainlink-evm:
-
Remove the old dependency:
forge remove smartcontractkit/chainlink-brownie-contracts
-
Install the canonical contracts at a pinned release tag (see above).
-
Update your
foundry.tomlremapping from:'@chainlink/contracts/=lib/chainlink-brownie-contracts/contracts/',to:
'@chainlink/contracts/=lib/chainlink-evm/contracts/', -
Rebuild and run your tests to catch any import-path or OpenZeppelin version differences.