Skip to content
Merged
2 changes: 1 addition & 1 deletion ccv/chains/evm/deployment/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20251101235216-c2afcdc23ae0
github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20251101235216-c2afcdc23ae0
github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment v0.0.0-20251101235216-c2afcdc23ae0
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20251101235216-c2afcdc23ae0
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20251103163328-9d84f878eb79
github.com/smartcontractkit/chainlink-deployments-framework v0.56.0
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20250808121824-2c3544aab8f3
github.com/smartcontractkit/mcms v0.25.0
Expand Down
4 changes: 2 additions & 2 deletions ccv/chains/evm/deployment/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250908144012-8
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250908144012-8184001834b5/go.mod h1:Ve1xD71bl193YIZQEoJMmBqLGQJdNs29bwbuObwvbhQ=
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5 h1:QhcYGEhRLInr1/qh/3RJiVdvJ0nxBHKhPe65WLbSBnU=
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250908144012-8184001834b5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg=
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20251101235216-c2afcdc23ae0 h1:3iatTQpnMivA4kP4I+vfq5Wi3cyaEFILIHDtwftjb7Y=
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20251101235216-c2afcdc23ae0/go.mod h1:OmWUdexQbmSKsJOvE0j0R94XSMXd1QAFAnV+nX2MbZ4=
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20251103163328-9d84f878eb79 h1:wucO++cfFcJr2XUyR5+p0M9FKC5vMCITYEw11teJx8M=
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20251103163328-9d84f878eb79/go.mod h1:OmWUdexQbmSKsJOvE0j0R94XSMXd1QAFAnV+nX2MbZ4=
github.com/smartcontractkit/chainlink-common v0.9.6-0.20250929154511-1f5fbda7ae76 h1:Slnws8RoXRUYGgEMYK6X2yYzjZwNgVb93PxU45VEObQ=
github.com/smartcontractkit/chainlink-common v0.9.6-0.20250929154511-1f5fbda7ae76/go.mod h1:1r3aM96KHAESfnayJ3BTHCkP1qJS1BEG1r4czeoaXlA=
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.4 h1:hvqATtrZ0iMRTI80cpBot/3JFbjz2j+2tvpfooVhRHw=
Expand Down
24 changes: 24 additions & 0 deletions ccv/chains/evm/deployment/v1_7_0/adapters/chain_family.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package adapters

import (
"github.com/ethereum/go-ethereum/common"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/sequences"
seq_core "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences"
"github.com/smartcontractkit/chainlink-ccip/deployment/v1_7_0/adapters"
"github.com/smartcontractkit/chainlink-deployments-framework/chain"
"github.com/smartcontractkit/chainlink-deployments-framework/datastore"
"github.com/smartcontractkit/chainlink-deployments-framework/operations"
)

// ChainFamilyAdapter is the adapter for chains of the EVM family.
type ChainFamilyAdapter struct{}

// ConfigureChainForLanesSequence returns the sequence for configuring a chain of the EVM family for CCIP lanes.
func (c *ChainFamilyAdapter) ConfigureChainForLanes() *operations.Sequence[adapters.ConfigureChainForLanesInput, seq_core.OnChainOutput, chain.BlockChains] {
return sequences.ConfigureChainForLanes
}

// AddressRefToBytes returns the byte representation of an address for this chain family.
func (c *ChainFamilyAdapter) AddressRefToBytes(ref datastore.AddressRef) ([]byte, error) {
return common.HexToAddress(ref.Address).Bytes(), nil
}
141 changes: 141 additions & 0 deletions ccv/chains/evm/deployment/v1_7_0/adapters/chain_family_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
package adapters_test

import (
"testing"

"github.com/Masterminds/semver/v3"
evm_adapters "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/adapters"
v1_7_0 "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/changesets"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/committee_verifier"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/executor"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/fee_quoter"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/offramp"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/onramp"
"github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/testsetup"
"github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router"
"github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets"
"github.com/smartcontractkit/chainlink-ccip/deployment/v1_7_0/adapters"
v1_7_0_changesets "github.com/smartcontractkit/chainlink-ccip/deployment/v1_7_0/changesets"
"github.com/smartcontractkit/chainlink-deployments-framework/datastore"
"github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment"
"github.com/stretchr/testify/require"
)

