1/5
## Pool Configuration Test We need to configure the token pools before we mint tokens and transfer them cross-chain. To configure the token pool, we need to call `applyChainUpdates`. This function is inside the token pool, which we are inheriting from the re-base token pool. ```javascript applyChainUpdates ``` This function takes two constructor arguments: `uint64[] calldata remoteChainSelectorsToRemove` and `ChainUpdate[] calldata chainsToAdd` (an array that contains the configuration for any chains that we want to enable). Enabling a chain means that we are allowing tokens to be received and sent to this chain. To configure our token pools, we will create a function called `configureTokenPool`: ```javascript function configureTokenPool( uint256 fork, address localPool, uint64 remoteChainSelector, address remotePool, address remoteTokenAddress ) public { vm.selectFork(fork); vm.prank(owner); bytes memory remotePoolAddresses = new bytes(1); remotePoolAddresses[0] = abi.encode(remotePool); TokenPool.ChainUpdate memory chainToAdd = new TokenPool.ChainUpdate(1); chainToAdd.remoteChainSelector = remoteChainSelector; chainToAdd.remotePoolAddresses = remotePoolAddresses; chainToAdd.remoteTokenAddress = abi.encode(remoteTokenAddress); chainToAdd.outboundRateLimiterConfig = RateLimiter.Config(isEnable: false, capacity: 0, rate: 0); chainToAdd.inboundRateLimiterConfig = RateLimiter.Config(isEnable: false, capacity: 0, rate: 0); TokenPool(localPool).applyChainUpdates(new uint64(1)[0], chainToAdd); } ``` We need to import `TokenPool` and `RateLimiter`: ```javascript import "TokenPool" from "@ccip/contracts/src/v0.8/ccip/pools/TokenPool.sol"; import "RateLimiter" from "@ccip/contracts/src/v0.8/ccip/libraries/RateLimiter.sol"; ``` We are going to use the Sepolia fork, the Sepolia pool as our local pool, the Arbitrum Sepolia network details, and the Arbitrum Sepolia token as our remote values: ```javascript configureTokenPool(sepoliaFork, sepoliaLiPool, arbSepoliaNetworkDetails.chainSelector, arbSepoliaLiPool, arbSepoliaLiToken); ``` We then need to repeat the process for Sepolia, using the Arbitrum fork, Arbitrum pool as the local pool, the Sepolia network details and Sepolia token as our remote values: ```javascript configureTokenPool(arbSepoliaFork, arbSepoliaLiPool, sepoliaNetworkDetails.chainSelector, sepoliaLiPool, sepoliaLiToken); ``` We can now call the `configureTokenPool` function: ```bash run forge build ``` This successfully builds, and now we have configured our token pools!
A detailed guide to configuring token pools using CCIP in Solidity. The lesson covers the basics of using the `applyChainUpdates` function inside of the `TokenPool` library to enable cross-chain communication between Sepolia and Arbitrum Sepolia. It also covers importing the `RateLimiter` library to configure rate limits for the token pool.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Advanced smart contract development
How to develop a stablecoin
How to develop a DeFi protocol
How to develop a DAO
Advanced smart contracts testing
Fuzz testing
Manual verification
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Security researcher
$49,999 - $120,000 (avg. salary)
Guest lecturers:
Juliette Chevalier
Lead Developer relations at Aragon
Nader Dabit
Director of developer relations at Avara
Ally Haire
Developer relations at Protocol Labs
Harrison
Founder at GasliteGG
Last updated on March 11, 2025
Solidity Developer
Advanced FoundryDuration: 36min
Duration: 3h 06min
Duration: 5h 02min
Duration: 6h 02min
Duration: 2h 47min
Duration: 1h 23min
Duration: 4h 28min
Duration: 1h 19min
Duration: 1h 10min
Course Overview
About the course
Advanced smart contract development
How to develop a stablecoin
How to develop a DeFi protocol
How to develop a DAO
Advanced smart contracts testing
Fuzz testing
Manual verification
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Security researcher
$49,999 - $120,000 (avg. salary)
Guest lecturers:
Juliette Chevalier
Lead Developer relations at Aragon
Nader Dabit
Director of developer relations at Avara
Ally Haire
Developer relations at Protocol Labs
Harrison
Founder at GasliteGG
Last updated on March 11, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar