|
| 1 | +package consts |
| 2 | + |
| 3 | +// This package contains ChainReader and ChainWriter related constants. |
| 4 | + |
| 5 | +// Contract Names |
| 6 | +const ( |
| 7 | + ContractNameOffRamp = "OffRamp" |
| 8 | + ContractNameOnRamp = "OnRamp" |
| 9 | + ContractNameFeeQuoter = "FeeQuoter" |
| 10 | + ContractNameCapabilitiesRegistry = "CapabilitiesRegistry" |
| 11 | + ContractNameCCIPConfig = "CCIPHome" |
| 12 | + ContractNamePriceAggregator = "AggregatorV3Interface" |
| 13 | + ContractNameNonceManager = "NonceManager" |
| 14 | + ContractNameRMNHome = "RMNHome" |
| 15 | + ContractNameRMNRemote = "RMNRemote" |
| 16 | + ContractNameRMNProxy = "RMNProxy" |
| 17 | + ContractNameRouter = "Router" |
| 18 | + ContractNameCCTPMessageTransmitter = "MessageTransmitter" |
| 19 | + ContractNameUSDCTokenPool = "USDCTokenPool" //nolint:gosec // Solana USDC Token Pool contract name |
| 20 | +) |
| 21 | + |
| 22 | +func AllContractNames() []string { |
| 23 | + return []string{ |
| 24 | + ContractNameOffRamp, |
| 25 | + ContractNameOnRamp, |
| 26 | + ContractNameFeeQuoter, |
| 27 | + ContractNameCapabilitiesRegistry, |
| 28 | + ContractNameCCIPConfig, |
| 29 | + ContractNamePriceAggregator, |
| 30 | + ContractNameNonceManager, |
| 31 | + ContractNameRMNHome, |
| 32 | + ContractNameRMNRemote, |
| 33 | + ContractNameRMNProxy, |
| 34 | + ContractNameRouter, |
| 35 | + ContractNameCCTPMessageTransmitter, |
| 36 | + } |
| 37 | +} |
| 38 | + |
| 39 | +// Method Names |
| 40 | +// TODO: these should be better organized, maybe separate packages. |
| 41 | +const ( |
| 42 | + // Router methods |
| 43 | + MethodNameRouterGetWrappedNative = "GetWrappedNative" |
| 44 | + |
| 45 | + // OffRamp methods |
| 46 | + MethodNameGetSourceChainConfig = "GetSourceChainConfig" |
| 47 | + MethodNameOffRampGetAllSourceChainConfigs = "OffRampGetAllSourceChainConfigs" |
| 48 | + MethodNameOffRampGetDynamicConfig = "OffRampGetDynamicConfig" |
| 49 | + MethodNameOffRampGetStaticConfig = "OffRampGetStaticConfig" |
| 50 | + MethodNameOffRampLatestConfigDetails = "OffRampLatestConfigDetails" |
| 51 | + MethodNameGetLatestPriceSequenceNumber = "GetLatestPriceSequenceNumber" |
| 52 | + MethodNameGetMerkleRoot = "GetMerkleRoot" |
| 53 | + MethodNameGetExecutionState = "GetExecutionState" |
| 54 | + |
| 55 | + // OnRamp methods |
| 56 | + MethodNameOnRampGetDynamicConfig = "OnRampGetDynamicConfig" |
| 57 | + MethodNameOnRampGetStaticConfig = "OnRampGetStaticConfig" |
| 58 | + MethodNameOnRampGetDestChainConfig = "OnRampGetDestChainConfig" |
| 59 | + MethodNameGetExpectedNextSequenceNumber = "GetExpectedNextSequenceNumber" |
| 60 | + |
| 61 | + // FeeQuoter view/pure methods |
| 62 | + MethodNameFeeQuoterGetTokenPrices = "GetTokenPrices" |
| 63 | + MethodNameFeeQuoterGetTokenPrice = "GetTokenPrice" |
| 64 | + MethodNameGetFeePriceUpdate = "GetDestinationChainGasPrice" |
| 65 | + MethodNameFeeQuoterGetStaticConfig = "GetStaticConfig" |
| 66 | + MethodNameGetDestChainConfig = "GetDestChainConfig" |
| 67 | + MethodNameGetPremiumMultiplierWeiPerEth = "GetPremiumMultiplierWeiPerEth" |
| 68 | + MethodNameGetTokenTransferFeeConfig = "GetTokenTransferFeeConfig" |
| 69 | + MethodNameProcessMessageArgs = "ProcessMessageArgs" |
| 70 | + MethodNameGetValidatedTokenPrice = "GetValidatedTokenPrice" |
| 71 | + MethodNameGetFeeTokens = "GetFeeTokens" |
| 72 | + |
| 73 | + // Aggregator methods |
| 74 | + MethodNameGetLatestRoundData = "latestRoundData" |
| 75 | + MethodNameGetDecimals = "decimals" |
| 76 | + |
| 77 | + // NonceManager methods |
| 78 | + MethodNameGetInboundNonce = "GetInboundNonce" |
| 79 | + MethodNameGetOutboundNonce = "GetOutboundNonce" |
| 80 | + |
| 81 | + /* |
| 82 | + // On EVM: |
| 83 | + function commit( |
| 84 | + bytes32[3] calldata reportContext, |
| 85 | + bytes calldata report, |
| 86 | + bytes32[] calldata rs, |
| 87 | + bytes32[] calldata ss, |
| 88 | + bytes32 rawVs // signatures |
| 89 | + ) external |
| 90 | + */ |
| 91 | + MethodCommit = "Commit" |
| 92 | + MethodCommitPriceOnly = "CommitPriceOnly" |
| 93 | + |
| 94 | + // On EVM: |
| 95 | + // function execute(bytes32[3] calldata reportContext, bytes calldata report) external |
| 96 | + MethodExecute = "Execute" |
| 97 | + |
| 98 | + // Capability registry methods. |
| 99 | + // Used by the home chain reader. |
| 100 | + MethodNameGetCapability = "GetCapability" |
| 101 | + |
| 102 | + // CCIPHome.sol methods. |
| 103 | + // Used by the home chain reader. |
| 104 | + // TODO: change them to getConfig, getAllConfigs |
| 105 | + MethodNameGetAllChainConfigs = "GetAllChainConfigs" |
| 106 | + MethodNameGetOCRConfig = "GetOCRConfig" |
| 107 | + |
| 108 | + // RMNHome.sol methods |
| 109 | + // Used by the rmn home reader. |
| 110 | + MethodNameGetAllConfigs = "GetAllConfigs" |
| 111 | + |
| 112 | + // RMNRemote.sol methods |
| 113 | + // Used by the rmn remote reader. |
| 114 | + MethodNameGetVersionedConfig = "GetVersionedConfig" |
| 115 | + MethodNameGetReportDigestHeader = "GetReportDigestHeader" |
| 116 | + MethodNameGetCursedSubjects = "GetCursedSubjects" |
| 117 | + |
| 118 | + // RMNProxy.sol methods |
| 119 | + MethodNameGetARM = "GetARM" |
| 120 | +) |
| 121 | + |
| 122 | +// Event Names |
| 123 | +const ( |
| 124 | + EventNameCCIPMessageSent = "CCIPMessageSent" |
| 125 | + EventNameExecutionStateChanged = "ExecutionStateChanged" |
| 126 | + EventNameCommitReportAccepted = "CommitReportAccepted" |
| 127 | + EventNameCCTPMessageSent = "MessageSent" |
| 128 | +) |
| 129 | + |
| 130 | +// Event Attributes |
| 131 | +const ( |
| 132 | + EventAttributeSequenceNumber = "SequenceNumber" |
| 133 | + EventAttributeSourceChain = "SourceChain" |
| 134 | + EventAttributeDestChain = "DestChain" |
| 135 | + EventAttributeState = "State" |
| 136 | + |
| 137 | + // Required for Solana CCTP |
| 138 | + EventAttributeCCTPNonce = "CctpNonce" |
| 139 | + EventAttributeSourceDomain = "SourceDomain" |
| 140 | +) |
| 141 | + |
| 142 | +// Dedicated filters |
| 143 | +const ( |
| 144 | + CCTPMessageSentValue = "CCTPMessageSentValue" |
| 145 | +) |
| 146 | + |
| 147 | +// Mirrors of Internal.sol's OCRPluginType |
| 148 | +const ( |
| 149 | + PluginTypeCommit uint8 = 0 |
| 150 | + PluginTypeExecute uint8 = 1 |
| 151 | +) |
| 152 | + |
| 153 | +type CtxKey string |
| 154 | + |
| 155 | +const InvalidateCacheKey = CtxKey("invalidate-cache") |
0 commit comments