func makeChainConfig(chainSelector uint64, remoteChainSelector uint64) v1_7_0_changesets.ChainConfig {
return v1_7_0_changesets.ChainConfig{
ChainSelector: chainSelector,
Router: datastore.AddressRef{
Type: datastore.ContractType(router.ContractType),
Version: semver.MustParse("1.2.0"),
},
OnRamp: datastore.AddressRef{
Type: datastore.ContractType(onramp.ContractType),
Version: semver.MustParse("1.7.0"),
},
CommitteeVerifiers: []adapters.CommitteeVerifier[datastore.AddressRef]{
{
Implementation: datastore.AddressRef{
Type: datastore.ContractType(committee_verifier.ContractType),
Version: semver.MustParse("1.7.0"),
},
Resolver: datastore.AddressRef{
Type: datastore.ContractType(committee_verifier.ResolverType),
Version: semver.MustParse("1.7.0"),
},
},
},
FeeQuoter: datastore.AddressRef{
Type: datastore.ContractType(fee_quoter.ContractType),
Version: semver.MustParse("1.7.0"),
},
OffRamp: datastore.AddressRef{
Type: datastore.ContractType(offramp.ContractType),
Version: semver.MustParse("1.7.0"),
},
RemoteChains: map[uint64]adapters.RemoteChainConfig[datastore.AddressRef, datastore.AddressRef]{
remoteChainSelector: {
AllowTrafficFrom: true,
OnRamp: datastore.AddressRef{
Type: datastore.ContractType(onramp.ContractType),
Version: semver.MustParse("1.7.0"),
},
OffRamp: datastore.AddressRef{
Type: datastore.ContractType(offramp.ContractType),
Version: semver.MustParse("1.7.0"),
},
DefaultInboundCCVs: []datastore.AddressRef{
{
Type: datastore.ContractType(committee_verifier.ContractType),
Version: semver.MustParse("1.7.0"),
},
},
DefaultOutboundCCVs: []datastore.AddressRef{
{
Type: datastore.ContractType(committee_verifier.ContractType),
Version: semver.MustParse("1.7.0"),
},
},
DefaultExecutor: datastore.AddressRef{
Type: datastore.ContractType(executor.ContractType),
Version: semver.MustParse("1.7.0"),
},
CommitteeVerifierDestChainConfig: testsetup.CreateBasicCommitteeVerifierDestChainConfig(),
FeeQuoterDestChainConfig: testsetup.CreateBasicFeeQuoterDestChainConfig(),
ExecutorDestChainConfig: testsetup.CreateBasicExecutorDestChainConfig(),
AddressBytesLength: 20,
BaseExecutionGasCost: 80_000,
},
},
}
}

func TestChainFamilyAdapter(t *testing.T) {
tests := []struct {
desc string
}{
{
desc: "happy path",
},
}
for _, test := range tests {
t.Run(test.desc, func(t *testing.T) {
chainA := uint64(5009297550715157269)
chainB := uint64(4949039107694359620)
e, err := environment.New(t.Context(),
environment.WithEVMSimulated(t, []uint64{chainA, chainB}),
)
require.NoError(t, err, "Failed to create test environment")
require.NotNil(t, e, "Environment should be created")

chainFamilyRegistry := adapters.NewChainFamilyRegistry()
chainFamilyRegistry.RegisterChainFamily("evm", &evm_adapters.ChainFamilyAdapter{})
mcmsRegistry := changesets.NewMCMSReaderRegistry()

// On each chain, deploy chain contracts
ds := datastore.NewMemoryDataStore()
for _, chainSel := range []uint64{chainA, chainB} {
deployChainOut, err := v1_7_0.DeployChainContracts(mcmsRegistry).Apply(*e, changesets.WithMCMS[v1_7_0.DeployChainContractsCfg]{
Cfg: v1_7_0.DeployChainContractsCfg{
ChainSel: chainSel,
Params: testsetup.CreateBasicContractParams(),
},
})
require.NoError(t, err, "Failed to apply DeployChainContracts changeset")
err = ds.Merge(deployChainOut.DataStore.Seal())
require.NoError(t, err, "Failed to merge datastore from DeployChainContracts changeset")
}

// Overwrite datastore in the environment
e.DataStore = ds.Seal()

// Configure chains for lanes
_, err = v1_7_0_changesets.ConfigureChainsForLanes(chainFamilyRegistry, mcmsRegistry).Apply(*e, v1_7_0_changesets.ConfigureChainsForLanesConfig{
Chains: []v1_7_0_changesets.ChainConfig{
makeChainConfig(chainA, chainB),
makeChainConfig(chainB, chainA),
},
})
require.NoError(t, err, "Failed to apply ConfigureChainsForLanes changeset")
})
}
}
6 changes: 3 additions & 3 deletions ccv/chains/evm/deployment/v1_7_0/adapters/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ func (t *TokenAdapter) ConfigureTokenForTransfersSequence() *operations.Sequence
return evm_tokens.ConfigureTokenForTransfers
}

// AddressRefToBytes returns an EVM address reference as an EVM address padded to 32 bytes.
// AddressRefToBytes returns an EVM address reference as an EVM address.
func (t *TokenAdapter) AddressRefToBytes(ref datastore.AddressRef) ([]byte, error) {
return common.LeftPadBytes(common.HexToAddress(ref.Address).Bytes(), 32), nil
return common.HexToAddress(ref.Address).Bytes(), nil
}

// DeriveTokenAddress derives the token address from a token pool reference, returning it as an EVM address padded to 32 bytes.
// DeriveTokenAddress derives the token address from a token pool reference, returning it as an EVM address.
func (t *TokenAdapter) DeriveTokenAddress(e deployment.Environment, chainSelector uint64, poolRef datastore.AddressRef) ([]byte, error) {
chain, ok := e.BlockChains.EVMChains()[chainSelector]
if !ok {
Expand Down

This file was deleted.

Loading
Loading