@@ -7,12 +7,14 @@ import (
77
88 "github.com/gagliardetto/solana-go"
99 chainsel "github.com/smartcontractkit/chain-selectors"
10+ "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm"
11+ "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract"
1012 "github.com/smartcontractkit/chainlink-deployments-framework/datastore"
1113 cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment"
1214 cldfops "github.com/smartcontractkit/chainlink-deployments-framework/operations"
1315
14- opsevm "github.com/smartcontractkit/cld-changesets/pkg/family/evm/operations"
1516 linkops "github.com/smartcontractkit/cld-changesets/tokens/link/operations"
17+ "github.com/smartcontractkit/cld-changesets/tokens/link/types"
1618)
1719
1820var _ cldf.ChangeSetV2 [DeployLinkTokenInput ] = DeployLinkTokenChangeset {}
@@ -69,9 +71,9 @@ func (DeployLinkTokenChangeset) VerifyPreconditions(e cldf.Environment, input De
6971 return fmt .Errorf ("unknown EVM LINK variant %q for chain %d: must be %q or %q" , cfg .Variant , sel , EVMLinkBurnMint , EVMLinkStatic )
7072 }
7173
72- tv := linkTokenTypeAndVersion ()
74+ tv := types . BurnMintLinkTokenTypeAndVersion
7375 if cfg .Variant == EVMLinkStatic {
74- tv = staticLinkTokenTypeAndVersion ()
76+ tv = types . StaticLinkTokenTypeAndVersion
7577 }
7678
7779 if err := validateNoExistingContract (e , []uint64 {sel }, tv , cfg .Qualifier ); err != nil {
@@ -92,7 +94,7 @@ func (DeployLinkTokenChangeset) VerifyPreconditions(e cldf.Environment, input De
9294 return fmt .Errorf ("solana chain %d: TokenPrivKey must be set" , sel )
9395 }
9496
95- if err := validateNoExistingContract (e , []uint64 {sel }, linkTokenTypeAndVersion () , cfg .Qualifier ); err != nil {
97+ if err := validateNoExistingContract (e , []uint64 {sel }, types . BurnMintLinkTokenTypeAndVersion , cfg .Qualifier ); err != nil {
9698 return err
9799 }
98100 }
@@ -111,24 +113,31 @@ func (DeployLinkTokenChangeset) Apply(e cldf.Environment, input DeployLinkTokenI
111113 }
112114
113115 op := linkops .OpEVMDeployLinkToken
114- tv := linkTokenTypeAndVersion ()
116+ tv := types . BurnMintLinkTokenTypeAndVersion
115117 if cfg .Variant == EVMLinkStatic {
116118 op = linkops .OpEVMDeployStaticLinkToken
117- tv = staticLinkTokenTypeAndVersion ()
119+ tv = types . StaticLinkTokenTypeAndVersion
118120 }
119121
120122 qualifier := cfg .Qualifier
121123 report , err := cldfops .ExecuteOperation (
122124 e .OperationsBundle ,
123125 op ,
124126 chain ,
125- opsevm.EVMDeployInput [any ]{ChainSelector : sel , Qualifier : & qualifier },
127+ contract.DeployInput [struct {}]{
128+ TypeAndVersion : tv ,
129+ Qualifier : & qualifier ,
130+ Args : struct {}{},
131+ },
132+ cldfops.WithIdempotencyKey [contract.DeployInput [struct {}], evm.Chain ](
133+ fmt .Sprintf ("link-token-deploy-%d-%s-%s" , sel , tv .String (), qualifier ),
134+ ),
126135 )
127136 if err != nil {
128137 return cldf.ChangesetOutput {}, fmt .Errorf ("failed to deploy link token for chain %d: %w" , sel , err )
129138 }
130139
131- addr := report .Output .Address . String ()
140+ addr := report .Output .Address
132141 if err := saveAddressRef (ds , sel , addr , tv , cfg .Qualifier ); err != nil {
133142 return cldf.ChangesetOutput {}, fmt .Errorf ("failed to save link token address for chain %d: %w" , sel , err )
134143 }
@@ -137,7 +146,7 @@ func (DeployLinkTokenChangeset) Apply(e cldf.Environment, input DeployLinkTokenI
137146 e .Logger .Infow ("Deployed link token" , "chain" , sel , "addr" , addr , "variant" , tv .Type )
138147 }
139148
140- tv := linkTokenTypeAndVersion ()
149+ tv := types . BurnMintLinkTokenTypeAndVersion
141150 for sel , cfg := range input .Solana {
142151 chain , ok := e .BlockChains .SolanaChains ()[sel ]
143152 if ! ok {
0 commit comments