-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
CCIP-4566 token pool views #16116
CCIP-4566 token pool views #16116
Conversation
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
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.
There are some additional fields that we should capture for USDC and LockRelease:
LockRelease: acceptLiquidity, rebalancer
USDC: domains, messageTransmitter, tokenMessenger
Maybe worth having three separate views?
- All burn mint types (burn mint, burn from mint, burn with from mint, etc.)
- Lock release
- USDC
"github.com/smartcontractkit/chainlink/deployment/common/view/types" | ||
) | ||
|
||
type TokenPoolContract interface { |
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.
This is technically the interface for v1_5_1, package name should be updated as there are breaking changes between v1_5 and v1_5_1
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.
Also, add comment for interface & maybe link here: https://github.com/smartcontractkit/chainlink/blob/develop/core/gethwrappers/ccip/generated/token_pool/token_pool.go
So it is clear where these methods are coming from.
type RemoteChainConfig struct { | ||
// RemoteTokenAddress is a hex representation of byte arrays | ||
RemoteTokenAddress string | ||
// RemotePoolAddresses are a hex representations of byte arrays | ||
RemotePoolAddresses []string | ||
} |
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.
type RemoteChainConfig struct { | |
// RemoteTokenAddress is a hex representation of byte arrays | |
RemoteTokenAddress string | |
// RemotePoolAddresses are a hex representations of byte arrays | |
RemotePoolAddresses []string | |
} | |
type RemoteChainConfig struct { | |
// RemoteTokenAddress is the address of the token on the remote chain. | |
RemoteTokenAddress []common.Address | |
// RemotePoolAddresses are the addresses of valid token pools on the remote chain. | |
RemotePoolAddresses []common.Address | |
// InboundRateLimiterConfig is the rate limiter config for inbound transfers from the remote chain. | |
InboundRateLimterConfig token_pool.RateLimiterConfig | |
// OutboundRateLimiterConfig is the rate limiter config for outbound transfers to the remote chain. | |
OutboundRateLimiterConfig token_pool.RateLimiterConfig | |
} |
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.
I didn't put common.Address here intentionally, as we don't know what length will be these byte arrays
Switched back from hex to []byte
type TokenPoolView struct { | ||
types.ContractMetaData | ||
Token common.Address `json:"token"` | ||
RemoteChainConfigs map[uint64]RemoteChainConfig `json:"remoteChainConfigs"` |
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.
"SupportedChains" aligns with convention of the contract
RemoteChainConfigs map[uint64]RemoteChainConfig `json:"remoteChainConfigs"` | |
SupportedChains map[uint64]RemoteChainConfig `json:"supportedChains"` |
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.
No, SupportedChains is another methods+field on the contract
remoteChainConfigs doesn't have public method, but corresponds to s_remoteChainConfigs internal field
} | ||
remotePoolsHex := make([]string, len(remotePools)) | ||
for i, remotePool := range remotePools { | ||
remotePoolsHex[i] = hex.EncodeToString(remotePool) |
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.
Can just use common.BytesToAddress() if you change the remote address fields to use common.Address
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.
I didn't put common.Address here intentionally, as we don't know what length will be these byte arrays
Switched back from hex to []byte
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.
Generic comments -
Do we need any specific info for USDC pool?
Are we including RateLimiter details here?
It will help if we create a map of pool views keyed by the token symbol.
Let's have all error messages formatted with pool/token address
|
CCIP 1.5/1.6 Token pool views