Skip to content

Commit

Permalink
Support for CCIP v1.5 and preparing for 0.2.2-beta release (#19)
Browse files Browse the repository at this point in the history
* feat: Add new changes to support CCIP v1.5 version

* forge: Update ccip
  • Loading branch information
andrejrakic authored Sep 12, 2024
1 parent eae01b6 commit 54ff7b0
Show file tree
Hide file tree
Showing 26 changed files with 1,666 additions and 1,176 deletions.
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,60 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.2-beta] - 12 September 2024

### Dependencies

| Package | Version |
| ------------------------- | ------------ |
| @chainlink/contracts-ccip | 1.4.0 |
| @chainlink/contracts | 1.5.0-beta.0 |

### Services

- [x] Chainlink CCIP
- [x] Chainlink CCIP v1.5
- [x] Chainlink Data Feeds
- [ ] Chainlink VRF 2
- [ ] Chainlink VRF 2.5

### Added

- Support for Chainlink CCIP v1.5 (bumped `@chainlink/contracts-ccip` to
`1.5.0-beta.0`)
- Set EVM Version strictly to `paris` for all contracts
- Added `supportNewTokenViaOwner` and `supportNewTokenViaGetCCIPAdmin` functions
to `CCIPLocalSimulator.sol` instead of `supportNewToken` function
- Added `rmnProxyAddress`, `tokenAdminRegistryAddress` and
`registryModuleOwnerCustomAddress` to the `NetworkDetails` struct of the
`Register.sol` smart contract
- Added unit tests for new functions in the `CCIPLocalSimulator.sol` contract
- Added e2e test for new changes in the `CCIPLocalSimulatorFork.sol` contract.
There is a test with ERC-20 token with an `owner()` function implemented and
Burn & Mint Pool, and test with ERC-20 token with a `getCCIPAdmin()` function
implemented and Lock & Release Pool

### Changed

- Bumped Solidity compiler version from 0.8.19 to 0.8.24
- The `getSupportedTokens()` function now only exists in the
`CCIPLocalSimulator.sol` contract, it has been removed from the CCIP's
`Router.sol` contract. Calling that function from the `Router.sol` contract in
the Forking mode will now revert
- Added `uint32[] memory tokenGasOverrides` as function parameter to the
`executeSingleMessage` function in the `CCIPLocalSimulatorFork.sol` contract
to reflect new changes in the CCIP's `EVM2EVMOffRamp.sol` smart contract
- Bumped pragma solidity version of `BasicTokenSender.sol`,
`CCIPReceiver_Unsafe.sol`, `ProgrammableTokenTransfers` and
`ProgrammableDefensiveTokenTransfers.sol` contracts from the `src/test` folder
from `0.8.19` to `0.8.24`

### Removed

- Removed `supportNewToken` function from `CCIPLocalSimulator.sol`
- Removed `CCIPLocalSimulatorV0.sol` and `MockEvm2EvmOffRamp.sol` contracts as
they have not being used for a while

## [0.2.1] - 5 July 2024

### Dependencies
Expand Down Expand Up @@ -98,3 +152,5 @@ and this project adheres to
[0.2.1-beta]:
https://github.com/smartcontractkit/chainlink-local/releases/tag/v0.2.1-beta
[0.2.1]: https://github.com/smartcontractkit/chainlink-local/releases/tag/v0.2.1
[0.2.2-beta]:
https://github.com/smartcontractkit/chainlink-local/releases/tag/v0.2.2-beta
29 changes: 26 additions & 3 deletions api_reference/solidity/ccip/CCIPLocalSimulator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ address[] s_supportedTokens

The list of supported token addresses

### CCIPLocalSimulator\_\_MsgSenderIsNotTokenOwner

```solidity
error CCIPLocalSimulator__MsgSenderIsNotTokenOwner()
```

### constructor

