Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,19 @@ jobs:
go-version: ${{ env.GO_VERSION }}
- name: Display Go version
run: go version
- name: Tidy
run: make gomodtidy
- name: Install protoc
run: make install-protoc
- name: Re-Generate files
run: |
make generate
- name: Tidy
run: go mod tidy
run: make generate
- name: ensure no changes
run: |
set -e
git_status=$(git status --porcelain=v1)
if [ ! -z "$git_status" ]; then
git status
git diff
echo "Error: modified files detected, run 'make generate' / 'go mod tidy'."
echo "Error: modified files detected, run 'make gomodtidy' / 'make generate' / ."
exit 1
fi
10 changes: 10 additions & 0 deletions .github/workflows/solidity-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ jobs:
working-directory: chains/evm
run: make wrappers

- name: Extract bytecode and abi from gobindings
run: |
cd chains/evm
make extract-bytecode-abi

- name: Version package.json
working-directory: chains/evm
shell: bash
Expand Down Expand Up @@ -210,6 +215,11 @@ jobs:
- name: Run native compile and generate wrappers
working-directory: chains/evm
run: make wrappers

- name: Extract bytecode and abi from gobindings
run: |
cd chains/evm
make extract-bytecode-abi

- name: Validate version
working-directory: chains/evm
Expand Down
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,33 @@ vendor/

# Ignore personal settings
**/.claude/settings.local.json

# Tooling caches
*.tsbuildinfo
.eslintcache

# Log files
*.log

# misc
.DS_Store
.envrc
.env*
.dbenv
.direnv
.idea
.vscode/
*.iml
debug.env
operator_ui/install
.devenv

# neovim
.nvim.lua

# codeship
*.aes
dockercfg
env
credentials.env
gcr_creds.env
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 20.13.1
nodejs 20.17.0
pnpm 10.6.5
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build: ensure_go_version

# If you have a different version of protoc installed, you can use the following command to generate the protobuf files
# make generate PROTOC_BIN=/path/to/protoc
generate: ensure_go_version clean-generate proto-generate generate-mocks
generate: ensure_go_version clean-generate proto-generate generate-mocks modgraph

generate-mocks: ensure_go_version
go install github.com/vektra/mockery/[email protected]
Expand Down Expand Up @@ -104,3 +104,13 @@ install_buf:

ensure_buf_version:
@$(BUF_BIN) --version | grep -q '1.50.0' || (echo "Please use buf 1.50.0" && exit 1)

gomods: ## Install gomods
go install github.com/jmank88/[email protected]

gomodtidy: gomods
gomods tidy

modgraph: gomods
go install github.com/jmank88/[email protected]
./modgraph > go.md
5 changes: 0 additions & 5 deletions chains/evm/.changeset/gold-papayas-dream.md

This file was deleted.

5 changes: 0 additions & 5 deletions chains/evm/.changeset/thick-deer-greet.md

This file was deleted.

2 changes: 1 addition & 1 deletion chains/evm/.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ FeeQuoter_applyFeeTokensUpdates:test_applyFeeTokensUpdates() (gas: 221002)
FeeQuoter_applyFeeTokensUpdates:test_applyFeeTokensUpdates_multipleTokens() (gas: 151398)
FeeQuoter_applyFeeTokensUpdates:test_applyFeeTokensUpdates_singleToken() (gas: 96121)
FeeQuoter_applyTokenTransferFeeConfigUpdates:test_applyTokenTransferFeeConfigUpdates() (gas: 82132)
FeeQuoter_constructor:test_constructor() (gas: 4307542)
FeeQuoter_constructor:test_constructor() (gas: 4307342)
FeeQuoter_convertTokenAmount:test_convertTokenAmount() (gas: 68228)
FeeQuoter_getTokenAndGasPrices:test_getTokenAndGasPrices() (gas: 71193)
FeeQuoter_getTokenAndGasPrices:test_getTokenAndGasPrices_ZeroGasPrice() (gas: 79255)
Expand Down
1 change: 1 addition & 0 deletions chains/evm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ report
scripts/abigen
scripts/forge_zksync
abi
bytecode/**/*.bin
solc
zkout
coverage
Expand Down
18 changes: 17 additions & 1 deletion chains/evm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
[NOTES.md](../../../chainlink/contracts/release/ccip/NOTES.md)# @chainlink/contracts-ccip

