feat: [NONEVM-4520] ContractTypeAndVersion in OperationMetadata#751
Conversation
feat: update cl-ton import
There was a problem hiding this comment.
Pull request overview
Adds a new ContractTypeAndVersion field to OperationMetadata so the TON SDK can carry a fully-qualified contract type-and-version string alongside the existing short ContractType. Call sites in the TON SDK (transaction creation, timelock converter/configurer, MCMS configurer) and tests are updated to populate it, and the TON decoder is migrated to the new tvm.ContractTLBRegistry / tvm.FullyQualifiedName types from the bumped chainlink-ton dependency. go.mod/go.sum are bumped accordingly.
Changes:
- Add
ContractTypeAndVersionfield totypes.OperationMetadataand a corresponding parameter toton.NewTransaction. - Switch TON decoder/decoded operation to
tvm.ContractTLBRegistryandtvm.FullyQualifiedName, and start usingbindings.ShortRBAC/ShortTimelock/ShortMCMSandbindings.TypeRBAC/TypeTimelock/TypeMCMSconstants instead of the hardcoded"RBACTimelock"/"MCMS"strings. - Bump
chainlink-ton(and many transitive deps) ingo.mod/go.sum.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| types/operation.go | Adds ContractTypeAndVersion field to OperationMetadata. |
| sdk/ton/transaction.go | Threads new contractTypeAndVersion parameter through NewTransaction. |
| sdk/ton/timelock_converter.go | Uses bindings.ShortTimelock / TypeTimelock and passes the new TAV string. |
| sdk/ton/timelock_configurer.go | Same update for the UpdateDelay skip-send path; reorganizes imports. |
| sdk/ton/configurer.go | Uses bindings.ShortMCMS / TypeMCMS for the SetConfig skip-send path. |
| sdk/ton/decoder.go | Switches to tvm.ContractTLBRegistry and tvm.FullyQualifiedName. |
| sdk/ton/decoded_operation.go | DecodedOperation.ContractType becomes tvm.FullyQualifiedName. |
| sdk/ton/decoder_test.go | Updates table to use tvm.FullyQualifiedName and binding constants. |
| sdk/ton/decoded_operation_test.go | Renames contractType → contractFQN and updates type. |
| sdk/ton/timelock_converter_test.go | Updates fixtures to use binding constants and the new field. |
| sdk/ton/encoder_test.go | Adds the new empty-string argument to NewTransaction calls. |
| go.mod / go.sum | Bumps chainlink-ton and many transitive dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Notice: EVM just sets 0 here, but on TON we need to set some value to cover gas fees | ||
| var tx types.Transaction | ||
| tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), "RBACTimelock", tags) | ||
| tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), bindings.ShortTimelock, string(bindings.TypeTimelock)+" 0.0.0", tags) |
| big.NewInt(0), | ||
| "RBACTimelock", | ||
| bindings.ShortTimelock, | ||
| string(bindings.TypeTimelock)+" 0.0.0", |
There was a problem hiding this comment.
Why this space, shouldn't this be @ sign?
| "RBACTimelock", | ||
| string(bindings.TypeTimelock)+" 0.0.0", | ||
| []string{"RBACTimelock", "GrantRole"}, |
| // Notice: EVM just sets 0 here, but on TON we need to set some value to cover gas fees | ||
| var tx types.Transaction | ||
| tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), "RBACTimelock", tags) | ||
| tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), bindings.ShortTimelock, string(bindings.TypeTimelock)+" 0.0.0", tags) |
| ContractType string `json:"contractType"` | ||
| Tags []string `json:"tags"` | ||
| ContractType string `json:"contractType"` // ContractType is the short type used in data store e.g. "Router". It represents the crosschain interface/expected behaviour of the destination contract. | ||
| ContractTypeAndVersion string `json:"contractTypeAndVersion"` // ContractTypeAndVersion is the .String() representation of the TypeAndVersion of our contract. It is used for decoding the message data (cell) according to the correct TL-B schema. For example, in TON we use a FullyQualifiedName as the contract type. The resulting string looks like ""link.chain.ton.mcms.Timelock" 1.0.0". |
|
| // Notice: EVM just sets 0 here, but on TON we need to set some value to cover gas fees | ||
| var tx types.Transaction | ||
| tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), "RBACTimelock", tags) | ||
| tx, err = NewTransaction(dstAddr, data.BeginParse(), t.amount.Nano(), bindings.ShortTimelock, string(bindings.TypeTimelock)+" 0.0.0", tags) |
| ContractType string `json:"contractType"` | ||
| Tags []string `json:"tags"` | ||
| ContractType string `json:"contractType"` // ContractType is the short type used in data store e.g. "Router". It represents the crosschain interface/expected behaviour of the destination contract. | ||
| ContractTypeAndVersion string `json:"contractTypeAndVersion"` // ContractTypeAndVersion is the .String() representation of the TypeAndVersion of our contract. It is used for decoding the message data (cell) according to the correct TL-B schema. For example, in TON we use a FullyQualifiedName as the contract type. The resulting string looks like "link.chain.ton.mcms.Timelock 1.0.0". |
There was a problem hiding this comment.
why not just Version?
There was a problem hiding this comment.
also, I see the Copilot mentioning it's hardcoding -0.0.0. Why is it even added?
🤖 I have created a release *beep* *boop* --- ## [0.44.0](v0.43.0...v0.44.0) (2026-05-15) ### Features * [NONEVM-4520] ContractTypeAndVersion in OperationMetadata ([#751](#751)) ([16b18da](16b18da)) * support latest chain selectors in v1.0.100 ([#753](#753)) ([f5df18e](f5df18e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). [NONEVM-4520]: https://smartcontract-it.atlassian.net/browse/NONEVM-4520?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [0.45.0](v0.44.0...v0.45.0) (2026-05-18) ### Features * [NONEVM-4520] ContractVersion in OperationMetadata ([#751](#751)) ([f2eaf56](f2eaf56)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). [NONEVM-4520]: https://smartcontract-it.atlassian.net/browse/NONEVM-4520?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>




NONEVM-4520
Depends on: