Skip to main content
Version: 1.15.0

Function: assertTokenOwner()

assertTokenOwner(operation: string, chain: EVMChain, tokenAddress: string, sender: string): Promise<void>

Defined in: cct/evm/token/contracts.ts:307

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

Parameters​

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

Returns​

Promise<void>

Throws​

CCTParamsInvalidError if sender is not the token owner