@@ -17,6 +17,7 @@ import (
1717 solToken "github.com/gagliardetto/solana-go/programs/token"
1818
1919 cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana"
20+ "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/erc20"
2021
2122 "github.com/smartcontractkit/mcms"
2223 mcmsTypes "github.com/smartcontractkit/mcms/types"
@@ -554,9 +555,22 @@ func getOnChainEVMPoolConfig(e cldf.Environment, state stateview.CCIPOnChainStat
554555 return solBaseTokenPool.RemoteConfig {}, fmt .Errorf ("failed to get token evm token pool and token address: %w" , evmErr )
555556 }
556557 evmTokenPoolAddress := evmTokenPool .Address ()
557- evmTokenDecimals , err := evmTokenPool .GetTokenDecimals (& bind.CallOpts {Context : context .Background ()})
558+ callOpts := & bind.CallOpts {Context : context .Background ()}
559+ evmTokenDecimals , err := evmTokenPool .GetTokenDecimals (callOpts )
558560 if err != nil {
559- return solBaseTokenPool.RemoteConfig {}, fmt .Errorf ("failed to get token decimals: %w" , err )
561+ // Fallback: some pool ABIs omit GetTokenDecimals; read decimals from the underlying ERC20.
562+ tokenAddr , err2 := evmTokenPool .GetToken (callOpts )
563+ if err2 != nil {
564+ return solBaseTokenPool.RemoteConfig {}, fmt .Errorf ("failed to get token address from evm token pool: %w" , err2 )
565+ }
566+ token , err2 := erc20 .NewERC20 (tokenAddr , evmChain .Client )
567+ if err2 != nil {
568+ return solBaseTokenPool.RemoteConfig {}, fmt .Errorf ("failed to bind erc20 to fetch decimals at %s: %w" , tokenAddr .Hex (), err2 )
569+ }
570+ evmTokenDecimals , err2 = token .Decimals (callOpts )
571+ if err2 != nil {
572+ return solBaseTokenPool.RemoteConfig {}, fmt .Errorf ("failed to get token decimals from token contract: %w" , err2 )
573+ }
560574 }
561575 onChainEVMRemoteConfig := solBaseTokenPool.RemoteConfig {
562576 TokenAddress : solBaseTokenPool.RemoteAddress {
0 commit comments