From 6a09b54a6e3cb1a3bfa27745d010209d94f7a114 Mon Sep 17 00:00:00 2001 From: nje <8985830+Nalon@users.noreply.github.com> Date: Thu, 2 Oct 2025 00:42:58 -0700 Subject: [PATCH 1/6] Upgraded to 1.5.0 of Chainlink contracts The unvendoring of OpenZeppelin contracts in version 1.5.0 of @chainlink/contracts results in developers having to rely on remappings to resolve the OpenZeppelin import paths. - Install required OpenZeppelin versions with alias - Remap import paths to the alias OZ directories - Upgrade to 1.5.0 release of contracts from chainlink-evm repo --- .gitmodules | 15 +++++++++++++++ foundry.lock | 32 ++++++++++++++++++++++++++++++++ lib/chainlink-evm | 2 +- lib/openzeppelin-contracts-4.7.3 | 1 + lib/openzeppelin-contracts-4.8.3 | 1 + lib/openzeppelin-contracts-4.9.6 | 1 + lib/openzeppelin-contracts-5.0.2 | 1 + lib/openzeppelin-contracts-5.1.0 | 1 + remappings.txt | 7 +++++++ 9 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 foundry.lock create mode 160000 lib/openzeppelin-contracts-4.7.3 create mode 160000 lib/openzeppelin-contracts-4.8.3 create mode 160000 lib/openzeppelin-contracts-4.9.6 create mode 160000 lib/openzeppelin-contracts-5.0.2 create mode 160000 lib/openzeppelin-contracts-5.1.0 diff --git a/.gitmodules b/.gitmodules index 274f71a..15c92d6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -11,3 +11,18 @@ [submodule "lib/chainlink-evm"] path = lib/chainlink-evm url = https://github.com/smartcontractkit/chainlink-evm +[submodule "lib/openzeppelin-contracts-4.8.3"] + path = lib/openzeppelin-contracts-4.8.3 + url = https://github.com/openzeppelin/openzeppelin-contracts +[submodule "lib/openzeppelin-contracts-4.7.3"] + path = lib/openzeppelin-contracts-4.7.3 + url = https://github.com/openzeppelin/openzeppelin-contracts +[submodule "lib/openzeppelin-contracts-4.9.6"] + path = lib/openzeppelin-contracts-4.9.6 + url = https://github.com/openzeppelin/openzeppelin-contracts +[submodule "lib/openzeppelin-contracts-5.0.2"] + path = lib/openzeppelin-contracts-5.0.2 + url = https://github.com/openzeppelin/openzeppelin-contracts +[submodule "lib/openzeppelin-contracts-5.1.0"] + path = lib/openzeppelin-contracts-5.1.0 + url = https://github.com/openzeppelin/openzeppelin-contracts diff --git a/foundry.lock b/foundry.lock new file mode 100644 index 0000000..a16d598 --- /dev/null +++ b/foundry.lock @@ -0,0 +1,32 @@ +{ + "lib/chainlink-evm": { + "rev": "86aa5a1d34b20eda8d18fe6eb0e4882948e545ba" + }, + "lib/forge-std": { + "rev": "1714bee72e286e73f76e320d110e0eaf5c4e649d" + }, + "lib/foundry-chainlink-toolkit": { + "branch": { + "name": "feature/integration-automation", + "rev": "caa68b15a67340b13f4d1a2147a7c454b3443744" + } + }, + "lib/openzeppelin-contracts-4.7.3": { + "rev": "ecd2ca2cd7cac116f7a37d0e474bbb3d7d5e1c4d" + }, + "lib/openzeppelin-contracts-4.8.3": { + "rev": "0a25c1940ca220686588c4af3ec526f725fe2582" + }, + "lib/openzeppelin-contracts-4.9.6": { + "rev": "dc44c9f1a4c3b10af99492eed84f83ed244203f6" + }, + "lib/openzeppelin-contracts-5.0.2": { + "rev": "dbb6104ce834628e473d2173bbc9d47f81a9eec3" + }, + "lib/openzeppelin-contracts-5.1.0": { + "rev": "69c8def5f222ff96f2b5beff05dfba996368aa79" + }, + "lib/solmate": { + "rev": "97bdb2003b70382996a79a406813f76417b1cf90" + } +} \ No newline at end of file diff --git a/lib/chainlink-evm b/lib/chainlink-evm index df6a094..86aa5a1 160000 --- a/lib/chainlink-evm +++ b/lib/chainlink-evm @@ -1 +1 @@ -Subproject commit df6a094dcee6bbde43dc51a416c4bb244c12588c +Subproject commit 86aa5a1d34b20eda8d18fe6eb0e4882948e545ba diff --git a/lib/openzeppelin-contracts-4.7.3 b/lib/openzeppelin-contracts-4.7.3 new file mode 160000 index 0000000..ecd2ca2 --- /dev/null +++ b/lib/openzeppelin-contracts-4.7.3 @@ -0,0 +1 @@ +Subproject commit ecd2ca2cd7cac116f7a37d0e474bbb3d7d5e1c4d diff --git a/lib/openzeppelin-contracts-4.8.3 b/lib/openzeppelin-contracts-4.8.3 new file mode 160000 index 0000000..0a25c19 --- /dev/null +++ b/lib/openzeppelin-contracts-4.8.3 @@ -0,0 +1 @@ +Subproject commit 0a25c1940ca220686588c4af3ec526f725fe2582 diff --git a/lib/openzeppelin-contracts-4.9.6 b/lib/openzeppelin-contracts-4.9.6 new file mode 160000 index 0000000..dc44c9f --- /dev/null +++ b/lib/openzeppelin-contracts-4.9.6 @@ -0,0 +1 @@ +Subproject commit dc44c9f1a4c3b10af99492eed84f83ed244203f6 diff --git a/lib/openzeppelin-contracts-5.0.2 b/lib/openzeppelin-contracts-5.0.2 new file mode 160000 index 0000000..dbb6104 --- /dev/null +++ b/lib/openzeppelin-contracts-5.0.2 @@ -0,0 +1 @@ +Subproject commit dbb6104ce834628e473d2173bbc9d47f81a9eec3 diff --git a/lib/openzeppelin-contracts-5.1.0 b/lib/openzeppelin-contracts-5.1.0 new file mode 160000 index 0000000..69c8def --- /dev/null +++ b/lib/openzeppelin-contracts-5.1.0 @@ -0,0 +1 @@ +Subproject commit 69c8def5f222ff96f2b5beff05dfba996368aa79 diff --git a/remappings.txt b/remappings.txt index 1627a9e..371dc69 100644 --- a/remappings.txt +++ b/remappings.txt @@ -3,3 +3,10 @@ @clones=lib/clones-with-immutable-args/src/ @chainlink/=lib/chainlink-evm/ forge-std/=lib/forge-std/src/ + + +@openzeppelin/contracts@4.7.3/=lib/openzeppelin-contracts-4.7.3/contracts/ +@openzeppelin/contracts@4.8.3/=lib/openzeppelin-contracts-4.8.3/contracts/ +@openzeppelin/contracts@4.9.6/=lib/openzeppelin-contracts-4.9.6/contracts/ +@openzeppelin/contracts@5.0.2/=lib/openzeppelin-contracts-5.0.2/contracts/ +@openzeppelin/contracts@5.1.0/=lib/openzeppelin-contracts-5.1.0/contracts/ \ No newline at end of file From 9f26ffb2d6d28413356231e794c5443215abb2d5 Mon Sep 17 00:00:00 2001 From: nje <8985830+Nalon@users.noreply.github.com> Date: Thu, 2 Oct 2025 00:44:36 -0700 Subject: [PATCH 2/6] Added codeowners --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..0bc7f93 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Root +* @zeuslawyer @andrejrakic @thodges-gh @Nalon @smartcontractkit/devrel \ No newline at end of file From f8842fd905e4e5514dc7bd4bd807d1561b99970e Mon Sep 17 00:00:00 2001 From: nje <8985830+Nalon@users.noreply.github.com> Date: Mon, 6 Oct 2025 13:53:48 -0700 Subject: [PATCH 3/6] Added Chainlink contracts install instructions to README - Added the installation instructions for Chainlink contracts depending on version - Included OZ dependency installation for versions >=1.5.0 --- README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index de5ca60..444b8c6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -_Note: This repo has been recently updated for Sepolia_ - +> [!IMPORTANT] +> This repository has recently been updated for use with [Chainlink contracts](https://github.com/smartcontractkit/chainlink-evm/) v1.5.0. See the [dependency installation section for instructions on how to set up v1.5.0](#>=1.5.0) within your own project using `forge install`. # Foundry Starter Kit
@@ -18,6 +18,7 @@ Foundry Starter Kit is a repo that shows developers how to quickly build, test, - [Getting Started](#getting-started) - [Requirements](#requirements) - [Quickstart](#quickstart) + - [Dependencies](#install-dependencies-as-follows) - [Testing](#testing) - [Deploying to a network](#deploying-to-a-network) - [Setup](#setup) @@ -50,14 +51,68 @@ git clone https://github.com/smartcontractkit/foundry-starter-kit cd foundry-starter-kit ``` -## Install dependencies as follows: +## Install dependencies as follows: Run `forge install` to install dependencies. [Foundry uses git submodules](https://book.getfoundry.sh/projects/dependencies) as its dependency management system. -> ⚠️ when running forge install, you may see an error message if you have uncomitted changes in your repo. Read the message carefully - it may inform you that you can add the `--no-commit` flag to each of these `install` commands if your workspace has uncommitted changes. +> ⚠️ when running forge install, you may see an error message if you have uncommitted changes in your repo. Read the message carefully - it may inform you that you can add the `--no-commit` flag to each of these `install` commands if your workspace has uncommitted changes. You can update dependencies by running `forge update` +## Installing Chainlink contracts with `forge install`: + +> [!IMPORTANT] +> For this starter kit, the packages have already been included and can be installed using the above `forge install` command. This package includes Chainlink contracts v1.5.0. The below steps are for those that wish to install Chainlink contracts into their own project or modify the version used within the starter kit. + +
+v1.5.0 and above + +### Step 1: Install >= v1.5.0 and required dependencies + +``` +forge install \ + smartcontractkit/chainlink-evm@contracts-v \ + openzeppelin-contracts-4.7.3=openzeppelin/openzeppelin-contracts@v4.7.3 \ + openzeppelin-contracts-4.8.3=openzeppelin/openzeppelin-contracts@v4.8.3 \ + openzeppelin-contracts-4.9.6=openzeppelin/openzeppelin-contracts@v4.9.6 \ + openzeppelin-contracts-5.0.2=openzeppelin/openzeppelin-contracts@v5.0.2 \ + openzeppelin-contracts-5.1.0=openzeppelin/openzeppelin-contracts@v5.1.0 +``` + +### Step 2: Set remappings + +Include the following remappings within your project's `remappings.txt` or `foundry.toml`. + +``` +@chainlink/=lib/chainlink-evm/ +@openzeppelin/contracts@4.7.3/=lib/openzeppelin-contracts-4.7.3/contracts/ +@openzeppelin/contracts@4.8.3/=lib/openzeppelin-contracts-4.8.3/contracts/ +@openzeppelin/contracts@4.9.6/=lib/openzeppelin-contracts-4.9.6/contracts/ +@openzeppelin/contracts@5.0.2/=lib/openzeppelin-contracts-5.0.2/contracts/ +@openzeppelin/contracts@5.1.0/=lib/openzeppelin-contracts-5.1.0/contracts/ +``` + +
+ +
+v1.4.0 and below + +#### Step 1: Install <= v1.4.0 + +``` +forge install smartcontractkit/chainlink-evm@ +``` + +#### Step 2: Set remappings + +Include the following remappings within your project's `remappings.txt` or `foundry.toml`. + +``` +@chainlink/contracts/=lib/chainlink-evm/contracts/ +``` + +
+ ## Testing To check that everything is compiling and working as intended after cloning and installing dependencies, run ``` @@ -76,7 +131,7 @@ Implementation of the following 4 Chainlink services using the [Foundry] (https: For [Chainlink Functions](https://docs.chain.link/chainlink-functions) please go to these starter kits: [Hardhat](https://github.com/smartcontractkit/functions-hardhat-starter-kit) | [Foundry (coming soon)](https://github.com/smartcontractkit/functions-foundry-starter-kit) -For [Chainlink CCIP (Cross Chain Interoperability Prototocol)](https://docs.chain.link/ccip) please go to these starter kits: [Hardhat](https://github.com/smartcontractkit/ccip-starter-kit-hardhat) | [Foundry](https://github.com/smartcontractkit/ccip-starter-kit-foundry) +For [Chainlink CCIP (Cross Chain Interoperability Protocol)](https://docs.chain.link/ccip) please go to these starter kits: [Hardhat](https://github.com/smartcontractkit/ccip-starter-kit-hardhat) | [Foundry](https://github.com/smartcontractkit/ccip-starter-kit-foundry) # Deploying to a network @@ -89,7 +144,7 @@ We'll demo using the Sepolia testnet. (Go here for [testnet sepolia ETH](https:/ You'll need to add the following variables to a `.env` file: - `SEPOLIA_RPC_URL`: A URL to connect to the blockchain. You can get one for free from [Infura](https://www.infura.io/) account -- `PRIVATE_KEY`: A private key from your wallet. You can get a private key from a new [Metamask](https://metamask.io/) account +- `PRIVATE_KEY`: A private key from your wallet. You can get a private key from a new [MetaMask](https://metamask.io/) account - Additionally, if you want to deploy to a testnet, you'll need test ETH and/or LINK. You can get them from [faucets.chain.link](https://faucets.chain.link/). - Optional `ETHERSCAN_API_KEY`: If you want to verify on etherscan From 7c86fd82264d7b59dc8a18a35adae1c7299402a2 Mon Sep 17 00:00:00 2001 From: nje <8985830+Nalon@users.noreply.github.com> Date: Mon, 6 Oct 2025 13:56:28 -0700 Subject: [PATCH 4/6] Fixed chainlink-evm tag for forge install - Corrected the tag used for specific versioning of chainlink-evm --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 444b8c6..3215fa2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ > [!IMPORTANT] -> This repository has recently been updated for use with [Chainlink contracts](https://github.com/smartcontractkit/chainlink-evm/) v1.5.0. See the [dependency installation section for instructions on how to set up v1.5.0](#>=1.5.0) within your own project using `forge install`. +> This repository has recently been updated for use with [Chainlink contracts](https://github.com/smartcontractkit/chainlink-evm/) v1.5.0. See the [dependency installation section for instructions on how to set up v1.5.0](#installing-chainlink-contracts-with-forge-install) within your own project using `forge install`. # Foundry Starter Kit
@@ -100,7 +100,7 @@ Include the following remappings within your project's `remappings.txt` or `foun #### Step 1: Install <= v1.4.0 ``` -forge install smartcontractkit/chainlink-evm@ +forge install smartcontractkit/chainlink-evm@contracts-v ``` #### Step 2: Set remappings From 238f55122ba3cccaead547058b208fbe5490c8fe Mon Sep 17 00:00:00 2001 From: nje <8985830+Nalon@users.noreply.github.com> Date: Tue, 4 Nov 2025 00:33:55 -0800 Subject: [PATCH 5/6] Updated README - Modified forge install step --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3215fa2..d6f9359 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,14 @@ Run `forge install` to install dependencies. [Foundry uses git submodules](https You can update dependencies by running `forge update` -## Installing Chainlink contracts with `forge install`: +## Installing Chainlink contracts: + +```forge install``` > [!IMPORTANT] -> For this starter kit, the packages have already been included and can be installed using the above `forge install` command. This package includes Chainlink contracts v1.5.0. The below steps are for those that wish to install Chainlink contracts into their own project or modify the version used within the starter kit. +> For this starter kit, the packages have already been included and can be installed using the above `forge install` command. This package includes Chainlink contracts v1.5.0. + +To add Chainlink contracts to an existing project:
v1.5.0 and above From f68c3921f9b474fa30d64a04017724be7909ab46 Mon Sep 17 00:00:00 2001 From: nje <8985830+Nalon@users.noreply.github.com> Date: Mon, 17 Nov 2025 12:50:22 -0800 Subject: [PATCH 6/6] Updated forge install code block --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d6f9359..511477e 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,9 @@ You can update dependencies by running `forge update` ## Installing Chainlink contracts: -```forge install``` +``` +forge install +``` > [!IMPORTANT] > For this starter kit, the packages have already been included and can be installed using the above `forge install` command. This package includes Chainlink contracts v1.5.0.