From 4f7c5a17ea0c2756e1385fa50c28d26cbe5b71b3 Mon Sep 17 00:00:00 2001 From: FelixFan1992 Date: Wed, 17 Jun 2026 10:55:36 -0400 Subject: [PATCH] add fast mcms package id to token pool deps --- .../changesets/cs_deploy_tp_and_configure.go | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/deployment/changesets/cs_deploy_tp_and_configure.go b/deployment/changesets/cs_deploy_tp_and_configure.go index 2fc79bff8..933522a0d 100644 --- a/deployment/changesets/cs_deploy_tp_and_configure.go +++ b/deployment/changesets/cs_deploy_tp_and_configure.go @@ -61,12 +61,21 @@ func (d DeployTPAndConfigure) Apply(e cldf.Environment, config DeployTPAndConfig SuiRPC: suiChain.URL, } + fastMcmsPackageID := state[config.SuiChainSelector].FastCurseMCMSPackageID + if fastMcmsPackageID == "" { + return cldf.ChangesetOutput{}, fmt.Errorf( + "fast MCMS package not deployed for Sui chain %d; run DeploySuiChain first", + config.SuiChainSelector, + ) + } + // Populate state information for each token pool type for _, tokenPoolType := range config.TokenPoolTypes { switch tokenPoolType { case deployment.TokenPoolTypeBurnMint: config.BurnMintTpInput.CCIPPackageId = state[config.SuiChainSelector].CCIPAddress config.BurnMintTpInput.MCMSAddress = state[config.SuiChainSelector].MCMSPackageID + config.BurnMintTpInput.FastMcmsAddress = fastMcmsPackageID // TODO: MCMSOwner address should come state config.BurnMintTpInput.MCMSOwnerAddress = deployerAddr config.BurnMintTpInput.CCIPObjectRefObjectId = state[config.SuiChainSelector].CCIPObjectRef @@ -74,6 +83,7 @@ func (d DeployTPAndConfigure) Apply(e cldf.Environment, config DeployTPAndConfig case deployment.TokenPoolTypeLockRelease: config.LockReleaseTPInput.CCIPPackageId = state[config.SuiChainSelector].CCIPAddress config.LockReleaseTPInput.MCMSAddress = state[config.SuiChainSelector].MCMSPackageID + config.LockReleaseTPInput.FastMcmsAddress = fastMcmsPackageID config.LockReleaseTPInput.MCMSOwnerAddress = deployerAddr config.LockReleaseTPInput.CCIPObjectRefObjectId = state[config.SuiChainSelector].CCIPObjectRef config.LockReleaseTPInput.TokenPoolAdministrator = deployerAddr @@ -89,6 +99,7 @@ func (d DeployTPAndConfigure) Apply(e cldf.Environment, config DeployTPAndConfig config.ManagedTPInput.CCIPPackageId = state[config.SuiChainSelector].CCIPAddress config.ManagedTPInput.ManagedTokenPackageId = managedTokenState.PackageID config.ManagedTPInput.MCMSAddress = state[config.SuiChainSelector].MCMSPackageID + config.ManagedTPInput.FastMcmsAddress = fastMcmsPackageID config.ManagedTPInput.MCMSOwnerAddress = deployerAddr config.ManagedTPInput.CCIPObjectRefObjectId = state[config.SuiChainSelector].CCIPObjectRef config.ManagedTPInput.TokenPoolAdministrator = deployerAddr @@ -204,5 +215,15 @@ func (d DeployTPAndConfigure) Apply(e cldf.Environment, config DeployTPAndConfig // VerifyPreconditions implements deployment.ChangeSetV2. func (d DeployTPAndConfigure) VerifyPreconditions(e cldf.Environment, config DeployTPAndConfigureConfig) error { + state, err := deployment.LoadOnchainStatesui(e) + if err != nil { + return err + } + if state[config.SuiChainSelector].FastCurseMCMSPackageID == "" { + return fmt.Errorf( + "fast MCMS package not deployed for Sui chain %d; run DeploySuiChain first", + config.SuiChainSelector, + ) + } return nil }