Skip to main content
Version: 1.15.0

Function: assertPoolRebalancer()

assertPoolRebalancer(operation: string, chain: EVMChain, poolAddress: string, sender: string): Promise<void>

Defined in: cct/evm/token-pool/contracts.ts:656

Pre-flights sender against the pool's on-chain getRebalancer() for a liquidity write, the rebalancer-gated counterpart of assertPoolOwner.

Parameters​

ParameterTypeDescription
operationstringOperation name, for the error's operation field.
chainEVMChainChain to read the rebalancer from.
poolAddressstringToken pool being written to.
senderstringThe address the tx will be sent from; compared checksummed.

Returns​

Promise<void>

Remarks​

Deliberately not the owner: provideLiquidity and withdrawLiquidity compare msg.sender to s_rebalancer and revert Unauthorized for everyone else, the owner included. The owner's role is to appoint the rebalancer, not to move liquidity itself.

Throws​

CCTParamsInvalidError if sender is not the pool's rebalancer, or no rebalancer is configured