Skip to main content
Version: 1.15.0

Function: assertPoolOwner()

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

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

Pre-flights sender against the pool's on-chain owner() for an owner-gated write, so an unauthorized caller fails as a CCTParamsInvalidError here instead of as an opaque OwnableUnauthorizedAccount revert after a multisig has already reviewed and signed.

Parameters​

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

Returns​

Promise<void>

Remarks​

A single owner() call, not the full getTokenPoolState query: owner is the only field this needs and the only one whose getter never changed spelling, so reading it directly costs one eth_call instead of a second typeAndVersion resolution plus every admin field.

Throws​

CCTParamsInvalidError if sender is not the pool owner