Skip to content

Conversation

@krebernisak
Copy link
Collaborator

No description provided.

@krebernisak krebernisak requested a review from a team as a code owner September 25, 2025 15:25
@changeset-bot
Copy link

changeset-bot bot commented Sep 25, 2025

🦋 Changeset detected

Latest commit: 099a18a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smartcontractkit/mcms Minor

Not sure what this means? Click here to learn what changesets are.

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

@krebernisak krebernisak marked this pull request as draft September 25, 2025 15:25
Copy link
Contributor

Choose a reason for hiding this comment

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

is nix mandatory for ton?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey! Nix is added to support dev environments for devs that use Nix.

Nix is also the way to get chainlink-ton packages, in this case I will need the TON contracts package, which I can easily pull from source with Nix. This is required to deploy contracts.

Same as we import Go bindings from a commit with Go,
we import TON contract artifacts from a commit with Nix.

Nix is an orthogonal add-on - this means that folks can use it or set up things manually.

For TON, some tools like Go need to be in a path and TON compiled contracts need to be available on a path defined with an env var. One can just run a prepared Nix shell to get all of that, or set up things manually.

Once I get everything working, I will also document how to get a TON env running manually as well.

Copy link
Contributor

@gustavogama-cll gustavogama-cll left a comment

Choose a reason for hiding this comment

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

I have a few requests, if you please.

  1. add a changeset file
  2. remove the .envrc file. We don't mind if you want to use nix, but we don't want to enforce it by default
  3. consider adding unit tests; I understand it's just an initial PR, but we do try have good coverage in the library. Ideally, in every PR.

@gustavogama-cll
Copy link
Contributor

I see the PR was marked as draft later... If it's not ready for review yet, please ignore my remarks.

@krebernisak
Copy link
Collaborator Author

I see the PR was marked as draft later... If it's not ready for review yet, please ignore my remarks.

Thx for a quick review! Yeah, still an early draft trying to move things forward.

@krebernisak krebernisak force-pushed the feat/ton-support branch 4 times, most recently from 01797f9 to 3e808a9 Compare November 3, 2025 12:48
@krebernisak krebernisak marked this pull request as ready for review November 3, 2025 14:10
Comment on lines +24 to +39
// TODO: unify and move these definitions to smartcontractkit/chainlink-ton
var TLBsByContract = map[string]map[uint64]interface{}{
// Jetton contract types
"com.github.ton-blockchain.jetton-contract.contracts.jetton-wallet": wallet.TLBs,
"com.github.ton-blockchain.jetton-contract.contracts.jetton-minter": minter.TLBs,
// CCIP contract types
"com.chainlink.ton.ccip.Router": router.TLBs,
"com.chainlink.ton.ccip.OnRamp": onramp.TLBs,
"com.chainlink.ton.ccip.OffRamp": offramp.TLBs,
"com.chainlink.ton.ccip.FeeQuoter": feequoter.TLBs,
"com.chainlink.ton.ccip.CCIPSendExecutor": ccipsendexecutor.TLBs,
// MCMS contract types
"com.chainlink.ton.lib.access.RBAC": rbac.TLBs,
"com.chainlink.ton.mcms.MCMS": mcms.TLBs,
"com.chainlink.ton.mcms.Timelock": timelock.TLBs,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

just flagging that this probably needs to be moved to chainlink-token as the TODO indicates

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure! I've left a couple of TODOs re: code structure across the PR.

Once I'm done with e2e tests, I'll these before merging. Some utility code and bindings can be moved and hosted in https://github.com/smartcontractkit/chainlink-ton

}

// Extract the input keys and args (tree/map lvl 0)
keys, err := lib.DecodeTLBStructKeys(v, tlbs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

might want to handle the err here


tx, err := executor.ExecuteOperation(ctx, tt.metadata, tt.nonce, tt.proof, tt.op)

assert.Equal(t, tt.wantTxHash, tx.Hash)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: might want to move this after the error check just to ensure err is nil before asserting

}

func TestTONSuite(t *testing.T) {
suite.Run(t, new(tone2e.TimelockInspectionTestSuite))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd strongly suggest to add the rest e2e tests before merging this one if possible. In past implementations like EVM/Solana they were super helpful to catch errors early. It saved us a lot of time specially when integrating with CLD. I know its a lot of work, so if not possible in this one at least having a followup before releasing the first TON mcms lib version

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure! At this point (1) implementation done, (2) unit test done (EVM parity), (3) e2e tests WIP

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