NEW

CCIP is now live for all developers. See what's new.

Back

Using Data Feeds on Starknet

Starknet is a permissionless decentralized Zk-rollup operating as an L2 network over Ethereum. Unlike other Ethereum L2 networks, Starknet is not EVM-compatible and uses Cairo as its smart contract language. Chainlink Data Feeds are available on Starknet Sepolia as Cairo smart contracts.

Offchain examples

You can read Chainlink Data Feeds offchain without a Starknet account. Complete these steps using only the Starkli CLI or the Starknet Foundry toolkit.

Onchain examples

You can read Chainlink Data Feeds on Starknet Sepolia using an onchain contract that you compile, declare, and deploy using Starknet Foundry.

Devnet examples

Experiment with Chainlink Data Feeds on Starknet using Starknet Devnet RS, a local Docker-based testnet environment implemented using Rust. The Starknet Devnet RS guide provides code examples and scripts that enable you to compile, declare, and deploy your own aggregator and consumer contracts. You can use a set of pre-funded accounts to interact with Chainlink Data Feeds on Starknet without deploying to a live network.

Getting Started (Starkli CLI)

Starkli is a Starknet standalone CLI similar to cairo-lang, but it is written in Rust. It enables interaction with a Starknet network without the need for extra tools or dependencies.

In this example, you will use the starkli call command to read data from a Chainlink Price Feed on Starknet Sepolia. This command requires the proxy aggregator address, the function selector, and an RPC endpoint for Starknet Sepolia.

Requirements

Make sure you have the Starkli CLI installed. You can check your current version by running starkli --version in your terminal. Expect an output similar to the following:

starkli --version
0.2.8 (f59724e)

Follow the official installation guide if necessary.

What's next

Stay updated on the latest Chainlink news