Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/plenty-results-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#updated CCIP changesets to deploy v1.5.1 TokenPoolFactory instead of latest version
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ require (
github.com/rs/zerolog v1.33.0
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20251006185749-5bbcd3de2ec8
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20251006204220-06f2720ee9a0
github.com/smartcontractkit/chainlink-common v0.9.6-0.20251007140624-a242e4bbd3dc
github.com/smartcontractkit/chainlink-data-streams v0.1.5
github.com/smartcontractkit/chainlink-deployments-framework v0.54.0
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1593,8 +1593,8 @@ github.com/smartcontractkit/chainlink-aptos v0.0.0-20250916164650-970686360fbf h
github.com/smartcontractkit/chainlink-aptos v0.0.0-20250916164650-970686360fbf/go.mod h1:tEjqontct1/5cKHm4q75nopZa1rwzaQZwd9U9wn0uZE=
github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU=
github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08=
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20251006185749-5bbcd3de2ec8 h1:onGICjK3QAFSeF5q9ItlV+o548VMdZcNfWL0SVo835c=
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20251006185749-5bbcd3de2ec8/go.mod h1:W3d6TbZ4PNLGb8QOK8URc/tVWBhnAOwtAYsQ2iPgwtw=
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20251006204220-06f2720ee9a0 h1:/FUN8x1iF3jYR3LYiIwvtHtJ6O6fZrMxtkbvTgO2GZA=
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20251006204220-06f2720ee9a0/go.mod h1:W3d6TbZ4PNLGb8QOK8URc/tVWBhnAOwtAYsQ2iPgwtw=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250912190424-fd2e35d7deb5 h1:f8ak6g6P2KT4HjUbleU+Bh0gUJXMoGuoriMSyGxxD4M=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:Ve1xD71bl193YIZQEoJMmBqLGQJdNs29bwbuObwvbhQ=
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 h1:Z4t2ZY+ZyGWxtcXvPr11y4o3CGqhg3frJB5jXkCSvWA=
Expand Down
110 changes: 43 additions & 67 deletions deployment/ccip/changeset/cs_prerequisites.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/latest/mock_lbtc_token_pool"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/latest/mock_usdc_token_messenger"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/latest/mock_usdc_token_transmitter"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/latest/token_pool_factory"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_0_0/rmn_proxy_contract"
price_registry_1_2_0 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/price_registry"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_mint_token_pool"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_with_from_mint_token_pool"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/lock_release_token_pool"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool_factory"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/usdc_token_pool"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/registry_module_owner_custom"
"github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/burn_mint_erc677"
Expand All @@ -38,10 +38,13 @@ import (

cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm"
cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment"
"github.com/smartcontractkit/chainlink-deployments-framework/operations"

"github.com/smartcontractkit/chainlink/deployment"
ccipopsv1_5_1 "github.com/smartcontractkit/chainlink/deployment/ccip/operation/evm/v1_5_1"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview"
opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils"
)

var (
Expand Down Expand Up @@ -560,15 +563,41 @@ func deployPrerequisiteContracts(e cldf.Environment, ab cldf.AddressBook, state
}
if deployOpts.TokenPoolFactoryEnabled {
var err error
tokenPoolFactory, factoryBurnMintERC20, burnMintTokenPool, burnFromMintTokenPool, burnWithFromMintTokenPool, lockReleaseTokenPool, err =
deployTokenPoolFactory(e.Logger, chain, ab, rmnProxy.Address(), r.Address(), tokenAdminReg.Address(),
regAddresses, tokenPoolFactory, factoryBurnMintERC20, burnMintTokenPool, burnFromMintTokenPool, burnWithFromMintTokenPool, lockReleaseTokenPool)
var tokenPoolFactoryAddr common.Address
if tokenPoolFactory == nil {
tpfReport, err := operations.ExecuteOperation(e.OperationsBundle, ccipopsv1_5_1.DeployTokenPoolFactoryOp, chain, opsutil.EVMDeployInput[ccipopsv1_5_1.DeployTokenPoolFactoryInput]{
ChainSelector: chain.ChainSelector(),
DeployInput: ccipopsv1_5_1.DeployTokenPoolFactoryInput{
ChainSelector: chain.ChainSelector(),
TokenAdminRegistry: tokenAdminReg.Address(),
RegistryModule1_6Addresses: regAddresses[0],
RMNProxy: rmnProxy.Address(),
Router: r.Address(),
},
})
if err != nil {
lggr.Errorw("Failed to deploy token pool factory", "chain", chain.String(), "err", err)
return err
}
tokenPoolFactoryAddr = tpfReport.Output.Address
err = ab.Save(chain.ChainSelector(), tpfReport.Output.Address.Hex(), cldf.MustTypeAndVersionFromString(tpfReport.Output.TypeAndVersion))
if err != nil {
return fmt.Errorf("failed to save address %s for chain %d: %w", tpfReport.Output.Address.Hex(), chain.ChainSelector(), err)
}
} else {
lggr.Infow("Token pool factory already deployed", "chain", chain.String(), "addr", tokenPoolFactory.Address)
tokenPoolFactoryAddr = tokenPoolFactory.Address()
}

factoryBurnMintERC20, burnMintTokenPool, burnFromMintTokenPool, burnWithFromMintTokenPool, lockReleaseTokenPool, err =
deployTokenPools(e.Logger, chain, ab, rmnProxy.Address(), r.Address(),
factoryBurnMintERC20, burnMintTokenPool, burnFromMintTokenPool, burnWithFromMintTokenPool, lockReleaseTokenPool)
if err != nil {
return err
}
e.Logger.Infow("Deployed TokenPoolFactory Contracts",
"chain", chain.String(),
"tokenPoolFactory", tokenPoolFactory.Address(),
"tokenPoolFactory", tokenPoolFactoryAddr,
"factoryBurnMintERC20", factoryBurnMintERC20.Address(),
"burnMintTokenPool", burnMintTokenPool.Address(),
"burnFromMintTokenPool", burnFromMintTokenPool.Address(),
Expand Down Expand Up @@ -718,81 +747,28 @@ func deployPrerequisiteContracts(e cldf.Environment, ab cldf.AddressBook, state
return nil
}

// deployTokenPoolFactory deploys the TokenPoolFactory contract and other associated contracts
// These are contracts are deployed by the TokenPoolFactory. These contracts are FactoryBurnMintERC20,
// BurnMintTokenPool, BurnFronMintTokenPool, BurnWithFromMintTokenPool & LockReleaseTokenPool
// deployTokenPools deploys contracts are deployed by the TokenPoolFactory. These contracts are
// FactoryBurnMintERC20, BurnMintTokenPool, BurnFronMintTokenPool, BurnWithFromMintTokenPool & LockReleaseTokenPool
// We deploy them here so that we can verify them. All subsequent user deployments would then be verified.
func deployTokenPoolFactory(
func deployTokenPools(
lggr logger.Logger,
chain cldf_evm.Chain,
addresses cldf.AddressBook,
rmnProxy common.Address,
router common.Address,
tokenAdminRegistry common.Address,
registryAddresses []common.Address,
tokenPoolFactory *token_pool_factory.TokenPoolFactory,
factoryBurnMintERC20 *factory_burn_mint_erc20.FactoryBurnMintERC20,
burnMintTokenPool *burn_mint_token_pool.BurnMintTokenPool,
burnFromMintTokenPool *burn_from_mint_token_pool.BurnFromMintTokenPool,
burnWithFromMintTokenPool *burn_with_from_mint_token_pool.BurnWithFromMintTokenPool,
lockReleaseTokenPool *lock_release_token_pool.LockReleaseTokenPool,
) (
*token_pool_factory.TokenPoolFactory,
*factory_burn_mint_erc20.FactoryBurnMintERC20,
*burn_mint_token_pool.BurnMintTokenPool,
*burn_from_mint_token_pool.BurnFromMintTokenPool,
*burn_with_from_mint_token_pool.BurnWithFromMintTokenPool,
*lock_release_token_pool.LockReleaseTokenPool,
error,
) {
if tokenPoolFactory == nil {
tokenPoolFactoryContractDeploy, err := cldf.DeployContract(lggr, chain, addresses,
func(chain cldf_evm.Chain) cldf.ContractDeploy[*token_pool_factory.TokenPoolFactory] {
var (
tpfAddr common.Address
tx2 *types.Transaction
contract *token_pool_factory.TokenPoolFactory
err2 error
)
if chain.IsZkSyncVM {
tpfAddr, _, contract, err2 = token_pool_factory.DeployTokenPoolFactoryZk(
nil,
chain.ClientZkSyncVM,
chain.DeployerKeyZkSyncVM,
chain.Client,
tokenAdminRegistry,
registryAddresses[0],
rmnProxy,
router,
)
} else {
tpfAddr, tx2, contract, err2 = token_pool_factory.DeployTokenPoolFactory(
chain.DeployerKey,
chain.Client,
tokenAdminRegistry,
// There will always be at least one registry module deployed at this point.
// We just use the first one here. If a different RegistryModule is desired,
// users can run DeployTokenPoolFactoryChangeset with the desired address.
registryAddresses[0],
rmnProxy,
router,
)
}
return cldf.ContractDeploy[*token_pool_factory.TokenPoolFactory]{
Address: tpfAddr, Contract: contract, Tx: tx2, Tv: cldf.NewTypeAndVersion(shared.TokenPoolFactory, deployment.Version1_5_1), Err: err2,
}
},
)
if err != nil {
lggr.Errorw("Failed to deploy token pool factory", "chain", chain.String(), "err", err)
return nil, nil, nil, nil, nil, nil, err
}

tokenPoolFactory = tokenPoolFactoryContractDeploy.Contract
} else {
lggr.Infow("Token pool factory already deployed", "chain", chain.String(), "addr", tokenPoolFactory.Address)
}

// FactoryBurnMintERC20, BurnMintTokenPool, BurnFromMintTokenPool, BurnWithFromMintTokenPool & LockReleaseTokenPool
// are contracts that get deployed by the TokenPoolFactory.
// We deploy them here so that we can verify them. All subsequent user deployments would then be verified.
Expand Down Expand Up @@ -837,7 +813,7 @@ func deployTokenPoolFactory(
)
if err != nil {
lggr.Errorw("Failed to deploy factory burn mint erc20", "chain", chain.String(), "err", err)
return nil, nil, nil, nil, nil, nil, err
return nil, nil, nil, nil, nil, err
}

factoryBurnMintERC20 = factoryBurnMintERC20ContractDeploy.Contract // set this here so that the address can be referenced later
Expand Down Expand Up @@ -883,7 +859,7 @@ func deployTokenPoolFactory(
)
if err != nil {
lggr.Errorw("Failed to deploy burn mint token pool", "chain", chain.String(), "err", err)
return nil, nil, nil, nil, nil, nil, err
return nil, nil, nil, nil, nil, err
}

burnMintTokenPool = burnMintTokenPoolContractDeploy.Contract
Expand Down Expand Up @@ -929,7 +905,7 @@ func deployTokenPoolFactory(
)
if err != nil {
lggr.Errorw("Failed to deploy burn from mint token pool", "chain", chain.String(), "err", err)
return nil, nil, nil, nil, nil, nil, err
return nil, nil, nil, nil, nil, err
}

burnFromMintTokenPool = burnFromMintTokenPoolContractDeploy.Contract
Expand Down Expand Up @@ -974,7 +950,7 @@ func deployTokenPoolFactory(
)
if err != nil {
lggr.Errorw("Failed to deploy burn with from mint token pool", "chain", chain.String(), "err", err)
return nil, nil, nil, nil, nil, nil, err
return nil, nil, nil, nil, nil, err
}

burnWithFromMintTokenPool = burnWithFromMintTokenPoolContractDeploy.Contract
Expand Down Expand Up @@ -1022,15 +998,15 @@ func deployTokenPoolFactory(
)
if err != nil {
lggr.Errorw("Failed to deploy lock release token pool", "chain", chain.String(), "err", err)
return nil, nil, nil, nil, nil, nil, err
return nil, nil, nil, nil, nil, err
}

lockReleaseTokenPool = lockReleaseTokenPoolContractDeploy.Contract
} else {
lggr.Infow("lock release token pool already deployed", "chain", chain.String(), "addr", factoryBurnMintERC20.Address)
}

return tokenPoolFactory, factoryBurnMintERC20, burnMintTokenPool, burnFromMintTokenPool, burnWithFromMintTokenPool, lockReleaseTokenPool, nil
return factoryBurnMintERC20, burnMintTokenPool, burnFromMintTokenPool, burnWithFromMintTokenPool, lockReleaseTokenPool, nil
}

func deployUSDC(
Expand Down
44 changes: 19 additions & 25 deletions deployment/ccip/changeset/v1_5_1/cs_deploy_token_pool_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import (

"github.com/ethereum/go-ethereum/common"

"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/latest/token_pool_factory"

cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm"
cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment"
"github.com/smartcontractkit/chainlink-deployments-framework/operations"

"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared"
ccipopsv1_5_1 "github.com/smartcontractkit/chainlink/deployment/ccip/operation/evm/v1_5_1"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview"
opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils"
)

// DeployTokenPoolFactoryChangeset is a changeset that deploys the TokenPoolFactory contract on multiple chains.
Expand Down Expand Up @@ -97,30 +95,26 @@ func deployTokenPoolFactoryLogic(e cldf.Environment, config DeployTokenPoolFacto
registryModuleAddress = chainState.RegistryModules1_6[0].Address()
}

tokenPoolFactory, err := cldf.DeployContract(e.Logger, chain, addressBook,
func(chain cldf_evm.Chain) cldf.ContractDeploy[*token_pool_factory.TokenPoolFactory] {
address, tx, tokenPoolFactory, err := token_pool_factory.DeployTokenPoolFactory(
chain.DeployerKey,
chain.Client,
chainState.TokenAdminRegistry.Address(),
registryModuleAddress,
chainState.RMNProxy.Address(),
chainState.Router.Address(),
)

return cldf.ContractDeploy[*token_pool_factory.TokenPoolFactory]{
Address: address,
Contract: tokenPoolFactory,
Tx: tx,
Tv: cldf.NewTypeAndVersion(shared.TokenPoolFactory, deployment.Version1_5_1),
Err: err,
}
tpfReport, err := operations.ExecuteOperation(e.OperationsBundle, ccipopsv1_5_1.DeployTokenPoolFactoryOp, chain, opsutil.EVMDeployInput[ccipopsv1_5_1.DeployTokenPoolFactoryInput]{
ChainSelector: chain.ChainSelector(),
DeployInput: ccipopsv1_5_1.DeployTokenPoolFactoryInput{
ChainSelector: chain.ChainSelector(),
TokenAdminRegistry: chainState.TokenAdminRegistry.Address(),
RegistryModule1_6Addresses: registryModuleAddress,
RMNProxy: chainState.RMNProxy.Address(),
Router: chainState.Router.Address(),
},
)
})
if err != nil {
e.Logger.Errorw("Failed to deploy token pool factory", "chain", chain.String(), "err", err)
return cldf.ChangesetOutput{}, fmt.Errorf("failed to deploy token pool factory: %w", err)
}
e.Logger.Infof("Successfully deployed token pool factory %s on %s", tokenPoolFactory.Address.String(), chain.String())

err = addressBook.Save(chainSel, tpfReport.Output.Address.Hex(), cldf.MustTypeAndVersionFromString(tpfReport.Output.TypeAndVersion))
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to save address %s for chain %d: %w", tpfReport.Output.Address.Hex(), chainSel, err)
}
e.Logger.Infof("Successfully deployed token pool factory %s on %s", tpfReport.Output.Address.Hex(), chain.String())
}

return cldf.ChangesetOutput{AddressBook: addressBook}, nil
Expand Down
44 changes: 44 additions & 0 deletions deployment/ccip/operation/evm/v1_5_1/ops_token_pool_factory.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package v1_5_1

import (
"github.com/Masterminds/semver/v3"
"github.com/ethereum/go-ethereum/common"

"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool_factory"
"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared"
opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils"
)

type DeployTokenPoolFactoryInput struct {
ChainSelector uint64
TokenAdminRegistry common.Address
// RegistryModule1_6Addresses indicates which registry module to use for each chain.
// If the chain only has one 1.6.0 registry module, you do not need to specify it here.
RegistryModule1_6Addresses common.Address
RMNProxy common.Address
Router common.Address
}

var (
DeployTokenPoolFactoryOp = opsutil.NewEVMDeployOperation(
"DeployTokenPoolFactory",
semver.MustParse("1.0.0"),
"Deploys TokenPoolFactory contract on the specified evm chain",
shared.TokenPoolFactory,
token_pool_factory.TokenPoolFactoryMetaData,
&opsutil.ContractOpts{
Version: &deployment.Version1_5_1,
EVMBytecode: common.FromHex(token_pool_factory.TokenPoolFactoryBin),
ZkSyncVMBytecode: token_pool_factory.ZkBytecode,
},
func(input DeployTokenPoolFactoryInput) []interface{} {
return []interface{}{
input.TokenAdminRegistry,
input.RegistryModule1_6Addresses,
input.RMNProxy,
input.Router,
}
},
)
)
2 changes: 1 addition & 1 deletion deployment/ccip/shared/stateview/evm/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/latest/maybe_revert_message_receiver"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/latest/mock_usdc_token_messenger"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/latest/mock_usdc_token_transmitter"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/latest/token_pool_factory"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_0_0/rmn_proxy_contract"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/price_registry"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router"
Expand All @@ -35,6 +34,7 @@ import (
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_mint_token_pool"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_with_from_mint_token_pool"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/lock_release_token_pool"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool_factory"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/usdc_token_pool"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/ccip_home"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/fee_quoter"
Expand Down
Loading
Loading