99 "strconv"
1010 "time"
1111
12+ "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/cctp_verifier"
13+ "github.com/smartcontractkit/chainlink-ccv/verifier/token/cctp"
14+
1215 "github.com/BurntSushi/toml"
1316 "github.com/Masterminds/semver/v3"
1417
@@ -50,6 +53,8 @@ type TokenVerifierInput struct {
5053 DefaultExecutorOnRampAddresses map [string ]string `toml:"default_executor_on_ramp_addresses"`
5154 // Maps to rmn_remote_addresses in the verifier config toml.
5255 RMNRemoteAddresses map [string ]string `toml:"rmn_remote_addresses"`
56+
57+ CCTPVerifierAddresses map [string ]string `toml:"cctp_verifier_addresses"`
5358}
5459
5560type TokenVerifierOutput struct {
@@ -202,6 +207,26 @@ func (v *TokenVerifierInput) buildVerifierConfiguration(config *token.Config) er
202207 config .VerifierID = v .ContainerName
203208 config .OnRampAddresses = v .OnRampAddresses
204209 config .RMNRemoteAddresses = v .RMNRemoteAddresses
210+ if len (config .TokenVerifiers ) == 0 {
211+ config .TokenVerifiers = make ([]token.VerifierConfig , 0 )
212+ }
213+
214+ if len (v .CCTPVerifierAddresses ) > 0 {
215+ verifiers := make (map [string ]any )
216+ for k , addr := range v .CCTPVerifierAddresses {
217+ verifiers [k ] = addr
218+ }
219+ config .TokenVerifiers = append (config .TokenVerifiers , token.VerifierConfig {
220+ Type : "cctp" ,
221+ Version : "2.0" ,
222+ CCTPConfig : & cctp.CCTPConfig {
223+ AttestationAPI : "localhost:8080" ,
224+ AttestationAPIInterval : 60 * time .Second ,
225+ AttestationAPITimeout : 10 * time .Second ,
226+ Verifiers : verifiers ,
227+ },
228+ })
229+ }
205230
206231 return nil
207232}
@@ -210,6 +235,7 @@ func ResolveContractsForTokenVerifier(ds datastore.DataStore, blockchains []*blo
210235 ver .OnRampAddresses = make (map [string ]string )
211236 ver .DefaultExecutorOnRampAddresses = make (map [string ]string )
212237 ver .RMNRemoteAddresses = make (map [string ]string )
238+ ver .CCTPVerifierAddresses = make (map [string ]string )
213239
214240 for _ , chain := range blockchains {
215241 networkInfo , err := chainsel .GetChainDetailsByChainIDAndFamily (chain .ChainID , chainsel .FamilyEVM )
@@ -218,6 +244,20 @@ func ResolveContractsForTokenVerifier(ds datastore.DataStore, blockchains []*blo
218244 }
219245 selectorStr := strconv .FormatUint (networkInfo .ChainSelector , 10 )
220246
247+ cctpTokenVerifierAddressRef , err := ds .Addresses ().Get (datastore .NewAddressRefKey (
248+ networkInfo .ChainSelector ,
249+ datastore .ContractType (cctp_verifier .ResolverType ),
250+ semver .MustParse (cctp_verifier .Deploy .Version ()),
251+ "CCTP" ,
252+ ))
253+ if err != nil {
254+ framework .L .Info ().
255+ Str ("chainID" , chain .ChainID ).
256+ Msg ("Failed to get CCTP Verifier address from datastore" )
257+ } else {
258+ ver .CCTPVerifierAddresses [selectorStr ] = cctpTokenVerifierAddressRef .Address
259+ }
260+
221261 onRampAddressRef , err := ds .Addresses ().Get (datastore .NewAddressRefKey (
222262 networkInfo .ChainSelector ,
223263 datastore .ContractType (onrampoperations .ContractType ),
0 commit comments