-
Notifications
You must be signed in to change notification settings - Fork 27
feat: add token adapter for v1.5.0 #1503
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
base: main
Are you sure you want to change the base?
Conversation
…rtcontractkit/chainlink-ccip into bg/evm-token-deployment-toolingapi
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.
Pull request overview
This PR adds a token adapter implementation for version 1.5.0, enabling token management operations across EVM chains. The implementation includes support for token admin registry operations, token pool management, and cross-chain token configuration.
Key changes:
- New token adapter implementation for v1.5.0 with methods for token deployment, registration, and pool management
- Added token admin registry operations including role transfer and manual registration sequences
- Token pool operations support for v1.5.1 with chain update capabilities
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
chains/evm/deployment/v1_6_0/sequences/token_and_pools.go |
Updated to reference v1.0.0 token sequences and fixed function signature for DeployTokenVerify |
chains/evm/deployment/v1_5_1/operations/token_pool/token_pool.go |
New file implementing token pool chain update operations for v1.5.1 |
chains/evm/deployment/v1_5_0/sequences/token_admin_registry.go |
New manual registration sequence for token admin registry operations |
chains/evm/deployment/v1_5_0/operations/token_admin_registry/token_admin_registry.go |
Added TransferAdminRole operation and reformatted variable declarations |
chains/evm/deployment/v1_5_0/adapters/tokens.go |
New comprehensive token adapter implementation with helper methods and interface implementations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| func (a *EVMAdapter) DeployTokenVerify(in any) error { | ||
| func (a *EVMAdapter) DeployTokenVerify(in tokensapi.IN) error { |
Copilot
AI
Dec 19, 2025
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 type name 'IN' is ambiguous and unclear. Consider using a more descriptive type name such as 'DeployTokenInput' or 'DeployTokenVerifyInput' that clearly indicates what this input represents.
| return tokseq.DeployToken | ||
| } | ||
|
|
||
| func (a *TokenAdapter) DeployTokenVerify(in tokensapi.IN) error { |
Copilot
AI
Dec 19, 2025
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 type name 'IN' is ambiguous and unclear. Consider using a more descriptive type name such as 'DeployTokenInput' or 'DeployTokenVerifyInput' that clearly indicates what this input represents.
|
| var ApplyChainUpdates = contract.NewWrite(contract.WriteParams[ApplyChainUpdatesArgs, *token_pool.TokenPool]{ | ||
| Name: "token_pool:apply-chain-updates", | ||
| Version: Version, | ||
| Description: "Applies chain updates to the TokenPool 1.5.1 contract", | ||
| ContractType: ContractType, | ||
| ContractABI: token_pool.TokenPoolABI, | ||
| NewContract: token_pool.NewTokenPool, | ||
| IsAllowedCaller: contract.OnlyOwner[*token_pool.TokenPool, ApplyChainUpdatesArgs], | ||
| Validate: func(args ApplyChainUpdatesArgs) error { return nil }, | ||
| CallContract: func(tp *token_pool.TokenPool, opts *bind.TransactOpts, args ApplyChainUpdatesArgs) (*types.Transaction, error) { | ||
| return tp.ApplyChainUpdates(opts, args.RemoteChainSelectorsToRemove, args.ChainsToAdd) | ||
| }, | ||
| }) |
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.
NOTE: this is not used by the v1.5.0 adapter yet, but I've added it in since we will eventually use it later
This PR adds a
v1.5.0adapter that partially implements theTokenAdapterinterface from the tokens APIHere's a list of methods that have been implemented and which have not:
ConfigureTokenForTransfersSequenceAddressRefToBytesDeriveTokenAddressManualRegistrationDeployTokenDeployTokenVerifyDeployTokenPoolForTokenRegisterTokenSetPoolUpdateAuthoritiesImportant notes:
deploy_token_contractsfile has been moved from thev1_6_0folder to thev1_0_0folder since it doesn't belong to any specific version (all the bindings it uses are for tokens are defined inv1_0_0).ManualRegistrationsequence is fully idempotent. It reads the current token config from the chain and chooses whether it needs to propose an admin or transfer the admin role based on whether a token admin already exists or not.SetPoolsequence is also fully idempotent by virtue of the on-chain implementation. Calling it multiple times with the same input will produce no unintended consequences on-chain.