Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ npm run docs:gate # primitives catalog freshness + docs links/anchors/prose
npm run lint:sol # solhint (chainlink-ccip ruleset, zero warnings)
```

Disclaimer: Please note, this repo contains community examples only — these are not Chainlink products or services and are not supported or maintained by Chainlink. This code represents an example of using a Chainlink product or service, and is intended for demonstration and educational purposes only. It is provided “AS IS” and “AS AVAILABLE” without warranties of any kind, may not have been audited, and may omit checks or error handling. Each party intending to use this example code does so entirely at their own risk and must perform its own audits, security and code review, key management, and testing before any production deployment and ensure the operation and performance of such code matches expectations. Neither Chainlink Labs nor the Chainlink Foundation deploys, operates, monitors, maintains or endorses any deployment of this code. Note that this is not a Chainlink product, feature or service, and there are no commitments made with respect to the code, including compatibility with future Chainlink releases. You should not rely on this code without first conducting your own technical, engineering, and security review. This code is also outside the scope of any Chainlink bug bounty programs. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for outcomes due to errors in this example or how it is deployed or operated, or liable for any resulting claims or damages. Use of the Chainlink Network is subject to the Chainlink Foundation [Terms of Service](https://chain.link/terms), which provides important information and disclosures. By using this code, you acknowledge and agree to these terms.
Disclaimer: Please note, this repo contains community examples only - these are not Chainlink products or services and are not supported or maintained by Chainlink. This code represents an example of using a Chainlink product or service, and is intended for demonstration and educational purposes only. It is provided “AS IS” and “AS AVAILABLE” without warranties of any kind, may not have been audited, and may omit checks or error handling. Each party intending to use this example code does so entirely at their own risk and must perform its own audits, security and code review, key management, and testing before any production deployment and ensure the operation and performance of such code matches expectations. Neither Chainlink Labs nor the Chainlink Foundation deploys, operates, monitors, maintains or endorses any deployment of this code. Note that this is not a Chainlink product, feature or service, and there are no commitments made with respect to the code, including compatibility with future Chainlink releases. You should not rely on this code without first conducting your own technical, engineering, and security review. This code is also outside the scope of any Chainlink bug bounty programs. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for outcomes due to errors in this example or how it is deployed or operated, or liable for any resulting claims or damages. Use of the Chainlink Network is subject to the Chainlink Foundation [Terms of Service](https://chain.link/terms), which provides important information and disclosures. By using this code, you acknowledge and agree to these terms.
18 changes: 16 additions & 2 deletions test/reference/RateLimiterVersionBehavior.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct RateLimitConfigArgs {
interface IVersionedPool {
function typeAndVersion() external view returns (string memory);
function owner() external view returns (address);
function getDynamicConfig() external view returns (address router, address rateLimitAdmin, address feeAdmin);
// v1.5.0 / v1.5.1 / v1.6.1 rate-limit setter.
function setChainRateLimiterConfig(
uint64 remoteChainSelector,
Expand All @@ -43,6 +44,13 @@ interface IVersionedPool {
) external;
}

/// @dev Minimal router surface for resolving the live onRamp of a lane. The v2.0 pool's `_onlyOnRamp`
/// checks `msg.sender == s_router.getOnRamp(remoteChainSelector)`, so the prank target must match
/// whatever the pool's CURRENT router reports - not a constant, since Sepolia router configs drift.
interface IRouter {
function getOnRamp(uint64 remoteChainSelector) external view returns (address);
}

/// @title RateLimiterVersionBehavior
/// @notice Version-behavior fixtures backing docs/reference/pool-behavior-matrix.md rows for the
/// RateLimiter config-validation deltas, the PAUSE mechanics, the enabled-vs-disabled 0/0
Expand Down Expand Up @@ -71,9 +79,11 @@ contract RateLimiterVersionBehavior is BaseForkTest {
uint64 internal constant BASE_SEPOLIA = 8236463271206331221; // supported by V150 / V151
uint64 internal constant FUJI = 14767482510784806043; // supported by V161 / V200

// V200 runtime plumbing: token + the v1.x GA Router onRamp for the Fuji lane (Router.getOnRamp(FUJI)).
// V200 runtime plumbing: token + the onRamp for the Fuji lane. The onRamp is resolved live from
// the pool's current router (getDynamicConfig -> getOnRamp) in setUp, because Sepolia router configs
// drift and a hardcoded ramp address rots - the original constant caused CallerIsNotARampOnRouter.
address internal constant V200_TOKEN = 0x65901d3177F69CFA5b341C95D3943e72FFb2716A;
address internal constant V200_ONRAMP = 0x12492154714fBD28F28219f6fc4315d19de1025B;
address internal V200_ONRAMP;

// MG161A is an old-OZ BurnMintERC20: burning past balance reverts with this string. Seeing it (rather
// than TokenMaxCapacityExceeded) is the oracle that the rate limiter ALLOWED the transfer amount.
Expand All @@ -82,6 +92,10 @@ contract RateLimiterVersionBehavior is BaseForkTest {
function setUp() public override {
// Only the Sepolia fork is needed; skip the token/pool deploy fixtures of BaseForkTest.setUp.
_createSepoliaFork();
// Resolve the live onRamp for the Fuji lane from the pool's current router. Hardcoding this
// rots when the Sepolia router is reconfigured; reading it keeps the prank target correct.
(address router,,) = IVersionedPool(V200).getDynamicConfig();
V200_ONRAMP = IRouter(router).getOnRamp(FUJI);
}

// ─────────────────────────────────────────────────────────────────────────
Expand Down
Loading