Giter VIP home page Giter VIP logo

chainlink-feeds-with-foundry's Introduction

Labs

Chainstack is the leading suite of services connecting developers with Web3 infrastructure

         

Supported protocolsChainstack blogChainstack docsBlockchain API referenceStart for free

Using Chainlink data feeds with Foundry

This project shows how to use Foundry to compile and deploy Smart contracts.

See the full tutorial on the Chainstack blog:

Project details

Foundry is one of the latest smart contract development tools currently in the market, and it allows users to compile contracts, write tests, deploy contracts, and much more through its command line interface. This project is already set up for you to deploy smart contracts and interact with Chainlink’s data feeds.

Learn more about Foundry: Foundry: A fast Solidity smart contract development toolkit

Quick start

Clone this repository.

Install Foundry

curl -L https://foundry.paradigm.xyz | bash

Then:

foundryup

Compile smart contracts

forge build

Create a .env file

In the root directory:

touch .env

This will create a new .env file, paste and edit the following in it:

GOERLI_RPC_URL=CHAINSTACK_GOERLI_NODE_URL
PRIVATE_KEY=YOU_PRIVATE_KEY
ETHERSCAN_KEY=ETHERSCAN_API_KEY(to verify the smart contract)

Deploy the smart contract

Run the following command:

forge script script/priceFeedsScript.s.sol:ChainlinkScript --rpc-url $GOERLI_RPC_URL  --private-key $PRIVATE_KEY --broadcast --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv

Prerequisites

  • Linux or MacOS
  • A Goerli Chainstack endpoint

Deploy a Goerli node:

  1. Sign up with Chainstack.
  2. Deploy a node.
  3. View node access and credentials.

Dependencies

Install

Clone this repository.

Install Foundry

curl -L https://foundry.paradigm.xyz | bash

Then:

foundryup

Example

Here is a link to a verified smart contract deployed to the Goerli testnet, and then verified using Foundry's command line.

chainlink-feeds-with-foundry's People

Contributors

akegaviar avatar genesis3800 avatar soos3d avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.