```solidity
Expand All @@ -72,14 +78,31 @@ constructor() public

Constructor to initialize the contract and pre-deployed token instances

### supportNewToken
### supportNewTokenViaOwner

```solidity
function supportNewTokenViaOwner(address tokenAddress) external
```

Allows user to support any new token, besides CCIP BnM and CCIP LnM, for
cross-chain transfers. Reverts if token does not implement owner() function.
Reverts if the caller is not the token owner.

#### Parameters

| Name | Type | Description |
| ------------ | ------- | ------------------------------------------------------------------ |
| tokenAddress | address | - The address of the token to add to the list of supported tokens. |

### supportNewTokenViaGetCCIPAdmin

```solidity
function supportNewToken(address tokenAddress) external
function supportNewTokenViaGetCCIPAdmin(address tokenAddress) external
```

Allows user to support any new token, besides CCIP BnM and CCIP LnM, for
cross-chain transfers.
cross-chain transfers. Reverts if token does not implement getCCIPAdmin()
function. Reverts if the caller is not the token CCIPAdmin.

#### Parameters

Expand Down
10 changes: 9 additions & 1 deletion api_reference/solidity/ccip/CCIPLocalSimulatorFork.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

### OffRamp

Structure representing an offRamp configuration

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |

```solidity
struct OffRamp {
uint64 sourceChainSelector;
Expand All @@ -30,7 +37,7 @@ Gets the list of offRamps
### executeSingleMessage

```solidity
function executeSingleMessage(struct Internal.EVM2EVMMessage message, bytes[] offchainTokenData) external
function executeSingleMessage(struct Internal.EVM2EVMMessage message, bytes[] offchainTokenData, uint32[] tokenGasOverrides) external
```

Executes a single CCIP message on the offRamp
Expand All @@ -41,6 +48,7 @@ Executes a single CCIP message on the offRamp
| ----------------- | ------------------------------ | --------------------------------- |
| message | struct Internal.EVM2EVMMessage | - The CCIP message to be executed |
| offchainTokenData | bytes[] | - Additional offchain token data |
| tokenGasOverrides | uint32[] | |

## CCIPLocalSimulatorFork

Expand Down
176 changes: 0 additions & 176 deletions api_reference/solidity/ccip/MockEvm2EvmOffRamp.mdx

This file was deleted.

3 changes: 3 additions & 0 deletions api_reference/solidity/ccip/Register.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ struct NetworkDetails {
address wrappedNativeAddress;
address ccipBnMAddress;
address ccipLnMAddress;
address rmnProxyAddress;
address tokenAdminRegistryAddress;
address registryModuleOwnerCustomAddress;
}
```

Expand Down
1 change: 0 additions & 1 deletion api_reference/solidity/ccip/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
- [BurnMintERC677Helper](BurnMintERC677Helper.mdx)
- [CCIPLocalSimulator](CCIPLocalSimulator.mdx)
- [CCIPLocalSimulatorFork](CCIPLocalSimulatorFork.mdx)
- [MockEvm2EvmOffRamp](MockEvm2EvmOffRamp.mdx)
- [Register](Register.mdx)
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[profile.default]
src = 'src'
solc = '0.8.24'
evm_version = 'paris'
out = 'out'
libs = ['lib']
test = 'test'
Expand Down
12 changes: 10 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ import "@nomicfoundation/hardhat-foundry";
dotenv.config();

const config: HardhatUserConfig = {
solidity: "0.8.19",
solidity: {
compilers: [
{
version: "0.8.24",
settings: {
evmVersion: "paris"
},
}
]
},
paths: {
sources: "./src",
},
docgen: {
pages: "files",
pageExtension: ".mdx",
templates: "custom_templates",
exclude: ["test"],
outputDir: "api_reference/solidity",
},
Expand Down
2 changes: 1 addition & 1 deletion lib/ccip
Submodule ccip updated 3801 files
Loading

0 comments on commit 54ff7b0

Please sign in to comment.