CCIP v2.0.0 Proxy API Reference
Summary
Proxy is a minimal call-forwarding contract that:
- Forwards all fallback calls to a configurable target using
call. - Allows the owner to update the target address.
- Allows withdrawal of accumulated fee tokens to a configurable fee aggregator.
It does not use delegatecall. Forwarded calls execute in the context of the target contract.
Contract
chains/evm/contracts/Proxy.sol
Import
import {Proxy} from "chainlink-ccip/chains/evm/contracts/Proxy.sol";
Target + upgrade model
- The target address is stored in
s_target. - All unknown calls are forwarded via
call. - The owner may update the target via
setTarget. - No storage layout coupling exists (no delegatecall).
- Ether is not forwarded (value = 0).
This is a forwarding proxy, not an upgradeable storage proxy.
Inheritance
Ownable2StepMsgSenderITypeAndVersion
typeAndVersion
string public constant override typeAndVersion =
"Proxy 2.0.0-dev";
State
Constants
None declared beyond typeAndVersion.
Immutables
None declared.
Storage
address internal s_target;
address internal s_feeAggregator;
s_target— forwarding destination.s_feeAggregator— recipient of withdrawn fee token balances.
External API (forwarded surface)
getTarget
function getTarget()
external
view
virtual
returns (address);
Returns s_target.
setTarget
function setTarget(address target)
external
virtual
onlyOwner;
Reverts:
error ZeroAddressNotAllowed();
If target == address(0).
Internally calls _setTarget.
getFeeAggregator
function getFeeAggregator()
external
view
virtual
returns (address);
Returns s_feeAggregator.
setFeeAggregator
function setFeeAggregator(address feeAggregator)
external
virtual
onlyOwner;
Internally calls _setFeeAggregator.
Zero address is permitted but may cause downstream withdrawal reverts.
withdrawFeeTokens
function withdrawFeeTokens(
address[] calldata feeTokens
) external virtual;
Calls:
FeeTokenHandler._withdrawFeeTokens(
feeTokens,
s_feeAggregator
);
Permissionless.
fallback
fallback() external virtual;
Behavior:
- Copies calldata.
- Executes:
call(gas(), s_target, 0, calldataPtr, calldataSize, 0, 0)
- Returns or reverts with the returned data.
Notes:
- Uses
call, notdelegatecall. - Does not forward Ether.
- Proxy storage is never modified by fallback.
Internal Functions
_setTarget
function _setTarget(address target) internal;
Emits:
event TargetUpdated(
address indexed oldTarget,
address indexed newTarget
);
_setFeeAggregator
function _setFeeAggregator(address feeAggregator) internal;
Emits:
event FeeAggregatorUpdated(
address indexed oldFeeAggregator,
address indexed newFeeAggregator
);
Events
event TargetUpdated(
address indexed oldTarget,
address indexed newTarget
);
event FeeAggregatorUpdated(
address indexed oldFeeAggregator,
address indexed newFeeAggregator
);
Errors
error ZeroAddressNotAllowed();
Security model
- Only owner may update target or fee aggregator.
- No delegatecall prevents storage collision.
- Calls to non-contract targets revert.
- Withdrawal is permissionless but funds always go to
s_feeAggregator. - Misconfiguration of
s_targetcan halt functionality.