Skip to content

[NONEVM-3478] Implement Soft Freeze in core contracts#530

Open
patricios-space wants to merge 15 commits intomainfrom
feat/soft-freeze
Open

[NONEVM-3478] Implement Soft Freeze in core contracts#530
patricios-space wants to merge 15 commits intomainfrom
feat/soft-freeze

Conversation

@patricios-space
Copy link
Collaborator

@patricios-space patricios-space commented Jan 15, 2026

@patricios-space patricios-space changed the title [NONEVM-2480] Implement Soft Freeze [NONEVM-2480] Implement Soft Freeze in core contracts Jan 15, 2026
@patricios-space patricios-space changed the title [NONEVM-2480] Implement Soft Freeze in core contracts [NONEVM-3478] Implement Soft Freeze in core contracts Jan 16, 2026
@patricios-space patricios-space marked this pull request as ready for review January 29, 2026 16:26
@patricios-space patricios-space requested a review from a team as a code owner January 29, 2026 16:26
Copilot AI review requested due to automatic review settings January 29, 2026 16:26
Copy link
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

This PR implements a soft freeze mechanism in CCIP core contracts to prevent value leakage when contract balances fall below operational thresholds. The soft freeze restricts permissionless operations while allowing owner operations to continue, ensuring contracts remain operational for administrative tasks even when underfunded.

Changes:

  • Introduced soft freeze library and threshold constants across Router, OnRamp, OffRamp, and FeeQuoter contracts
  • Added validation for OnRamp reserve configuration to ensure it exceeds the soft freeze threshold
  • Updated default contract funding amounts and reserve values in deployment configurations and test files

Reviewed changes

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

Show a summary per file
File Description
pkg/ccip/bindings/soft_freeze/types.go Go bindings for soft freeze error codes
pkg/ccip/bindings/soft_freeze/exitcode_string.go Generated string representations for soft freeze exit codes
pkg/ccip/bindings/onramp/onramp.go Added InvalidReserve error to OnRamp exit codes
pkg/ccip/bindings/onramp/exitcode_string.go Generated strings for updated OnRamp exit codes
deployment/ccip/cs_test_helpers.go Increased default coin and reserve amounts in test deployment config
deployment/ccip/1_6_0/sequences/deploy_chain_contracts.go Updated default contract coin and reserve amount constants
contracts/wrappers/libraries/funding/SoftFreeze.ts TypeScript wrapper for soft freeze error codes
contracts/wrappers/ccip/Router.ts Added soft freeze threshold constant to Router
contracts/wrappers/ccip/OnRamp.ts Added soft freeze threshold and InvalidReserve error to OnRamp
contracts/wrappers/ccip/OffRamp.ts Added soft freeze threshold constant to OffRamp
contracts/wrappers/ccip/FeeQuoter.ts Added soft freeze threshold constant to FeeQuoter
contracts/tests/lib/funding/WithdrawableSpec.ts Updated funding logic to ensure balance exceeds reserve
contracts/tests/lib/funding/SoftFreezeSpec.ts New reusable test suite for soft freeze functionality
contracts/tests/gas-report/ccip/messaging/OnRamp.spec.ts Updated deployment amounts to use soft freeze threshold
contracts/tests/gas-report/ccip/messaging/OffRamp.spec.ts Updated deployment amounts and refactored imports
contracts/tests/gas-report/ccip/messaging/FeeQuoter.spec.ts Updated deployment amounts to use soft freeze threshold
contracts/tests/ccip/router/Router.spec.ts Added soft freeze test suite for Router
contracts/tests/ccip/router/Router.Setup.ts Updated deployment amounts to use soft freeze threshold
contracts/tests/ccip/onramp/OnRamp.withdrawFeeToken.spec.ts Refactored balance validation into helper function
contracts/tests/ccip/onramp/OnRamp.spec.ts Added soft freeze test suite for OnRamp
contracts/tests/ccip/onramp/OnRamp.setDynamicConfig.spec.ts Added test for invalid reserve validation
contracts/tests/ccip/onramp/OnRamp.Setup.ts Updated default reserve to exceed soft freeze threshold
contracts/tests/ccip/helpers/SetUp.ts Refactored to use namespaced imports
contracts/tests/ccip/feequoter/FeeQuoterSetup.ts Updated deployment amounts to use soft freeze threshold
contracts/tests/ccip/feequoter/FeeQuoter.spec.ts Added soft freeze test suite for FeeQuoter
contracts/tests/ccip/OffRamp.spec.ts Added soft freeze test suite for OffRamp
contracts/contracts/lib/funding/soft_freeze.tolk Core soft freeze implementation in Tolk
contracts/contracts/ccip/router/contract.tolk Integrated soft freeze check in Router message handler
contracts/contracts/ccip/onramp/errors.tolk Added InvalidReserve error to OnRamp
contracts/contracts/ccip/onramp/contract.tolk Integrated soft freeze and reserve validation in OnRamp
contracts/contracts/ccip/offramp/contract.tolk Integrated soft freeze check in OffRamp message handler
contracts/contracts/ccip/fee_quoter/contract.tolk Integrated soft freeze check in FeeQuoter message handler

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

@smartcontractkit smartcontractkit deleted a comment from Copilot AI Jan 29, 2026
@smartcontractkit smartcontractkit deleted a comment from Copilot AI Jan 29, 2026
@smartcontractkit smartcontractkit deleted a comment from Copilot AI Jan 29, 2026
@smartcontractkit smartcontractkit deleted a comment from Copilot AI Jan 29, 2026
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.

1 participant