Skip to content

Commit 4be884f

Browse files
committed
fix CI and readme
1 parent 2114b90 commit 4be884f

File tree

3 files changed

+88
-12
lines changed

3 files changed

+88
-12
lines changed

.github/workflows/solidity-build-and-publish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,16 @@ jobs:
215215
IS_RELEASE_CCIP: ${{ needs.tag-check.outputs.is-release-ccip }}
216216
RELEASE_VERSION_CCIP: ${{ needs.tag-check.outputs.release-version-ccip }}
217217
run: |
218-
version=""
219-
if [[ $IS_RELEASE_CCIP == 'true' ]]; then
220-
version="${RELEASE_VERSION_CCIP}"
218+
VERSION=""
219+
if [[ "${IS_RELEASE_CCIP}" == 'true' ]]; then
220+
VERSION="${RELEASE_VERSION_CCIP}"
221221
else
222222
echo "::error::No release version found."
223223
exit 1
224224
fi
225-
package_json_version="$(jq -r '.version' package.json)"
226-
if [[ "$PACKAGE_JSON_VERSION" != "${version}" ]]; then
227-
echo "::error version mismatch: package.json version ($package_json_version) does not match version computed from tag ${version}"
225+
PACKAGE_JSON_VERSION="$(jq -r '.version' package.json)"
226+
if [[ "${PACKAGE_JSON_VERSION}" != "${VERSION}" ]]; then
227+
echo "::error::Version mismatch: package.json version (${PACKAGE_JSON_VERSION}) does not match version computed from tag ${VERSION}"
228228
exit 1
229229
fi
230230

chains/evm/README.md

Lines changed: 81 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,109 @@
11
# Chainlink CCIP Smart Contracts
22

3+
> [!IMPORTANT]
4+
> Since v1.6.0 of the CCIP contracts, the contracts have been moved to a new repository:
5+
> [chainlink-ccip](https://github.com/smartcontractkit/chainlink-ccip).
6+
> The EVM contracts exist in the `chains/evm` directory of the repository.
7+
38
## Installation
49

10+
Chainlink-ccip relies on chainlink-evm, below are the instructions to install both.
11+
To find the correct version of chainlink-evm to use for any given version of chainlink-ccip,
12+
please refer to the `package.json` file in `/chains/evm`.
13+
It contains an NPM dependency on `@chainlink/contracts-evm` with the correct version for the given version of chainlink-ccip.
14+
15+
NOTE: while other versions of chainlink-evm may work, we only test against the version specified in the `package.json` file.
16+
Audits are also only done against the version specified in the `package.json` file.
17+
No guarantees are made for other versions.
18+
19+
#### Foundry (git)
20+
21+
> [!WARNING]
22+
> When installing via git, the ref defaults to master when no tag is given.
23+
24+
When installing through git, it is recommended to use a specific version tag to avoid breaking changes.
25+
The corresponding git tag will be `contracts-ccip/v<version>` for chainlink-ccip,
26+
and `contracts/v<version>` for chainlink-evm.
27+
28+
```sh
29+
$ forge install smartcontractkit/chainlink-evm@<version_tag>
30+
$ forge install smartcontractkit/chainlink-ccip@<version_tag>
31+
```
32+
33+
Add the following remappings
34+
35+
```
36+
@chainlink/contracts/=lib/smartcontractkit/chainlink-evm/contracts/
37+
@chainlink/contracts-ccip/contracts/=lib/smartcontractkit/chainlink-ccip/chains/evm/contracts/
38+
```
39+
#### NPM
40+
541
```sh
6-
# via pnpm
42+
# pnpm
43+
$ pnpm add @chainlink/contracts-evm
744
$ pnpm add @chainlink/contracts-ccip
8-
# via npm
45+
```
46+
```sh
47+
# npm
48+
$ npm install @chainlink/contracts-evm --save
949
$ npm install @chainlink/contracts-ccip --save
1050
```
1151

52+
Add the following remappings
53+
54+
```
55+
@chainlink/contracts/=node_modules/@chainlink/contracts/
56+
@chainlink/contracts-ccip/contracts/=node_modules/@chainlink/contracts-ccip/contracts/
57+
```
58+
1259
### Directory Structure
1360

1461
```sh
1562
@chainlink/contracts-ccip
1663
├── contracts # Solidity contracts
64+
├── scripts # Compilation script
1765
└── abi # ABI json output
1866
```
1967

2068
### Usage
2169

22-
The solidity smart contracts themselves can be imported via the `contracts` directory of `@chainlink/contracts-ccip`:
70+
> [!WARNING]
71+
> Contracts in `dev/` directories or with a typeAndVersion ending in `-dev` are under active development
72+
> and are likely unaudited.
73+
> Please refrain from using these in production applications.
74+
75+
76+
The contracts can be imported via `@chainlink/contracts-ccip/contracts`:
2377

2478
```solidity
25-
import '@chainlink/contracts-ccip/contracts/applications/CCIPReceiver.sol';
79+
import {CCIPReceiver} from '@chainlink/contracts-ccip/contracts/applications/CCIPReceiver.sol';
2680
```
2781

82+
#### Getting started with CCIP
83+
84+
To get started with CCIP, please refer to the [CCIP documentation](https://docs.chain.link/ccip).
85+
86+
The MockRouter contract is a good starting point when developing dapps that use CCIP.
87+
It is a simplified same-chain entry and exit point for CCIP messages.
88+
It lives in `contracts/test/mocks/MockRouter.sol`.
89+
90+
2891
### Remapping
2992

30-
This repository uses [Solidity remappings](https://docs.soliditylang.org/en/v0.8.20/using-the-compiler.html#compiler-remapping) to resolve imports.
31-
The remapping is defined in the `remappings.txt` file.
93+
This repository uses [Solidity remappings](https://docs.soliditylang.org/en/v0.8.20/using-the-compiler.html#compiler-remapping) to resolve imports,
94+
which are defined in the `remappings.txt` file.
95+
96+
Please see the Installation section above for the correct remappings based on your installation method.
97+
98+
If required, you can remap dependencies used within CCIP contracts, e.g. Openzeppelin contracts,
99+
by adding the following to your `remappings.txt` file:
100+
101+
```
102+
@chainlink/contracts/src/v0.8/vendor/openzeppelin-solidity/v4.8.3/contracts/=node_modules/@openzeppelin/contracts/
103+
@chainlink/contracts/src/v0.8/vendor/openzeppelin-solidity/v5.0.2/contracts/=node_modules/@openzeppelin/contracts/
104+
```
105+
106+
This allows you to use a wide range of versions of Openzeppelin in your project without conflicts.
32107

33108
### Changesets
34109

chains/evm/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.6.0",
44
"description": "Chainlink smart contracts for CCIP",
55
"author": "Chainlink devs",
6+
"repository": "github:smartcontractkit/chainlink-ccip",
67
"license": "BUSL-1.1",
78
"private": false,
89
"scripts": {

0 commit comments

Comments
 (0)