Socket
Book a DemoInstallSign in
Socket

@chainlink/contracts

Package Overview
Dependencies
Maintainers
8
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chainlink/contracts

Chainlink smart contracts

1.4.0
latest
Source
npmnpm
Version published
Weekly downloads
33K
13.12%
Maintainers
8
Weekly downloads
 
Created
Source

[!IMPORTANT] Since v1.4.0 of the Chainlink contracts, the contracts have been moved to their own repository: chainlink-evm. Prior to that, the contracts were part of the main Chainlink repository

Installation

Foundry (git)

[!WARNING] When installing via git, the ref defaults to master when no tag is given.

$ forge install smartcontractkit/chainlink-evm@<version_tag>

Add @chainlink/contracts/=lib/smartcontractkit/chainlink-evm/contracts/ in remappings.txt.

NPM

# pnpm
$ pnpm add @chainlink/contracts
# npm
$ npm install @chainlink/contracts --save

Add @chainlink/contracts/=node_modules/@chainlink/contracts/ in remappings.txt.

Directory Structure

@chainlink/contracts
├── src # Solidity contracts
│   └── v0.8
└── abi # ABI json output
    └── v0.8

Usage

The solidity smart contracts themselves can be imported via the src directory of @chainlink/contracts:

import {IVerifier} from '@chainlink/contracts/src/v0.8/llo-feeds/v0.5.0/interfaces/IVerifier.sol';

Remapping

This repository uses Solidity remappings to resolve imports. The remapping is defined in the remappings.txt file.

Local Development

Note: Contracts in dev/ directories or with a typeAndVersion ending in -dev are under active development and are likely unaudited. Please refrain from using these in production applications.

# Clone Chainlink repository
$ git clone https://github.com/smartcontractkit/chainlink.git
$ cd contracts/
$ pnpm

Each Chainlink project has its own directory under src/ which can be targeted using Foundry profiles. To test a specific project, run:

# Replace <project> with the product you want to test
export FOUNDRY_PROFILE=<project>
forge test

To test the llo-feeds (data steams) project:

export FOUNDRY_PROFILE=llo-feeds
forge test

Contributing

Please adhere to the Solidity Style Guide.

Contributions are welcome! Please refer to Chainlink's contributing guidelines for detailed contribution information.

Thank you!

Changesets

We use changesets to manage versioning the contracts.

Every PR that modifies any configuration or code, should most likely accompanied by a changeset file.

To install changesets:

  • Install pnpm if it is not already installed - docs.
  • Run pnpm install.

Either after or before you create a commit, run the pnpm changeset command in the contracts directory to create an accompanying changeset entry which will reflect on the CHANGELOG for the next release.

The format is based on Keep a Changelog,

and this project adheres to Semantic Versioning.

FAQs

Package last updated on 09 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.