Skip to content
Open
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/fierce-foxes-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#added changeset to clean up solana token mint authority after migration
4 changes: 2 additions & 2 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ require (
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260507123701-77fc93b573bb // indirect
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260428205619-2db1389501a1 // indirect
github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260408145530-22e2d05695cd // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260506144252-c100eabfda74 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260506144252-c100eabfda74 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260415165642-49f23e4d76cc // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260511195239-0f6e1b177fc7 // indirect
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260504204047-af9826978b72 // indirect
github.com/smartcontractkit/chainlink-ccv v0.0.2-0.20260428133800-3b1484e8b1fd // indirect
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 // indirect
Expand Down
8 changes: 4 additions & 4 deletions core/scripts/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 130 additions & 0 deletions deployment/ccip/changeset/solana_v0_1_1/cs_token_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/cctp_token_pool"
solLockReleaseTokenPool "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/lockrelease_token_pool"
solTestTokenPool "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/test_token_pool"
solBurnMintTokenPool_V1_6_2 "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v1_6_2/burnmint_token_pool"
solCommonUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/common"
solState "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state"
solTokenUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/tokens"
Expand Down Expand Up @@ -66,6 +67,9 @@ var _ cldf.ChangeSet[SyncDomainConfig] = SyncDomain
// extend token pool lookup table
var _ cldf.ChangeSet[ExtendTokenPoolLookupTableConfig] = ExtendTokenPoolLookupTable

// transfer mint authority back to pool signer PDA
var _ cldf.ChangeSet[TransferMintAuthorityToSignerPDAConfig] = TransferMintAuthorityToSignerPDA

// append mcms txns generated from solanainstructions
func appendTxs(instructions []solana.Instruction, tokenPool solana.PublicKey, poolType cldf.ContractType, txns *[]mcmsTypes.Transaction) error {
for _, ixn := range instructions {
Expand Down Expand Up @@ -929,6 +933,132 @@ func parseMultisigAddress(text string) (string, error) {
return m[1], nil
}

type TransferMintAuthorityToSignerPDAConfig struct {
ChainSelector uint64
TokenMint solana.PublicKey
PoolType *cldf.ContractType
Metadata string
MCMS *proposalutils.TimelockConfig
}

func (cfg TransferMintAuthorityToSignerPDAConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error {
if err := chainState.CommonValidation(e, cfg.ChainSelector, cfg.TokenMint); err != nil {
return err
}
Comment thread
agusaldasoro marked this conversation as resolved.
if cfg.PoolType == nil {
return errors.New("pool type is required")
}
if *cfg.PoolType != shared.BurnMintTokenPool {
return errors.New("transfer mint authority to signer PDA only for burn and mint pools")
}
if _, err := chainState.TokenToTokenProgram(cfg.TokenMint); err != nil {
return fmt.Errorf("token %s not found in existing state, deploy the token first", cfg.TokenMint.String())
}
tokenPool := chainState.GetActiveTokenPool(*cfg.PoolType, cfg.Metadata)
if tokenPool.IsZero() {
return fmt.Errorf("token pool of type %s not found in existing state, deploy the token pool first for chain %d", *cfg.PoolType, cfg.ChainSelector)
}
return nil
}

func TransferMintAuthorityToSignerPDA(e cldf.Environment, cfg TransferMintAuthorityToSignerPDAConfig) (cldf.ChangesetOutput, error) {
e.Logger.Infow("Transfer mint authority to signer PDA", "cfg", cfg)

state, err := stateview.LoadOnchainState(e)
if err != nil {
return cldf.ChangesetOutput{}, err
}
solChainState := state.SolChains[cfg.ChainSelector]
if err := cfg.Validate(e, solChainState); err != nil {
return cldf.ChangesetOutput{}, err
}
chain := e.BlockChains.SolanaChains()[cfg.ChainSelector]
tokenProgram, _ := solChainState.TokenToTokenProgram(cfg.TokenMint)
tokenPool := solChainState.GetActiveTokenPool(*cfg.PoolType, cfg.Metadata)

runSafely(func() {
solBurnMintTokenPool.SetProgramID(tokenPool)
Comment thread
agusaldasoro marked this conversation as resolved.
solBurnMintTokenPool_V1_6_2.SetProgramID(tokenPool)
})

tokenPoolSigner, err := solTokenUtil.TokenPoolSignerAddress(cfg.TokenMint, tokenPool)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get token pool signer address: %w", err)
}
poolConfig, err := solTokenUtil.TokenPoolConfigAddress(cfg.TokenMint, tokenPool)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to calculate the pool config: %w", err)
}
programData, err := getSolProgramData(e, chain, tokenPool)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get solana token pool program data: %w", err)
}

var mintAccount solToken.Mint
if err := chain.GetAccountDataBorshInto(context.Background(), cfg.TokenMint, &mintAccount); err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get token mint account data: %w", err)
}
if mintAccount.MintAuthority == nil {
return cldf.ChangesetOutput{}, fmt.Errorf("token %s has no mint authority set", cfg.TokenMint)
}
currentMintAuthority := *mintAccount.MintAuthority

useMcms := solanastateview.IsSolanaProgramOwnedByTimelock(
&e,
chain,
solChainState,
shared.BurnMintTokenPool,
cfg.TokenMint,
cfg.Metadata,
)

authority := chain.DeployerKey.PublicKey()
if useMcms {
timelockSigner, err := FetchTimelockSigner(e, cfg.ChainSelector)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to fetch timelock signer: %w", err)
}
authority = timelockSigner
}

ix, err := solBurnMintTokenPool_V1_6_2.NewTransferMintAuthorityToPdaSignerInstruction(
poolConfig,
cfg.TokenMint,
tokenProgram,
tokenPoolSigner,
authority,
currentMintAuthority,
tokenPool,
programData.Address,
).ValidateAndBuild()
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to build ix to transfer mint authority to signer PDA: %w", err)
}

if !useMcms {
if err := chain.Confirm([]solana.Instruction{ix}); err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to confirm instructions: %w", err)
}
return cldf.ChangesetOutput{}, nil
}

if cfg.MCMS == nil {
return cldf.ChangesetOutput{}, errors.New("MCMS config is required when program is owned by timelock")
}
var txns []mcmsTypes.Transaction
if err := appendTxs([]solana.Instruction{ix}, tokenPool, *cfg.PoolType, &txns); err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to generate mcms txn: %w", err)
}
proposal, err := BuildProposalsForTxns(
e, cfg.ChainSelector, "proposal to transfer mint authority to signer PDA", cfg.MCMS.MinDelay, txns)
if err != nil {
Comment thread
agusaldasoro marked this conversation as resolved.
return cldf.ChangesetOutput{}, fmt.Errorf("failed to build proposal: %w", err)
}
return cldf.ChangesetOutput{
MCMSTimelockProposals: []mcms.TimelockProposal{*proposal},
}, nil
}

func ModifyMintAuthority(e cldf.Environment, cfg NewMintTokenPoolConfig) (cldf.ChangesetOutput, error) {
e.Logger.Infow("Use multisig as mint authority", "cfg", cfg)

Expand Down
2 changes: 1 addition & 1 deletion deployment/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ require (
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260428205619-2db1389501a1
github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260506144252-c100eabfda74
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260415165642-49f23e4d76cc
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260415165642-49f23e4d76cc
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260511195239-0f6e1b177fc7
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260504204047-af9826978b72
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260511142328-0441b446ad75
github.com/smartcontractkit/chainlink-common/keystore v1.1.0
Expand Down
4 changes: 2 additions & 2 deletions deployment/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260428205619-2db1389501a1
github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260506144252-c100eabfda74
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260415165642-49f23e4d76cc
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260415165642-49f23e4d76cc
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260511195239-0f6e1b177fc7
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260511142328-0441b446ad75
github.com/smartcontractkit/chainlink-common/keystore v1.1.0
github.com/smartcontractkit/chainlink-deployments-framework v0.101.0
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion integration-tests/load/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260428205619-2db1389501a1
github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260506144252-c100eabfda74
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260415165642-49f23e4d76cc
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260415165642-49f23e4d76cc
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260511195239-0f6e1b177fc7
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260511142328-0441b446ad75
github.com/smartcontractkit/chainlink-deployments-framework v0.101.0
github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260507171202-46e6a397da2d
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/load/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion system-tests/lib/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ require (
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260428205619-2db1389501a1 // indirect
github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260408145530-22e2d05695cd // indirect
github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260506144252-c100eabfda74 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260415165642-49f23e4d76cc // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260511195239-0f6e1b177fc7 // indirect
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260504204047-af9826978b72 // indirect
github.com/smartcontractkit/chainlink-ccv v0.0.2-0.20260428133800-3b1484e8b1fd // indirect
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 // indirect
Expand Down
4 changes: 2 additions & 2 deletions system-tests/lib/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions system-tests/tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ require (
github.com/sigstore/sigstore-go v1.1.4 // indirect
github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260408145530-22e2d05695cd // indirect
github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260506144252-c100eabfda74 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260506144252-c100eabfda74 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260506144252-c100eabfda74 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260415165642-49f23e4d76cc // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260511195239-0f6e1b177fc7 // indirect
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260504204047-af9826978b72 // indirect
github.com/smartcontractkit/chainlink-ccv v0.0.2-0.20260428133800-3b1484e8b1fd // indirect
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/committee-verifier v0.0.0-20251211142334-5c3421fe2c8d // indirect
Expand Down
Loading
Loading