Skip to content

[CLD-1777]: feat(operations-gen): add evm support#910

Open
graham-chainlink wants to merge 1 commit intomainfrom
ggoh/cld-1777/evm-support-operations-gen
Open

[CLD-1777]: feat(operations-gen): add evm support#910
graham-chainlink wants to merge 1 commit intomainfrom
ggoh/cld-1777/evm-support-operations-gen

Conversation

@graham-chainlink
Copy link
Copy Markdown
Collaborator

Add evm support for the operations-gen cli, basically ported the code from https://github.com/smartcontractkit/chainlink-ccip/blob/main/chains/evm/cmd/operations-gen/main.go and adapted it to the new design

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-1777

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 3, 2026

⚠️ No Changeset found

Latest commit: 0d43e7b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Collaborator Author

@graham-chainlink graham-chainlink Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file mainly copied from https://github.com/smartcontractkit/chainlink-ccip/blob/main/chains/evm/cmd/operations-gen/main.go and adapted to the new design and added tests.

I will update the ported code in chainlink-ccip to point to this one when this PR is merged.

@graham-chainlink graham-chainlink changed the title feat(operations-gen): add evm support [CLD-1777]: feat(operations-gen): add evm support Apr 3, 2026
@graham-chainlink graham-chainlink marked this pull request as ready for review April 3, 2026 02:28
@graham-chainlink graham-chainlink requested a review from a team as a code owner April 3, 2026 02:28
Copilot AI review requested due to automatic review settings April 3, 2026 02:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds EVM support to the tools/operations-gen CLI so it can generate type-safe Go operation wrappers from Solidity ABIs/bytecode, using an EVM-specific handler and template.

Changes:

  • Registers the evm chain-family handler and introduces EVM extraction/generation logic.
  • Adds an EVM operations template plus supporting utilities (type mapping, ABI parsing, overload handling).
  • Adds documentation and unit tests for key EVM helpers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
tools/operations-gen/README.md Documents the CLI, config schema, and input/output layouts for EVM generation.
tools/operations-gen/main.go Enables EVM by registering evmHandler in chainFamilies.
tools/operations-gen/evm.go Implements EVM handler: config decoding, ABI/bytecode reading, ABI parsing, template data preparation, and codegen helpers.
tools/operations-gen/evm_test.go Adds unit tests for EVM naming/type mapping utilities and overload handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1777/evm-support-operations-gen branch from 3df479d to 0d43e7b Compare April 3, 2026 02:49
@cl-sonarqube-production
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

Comment on lines +23 to +26
var nameOverrides = map[string]string{
"OnRamp": "onramp",
"OffRamp": "offramp",
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we actually want to support this product specific overrides. Can ythey do it in configuration instead?

Copy link
Copy Markdown
Collaborator

@jkongie jkongie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add more documentation to this

Comment on lines +9 to +11
```bash
task generate:operations CONFIG=/path/to/operations_gen_config.yaml
```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this applicable? task seems like a repo specific wrapper

Comment on lines +29 to +33
input:
base_path: "." # Directory containing abi/ and bytecode/ subdirectories

output:
base_path: "." # Directory where generated operations/ folders are written
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we always assume that the contracts will be in a single base path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants