Skip to content

TokenAdminRegistry - #857

Open
vicentevieytes wants to merge 28 commits into
mainfrom
vv/TokenAdminRegistry
Open

TokenAdminRegistry#857
vicentevieytes wants to merge 28 commits into
mainfrom
vv/TokenAdminRegistry

Conversation

@vicentevieytes

Copy link
Copy Markdown
Collaborator

No description provided.

@vicentevieytes vicentevieytes changed the title logpoller backfill TokenAdminRegistry Aug 26, 2026
Comment thread contracts/contracts/ccip/ccipsend_executor/messages.tolk Outdated
struct OffRamp_Deployables {
rmnRouter: address;
// Separate TokenAdminRegistry root used to derive deterministic entries.
tokenAdminRegistry: address;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Probably doesn't make sense to have this both here and in Config

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 agree this belongs only to the static config

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.

Oh, I see there's no StaticConfig struct. Why though?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's just the way we implemented this originally, I'm not sure there's a reason beyond that

Comment thread contracts/contracts/ccip/onramp/contract.tolk Outdated
struct (0xaf3c62b3) CCIPSendExecutor_Execute {
onrampSend: OnRamp_Send,
// Derived by the OnRamp rather than supplied by the Router.
tokenRegistry: address?,

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'd put it in Config together with all the other addresses

@vicentevieytes
vicentevieytes marked this pull request as ready for review September 7, 2026 13:34
@vicentevieytes
vicentevieytes requested a review from a team as a code owner September 7, 2026 13:34
vicentevieytes and others added 13 commits September 7, 2026 10:52
* feat: overflow static analyzer

* ref: move shared toml.ts lib

* feat: run with nix

* feat: add type notation

* fix: fmt and wrong file

* fix: comments
* Add TP <> ContextExecutor integration to support async flow continuation

* Stash current behaviour - throw on error in transfer continuation

* Lock or burn transfer error handling and return

* LockReleaseLockboxTokenPool use ContextExecutor vs. local st

* yarn fmt

* Fix lint

* Update Go bindings

* Share code in TP lib + docs

* CE - wait for deploy confirmation before continuation

* Fix golangci-lint

* Remove local review

* Add TODOs for forwardTonAmount

* Migrate CE to OffRampAccount to support async flow

* Fix lock_release & lockbox flow

* Embed AskToTransfer in oa withdraw, check msg.transferInitiator == null on mint

* Document OffRampAccount contract

* TP compose consumeIn/OutboundRateLimit functions

* Replace CE on burn_mint burn path with CCT burn flow fwdPayload

* Fix oplint

* rm tests/debug_cells.test.ts

* Add OnRampAccount + handle TP deposit auth

* Improve TP error handling - return transfer

* PR feedback - missing lazy

* Fix lint

* Fix test
* Add TP <> ContextExecutor integration to support async flow continuation

* Stash current behaviour - throw on error in transfer continuation

* Lock or burn transfer error handling and return

* LockReleaseLockboxTokenPool use ContextExecutor vs. local st

* yarn fmt

* Fix lint

* Update Go bindings

* Share code in TP lib + docs

* CE - wait for deploy confirmation before continuation

* Fix golangci-lint

* Remove local review

* Add TODOs for forwardTonAmount

* Migrate CE to OffRampAccount to support async flow

* Fix lock_release & lockbox flow

* Embed AskToTransfer in oa withdraw, check msg.transferInitiator == null on mint

* Document OffRampAccount contract

* TP compose consumeIn/OutboundRateLimit functions

* Replace CE on burn_mint burn path with CCT burn flow fwdPayload

* Fix oplint

* rm tests/debug_cells.test.ts

* Add OnRampAccount + handle TP deposit auth

* Improve TP error handling - return transfer

* PR feedback - missing lazy

* DepositAccount contract for on/off-ramp escrows

* Remove DepositAccount allowedJettonWallet

* Fix lint

* DepositAccount Go bindings

* Simplify deposit acc bounce handling

* Post merge fix - rm accounts/off_ramp_account

* Remove ContextExecutor contract - replaced with deposit acc

* Update Go bindings and add TP contracts to pkg archive

* Fix Go bindings - exit codes

* Update pool FQN and exit codes

* Fix exit codes
* feat: use LockRelease TokenPool for tests

* fix: go tests and deployment sequences

* fix: missing Pools in the generator script

* fix: DepositAccount code missing from Token Pool

* fix: pin ton version
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…851)

* fix: DefaultTokenDestGasOverhead

* fix: fund LockRelease Token Pool

* fix: golint

* feat: fetch DepositAccount from TP

* fix: missmatch in Any2TVMTokenTransfer go binding

* doc: TODO missing gap

* fix: Execute amount didn't account for TokenTransfer flow

* fix: extractDestGasAmountFromMap should handle int64

* fix: update DefaultTokenDestGasOverhead

* fix: offramp missing from TokenPool config

* fix: broken TokenPool funding

* DataStore was outdated
* error finding TP in Datastore was ignored
* Missing wait and check after minting

* fix: raise forwardTonAmount on offRamp account notification

* fix: ExtraData is optional

* fix: nix hash

* test: updated gas calculation in transmiter

* fix: OffRamp_DispatchValidated value too low

* chore: bump imports to chainlink-ccip/deployment

* chore: bump imports to chainlink-ccip/deployment

* fix: unpin ton version

* fix: breaking change

* fix: ping ugorji/go/codec version

* fix: mock UltraFastCurseMCMS
* fix: remove local replace for cciplib

* fix: nix hash

* fix: remove env var guard on token transfer config and pool funding

* fix: bump to latest in feat/e2e-ton-as-dest
* Resolve loader relative paths via CWD

* Remove stale test

* Update .core_version - long running branch, build fix

* Bump ContractsPackageLatestSupported to contracts/1.6.2
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix lodash & protobufjs

* update lock.nix

* fixes

* Update to nixpkgs >= 26.11, drop x86_64-darwin support

* lint

* fix lint

* nix

* nix

* nix

* nix

* nix

* mockery

---------

Co-authored-by: Kristijan <kristijan.rebernisak@gmail.com>

@duck-types duck-types left a comment

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.

Great PR. I'd rather pass through the TokenAdminRegistry contract for ownership changes. That way, we can change how the checks are applied, for future implementation of self registration.

struct OffRamp_Deployables {
rmnRouter: address;
// Separate TokenAdminRegistry root used to derive deterministic entries.
tokenAdminRegistry: address;

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 agree this belongs only to the static config

struct OffRamp_Deployables {
rmnRouter: address;
// Separate TokenAdminRegistry root used to derive deterministic entries.
tokenAdminRegistry: address;

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.

Oh, I see there's no StaticConfig struct. Why though?

Comment thread contracts/contracts/ccip/offramp/contract.tolk
// ownership state changes such as a pending owner.
struct OnRamp_DeployablesConfig {
executor: ExecutorDeployment;
tokenAdminRegistry: address;

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.

Why don't you use OnRamp_DynamicConfig? It already holds feeQuoter ande feeAggregator. I don't think deployable is the right name because the OnRamp is not deploying the tokenAdminRegistry. It's for authorization checks.

@vicentevieytes vicentevieytes Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah but I still need to use the Deployable code to calculate the adderss of the TokenAdminRegistry entry.

I didn't like that I had to access the ExecutorDeployment struct to get the Deployable code to get the address of something completely unrelated to the Executor.

Tbh, I think this is just a temporary thing. I really want us to move to inlined instead of stored code cells for sub-contracts and I was planning on picking that up as a follow-up for this work

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

refactor in progress to inline all deployable contract dependencies: #873

Comment on lines +5 to +6
administrator: address?
pendingAdministrator: address?

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.

Why not use Ownable2Step instead?

newAdministrator: address?
}

struct (0xd1fbd97c) TokenAdminRegistryEntry_AcceptAdminRole {}

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.

Proposal:

  1. Add queryIDs to all messages for easier traceability.
  2. the on<MessageName>() handlers in contract.tolk should always receive the message, even if it doesn't have data. It makes it easier to navigate the code. When you search for references of the message type, you can find the message handler directly, instead of going through the match.

@@ -0,0 +1,51 @@
import "types"

type TokenAdminRegistryEntry_InMessage =

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.

Shall we add SetEnabled(enabled: bool) message?

Comment thread contracts/contracts/ccip/token_admin_registry_entry/contract.tolk
Comment thread contracts/contracts/ccip/token_admin_registry/contract.tolk Outdated
Comment thread contracts/contracts/ccip/token_admin_registry/contract.tolk Outdated
krebernisak and others added 2 commits September 7, 2026 15:34
* Add TP <> ContextExecutor integration to support async flow continuation

* Stash current behaviour - throw on error in transfer continuation

* Lock or burn transfer error handling and return

* LockReleaseLockboxTokenPool use ContextExecutor vs. local st

* yarn fmt

* Fix lint

* Update Go bindings

* Share code in TP lib + docs

* CE - wait for deploy confirmation before continuation

* Fix golangci-lint

* Remove local review

* Add TODOs for forwardTonAmount

* Migrate CE to OffRampAccount to support async flow

* Fix lock_release & lockbox flow

* Embed AskToTransfer in oa withdraw, check msg.transferInitiator == null on mint

* Document OffRampAccount contract

* TP compose consumeIn/OutboundRateLimit functions

* Replace CE on burn_mint burn path with CCT burn flow fwdPayload

* Fix oplint

* rm tests/debug_cells.test.ts

* Add OnRampAccount + handle TP deposit auth

* Improve TP error handling - return transfer

* PR feedback - missing lazy

* DepositAccount contract for on/off-ramp escrows

* Remove DepositAccount allowedJettonWallet

* Fix lint

* DepositAccount Go bindings

* Simplify deposit acc bounce handling

* Add withdrawable fee jettons via JettonWithdrawable

* Fix lint

* Add Go bindings + tlbe.Array

* Polish docs and fix lint

* Remove CE files post merge, polish

* Polish + rm unused compilation targets

* Fix lock/release tp fee withdrawal + Go bindings

* Add proper isZeroAddress check

* Fix withdrawable maxAmount checks

* Improve value check onWithdraw via reserve

* Add Jetton_ForwardPayloadWrap, used by JettonWithdrawable

* Remove duplicated field - ctx.withdrawInitiator

* PR feedback + polish

* Fix oplint

* Fix Go binding - lock/release storage
// participant ReceiveExecutor

// Receiver ->> Router: Receiver_CCIPReceiveV2 (bounce)
// Receiver ->> Router: Receiver_CCIPReceive (bounce)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Merged incorrectly, i'll stick to CCIPReceiveV2

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.

6 participants