## 1.6.3

CCIP 1.6.3 is a minor release that adds support for Sui to the FeeQuoter. No other contracts are in scope.


### New features
This release will start including compiled bytecode for the contracts that are in scope for each release.

### Minor Changes

- [#1217](https://github.com/smartcontractkit/chainlink-ccip/pull/1217) - Adds Sui support to the FeeQuoter contract.


## 1.6.2

Expand Down Expand Up @@ -33,6 +45,10 @@ wrapper
- [#1009](https://github.com/smartcontractkit/chainlink-ccip/pull/1009) [`d22a78e`](https://github.com/smartcontractkit/chainlink-ccip/pull/1009/commits/d22a78e6de780b6bb1f8259a6ea7753ed92892ce) - Adds support for USDC messages on Solana using a mint-recipient
override field for CCTP messages.

### Fixes

- Fixed an issue that prevented ABIs from being included in the NPM package.

## 1.6.1

CCIP 1.6.1 is a minor release that focuses on token pools, adding overall pool improvements.
Expand Down
4 changes: 4 additions & 0 deletions chains/evm/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ abigen: ## Build & install abigen.
.PHONY: mockery
mockery: $(mockery) ## Install mockery.
go install github.com/vektra/mockery/[email protected]

.PHONY: extract-bytecode-abi
extract-bytecode-abi: ## Extract bytecode and abi from versioned gobindings to bytecode and abi directories
cd gobindings && go run ./cmd/extract_bytecode/main.go
72 changes: 72 additions & 0 deletions chains/evm/bytecode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Bytecode Directory

This directory contains extracted bytecode from versioned gobindings, organized by version.

## Overview

Bytecode is automatically extracted from the gobindings using the extraction script located at:
`gobindings/cmd/extract_bytecode/main.go`

The script:
- Scans all versioned directories in `gobindings/generated/` (e.g., `v1_0_0`, `v1_2_0`, etc.)
- Excludes the `latest/` directory (unaudited code)
- Extracts the `Bin` field from each `*MetaData` variable in `.go` files
- Writes the bytecode to corresponding `.bin` files in this directory
- Also extracts ABIs (as JSON) to the `../abi` directory

## Usage

### Running Manually

From the `chains/evm` directory:

```
make extract-bytecode
```

### Running in CI

The script can be run in CI pipelines. It will:
- Create the bytecode directory structure if it doesn't exist
- Extract bytecode from all versioned gobindings
- Report any errors to stderr with a non-zero exit code

Example CI integration:

```yaml
- name: Extract bytecode and ABIs
run: |
cd chains/evm
make extract-bytecode
```

Note: The extraction script extracts both bytecode and ABIs in a single pass.

## Directory Structure

The bytecode is organized by version with all binaries directly in the version directory:

```
bytecode/
├── v1_0_0/
│ ├── lock_release_token_pool.bin
│ ├── rmn_proxy_contract.bin
│ └── ...
├── v1_2_0/
│ ├── burn_mint_token_pool.bin
│ ├── commit_store.bin
│ └── ...
└── ...
```

Each `.bin` file contains the raw bytecode hex string (with `0x` prefix) extracted from the corresponding gobinding.

## How It Works

The extraction script uses Go's AST parser to:
1. Parse each `.go` file in versioned directories
2. Find variable declarations ending with `MetaData`
3. Extract the `Bin` field from the `&bind.MetaData{...}` composite literal
4. Write the bytecode to a corresponding `.bin` file

This approach is robust and doesn't rely on regex or string manipulation, ensuring accurate extraction even as the gobinding format evolves.
17 changes: 6 additions & 11 deletions chains/evm/contracts/libraries/Client.sol
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,13 @@ library Client {
bytes32[] receiverObjectIds;
}

/// @dev The expected static payload size of a token transfer when Borsh encoded and submitted to SUI.
/// @dev The expected static payload size of a token transfer when BCS encoded and submitted to SUI.
/// TokenPool extra data and offchain data sizes are dynamic, and should be accounted for separately.
uint256 public constant SUI_TOKEN_TRANSFER_DATA_OVERHEAD = (4 + 32) // source_pool
+ 32 // token_address
+ 4 // gas_amount
+ 4 // extra_data overhead
+ 32 // amount
+ 32 // size of the token lookup table account
+ 32 // token-related accounts in the lookup table, over-estimated to 32, typically between 11 - 13
+ 32 // token account belonging to the token receiver, e.g ATA, not included in the token lookup table
+ 32 // per-chain token pool config, not included in the token lookup table
+ 32; // per-chain token billing config, not always included in the token lookup table
uint256 public constant SUI_TOKEN_TRANSFER_DATA_OVERHEAD = (4 + 32) // source_pool, 4 bytes for length, 32 bytes for address
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Remove all Sui references?

+ 32 // dest_token_address
+ 4 // dest_gas_amount
+ 4 // extra_data length, the contents are calculated separately
+ 32; // amount

/// @dev Number of overhead accounts needed for message execution on SUI.
/// @dev This is the message.receiver.
Expand Down
4 changes: 4 additions & 0 deletions chains/evm/contracts/libraries/Internal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ library Internal {
// https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/doc/account.md#function-create_framework_reserved_account-1
uint256 public constant APTOS_PRECOMPILE_SPACE = 0x0b;

// According to the Sui docs, a set of non-contiguous addresses below 0xdee9 are reserved for system use.
// https://github.com/MystenLabs/sui/blob/54ae98508569804127bd73d84aa2fb816bdea402/crates/sui-types/src/lib.rs#L141
uint256 public constant SUI_PRECOMPILE_SPACE = 0xdee9;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Remove all Sui references?


/// @notice This methods provides validation for parsing abi encoded addresses by ensuring the address is within the
/// EVM address space. If it isn't it will revert with an InvalidEVMAddress error, which we can catch and handle
/// more gracefully than a revert from abi.decode.
Expand Down
2 changes: 1 addition & 1 deletion chains/evm/contracts/pools/BurnFromMintTokenPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {SafeERC20} from "@openzeppelin/[email protected]/token/ERC20/utils/SafeERC
contract BurnFromMintTokenPool is BurnMintTokenPoolAbstract, ITypeAndVersion {
using SafeERC20 for IBurnMintERC20;

string public constant override typeAndVersion = "BurnFromMintTokenPool 1.6.3-dev";
string public constant override typeAndVersion = "BurnFromMintTokenPool 1.7.0-dev";

constructor(
IBurnMintERC20 token,
Expand Down
2 changes: 1 addition & 1 deletion chains/evm/contracts/pools/BurnMintTokenPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {TokenPool} from "./TokenPool.sol";
/// If that is expected, please make sure the token's burner/minter roles are adjustable.
/// @dev This contract is a variant of BurnMintTokenPool that uses `burn(amount)`.
contract BurnMintTokenPool is BurnMintTokenPoolAbstract, ITypeAndVersion {
string public constant override typeAndVersion = "BurnMintTokenPool 1.6.3-dev";
string public constant override typeAndVersion = "BurnMintTokenPool 1.7.0-dev";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all the token pool versions, pools on develop are CCV enabled and versions should reflect that.


constructor(
IBurnMintERC20 token,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {SafeERC20} from "@openzeppelin/[email protected]/token/ERC20/utils/SafeERC
contract BurnToAddressMintTokenPool is BurnMintTokenPoolAbstract, ITypeAndVersion {
using SafeERC20 for IERC20;

string public constant override typeAndVersion = "BurnToAddressTokenPool 1.6.3-dev";
string public constant override typeAndVersion = "BurnToAddressTokenPool 1.7.0-dev";

/// @notice The address where tokens are sent during a call to lockOrBurn, functionally burning but without decreasing
/// total supply. This address is expected to have no ability to recover the tokens sent to it, and will thus be locked forever.
Expand Down
2 changes: 1 addition & 1 deletion chains/evm/contracts/pools/BurnWithFromMintTokenPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {SafeERC20} from "@openzeppelin/[email protected]/token/ERC20/utils/SafeERC
contract BurnWithFromMintTokenPool is BurnMintTokenPoolAbstract, ITypeAndVersion {
using SafeERC20 for IBurnMintERC20;

string public constant override typeAndVersion = "BurnWithFromMintTokenPool 1.6.3-dev";
string public constant override typeAndVersion = "BurnWithFromMintTokenPool 1.7.0-dev";

constructor(
IBurnMintERC20 token,
Expand Down
2 changes: 1 addition & 1 deletion chains/evm/contracts/pools/LockReleaseTokenPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract LockReleaseTokenPool is TokenPool, ITypeAndVersion {
event LiquidityRemoved(address indexed provider, uint256 indexed amount);
event RebalancerSet(address oldRebalancer, address newRebalancer);

string public constant override typeAndVersion = "LockReleaseTokenPool 1.6.3-dev";
string public constant override typeAndVersion = "LockReleaseTokenPool 1.7.0-dev";

/// @notice The address of the rebalancer.
address internal s_rebalancer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ contract SiloedLockReleaseTokenPool is TokenPool, ITypeAndVersion {

/// @notice Using a function because constant state variables cannot be overridden by child contracts.
function typeAndVersion() external pure virtual override returns (string memory) {
return "SiloedLockReleaseTokenPool 1.6.3-dev";
return "SiloedLockReleaseTokenPool 1.7.0-dev";
}

/// @notice Locks the token in the pool
Expand Down
2 changes: 1 addition & 1 deletion chains/evm/contracts/pools/USDC/SiloedUSDCTokenPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ contract SiloedUSDCTokenPool is SiloedLockReleaseTokenPool, AuthorizedCallers {

/// @notice Using a function because constant state variables cannot be overridden by child contracts.
function typeAndVersion() external pure virtual override returns (string memory) {
return "SiloedUSDCTokenPool 1.6.3-dev";
return "SiloedUSDCTokenPool 1.7.0-dev";
}

/// @inheritdoc SiloedLockReleaseTokenPool
Expand Down
2 changes: 1 addition & 1 deletion chains/evm/contracts/pools/USDC/USDCTokenPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ contract USDCTokenPool is TokenPool, ITypeAndVersion, AuthorizedCallers {

/// @notice Using a function because constant state variables cannot be overridden by child contracts.
function typeAndVersion() external pure virtual override returns (string memory) {
return "USDCTokenPool 1.6.3-dev";
return "USDCTokenPool 1.7.0-dev";
}

/// @notice Burn tokens from the pool to initiate cross-chain transfer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pragma solidity ^0.8.0;

import {Client} from "../../../libraries/Client.sol";
import {TokenSetup} from "../../TokenSetup.t.sol";
import {IRouterClient, MockCCIPRouter} from "../MockRouter.sol";
import {IRouterClient, MockCCIPRouter} from "../../mocks/MockRouter.sol";

import {IERC20} from "@openzeppelin/[email protected]/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/[email protected]/token/ERC20/utils/SafeERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion chains/evm/deployment/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20251015131629-84c35bb9c419
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20251015131629-84c35bb9c419
github.com/smartcontractkit/chainlink-common v0.9.6-0.20250929154511-1f5fbda7ae76
github.com/smartcontractkit/chainlink-deployments-framework v0.55.1
github.com/smartcontractkit/chainlink-deployments-framework v0.56.0
github.com/smartcontractkit/chainlink-evm v0.3.3
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3
github.com/smartcontractkit/mcms v0.25.0
Expand Down
Loading
Loading