Skip to main content
Version: 1.15.0

Class: DepositToLockbox

Defined in: cct/evm/lockbox/operations/deposit.ts:65

Deposits tokens into an ERC20LockBox as one of its authorized callers (v2.0.0).

Extends​

Constructors​

Constructor​

new DepositToLockbox(): DepositToLockbox

Returns​

DepositToLockbox

Inherited from​

EVMOperation<DepositToLockboxParams>.constructor

Properties​

name​

readonly name: "depositToLockbox" = 'depositToLockbox'

Defined in: cct/evm/lockbox/operations/deposit.ts:66

camelCase id; matches the token-manager facade method and error context.

Overrides​

EVMOperation.name

Methods​

buildUnsigned()​

protected buildUnsigned(chain: EVMChain, __namedParameters: DepositToLockboxParams): Promise<UnsignedEVMTx>

Defined in: cct/evm/lockbox/operations/deposit.ts:93

Confirms the target is a deployed, supported lockbox and that it escrows token, then — with a known sender — that it accepts calls from that account and that the account can actually fund the transfer.

Parameters​

ParameterType
chainEVMChain
__namedParametersDepositToLockboxParams

Returns​

Promise<UnsignedEVMTx>

Remarks​

Ordered cheapest-to-narrowest, and property-of-the-lockbox before property-of-the-caller: an unusable lockbox or a token mismatch fails for every possible sender, so no choice of signer helps and there is no point reading the caller set first.

Throws​

CCTParamsInvalidError if nothing at lockbox answers typeAndVersion(), if the lockbox escrows a different token, or if sender is not an authorized caller

Throws​

CCTContractTypeInvalidError if lockbox is some other contract, e.g. the pool

Throws​

CCTContractVersionUnsupportedError if it reports an unsupported version

Throws​

CCTTxFailedError if sender holds, or has approved the lockbox for, less than amount

Overrides​

EVMOperation.buildUnsigned


execute()​

execute(chain: EVMChain, params: EVMExecuteParams<DepositToLockboxParams>): Promise<TransactionResult>

Defined in: cct/evm/operation.ts:150

generate, then sign and submit; returns the confirmed tx hash.

Parameters​

ParameterType
chainEVMChain
paramsEVMExecuteParams<DepositToLockboxParams>

Returns​

Promise<TransactionResult>

Inherited from​

EVMOperation.execute


generate()​

generate(chain: EVMChain, params: DepositToLockboxParams): Promise<UnsignedEVMTx>

Defined in: cct/evm/operation.ts:110

Run prepare and buildUnsigned, applying optional sender; no signing.

Parameters​

ParameterType
chainEVMChain
paramsDepositToLockboxParams

Returns​

Promise<UnsignedEVMTx>

Remarks​

Also pins every built transaction to chain.network.chainId (no RPC, known at construction). This is the one point every CCT builder and both execute paths pass through; unpinned, ethers would infer the chain from the eventual signer's provider.

Inherited from​

EVMOperation.generate


parse()​

protected parse(params: DepositToLockboxParams): DepositToLockboxParams

Defined in: cct/operation.ts:42

Normalize validated params for the builder — defaults, conversions, derived values. Identity by default, so an op that needs no normalization declares nothing.

Parameters​

ParameterType
paramsDepositToLockboxParams

Returns​

DepositToLockboxParams

Inherited from​

EVMOperation.parse


prepare()​

protected prepare(params: DepositToLockboxParams): DepositToLockboxParams

Defined in: cct/operation.ts:48

validate then parse — the single pre-RPC step, before any chain access.

Parameters​

ParameterType
paramsDepositToLockboxParams

Returns​

DepositToLockboxParams

Inherited from​

EVMOperation.prepare


resolveWalletSender()​

protected resolveWalletSender(wallet: unknown, sender?: string): Promise<string>

Defined in: cct/evm/operation.ts:130

Resolves the address a signed submission is authorized against: the signing wallet's own. The chain gates on msg.sender, and submit clears any builder-set tx.from before populating the tx (so ethers' own from/signer guard never fires) — an explicit sender that differs from the wallet would therefore let an op's pre-tx checks authorize one address while a different one actually signs, passing every local guard and reverting on-chain. Ops that gate on an on-chain role call this from execute; build with generateUnsigned* instead when the eventual signer isn't known yet, where sender is trusted as given.

Parameters​

ParameterType
walletunknown
sender?string

Returns​

Promise<string>

Throws​

CCIPWalletInvalidError if wallet is not a valid signer

Throws​

CCTParamsInvalidError if sender is given and is not the wallet's address

Inherited from​

EVMOperation.resolveWalletSender


validate()​

protected validate(__namedParameters: DepositToLockboxParams): void

Defined in: cct/evm/lockbox/operations/deposit.ts:69

Validates every param before any RPC; a zero amount reverts TokenAmountCannotBeZero.

Parameters​

ParameterType
__namedParametersDepositToLockboxParams

Returns​

void

Overrides​

EVMOperation.validate