-
Notifications
You must be signed in to change notification settings - Fork 29
[CRE-491] Move ccip consts from chainnlink-ccip to chainlink-common #1773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+155
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| package consts | ||
|
|
||
| // This package contains ChainReader and ChainWriter related constants. | ||
|
|
||
| // Contract Names | ||
| const ( | ||
| ContractNameOffRamp = "OffRamp" | ||
| ContractNameOnRamp = "OnRamp" | ||
| ContractNameFeeQuoter = "FeeQuoter" | ||
| ContractNameCapabilitiesRegistry = "CapabilitiesRegistry" | ||
| ContractNameCCIPConfig = "CCIPHome" | ||
| ContractNamePriceAggregator = "AggregatorV3Interface" | ||
| ContractNameNonceManager = "NonceManager" | ||
| ContractNameRMNHome = "RMNHome" | ||
| ContractNameRMNRemote = "RMNRemote" | ||
| ContractNameRMNProxy = "RMNProxy" | ||
| ContractNameRouter = "Router" | ||
| ContractNameCCTPMessageTransmitter = "MessageTransmitter" | ||
| ContractNameUSDCTokenPool = "USDCTokenPool" //nolint:gosec // Solana USDC Token Pool contract name | ||
| ) | ||
|
|
||
| func AllContractNames() []string { | ||
| return []string{ | ||
| ContractNameOffRamp, | ||
| ContractNameOnRamp, | ||
| ContractNameFeeQuoter, | ||
| ContractNameCapabilitiesRegistry, | ||
| ContractNameCCIPConfig, | ||
| ContractNamePriceAggregator, | ||
| ContractNameNonceManager, | ||
| ContractNameRMNHome, | ||
| ContractNameRMNRemote, | ||
| ContractNameRMNProxy, | ||
| ContractNameRouter, | ||
| ContractNameCCTPMessageTransmitter, | ||
| } | ||
| } | ||
|
|
||
| // Method Names | ||
| // TODO: these should be better organized, maybe separate packages. | ||
| const ( | ||
| // Router methods | ||
| MethodNameRouterGetWrappedNative = "GetWrappedNative" | ||
|
|
||
| // OffRamp methods | ||
| MethodNameGetSourceChainConfig = "GetSourceChainConfig" | ||
| MethodNameOffRampGetAllSourceChainConfigs = "OffRampGetAllSourceChainConfigs" | ||
| MethodNameOffRampGetDynamicConfig = "OffRampGetDynamicConfig" | ||
| MethodNameOffRampGetStaticConfig = "OffRampGetStaticConfig" | ||
| MethodNameOffRampLatestConfigDetails = "OffRampLatestConfigDetails" | ||
| MethodNameGetLatestPriceSequenceNumber = "GetLatestPriceSequenceNumber" | ||
| MethodNameGetMerkleRoot = "GetMerkleRoot" | ||
| MethodNameGetExecutionState = "GetExecutionState" | ||
|
|
||
| // OnRamp methods | ||
| MethodNameOnRampGetDynamicConfig = "OnRampGetDynamicConfig" | ||
| MethodNameOnRampGetStaticConfig = "OnRampGetStaticConfig" | ||
| MethodNameOnRampGetDestChainConfig = "OnRampGetDestChainConfig" | ||
| MethodNameGetExpectedNextSequenceNumber = "GetExpectedNextSequenceNumber" | ||
|
|
||
| // FeeQuoter view/pure methods | ||
| MethodNameFeeQuoterGetTokenPrices = "GetTokenPrices" | ||
| MethodNameFeeQuoterGetTokenPrice = "GetTokenPrice" | ||
| MethodNameGetFeePriceUpdate = "GetDestinationChainGasPrice" | ||
| MethodNameFeeQuoterGetStaticConfig = "GetStaticConfig" | ||
| MethodNameGetDestChainConfig = "GetDestChainConfig" | ||
| MethodNameGetPremiumMultiplierWeiPerEth = "GetPremiumMultiplierWeiPerEth" | ||
| MethodNameGetTokenTransferFeeConfig = "GetTokenTransferFeeConfig" | ||
| MethodNameProcessMessageArgs = "ProcessMessageArgs" | ||
| MethodNameGetValidatedTokenPrice = "GetValidatedTokenPrice" | ||
| MethodNameGetFeeTokens = "GetFeeTokens" | ||
|
|
||
| // Aggregator methods | ||
| MethodNameGetLatestRoundData = "latestRoundData" | ||
| MethodNameGetDecimals = "decimals" | ||
|
|
||
| // NonceManager methods | ||
| MethodNameGetInboundNonce = "GetInboundNonce" | ||
| MethodNameGetOutboundNonce = "GetOutboundNonce" | ||
|
|
||
| /* | ||
| // On EVM: | ||
| function commit( | ||
| bytes32[3] calldata reportContext, | ||
| bytes calldata report, | ||
| bytes32[] calldata rs, | ||
| bytes32[] calldata ss, | ||
| bytes32 rawVs // signatures | ||
| ) external | ||
| */ | ||
| MethodCommit = "Commit" | ||
| MethodCommitPriceOnly = "CommitPriceOnly" | ||
|
|
||
| // On EVM: | ||
| // function execute(bytes32[3] calldata reportContext, bytes calldata report) external | ||
| MethodExecute = "Execute" | ||
|
|
||
| // Capability registry methods. | ||
| // Used by the home chain reader. | ||
| MethodNameGetCapability = "GetCapability" | ||
|
|
||
| // CCIPHome.sol methods. | ||
| // Used by the home chain reader. | ||
| // TODO: change them to getConfig, getAllConfigs | ||
| MethodNameGetAllChainConfigs = "GetAllChainConfigs" | ||
| MethodNameGetOCRConfig = "GetOCRConfig" | ||
|
|
||
| // RMNHome.sol methods | ||
| // Used by the rmn home reader. | ||
| MethodNameGetAllConfigs = "GetAllConfigs" | ||
|
|
||
| // RMNRemote.sol methods | ||
| // Used by the rmn remote reader. | ||
| MethodNameGetVersionedConfig = "GetVersionedConfig" | ||
| MethodNameGetReportDigestHeader = "GetReportDigestHeader" | ||
| MethodNameGetCursedSubjects = "GetCursedSubjects" | ||
|
|
||
| // RMNProxy.sol methods | ||
| MethodNameGetARM = "GetARM" | ||
| ) | ||
|
|
||
| // Event Names | ||
| const ( | ||
| EventNameCCIPMessageSent = "CCIPMessageSent" | ||
| EventNameExecutionStateChanged = "ExecutionStateChanged" | ||
| EventNameCommitReportAccepted = "CommitReportAccepted" | ||
| EventNameCCTPMessageSent = "MessageSent" | ||
| ) | ||
|
|
||
| // Event Attributes | ||
| const ( | ||
| EventAttributeSequenceNumber = "SequenceNumber" | ||
| EventAttributeSourceChain = "SourceChain" | ||
| EventAttributeDestChain = "DestChain" | ||
| EventAttributeState = "State" | ||
|
|
||
| // Required for Solana CCTP | ||
| EventAttributeCCTPNonce = "CctpNonce" | ||
| EventAttributeSourceDomain = "SourceDomain" | ||
| ) | ||
|
|
||
| // Dedicated filters | ||
| const ( | ||
| CCTPMessageSentValue = "CCTPMessageSentValue" | ||
| ) | ||
|
|
||
| // Mirrors of Internal.sol's OCRPluginType | ||
| const ( | ||
| PluginTypeCommit uint8 = 0 | ||
| PluginTypeExecute uint8 = 1 | ||
| ) | ||
|
|
||
| type CtxKey string | ||
|
|
||
| const InvalidateCacheKey = CtxKey("invalidate-cache") | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
AllContractNames()function is missingContractNameUSDCTokenPoolfrom its return slice, even though it's defined as a constant. This creates inconsistency between the defined constants and what the function returns.